Page MenuHome GnuPG

gpgme: conf/config.h dependency
Testing, WishlistPublic

Description

gpgme puts its config.h in conf directory.

Current Automake doesn't handle this case correctly for the dependency to config.h generation.
For example, when configure.ac is touched, config.h.in won't be generated by make invocation.

Possible fix is either of:
(1) put config.h in the top directory. Then, Makefile includes the dependency all: config.h
(2) create conf/Makefile.am and add conf/Makefile in configure.ac, and add the conf directory to SUBDIR in the top Makefile.am

Revisions and Commits

Event Timeline

gniibe triaged this task as Wishlist priority.Jun 20 2023, 8:22 AM
gniibe created this task.

I vote for (1). All other GnuPG projects put config.h[.in] in the top directory.

See T4168 and rMecfa48fffa9 for the reason why we need this conf directory. Thus (1) is not an option.

Thank you. Now, I see the reason for conf/ sub directory.

I tried the option (2), but it doesn't work well since conf/config.h should be generated before the recursive targets.

I read the documentation and a bit of source code of Automake. Following is the next try of mine to put a dependency to conf/config.h:

diff --git a/Makefile.am b/Makefile.am
index 2bee07c6..ad9cc6e2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,6 +38,7 @@ EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in  \
              ChangeLog-2011 m4/ChangeLog-2011     \
              conf/whatisthis VERSION LICENSES
 
+BUILT_SOURCES = conf/config.h
 
 if RUN_GPG_TESTS
 tests = tests

It works for me. If no other drawbacks, this may be a solution.

gniibe changed the task status from Open to Testing.Jun 23 2023, 3:40 AM
gniibe claimed this task.

Applied.