[macppc] net/freeradius3 now requires atomics

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[macppc] net/freeradius3 now requires atomics

Charlene Wendling
Hi ports, Stuart,

Freeradius is broken with ports-gcc on macppc. It's a classic:

> /usr/ports/pobj/freeradius-server-3.0.19/freeradius-server-3.0.19/build/lib/local/.libs/libfreeradius-radius.so: undefined reference to `__atomic_store_8'
> /usr/ports/pobj/freeradius-server-3.0.19/freeradius-server-3.0.19/build/lib/local/.libs/libfreeradius-radius.so: undefined reference to `__atomic_load_8'
> /usr/ports/pobj/freeradius-server-3.0.19/freeradius-server-3.0.19/build/lib/local/.libs/libfreeradius-radius.so: undefined reference to `__atomic_compare_exchange_8'

As such i added the infamous block to the Makefile (all subpackages
need it) and, while here, port-lib-depends-check asked for the
mariadb^W mysql subpackage a WANTLIB update, so i did it.

Once done, it builds fine on macppc [0], and on amd64 as well.

Comments/feedback are welcome!

Charlène.


[0] http://0x0.st/zuZ8.txt


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/freeradius3/Makefile,v
retrieving revision 1.39
diff -u -p -u -p -r1.39 Makefile
--- Makefile 3 Jun 2019 16:06:53 -0000 1.39
+++ Makefile 6 Jun 2019 17:11:59 -0000
@@ -14,6 +14,7 @@ COMMENT-python= freeradius python rlm ad
 V= 3.0.19
 DISTNAME= freeradius-server-$V
 EXTRACT_SUFX= .tar.bz2
+REVISION= 0
 
 PKGNAME-main= freeradius-$V
 PKGNAME-freetds= freeradius-freetds-$V
@@ -146,7 +147,7 @@ CONFIGURE_ARGS+= --with-mysql-include-di
 CONFIGURE_ARGS+= --without-rlm_sql_mysql
 .endif
 LIB_DEPENDS-mysql= databases/mariadb
-WANTLIB-mysql= crypto ssl m pthread z mysqlclient_r
+WANTLIB-mysql= crypto iconv m mariadb ssl z
 RUN_DEPENDS-mysql= #empty
 
 # rlm_sql_postgresql
@@ -170,6 +171,13 @@ SUBST_VARS= FREERADIUS_ETC
 MAKE_FLAGS= PACKAGE=openbsd VERBOSE=1
 FAKE_FLAGS= VERBOSE=1 R=${WRKINST} \
  raddbdir=${PREFIX}/share/examples/freeradius
+
+.if ${MACHINE_ARCH} == "powerpc"
+LDFLAGS += -latomic
+.for i in ${MULTI_PACKAGES}
+WANTLIB$i += atomic
+.endfor
+.endif
 
 post-configure:
  sed -i -e 's,/etc/raddb,${SYSCONFDIR}/raddb,g' ${WRKSRC}/man/*/*