On Thu, Jul 27 2017, Jeremie Courreges-Anglas <[email protected]> wrote:
> Now that clang from base is used to build openvpn-auth-ldap, the
> configure script can't find -lobjc2 because it doesn't tell the linker
> to look in /usr/local/lib.  Instead of modifying our patches I chose to
> put /usr/local/lib at the start of LIBS.  With this diff,
> openvpn-auth-ldap now builds fine on -current amd64.

naddy@ pointed out that adding -L/usr/local/lib to LDFLAGS should work.
Our current patches are fine, it's platform.m4 that clobbers LDFLAGS.

So let's fix platform.m4 and use CONFIGURE_ENV to pass -L/usr/local/lib.
It feels weird not to also pass CPPFLAGS=-I/usr/local/include, but the
build seems unaffected.

While here, no need to pass --prefix= twice to the configure script
(already done by gnu.port.mk).

> ok?

I plan to commit this soon.  Test reports would be good, though.


Index: Makefile
===================================================================
RCS file: /d/cvs/ports/net/openvpn-auth-ldap/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    27 Jul 2017 09:55:45 -0000      1.13
+++ Makefile    30 Jul 2017 22:27:02 -0000
@@ -39,6 +39,7 @@ CONFIGURE_ARGS += --prefix=${LOCALBASE} 
                  --with-check=${LOCALBASE} \
                  --with-openldap=${LOCALBASE} \
                  --with-openvpn=${LOCALBASE}/include/openvpn
+CONFIGURE_ENV =                LDFLAGS="-L${LOCALBASE}/lib ${LDFLAGS}"
 
 SAMPLES_DIR =          ${PREFIX}/share/examples/openvpn-auth-ldap
 
Index: patches/patch-platform_m4
===================================================================
RCS file: patches/patch-platform_m4
diff -N patches/patch-platform_m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-platform_m4   30 Jul 2017 22:35:21 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Don't clobber LDFLAGS.
+
+Index: platform.m4
+--- platform.m4.orig
++++ platform.m4
+@@ -97,7 +97,7 @@ AC_DEFUN(OD_CONFIG_PLUGIN, [
+           PLUGIN_LD="${CC} -shared"
+           PLUGIN_LD_FLAGS=""
+           PLUGIN_SUFFIX=".so"
+-          LDFLAGS="-export-dynamic"
++          LDFLAGS="-export-dynamic ${LDFLAGS}"
+           ;;
+     esac
+ 


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to