2

My question is similar to the following:

automake third party libraries

I have to add GnuTLS library to our projects tarball. My directory structure is:

program/
|
+--src/
|   |
|   +-- *.cpp; *.hpp
|
+--lib/
|   |
|   +--gnutls
|       |
|       +--Makefile.am
|       +--configure.ac
|       +--*.cpp; *.hpp; etc.
|
+--Makefile.am
+--configure.ac

My problem is with the configure.ac of the gnutls. I would like to include somehow to my configure.ac or Makefile.am or similar.

What I tried is to include the Makefiles of gnutls in my configure.ac:

AC_CONFIG_FILES([lib/gnutls/Makefile lib/gnutls/lib/Makefile lib/gnutls/src/Makefile])

Then it gives me a lots of errors:

lib/gnutls/lib/Makefile.am:98: error: ENABLE_PKCS11 does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:122: error: ENABLE_PKCS11 does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:142: error: HAVE_LIBIDN does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:154: error: NEEDS_LIBRT does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:158: error: ENABLE_FIPS140 does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:167: error: HAVE_LD_VERSION_SCRIPT does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:184: error: HAVE_LD_OUTPUT_DEF does not appear in AM_CONDITIONAL
lib/gnutls/lib/Makefile.am:200: error: ENABLE_CXX does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:29: error: ENABLE_CRYWRAP does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:33: error: NEED_LIBOPTS does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:53: error: ENABLE_SRP does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:57: error: ENABLE_OCSP does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:59: error: ENABLE_ANON does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:64: error: ENABLE_DANE does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:68: error: ENABLE_TROUSERS does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:74: error: ENABLE_PKCS11 does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:81: error: ENABLE_SRP does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:96: error: ENABLE_OCSP does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:118: error: ENABLE_ANON does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:126: error: ENABLE_DANE does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:163: error: ENABLE_DANE does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:177: error: ENABLE_PKCS11 does not appear in AM_CONDITIONAL
lib/gnutls/src/Makefile.am:193: error: ENABLE_TROUSERS does not appear in AM_CONDITIONAL

I think these conditionals should come from the configure.ac of gnutls. My questions are:

  • How can I include this configure.ac in my configure.ac?
  • Are there any better ways to include GnuTLS in our building process?
Community
  • 1
  • 1
Norbert
  • 302
  • 1
  • 9
  • 19
  • I found out that there is a macro called "AC_CONFIG_SUBDIRS". But there is still a question: Is it the bestway? – Norbert Apr 18 '16 at 12:41
  • Fyi: https://www.gnu.org/software/automake/manual/html_node/Subpackages.html – Norbert Apr 18 '16 at 12:44
  • 1
    No, you don't have to add the library to your tarball. If you need to produce a tarball that includes some packaging that includes both your project and the library, then do that. But the autotools are not a packaging tool, and using the autotool meta files to attempt to bundle multiple packages into a tarball is a mistake. (ie, stop using the word "tarball" to mean "that object produced by 'make distcheck'" and instead use it to mean "that object that we ship that contains both our project's autotool generated files as well as those of GnuTLS") – William Pursell Apr 18 '16 at 12:44
  • Thanks for your help! My problem is not the way it will be packed, so forgot that it will be packed into a package with GnuTLS included. The problem and my questions are about the building process of my library with a nested library. I think the previous link I posted answered my question. But I still don't know this is the "official" way to doing this. However I have to include GnuTLS in our delivery package. – Norbert Apr 18 '16 at 12:54
  • 1
    Yes, and I am suggesting that you *not* attempt to use nested libraries. If a library you depend on is a proper library, then require the user to install it. If it is a 'copy and paste' library, then incorporate its source code directly in your package and don't try to use recursive configure. It is brittle, fragile, and a pain to maintain. – William Pursell Apr 18 '16 at 13:02
  • I fully agree with you, but unfortunately it was our management's request. Previously this library was included in one of our customers package but just because we need it. They had a custom install scripts which configured and installed their library and this included calls to "./configure && make install" of GnuTLS. Thats why I am confused which way should I do it. – Norbert Apr 18 '16 at 13:08

0 Answers0