[Openvpn-devel,v2] cmocka: use relative paths

Message ID 20181028145449.12676-1-steffan@karger.me
State Accepted, archived
Delegated to: David Sommerseth
Headers show
Series
  • [Openvpn-devel,v2] cmocka: use relative paths
Related show

Commit Message

Steffan Karger Oct. 28, 2018, 2:54 p.m.
Simplifies the build scripts, and fixes my CI, where paths on the test
slave can be different from paths on the build slave.

Signed-off-by: Steffan Karger <steffan@karger.me>
---
v2: rebase on master, fix in-source builds (thanks dazo for spotting)

 .gitignore         |  2 +-
 configure.ac       | 11 ++---------
 vendor/Makefile.am | 16 ++++++++--------
 3 files changed, 11 insertions(+), 18 deletions(-)

Comments

David Sommerseth April 17, 2019, 8:10 p.m. | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Acked-By: David Sommerseth <davids@openvpn.net>

This didn't break anything on my systems, and changes makes sense.
I spotted another fix also sneaked in, replacing the incorrect
OPTIONAL_PKCS11_{LIBS,CFLAGS} with the correct
OPTIONAL_PKCS11_HELPER_{LIBS,CFLAGS}.


Your patch has been applied to the following branches

commit 4ded2deda0d6d33d38fbbd1f4cd4e9acc0836a89  (master)
commit 84a649bee961947343be2c47041a8ec9b37e29d1  (release/2.4)
Author: Steffan Karger
Date:   Sun Oct 28 15:54:49 2018 +0100

     cmocka: use relative paths

     Signed-off-by: Steffan Karger <steffan@karger.me>
     Acked-by: David Sommerseth <davids@openvpn.net>
     Message-Id: <20181028145449.12676-1-steffan@karger.me>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17849.html
     Signed-off-by: David Sommerseth <davids@openvpn.net>


- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCgAGBQJct4ghAAoJEIbPlEyWcf3yDboP/j6hYYlcbAibt8VYCaW9fCdo
MUteapG0gP+aLsgfcLf5MAj3ArY1hWN1E2QRMaHbimyzjHG7HvoZZRbZ0TXH+adJ
7euIRQbngG/eGUozrxaYc4rVDANlY578K7rKsfsJTbl0U5JmMckmMfrN9o3dvTaY
x1mtoU/9tzrKKiBUNRRF4y6IIAnGl5ll3MAA5J05i6ffoD0EekDOgOHHVwOut2un
Uah1DmpKrZzL6MWuuwFG0i5x1yh6THql+usLvoVXWmzY8AUSOgfHyPNg7g0hgqx5
K2jJhuc26aLfgxwSEPOc6z41xt7lHGpjOTwfLyGx8Z0OGCykEDLwtnnea429gC48
8MvQYTefpPX7OoTJ81KLg6By1fVv9j/aGL83/PEtm8YqxZnypZRk53kj5wXNn4fJ
ovs3nmQwSuwvDPIsfa636e+ZzKc9wAMI7O6BIx/JJ4DfVFe7dIuChGMnbJsDJ3dq
J063yXqwleeoNUfXrDBHgrMdvXJe40nEjqAJQ5nzcxA6diu9gvJeSzD+ZaEpfQ6o
ZS8lXlHeREqNaLepx+HXQGVu69SlGNb8nZhGUH5qC6Q+eghfGTmoqai25cJJzeJV
3xYBOea4k5euvLn850bf6dGvzuD8kdgmaxyd1vOJlEG1bpvz2Dy7l+rRF0tiF+FC
K92L6CRrNdjMEVYnMXjy
=ogEA
-----END PGP SIGNATURE-----

Patch

diff --git a/.gitignore b/.gitignore
index 25009d81..5ef9c14d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,7 +56,7 @@  doc/openvpn.8.html
 distro/rpm/openvpn.spec
 distro/systemd/*.service
 sample/sample-keys/sample-ca/
-vendor/.build
+vendor/cmocka_build
 vendor/dist
 build/msvc/msvc-generate/version.m4
 
diff --git a/configure.ac b/configure.ac
index 1e6891b1..7fe9b6e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1353,15 +1353,8 @@  AC_SUBST([sampledir])
 AC_SUBST([systemdunitdir])
 AC_SUBST([tmpfilesdir])
 
-VENDOR_SRC_ROOT="\$(abs_top_srcdir)/vendor/"
-VENDOR_DIST_ROOT="\$(abs_top_builddir)/vendor/dist"
-VENDOR_BUILD_ROOT="\$(abs_top_builddir)/vendor/.build"
-AC_SUBST([VENDOR_SRC_ROOT])
-AC_SUBST([VENDOR_BUILD_ROOT])
-AC_SUBST([VENDOR_DIST_ROOT])
-
-TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_LIBS} -lcmocka -L\$(abs_top_builddir)/vendor/dist/lib -Wl,-rpath,\$(abs_top_builddir)/vendor/dist/lib"
-TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_CFLAGS} -I\$(top_srcdir)/include -I\$(abs_top_builddir)/vendor/dist/include"
+TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_HELPER_LIBS} -lcmocka -L\$(top_builddir)/vendor/dist/lib -Wl,-rpath,\$(top_builddir)/vendor/dist/lib"
+TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_HELPER_CFLAGS} -I\$(top_srcdir)/include -I\$(top_builddir)/vendor/dist/include"
 
 AC_SUBST([TEST_LDFLAGS])
 AC_SUBST([TEST_CFLAGS])
diff --git a/vendor/Makefile.am b/vendor/Makefile.am
index 674784ab..46072c3c 100644
--- a/vendor/Makefile.am
+++ b/vendor/Makefile.am
@@ -1,18 +1,18 @@ 
-# needs an absolute path bc. of the cmake invocation
-cmockasrc     = "@VENDOR_SRC_ROOT@/cmocka"
-cmockabuild   = "@VENDOR_BUILD_ROOT@/cmocka"
-cmockainstall = "@VENDOR_DIST_ROOT@"
+cmockasrc   = $(srcdir)/cmocka
+# Not just '$(builddir)/cmocka', because cmocka requires an out-of-source build
+cmockabuild = $(builddir)/cmocka_build
+cmockadist  = $(builddir)/dist
 
 MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in \
 	"$(cmockabuild)" \
-	"$(cmockainstall)" \
-	"@VENDOR_BUILD_ROOT@"
+	"$(cmockadist)"
 
 libcmocka:
 if CMOCKA_INITIALIZED
-	mkdir -p $(cmockabuild) $(cmockainstall)
-	(cd $(cmockabuild) && cmake -DCMAKE_INSTALL_PREFIX=$(cmockainstall) $(cmockasrc) && make && make install)
+	mkdir -p $(cmockabuild) $(cmockadist)
+	## Compensate for the cd in the paths
+	(cd $(cmockabuild) && cmake -DCMAKE_INSTALL_PREFIX=../$(cmockadist) ../$(cmockasrc) && make && make install)
 endif
 
 check: libcmocka