gpg-agent: Use "pinentry-basic" as fallback.
[gnupg.git] / common / Makefile.am
index a777a34..6b41062 100644 (file)
 
 EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk ChangeLog-2011 \
              audit-events.h status-codes.h README.jnlib ChangeLog.jnlib \
-            ChangeLog-2011.include w32info-rc.h.in gnupg.ico
+            ChangeLog-2011.include w32info-rc.h.in gnupg.ico tls-ca.pem
 
-noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a
+noinst_LIBRARIES = libcommon.a libcommonpth.a libgpgrl.a \
+                   libcommontls.a libcommontlsnpth.a
 if !HAVE_W32CE_SYSTEM
 noinst_LIBRARIES += libsimple-pwquery.a
 endif
@@ -42,7 +43,7 @@ include $(top_srcdir)/am/cmacros.am
 jnlib_sources = \
        libjnlib-config.h \
        types.h host2net.h dynload.h w32help.h \
-       stringhelp.c stringhelp.h \
+       mapstrings.c stringhelp.c stringhelp.h \
        strlist.c strlist.h \
        utf8conv.c utf8conv.h \
        argparse.c argparse.h \
@@ -58,7 +59,6 @@ endif
 common_sources = \
        common-defs.h \
        util.h i18n.c i18n.h \
-       estream.c estream.h estream-printf.c estream-printf.h \
        status.c status.h\
        shareddefs.h \
        openpgpdefs.h \
@@ -72,7 +72,7 @@ common_sources = \
        homedir.c \
        gettime.c gettime.h \
        yesno.c \
-       b64enc.c b64dec.c \
+       b64enc.c b64dec.c zb32.c \
        convert.c \
        percent.c \
        miscellaneous.c \
@@ -88,7 +88,6 @@ common_sources = \
        srv.h \
        dns-cert.c dns-cert.h \
        pka.c pka.h \
-       http.c http.h \
        localename.c \
        session-env.c session-env.h \
        userids.c userids.h \
@@ -97,6 +96,12 @@ common_sources = \
        agent-opt.c \
        helpfile.c
 
+# Sources possible requiring a TLS library are put into a separate
+# conveince library.
+tls_sources = \
+       http.c http.h
+
+
 # To make the code easier to read we have split home some code into
 # separate source files.
 if HAVE_W32_SYSTEM
@@ -126,6 +131,12 @@ libcommonpth_a_SOURCES += srv.c
 endif
 libcommonpth_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) $(NPTH_CFLAGS)
 
+libcommontls_a_SOURCES = $(tls_sources)
+libcommontls_a_CFLAGS = $(AM_CFLAGS) $(LIBGNUTLS_CFLAGS) -DWITHOUT_NPTH=1
+
+libcommontlsnpth_a_SOURCES = $(tls_sources)
+libcommontlsnpth_a_CFLAGS = $(AM_CFLAGS) $(LIBGNUTLS_CFLAGS) $(NPTH_CFLAGS)
+
 if !HAVE_W32CE_SYSTEM
 libsimple_pwquery_a_SOURCES = \
        simple-pwquery.c simple-pwquery.h asshelp.c asshelp.h
@@ -165,15 +176,25 @@ if HAVE_W32_SYSTEM
 jnlib_tests += t-w32-reg
 endif
 module_tests = t-convert t-percent t-gettime t-sysutils t-sexputil \
-              t-session-env t-openpgp-oid t-ssh-utils t-dns-cert
+              t-session-env t-openpgp-oid t-ssh-utils t-dns-cert \
+              t-mapstrings t-zb32
 if !HAVE_W32CE_SYSTEM
 module_tests += t-exechelp
 endif
-module_maint_tests = t-helpfile t-b64
 
+if MAINTAINER_MODE
+module_maint_tests = t-helpfile t-b64 t-http
+else
+module_maint_tests =
+endif
+
+
+t_common_cflags = $(KSBA_CFLAGS) $(LIBGCRYPT_CFLAGS) \
+                  $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
+t_common_ldadd = libcommon.a \
+                 $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
+                $(LIBINTL) $(LIBICONV)
 
-t_common_ldadd = libcommon.a ../gl/libgnu.a \
-                 $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) $(LIBICONV)
 
 # jnlib tests
 t_stringhelp_SOURCES = t-stringhelp.c $(t_jnlib_src)
@@ -200,3 +221,14 @@ t_session_env_LDADD = $(t_common_ldadd)
 t_openpgp_oid_LDADD = $(t_common_ldadd)
 t_ssh_utils_LDADD = $(t_common_ldadd)
 t_dns_cert_LDADD = $(t_common_ldadd) $(DNSLIBS)
+t_mapstrings_LDADD = $(t_common_ldadd)
+t_zb32_LDADD = $(t_common_ldadd)
+
+# http tests
+t_http_SOURCES = t-http.c
+t_http_CFLAGS  = $(t_common_cflags) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS)
+t_http_LDADD   = libcommontls.a $(t_common_ldadd) \
+                $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
+
+# All programs should depend on the created libs.
+$(PROGRAMS) : libcommon.a libcommonpth.a libcommontls.a libcommontlsnpth.a