Page MenuHome GnuPG

tests fail with --disable-gpg
Closed, ResolvedPublic

Description

./configure --disable-scdaemon --disable-gpgsm --disable-gpg --disable-dirmngr --disable-doc --disable-gpgtar  --disable-ccid-driver --disable-dirmngr-auto-start  --disable-ldap --disable-sqlite --disable-gnutls --enable-maintainer-mode

will not build for me. The issue is this repeated portion of some tests/*/Makefile.am files:

# Programs required before we can run these tests.
required_pgms = ../../g10/gpg$(EXEEXT) ../../agent/gpg-agent$(EXEEXT) \
                ../../tools/gpg-connect-agent$(EXEEXT) \
		../gpgscm/gpgscm$(EXEEXT)

<snip>

# We need to depend on a couple of programs so that the tests don't
# start before all programs are built.
all-local: $(required_pgms)

That works fine if g10/gpg is being built. But if ../../g10/gpg isn't supposed to be built, it fails like this:

gcc -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wformat -Wno-format-y2k -Wformat-security -W -Wno-sign-compare -Wno-missing-field-initializers -Wdeclaration-after-statement -Wlogical-op -Wvla -Wno-pointer-sign -Wpointer-arith -g -O2    ../../g10/gpg.c   -o ../../g10/gpg
../../g10/gpg.c:22:10: fatal error: config.h: No such file or directory
 #include <config.h>
          ^~~~~~~~~~
compilation terminated.

I think an implicit rule is taking over there. I was able to get things to at least build by making these changes, just making an empty target for it at the bottom of each Makefile.am

diff --git a/tests/gpgme/Makefile.am b/tests/gpgme/Makefile.am
index f1c19eb16..532d09c66 100644
--- a/tests/gpgme/Makefile.am
+++ b/tests/gpgme/Makefile.am
@@ -55,3 +55,5 @@ CLEANFILES = *.log report.xml
 # We need to depend on a couple of programs so that the tests don't
 # start before all programs are built.
 all-local: $(required_pgms)
+
+../../g10/gpg: ;
diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am
index e54db7842..738a75f4c 100644
--- a/tests/gpgsm/Makefile.am
+++ b/tests/gpgsm/Makefile.am
@@ -73,3 +73,5 @@ CLEANFILES = *.log report.xml
 # We need to depend on a couple of programs so that the tests don't
 # start before all programs are built.
 all-local: $(required_pgms)
+
+../../g10/gpg: ;
diff --git a/tests/migrations/Makefile.am b/tests/migrations/Makefile.am
index d90c9c7f9..9634cfd5d 100644
--- a/tests/migrations/Makefile.am
+++ b/tests/migrations/Makefile.am
@@ -64,3 +64,5 @@ CLEANFILES = *.log report.xml
 # We need to depend on a couple of programs so that the tests don't
 # start before all programs are built.
 all-local: $(required_pgms)
+
+../../g10/gpg: ;
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index f6014c9c5..17b810aee 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -286,3 +286,5 @@ clean-local:
 # We need to depend on a couple of programs so that the tests don't
 # start before all programs are built.
 all-local: $(required_pgms)
+
+../../g10/gpg: ;

I suspect there are better solutions to be had though.

Revisions and Commits

Event Timeline

werner added a subscriber: werner.

gpg is required by several parts of GnuPG. Tracking dependencies for it for the esoteric case of not building it does not make any sense. Thus the option will be removed from from master.

werner claimed this task.