]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Do not regenerate autogen files if --enable-local-libopts is given
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 25 May 2019 19:17:27 +0000 (21:17 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 29 May 2019 15:05:04 +0000 (17:05 +0200)
This addresses issue on installed systems which have autogen but
use --enable-local-libopts. In these systems if the installed autogen
would not match the local libopts library version compilation would
fail because the auto-generated files depend on the corresponding to
autogen version libopts internals.

Resolves: #772

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
.gitlab-ci.yml
configure.ac
src/Makefile.am

index 7fc747f5ff897f72b76cbcb1baade72f4676461e..ac6a8eb6ac59d73eab62d382b21a9b1206e959f1 100644 (file)
@@ -385,9 +385,13 @@ MinGW64:
     echo ':DOSWin:M::MZ::/usr/bin/wine64:' > /proc/sys/fs/binfmt_misc/register &&
     mkdir -p build && cd build
   - dash ../configure --disable-gcc-warnings --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --cache-file ../cache/config.cache --with-included-libtasn1 --disable-guile --disable-nls --with-included-unistring --enable-local-libopts --disable-full-test-suite --disable-non-suiteb-curves --disable-doc
+  # generate the certtool autogen file to check whether later compilation will modify it
+  - mingw64-make -C src certtool-args.c.bak
   - mingw64-make -j$(nproc)
   - mingw64-make -C tests check -j$(nproc)
   - cd ..
+  # since we use --enable-local-libopts the generated files must equal the .bak
+  - cmp build/src/certtool-args.c build/src/certtool-args.c.bak || false
   tags:
   - shared
   - docker
index 2112606601071542daa80c478221f0e1a77c8be1..e0c5c25d5bfaec9e93946f30f1f078e4842d17cc 100644 (file)
@@ -735,7 +735,7 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
 *** autogen not found. Will not link against system libopts.
 *** ]])
                dnl simulate specifying option on the command line
-               enable_local_libopts=yes
+               included_libopts=yes
        fi
        LIBOPTS_CHECK([src/libopts])
        if test "$NEED_LIBOPTS_DIR" = "true";then
index 0374924c5377efb0a24b5977e486d691406b44c3..501bca58c160c4ebea9ec3d802eeb72f3be0010c 100644 (file)
@@ -272,6 +272,23 @@ libcmd_systemkey_la_LIBADD += $(LTLIBREADLINE) $(INET_PTON_LIB) $(LIB_CLOCK_GETT
 
 SUFFIXES = .stamp .def .c.bak .h.bak
 
+if NEED_LIBOPTS
+# case --enable-local-libopts: We do not call AUTOGEN unless the .bak files are missing
+.def.stamp:
+       @b=`echo $@ | sed 's/.stamp$$//'`; \
+       if ! test -f $${srcdir}$${b}.c.bak;then \
+               echo "No .bak files found; will call autogen"; \
+               $(AM_V_GEN) $(AUTOGEN) $<; \
+       else \
+               echo "Re-using .bak files"; \
+               srcdir=$(srcdir)/; \
+               rm -f $${b}.c $${b}.h; \
+               cp -p $${srcdir}$${b}.c.bak $${b}.c; \
+               cp -p $${srcdir}$${b}.h.bak $${b}.h; \
+       fi
+       touch $@
+else
+# default case. We call autogen, and if that fails we resort to the bundled files.
 .def.stamp:
        $(AM_V_GEN) $(AUTOGEN) $< || { \
                srcdir=''; \
@@ -281,6 +298,7 @@ SUFFIXES = .stamp .def .c.bak .h.bak
                cp -p $${srcdir}$${b}.h.bak $${b}.h; \
        } && \
        touch $@
+endif
 
 .c.c.bak:
        -@rm -f $@