1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
2 diff --git a/configure.ac b/configure.ac
3 index 2112606601..e0c5c25d5b 100644
6 @@ -735,7 +735,7 @@ if test "$enable_tools" != "no" || test "$enable_doc" != "no"; then
7 *** autogen not found. Will not link against system libopts.
9 dnl simulate specifying option on the command line
10 - enable_local_libopts=yes
11 + included_libopts=yes
13 LIBOPTS_CHECK([src/libopts])
14 if test "$NEED_LIBOPTS_DIR" = "true";then
15 diff --git a/src/Makefile.am b/src/Makefile.am
16 index 0374924c53..8dac61cac5 100644
19 @@ -272,6 +272,25 @@ libcmd_systemkey_la_LIBADD += $(LTLIBREADLINE) $(INET_PTON_LIB) $(LIB_CLOCK_GETT
21 SUFFIXES = .stamp .def .c.bak .h.bak
24 +# case --enable-local-libopts: We only call AUTOGEN if the .bak files are not present.
25 +# Normally we wouldn't want to call AUTOGEN here as it is explicitly asked not to, but
26 +# in certain CI systems, we need to use this
27 +# our CI systems, which work on
29 + b=`echo $@ | sed 's/.stamp$$//'`; \
30 + if ! test -f $${srcdir}$${b}.c.bak;then \
31 + echo $${srcdir}$${b}.c.bak; \
34 + srcdir=$(srcdir)/; \
35 + rm -f $${b}.c $${b}.h; \
36 + cp -p $${srcdir}$${b}.c.bak $${b}.c; \
37 + cp -p $${srcdir}$${b}.h.bak $${b}.h; \
41 +# default case. We call autogen, and if that fails we resort to the bundled files.
43 $(AM_V_GEN) $(AUTOGEN) $< || { \
45 @@ -281,6 +300,7 @@ SUFFIXES = .stamp .def .c.bak .h.bak
46 cp -p $${srcdir}$${b}.h.bak $${b}.h; \