2 dnl Configure template for GNUPG
4 dnl (Process this file with autoconf to produce a configure script.)
5 AC_REVISION($Revision$)dnl
7 dnl Must reset CDPATH so that bash's cd does not print to stdout
12 AC_CONFIG_AUX_DIR(scripts)
13 AM_CONFIG_HEADER(config.h)
15 AM_INIT_AUTOMAKE(gnupg,1.1.2a)
17 ALL_LINGUAS="da de eo es_ES fr id it ja nl pl pt_BR pt_PT ru sv"
22 dnl Check other options
25 AC_MSG_CHECKING([whether memory debugging is requested])
26 AC_ARG_ENABLE(m-debug,
27 [ --enable-m-debug enable debugging of memory allocation],
28 use_m_debug=$enableval, use_m_debug=no)
29 AC_MSG_RESULT($use_m_debug)
30 if test "$use_m_debug" = yes; then
34 AC_MSG_CHECKING([whether memory guard is requested])
35 AC_ARG_ENABLE(m-guard,
36 [ --enable-m-guard enable memory guard facility],
37 use_m_guard=$enableval, use_m_guard=no)
38 AC_MSG_RESULT($use_m_guard)
40 if test "$use_m_guard" = yes ; then
45 AC_MSG_CHECKING([whether included zlib is requested])
46 AC_ARG_WITH(included-zlib,
47 [ --with-included-zlib use the zlib code included here],
48 [g10_force_zlib=yes], [g10_force_zlib=no] )
49 AC_MSG_RESULT($g10_force_zlib)
52 dnl Check whether we want to use Linux capabilities
54 AC_MSG_CHECKING([whether use of capabilities is requested])
55 AC_ARG_WITH(capabilities,
56 [ --with-capabilities use linux capabilities [default=no]],
57 [use_capabilities="$withval"],[use_capabilities=no])
58 AC_MSG_RESULT($use_capabilities)
66 dnl Checks for programs.
69 dnl Setup some stuff depending on host/target.
73 # special stuff for Windoze NT
74 # Do we need to set cross_compiling here or is it sufficient
75 # to rely on AC_PROG_CC which is called later?
78 CPP="${target}-gcc -E"
79 RANLIB="${target}-ranlib"
80 disallowed_modules="rndunix rndlinux rndegd"
83 disallowed_modules="rndw32"
90 missing_dir=`cd $ac_aux_dir && pwd`
91 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
92 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
93 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
94 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
95 dnl AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
108 # special stuff for Windoze NT
109 ac_cv_have_dev_random=no
110 AC_DEFINE(USE_ONLY_8DOT3)
111 AC_DEFINE(HAVE_DRIVE_LETTERS)
112 AC_DEFINE(HAVE_DOSISH_SYSTEM)
113 AC_DEFINE(USE_SIMPLE_GETTEXT)
116 i?86-emx-os2 | i?86-*-os2*emx )
117 # OS/2 with the EMX environment
118 ac_cv_have_dev_random=no
119 AC_DEFINE(HAVE_DRIVE_LETTERS)
120 AC_DEFINE(HAVE_DOSISH_SYSTEM)
125 # DOS with the DJGPP environment
126 ac_cv_have_dev_random=no
127 AC_DEFINE(HAVE_DRIVE_LETTERS)
128 AC_DEFINE(HAVE_DOSISH_SYSTEM)
134 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
135 LDFLAGS="$LDFLAGS -L/usr/local/lib"
139 if test -z "$GCC" ; then
140 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
144 if test -z "$GCC" ; then
145 # Suppress all warnings
146 # to get rid of the unsigned/signed char mismatch warnings.
159 PRINTABLE_OS_NAME="MingW32"
161 i?86-emx-os2 | i?86-*-os2*emx )
162 PRINTABLE_OS_NAME="OS/2"
165 PRINTABLE_OS_NAME="MSDOS/DJGPP"
168 PRINTABLE_OS_NAME="GNU/Linux"
170 dnl let that after linux to avoid gnu-linux problems
172 PRINTABLE_OS_NAME="GNU/Hurd"
175 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
178 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME")
180 dnl Checks for libraries.
182 if test "$try_gettext" = yes; then
186 USE_INCLUDED_LIBINTL=no
188 AC_SUBST(USE_INCLUDED_LIBINTL)
191 AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config)
192 if test -n "$LIBGCRYPT_CONFIG"; then
193 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
194 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
198 *** You need libgcrypt to build this program.
199 *** It should be available at the same place you go this
203 AC_SUBST(LIBGCRYPT_CFLAGS)
204 AC_SUBST(LIBGCRYPT_LIBS)
207 dnl Where is the GTK+ toolkit
208 if test "$cross_compiling" = yes ; then
209 CFLAGS="$CFLAGS -I/home/wk/work/gtk+w32/include/gtk+/gdk/win32 \
210 -I/home/wk/work/gtk+w32/include -I/home/wk/work/gtk+w32/include/gtk+"
211 LIBS="$LIBS -L/home/wk/work/gtk+w32/lib -lgtk -lgdk -lglib"
214 AM_PATH_GTK(1.2.1, compile_agent=yes,compile_agent=no)
216 AM_CONDITIONAL(COMPILE_AGENT, test x$compile_agent = xyes)
219 dnl Solaris needs -lsocket and -lnsl. Unisys system includes
220 dnl gethostbyname in libsocket but needs libnsl for socket.
221 AC_CHECK_LIB(nsl, gethostbyname)
222 AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
223 if test x$ac_need_libsocket = x1; then
224 LIBS="$LIBS -lsocket"
226 if test x$ac_try_nsl = x1; then
227 AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
228 if test x$ac_need_libnsl = x1
235 dnl Checks for header files.
237 AC_CHECK_HEADERS(unistd.h langinfo.h termio.h)
240 dnl Checks for typedefs, structures, and compiler characteristics.
250 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
251 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
252 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
253 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
254 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
256 AC_CHECK_SIZEOF(unsigned short, 2)
257 AC_CHECK_SIZEOF(unsigned int, 4)
258 AC_CHECK_SIZEOF(unsigned long, 4)
259 AC_CHECK_SIZEOF(unsigned long long, 0)
261 if test "$ac_cv_sizeof_unsigned_short" = "0" \
262 || test "$ac_cv_sizeof_unsigned_int" = "0" \
263 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
264 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
269 dnl Checks for library functions.
271 AC_CHECK_FUNCS(strerror stpcpy strlwr stricmp tcgetattr rand strtoul mmap)
272 AC_CHECK_FUNCS(memmove gettimeofday getrusage gethrtime setrlimit clock_gettime)
273 AC_CHECK_FUNCS(memicmp atexit raise getpagesize strftime nl_langinfo)
274 AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask fopen64 fstat64)
277 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
280 dnl Check whether we can use Linux capabilities as requested
282 if test "$use_capabilities" = "yes" ; then
284 AC_CHECK_HEADERS(sys/capability.h)
285 if test "$ac_cv_header_sys_capability_h" = "yes" ; then
286 AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
287 if test "$ac_cv_lib_cap_cap_init" = "yes"; then
288 AC_DEFINE(USE_CAPABILITIES)
293 if test "$use_capabilities" = "no" ; then
296 *** The use of capabilities on this system is not possible.
297 *** You need a recent Linux kernel and some patches:
298 *** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
299 *** fcap-module-990613.tar.gz (kernel module)
300 *** libcap-1.92.tar.gz (user mode library and utilities)
301 *** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
302 *** set (filesystems menu). Be warned: This code is *really* ALPHA.
309 if test "$ac_cv_header_sys_shm_h" = "yes"; then
310 AC_DEFINE(USE_SHM_COPROCESSING)
315 dnl Do we have zlib? Must do it here because Solaris failed
316 dnl when compiling a conftest (due to the "-lz" from LIBS).
319 if test "$g10_force_zlib" = "yes"; then
322 AC_CHECK_HEADERS(zlib.h)
323 if test "$ac_cv_header_zlib_h" = yes ; then
324 AC_CHECK_LIB(z,deflateInit2_,use_local_zlib=no,:)
328 if test "$use_local_zlib" = yes ; then
329 AM_CONDITIONAL(ENABLE_LOCAL_ZLIB, true)
330 GNUPG_LINK_FILES(zlib/zlib.h, zlib.h )
331 GNUPG_LINK_FILES(zlib/zconf.h, zconf.h )
332 ZLIBS="../zlib/libzlib.a"
334 AM_CONDITIONAL(ENABLE_LOCAL_ZLIB, false)
341 # Allow users to append something to the version string without
342 # flagging it as development version. The user version part is
343 # considered everything after a dash.
347 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
348 AC_DEFINE(IS_DEVELOPMENT_VERSION)
352 GNUPG_LINK_FILES(include/types.h, types.h )
354 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
360 if test "$GCC" = yes; then
361 if test "$MAINTAINER_MODE" = "yes"; then
362 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
364 CFLAGS="$CFLAGS -Wall"
370 chmod +x scripts/db2html
371 cat >gnupg-defs.tmp <<G10EOF
372 /* Generated automatically by configure */
373 #ifdef HAVE_DRIVE_LETTERS
374 #define GNUPG_LOCALEDIR "c:/lib/gnupg/locale"
375 #define GNUPG_LIBDIR "c:/lib/gnupg"
376 #define GNUPG_DATADIR "c:/lib/gnupg"
377 #define GNUPG_HOMEDIR "c:/gnupg-test"
379 #define GNUPG_LOCALEDIR "${prefix}/${DATADIRNAME}/locale"
380 #define GNUPG_LIBDIR "${libdir}/gnupg"
381 #define GNUPG_DATADIR "${datadir}/gnupg"
383 #define GNUPG_HOMEDIR "/SYS\$LOGIN/gnupg"
385 #define GNUPG_HOMEDIR "~/.gnupg-test"
389 if cmp -s gnupg-defs.h gnupg-defs.tmp 2>/dev/null; then
390 echo "gnupg-defs.h is unchanged"
394 mv gnupg-defs.tmp gnupg-defs.h
395 echo "gnupg-defs.h created"
399 exec_prefix=$exec_prefix
402 DATADIRNAME=$DATADIRNAME