From 9f8b4bcde30c0ca3bf6cead5f48aa102536e0e92 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Wed, 11 Jun 2014 14:49:59 +0000 Subject: Support LIBS like LDFLAGS. - Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV. - Add an option helper for LIBS. - Adjust all ports that already use LIBS. Also remove references to PTHREAD_CFLAGS and PTHREAD_LIBS while here. - Some ports did not support having a LIBS environment variable and required additional patches. Somewhat simplified a linker command line looks like: ${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS} where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and LIBS can be controlled by us. If possible -L and -l flags need to be added to LIBS to make sure they appear after any -L and -l flags set by upstream. Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this may appear too early on the command line causing installed libraries to be linked in instead of freshly built ones. Additional changes: benchmarks/netio: Replace WITH_IPV6 with an IPV6 option. comms/gnokii: Replace some patches with USES=pathfix. Also remove -fPIC. graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR. graphics/visionworkbench: Remove FreeBSD 7 support. multimedia/libmovtar: New LIB_DEPENDS syntax. multimedia/opencinematools: Use standard do-build. net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins) net-mgmt/nagios: Remove -fPIC. net-mgmt/nagios4: Remove -fPIC. print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036. security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS. This skips a test in configure that falsely detects pthread_mutexattr_init in our libc. sysutils/dar: Fix iconv detection. x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD hack and use $CXX as linker as on other platforms. PR: 190592 Exp-run by: antoine Approved by: portmgr (antoine) --- x11/gdm/Makefile | 5 ++-- x11/gnome-swallow/Makefile | 3 +-- x11/libxcb/Makefile | 3 +-- x11/mrxvt/Makefile | 2 +- x11/rxvt-devel/Makefile | 5 ++-- x11/rxvt-unicode/Makefile | 3 ++- x11/rxvt-unicode/files/patch-configure | 45 ++++++++++++++++++++++++++++++++++ x11/wbar/Makefile | 2 +- x11/workrave/Makefile | 3 +-- x11/x3270/Makefile | 5 ++-- x11/xscreensaver-gnome/Makefile | 3 +-- x11/xterm/Makefile | 2 +- x11/xtermcontrol/Makefile | 2 +- x11/zenity/Makefile | 6 ++--- 14 files changed, 63 insertions(+), 26 deletions(-) create mode 100644 x11/rxvt-unicode/files/patch-configure (limited to 'x11') diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile index 336db2cf0b75..1847ed8c81df 100644 --- a/x11/gdm/Makefile +++ b/x11/gdm/Makefile @@ -42,10 +42,9 @@ GCONF_SCHEMAS= gdm-simple-greeter.schemas GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-working-directory=${PREFIX}/etc/gdm/home \ --with-at-spi-registryd-directory=${LOCALBASE}/libexec -CONFIGURE_ENV= LIBS="-lm" \ - GTKDOC="false" +CONFIGURE_ENV= GTKDOC="false" CPPFLAGS+= -I${LOCALBASE}/include -DHAS_SA_LEN -LDFLAGS+= -L${LOCALBASE}/lib +LIBS+= -L${LOCALBASE}/lib -lm SUB_FILES+= gdm.pam diff --git a/x11/gnome-swallow/Makefile b/x11/gnome-swallow/Makefile index 3432a787a0f2..c48f33cc1a85 100644 --- a/x11/gnome-swallow/Makefile +++ b/x11/gnome-swallow/Makefile @@ -14,9 +14,8 @@ USE_XORG= x11 USES= gmake pathfix pkgconfig USE_GNOME= gnomeprefix gnomepanel libgnomeui GNU_CONFIGURE= yes -CONFIGURE_ENV= LIBS="`pkg-config --libs libgnomeui-2.0`" CPPFLAGS+= -I${LOCALBASE}/include `pkg-config --cflags libgnomeui-2.0` -LDFLAGS+= -L${LOCALBASE}/lib +LIBS+= -L${LOCALBASE}/lib `pkg-config --libs libgnomeui-2.0` post-patch: @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g ; \ diff --git a/x11/libxcb/Makefile b/x11/libxcb/Makefile index ce6c01d3a590..f36f0fb49ed4 100644 --- a/x11/libxcb/Makefile +++ b/x11/libxcb/Makefile @@ -30,10 +30,9 @@ USE_PYTHON_BUILD=2 CONFIGURE_ARGS+=${f}="${${f}}" .endfor CONFIGURE_ARGS+=--enable-xkb -CONFIGURE_ENV= LIBS="`pkg-config --libs pthread-stubs`" NEEDED_CFLAGS= -I${LOCALBASE}/include -NEEDED_LIBS= -L${LOCALBASE}/lib -lXau ${PTHREAD_STUBS_LIBS} +NEEDED_LIBS= -L${LOCALBASE}/lib -lXau `pkg-config --libs pthread-stubs` XDMCP_CFLAGS= -I${LOCALBASE}/include XDMCP_LIBS= -L${LOCALBASE}/lib -lXdmcp diff --git a/x11/mrxvt/Makefile b/x11/mrxvt/Makefile index 4f5a337e5ad3..c5750d4c49cd 100644 --- a/x11/mrxvt/Makefile +++ b/x11/mrxvt/Makefile @@ -34,8 +34,8 @@ LIB_DEPENDS+= Xft.2:${PORTSDIR}/x11-fonts/libXft CONFIGURE_ARGS+= --enable-xft .endif -CONFIGURE_ENV= LIBS="${LIBS} -L${LOCALBASE}/lib" CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib .if !defined(NOPORTDOCS) PORTDOCS= TIPS \ diff --git a/x11/rxvt-devel/Makefile b/x11/rxvt-devel/Makefile index b4378eb98c82..9f333337c927 100644 --- a/x11/rxvt-devel/Makefile +++ b/x11/rxvt-devel/Makefile @@ -13,6 +13,7 @@ COMMENT= Low memory usage xterm replacement that supports color USE_AUTOTOOLS= libtool USES= perl5 +USE_LDCONFIG= yes USE_PERL5= build patch USE_XORG= xpm GNU_CONFIGURE= yes @@ -39,7 +40,7 @@ XTERM_DESC= Build with Xterm scrollbar CONFIGURE_ARGS= --enable-utmp --enable-lastlog \ --with-xpm --enable-xpm-background --enable-shared \ --enable-mousewheel --disable-languages -USE_LDCONFIG= yes +LIBS+= -lutil .include @@ -131,8 +132,6 @@ CONFIGURE_ARGS+= --enable-xim CONFIGURE_ARGS+= --enable-xterm-scroll .endif -CONFIGURE_ENV+= LIBS="-lutil" - post-patch: @${PERL} -pi -e 's|(PTYCHAR2\s+"[^"]+)"|\1ghijklmnopqrstuv"|' \ ${WRKSRC}/src/ptytty.c diff --git a/x11/rxvt-unicode/Makefile b/x11/rxvt-unicode/Makefile index 2a6ee74aa249..cadac20c5536 100644 --- a/x11/rxvt-unicode/Makefile +++ b/x11/rxvt-unicode/Makefile @@ -21,7 +21,8 @@ USES= pkgconfig shebangfix tar:bzip2 USE_XORG= xpm xft xrender GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include -CONFIGURE_ENV= LIBS="-lstdc++ -lutil" TIC=${LOCALBASE}/bin/tic +LIBS+= -lutil +CONFIGURE_ENV= TIC=${LOCALBASE}/bin/tic CONFIGURE_ARGS= --enable-everything --with-term=rxvt \ --with-terminfo=${LOCALBASE}/share/misc/terminfo.db diff --git a/x11/rxvt-unicode/files/patch-configure b/x11/rxvt-unicode/files/patch-configure new file mode 100644 index 000000000000..eb5b7445d233 --- /dev/null +++ b/x11/rxvt-unicode/files/patch-configure @@ -0,0 +1,45 @@ +--- configure.orig ++++ configure +@@ -4436,42 +4436,6 @@ + + + LINKER="$CXX" +-if test x$GCC = xyes && test x$GXX = xyes; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working libsupc++" >&5 +-$as_echo_n "checking for working libsupc++... " >&6; } +- save_CXX="$CXX" +- save_LIBS="$LIBS" +- CXX="$CC" +- LIBS="$LIBS -lsupc++" +- +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-struct test { }; void f() try { throw new test; } catch (...) { throw; } +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +-$as_echo "ok" >&6; } +- LINKER="$CC" +-else +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, making everything bigger and slower" >&5 +-$as_echo "no, making everything bigger and slower" >&6; } +- LIBS="$save_LIBS" +- +- +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- CXX="$save_CXX" +-fi +-LINKER=$LINKER + + + if test -z "$orig_CXXFLAGS"; then diff --git a/x11/wbar/Makefile b/x11/wbar/Makefile index 59e748063543..45c669f772e0 100644 --- a/x11/wbar/Makefile +++ b/x11/wbar/Makefile @@ -27,7 +27,7 @@ OPTIONS_SUB= yes WBARCONFIG_DESC= Build the GTK+ configuration interface NLS_CONFIGURE_ENABLE= nls -NLS_CONFIGURE_ENV= LIBS=-lintl +NLS_LIBS= -lintl WBARCONFIG_CONFIGURE_ENABLE= wbar-config WBARCONFIG_USE= GNOME=libglade2 diff --git a/x11/workrave/Makefile b/x11/workrave/Makefile index 9b0c2420c9dc..33d063432b37 100644 --- a/x11/workrave/Makefile +++ b/x11/workrave/Makefile @@ -27,8 +27,7 @@ USES= pathfix pkgconfig gmake USE_GNOME= gnomeprefix intlhack gconf2 intltool USE_GSTREAMER= good GNU_CONFIGURE= yes -CONFIGURE_ENV= LIBS="`pkg-config --libs libgnomeui-2.0`" -LDFLAGS+= -L${LOCALBASE}/lib +LIBS+= -L${LOCALBASE}/lib `pkg-config --libs libgnomeui-2.0` CONFIGURE_ARGS= --enable-gconf --disable-pulse .include diff --git a/x11/x3270/Makefile b/x11/x3270/Makefile index a587069656ba..7f1cbcf85b6a 100644 --- a/x11/x3270/Makefile +++ b/x11/x3270/Makefile @@ -21,9 +21,8 @@ USES= iconv imake:env USE_XORG= ice sm x11 xaw xext xmu xt GNU_CONFIGURE= yes CONFIGURE_ARGS+= --with-fontdir=${PREFIX}/lib/X11/fonts/local --disable-dbcs -CONFIGURE_ENV= LIBS="-L${PREFIX}/lib" -CPPFLAGS+= -I${PREFIX}/include -LDFLAGS+= -L${PREFIX}/lib +CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib .if defined(WITHOUT_OPENSSL) CONFIGURE_ARGS+= --disable-ssl .else diff --git a/x11/xscreensaver-gnome/Makefile b/x11/xscreensaver-gnome/Makefile index 026c194b9faf..04170906599e 100644 --- a/x11/xscreensaver-gnome/Makefile +++ b/x11/xscreensaver-gnome/Makefile @@ -29,9 +29,8 @@ CONFIGURE_ARGS= --with-gtk --with-gl --with-gle --with-pixbuf --with-xpm \ --with-configdir=${PREFIX}/share/xscreensaver/config \ --with-dpms-ext --with-xinerama-ext --with-xf86vmode-ext \ --with-xf86gamma-ext --with-randr-ext --enable-locking -CONFIGURE_ENV= LIBS="-lintl" CPPFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= -L${LOCALBASE}/lib +LIBS+= -L${LOCALBASE}/lib -lintl OPTIONS_DEFINE= PAM KEYRING ALL_FORTUNES SETUID_HACKS OPTIONS_DEFAULT= PAM KEYRING diff --git a/x11/xterm/Makefile b/x11/xterm/Makefile index 92fffdd2161e..64e5dcc203d2 100644 --- a/x11/xterm/Makefile +++ b/x11/xterm/Makefile @@ -18,10 +18,10 @@ CONFLICTS= x11iraf-[0-9]* USE_XORG= xaw xft GNU_CONFIGURE= yes -CONFIGURE_ENV+= LIBS="-L${LOCALBASE}/lib" CONFIGURE_ARGS+= --with-utempter --enable-narrowproto CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib ICONVERSION= 1 diff --git a/x11/xtermcontrol/Makefile b/x11/xtermcontrol/Makefile index 570122cadda7..8bcb07a0ebf9 100644 --- a/x11/xtermcontrol/Makefile +++ b/x11/xtermcontrol/Makefile @@ -14,8 +14,8 @@ RUN_DEPENDS= xterm:${PORTSDIR}/x11/xterm USES= gettext GNU_CONFIGURE= yes -CONFIGURE_ENV= LIBS="-L${LOCALBASE}/lib" CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib PLIST_FILES= bin/xtermcontrol man/man1/${PORTNAME}.1.gz diff --git a/x11/zenity/Makefile b/x11/zenity/Makefile index f29304241e49..47b1e672f4ad 100644 --- a/x11/zenity/Makefile +++ b/x11/zenity/Makefile @@ -20,10 +20,8 @@ USE_GNOME= gnomeprefix gtk20 gnomedocutils intlhack USE_BZIP2= yes GNU_CONFIGURE= yes INSTALLS_OMF= yes -CONFIGURE_ENV= LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" -CPPFLAGS+= -I${LOCALBASE}/include ${PTHREAD_CFLAGS} -LDFLAGS+= -L${LOCALBASE}/lib -lintl -CONFIGURE_ENV= LIBS="${PTHREAD_LIBS}" +CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib -lintl CONFLICTS= gtkada-1.2.* -- cgit v1.2.3