File: configure.ac

package info (click to toggle)
dirmngr 0.9.6-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,984 kB
  • ctags: 2,305
  • sloc: ansic: 25,574; sh: 4,577; makefile: 524; yacc: 288; sed: 16
file content (422 lines) | stat: -rw-r--r-- 11,833 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# configure.ac - for DirMngr
#       Copyright (C) 2002 Klarälvdalens Datakonsult AB
#       Copyright (C) 2003, 2004, 2005, 2006 g10 Code GmbH
# 
# This file is part of DirMngr.
# 
# DirMngr is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# DirMngr is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
min_automake_version="1.9.3"

AC_INIT(dirmngr, 0.9.6, gpa-dev@gnupg.org)

NEED_GPG_ERROR_VERSION=1.0

NEED_LIBGCRYPT_API=1
NEED_LIBGCRYPT_VERSION=1.2.0

NEED_LIBASSUAN_VERSION=0.6.8

NEED_KSBA_API=1
NEED_KSBA_VERSION=1.0.0

PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION

AC_CONFIG_SRCDIR(src/dirmngr.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AB_INIT

AC_GNU_SOURCE

# Some status variables to give feedback at the end of a configure run
have_gpg_error=no
have_libgcrypt=no 
have_libassuan=no
have_ksba=no
have_ldap=no
have_pth=no

AM_MAINTAINER_MODE

AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
                                        [Bug report address])
AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
                                       [Required version of Libgcrypt])
AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
                                       [Required version of Libksba])

# Checks for programs.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
#AC_ARG_PROGRAM
AC_SYS_LARGEFILE


AC_ARG_ENABLE(gcc-warnings,
	      AC_HELP_STRING([--enable-gcc-warnings],
			     [enable more verbose gcc warnings]),
	      [more_gcc_warnings="$enableval"],
	      [more_gcc_warnings="no"])

if test "$GCC" = yes; then
    if test "$USE_MAINTAINER_MODE" = "yes" ||
       test "$more_gcc_warnings" = "yes"; then
        CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
        CFLAGS="$CFLAGS -Wformat-nonliteral"
        if test "$more_gcc_warnings" = "yes"; then
            CFLAGS="$CFLAGS -W -Wpointer-arith -Wbad-function-cast"
            CFLAGS="$CFLAGS -Wwrite-strings -Wunreachable-code"
            CFLAGS="$CFLAGS -Wno-sign-compare"
        fi
    else
        CFLAGS="$CFLAGS -Wall"
    fi

    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
    _gcc_cflags_save=$CFLAGS
    CFLAGS="-Wno-pointer-sign"
    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
    AC_MSG_RESULT($_gcc_psign)
    CFLAGS=$_gcc_cflags_save;
    if test x"$_gcc_psign" = xyes ; then
       CFLAGS="$CFLAGS -Wno-pointer-sign"
    fi
fi


# Tweaks for certain OSes.
PRINTABLE_OS_NAME=
case "${host}" in
    *-*-mingw32*)
        PRINTABLE_OS_NAME="MingW32"
        ;;
    *-*-cygwin*)
        PRINTABLE_OS_NAME="Cygwin"
        ;;
    i?86-emx-os2 | i?86-*-os2*emx )
        PRINTABLE_OS_NAME="OS/2"
        ;;
    i?86-*-msdosdjgpp*)
        PRINTABLE_OS_NAME="MSDOS/DJGPP"
        try_dynload=no
        ;;
    *-*-freebsd*)
       # Need to include /usr/local for FreeBSD
       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
       LDFLAGS="$LDFLAGS -L/usr/local/lib"
       ;;
    *-linux*)
        PRINTABLE_OS_NAME="GNU/Linux"
        ;;
esac
if test -z "$PRINTABLE_OS_NAME"; then
  PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
fi

AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
                   [A human readable text with the name of the OS])


AM_GNU_GETTEXT_VERSION(0.12.1)
AM_GNU_GETTEXT(,[need-ngettext])

#
# Checks for libraries.
#

#
# libgpg-error is a library with error codes shared between GnuPG
# related projects.
#
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
                  have_gpg_error=yes,have_gpg_error=no)
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_DIRMNGR,
          [The default error source for GPGME.])

#
# Libgcrypt is our generic crypto library
#
AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
        have_libgcrypt=yes,have_libgcrypt=no)   


#
# libassuan is used for IPC
#
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
                  have_libassuan=yes,have_libassuan=no)


#
# libksba is our X.509 support library
#
AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)


#
# Check whether the GNU Pth library is available
#
AC_ARG_WITH(pth-prefix,
            AC_HELP_STRING([--with-pth-prefix=PFX],
                           [prefix where GNU Pth is installed (optional)]),
     pth_config_prefix="$withval", pth_config_prefix="")
if test x$pth_config_prefix != x ; then
   PTH_CONFIG="$pth_config_prefix/bin/pth-config"
fi
AC_PATH_PROG(PTH_CONFIG, pth-config, no)
if test "$PTH_CONFIG" != "no"; then
  if test -x "$PTH_CONFIG"; then 
    GNUPG_PTH_VERSION_CHECK(1.3.7)
      if test $have_pth = yes; then      
        PTH_CFLAGS=`$PTH_CONFIG --cflags`
        PTH_LIBS=`$PTH_CONFIG --ldflags`
        PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
        AC_DEFINE(USE_GNU_PTH, 1,
                  [Defined if the GNU Portable Thread Library should be used])
      fi
   fi
fi
AC_SUBST(PTH_CFLAGS)
AC_SUBST(PTH_LIBS)


#
# Must check for network library requirements before doing link tests
# for ldap, for example. If ldap libs are static (or dynamic and without
# ELF runtime link paths), then link will fail and LDAP support won't
# be detected.
#
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
	[NETLIBS="-lnsl $NETLIBS"]))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
	[NETLIBS="-lsocket $NETLIBS"]))

#
# LDAP libraries/includes
#
# From gnupg 1.4:
# Try and link a LDAP test program to weed out unusable LDAP
# libraries.  -lldap [-llber [-lresolv]] is for older OpenLDAPs.
# OpenLDAP, circa 1999, was terrible with creating weird dependencies.
# This seems to have all been resolved, so I'm simplifying this code
# significantly.  If all else fails, the user can play
# guess-the-dependency by using something like ./configure
# LDAPLIBS="-Lfoo -lbar"
#
for MY_LDAPLIBS in ${LDAPLIBS+"$LDAPLIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv" "-lwldap32"; do
    _ldap_save_libs=$LIBS
    LIBS="$MY_LDAPLIBS $NETLIBS $LIBS"

    AC_MSG_CHECKING([whether LDAP via \"$MY_LDAPLIBS\" is present and sane])
    AC_TRY_LINK([
#ifdef _WIN32
#include <winsock2.h>
#include <winldap.h>
#else
#include <ldap.h>
#endif
],[ldap_open("foobar",1234);],
                [gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
    AC_MSG_RESULT([$gnupg_cv_func_ldap_init])

    if test "$gnupg_cv_func_ldap_init" = yes ; then
       LDAPLIBS=$MY_LDAPLIBS
       have_ldap=yes

       AC_CHECK_FUNCS(ldap_get_option ldap_set_option ldap_start_tls_s)

       if test "$ac_cv_func_ldap_get_option" != yes ; then
          AC_MSG_CHECKING([whether LDAP supports ld_errno])
	  AC_TRY_LINK([#include <ldap.h>],[LDAP *ldap; ldap->ld_errno;],
	     [gnupg_cv_func_ldap_ld_errno=yes],
	     [gnupg_cv_func_ldap_ld_errno=no])
          AC_MSG_RESULT([$gnupg_cv_func_ldap_ld_errno])

	  if test "$gnupg_cv_func_ldap_ld_errno" = yes ; then
	     AC_DEFINE(HAVE_LDAP_LD_ERRNO,1,
                      [Define if the LDAP library supports ld_errno])
          fi
       fi
    fi

    LIBS=$_ldap_save_libs

    if test $have_ldap = yes ; then break; fi
done
AC_SUBST(LDAPLIBS)



# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h])


# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_DECL_SYS_SIGLIST

GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)


AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])


# Checks for library functions.

# begin jnlib checks - fixme: we should have a macros for them
AC_CHECK_FUNCS(memicmp stpcpy strlwr strtoul memmove stricmp strtol)
AC_CHECK_FUNCS(getrusage setrlimit stat setlocale)
AC_CHECK_FUNCS(flockfile funlockfile fopencookie funopen)
# end jnlib checks

AC_CHECK_FUNCS([gmtime_r])

AC_CHECK_FUNCS([getaddrinfo])

AC_CHECK_FUNCS([mmap])
if test $ac_cv_func_mmap != yes; then
  AC_MSG_ERROR([[Sorry, the current implemenation requires mmap.]])
fi

AC_CHECK_FUNCS([canonicalize_file_name])

# Check for funopen
AC_CHECK_FUNCS(funopen fopencookie)
if test $ac_cv_func_funopen != yes; then
  # No funopen but we can implement that in terms of fopencookie.
  if test $ac_cv_func_fopencookie = yes; then
      AC_LIBOBJ([funopen])
  else
      AC_MSG_ERROR([[No implementation of fopencookie or funopen available.]])
  fi
fi

# We use jnlib, so tell other modules about it
AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
         [Defined if jnlib style logging fucntions are available])



#
# Print errors here so that they are visible all
# together and the user can acquire them all together.
#
die=no
if test "$have_gpg_error" = "no"; then
   die=yes
   AC_MSG_NOTICE([[
***  
*** You need libgpg-error to build this program.
**  This library is for example available at
***   ftp://ftp.gnupg.org/pub/gcrypt/libgpg-error
*** (at least version $NEED_GPG_ERROR_VERSION is required.)
***]])
fi
if test "$have_libgcrypt" = "no"; then
   die=yes
   AC_MSG_NOTICE([[
***  
*** You need libgcrypt to build this program.
**  This library is for example available at
***   ftp://ftp.gnupg.org/pub/gcrypt/libgcrypt/
*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
***]])
fi
if test "$have_libassuan" = "no"; then
   die=yes
   AC_MSG_NOTICE([[
***
*** You need libassuan to build this program.
*** This library is for example available at
***   ftp://ftp.gnupg.org/pub/gcrypt/alpha/libassuan/
*** (at least version $NEED_LIBASSUAN_VERSION is required).
***]])
fi
if test "$have_ksba" = "no"; then
   die=yes
    AC_MSG_NOTICE([[
***
*** You need libksba to build this program.
*** This library is for example available at
***   ftp://ftp.gnupg.org/pub/gcrypt/libksba/
*** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required.)
***]])
fi
if test "$have_ldap" = "no"; then
   die=yes
    AC_MSG_NOTICE([[
***
*** You need a LDAP library to build this program.
*** Check out 
***    http://www.openldap.org 
*** for a suitable implementation. 
***]])
fi
if test "$have_pth" = "no"; then
   die=yes
    AC_MSG_NOTICE([[
***
*** GNU Portable Threads Library not found.  
*** Download GNU Pth from ftp://ftp.gnu.org/gnu/pth/
*** On a Debian GNU/Linux system you might want to try 
***   apt-get install libpth-dev
***]])
fi

if test "$die" = "yes"; then
    AC_MSG_ERROR([[
***
*** Required libraries not found. Please consult the above messages
*** and install them before running configure again.
***]])
fi



AC_CONFIG_FILES([ intl/Makefile po/Makefile.in 
Makefile
m4/Makefile
jnlib/Makefile
src/Makefile
doc/Makefile
tests/Makefile
])
AC_OUTPUT