1
1
# Configure.ac script for Libgcrypt
2
2
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
3
# 2007, 2008 Free Software Foundation, Inc.
3
# 2007, 2008, 2009 Free Software Foundation, Inc.
5
5
# This file is part of Libgcrypt.
26
26
# Remember to change the version number immediately *after* a release.
27
27
# Set my_issvn to "yes" for non-released code. Remember to run an
28
28
# "svn up" and "autogen.sh" right before creating a distribution.
29
m4_define([my_version], [1.4.1])
29
m4_define([my_version], [1.4.4])
30
30
m4_define([my_issvn], [no])
32
m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
33
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
32
m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
33
| sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
34
34
AC_INIT([libgcrypt],
35
35
[my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
36
36
[bug-libgcrypt@gnupg.org])
445
449
[use_capabilities="$withval"],[use_capabilities=no])
446
450
AC_MSG_RESULT($use_capabilities)
452
# Implementation of the --enable-hmac-binary-check.
453
AC_MSG_CHECKING([whether a HMAC binary check is requested])
454
AC_ARG_ENABLE(hmac-binary-check,
455
AC_HELP_STRING([--enable-hmac-binary-check],
456
[Enable library integrity check]),
457
[use_hmac_binary_check=$enableval],
458
[use_hmac_binary_check=no])
459
AC_MSG_RESULT($use_hmac_binary_check)
460
if test "$use_hmac_binary_check" = yes ; then
461
AC_DEFINE(ENABLE_HMAC_BINARY_CHECK,1,
462
[Define to support an HMAC based integrity check])
449
466
# Implementation of the --disable-padlock-support switch.
450
467
AC_MSG_CHECKING([whether padlock support is requested])
683
700
AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise)
685
702
AC_CHECK_FUNCS(strerror rand mmap getpagesize sysconf waitpid wait4)
686
AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime)
703
AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime syslog)
687
704
AC_CHECK_FUNCS(fcntl ftruncate)
689
706
GNUPG_CHECK_MLOCK
710
# Check wether it is necessary to link against libdl.
713
if test "$use_hmac_binary_check" = yes ; then
714
_gcry_save_libs="$LIBS"
716
AC_SEARCH_LIBS(dlopen, c dl,,,)
718
LIBS="$_gcry_save_libs"
719
LIBGCRYPT_CONFIG_LIBS="${LIBGCRYPT_CONFIG_LIBS} ${DL_LIBS}"
691
725
# Check whether we can use Linux capabilities as requested.
692
727
if test "$use_capabilities" = "yes" ; then
693
728
use_capabilities=no
694
729
AC_CHECK_HEADERS(sys/capability.h)
817
852
CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
820
AC_ARG_ENABLE(gcc-warnings,
821
AC_HELP_STRING([--enable-gcc-warnings],
822
[enable more verbose gcc warnings]),
823
[more_gcc_warnings="$enableval"],
824
[more_gcc_warnings="no"])
855
# CFLAGS mangling when using gcc.
826
856
if test "$GCC" = yes; then
827
if test "$USE_MAINTAINER_MODE" = "yes" ||
828
test "$more_gcc_warnings" = "yes"; then
829
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
830
if test "$more_gcc_warnings" = "yes"; then
831
CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
832
CFLAGS="$CFLAGS -Wwrite-strings"
833
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
834
CFLAGS="$CFLAGS -Wno-missing-field-initializers"
835
CFLAGS="$CFLAGS -Wno-sign-compare"
836
# Note: We don't use -Wunreachable-code because this gives
837
# warnings for all asserts and many inline functions like
838
# gpg_error (gcc 4.1.2 20060928).
841
CFLAGS="$CFLAGS -Wall"
844
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
845
_gcc_cflags_save=$CFLAGS
846
CFLAGS="-Wpointer-arith"
847
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
848
AC_MSG_RESULT($_gcc_wopt)
849
CFLAGS=$_gcc_cflags_save;
850
if test x"$_gcc_wopt" = xyes ; then
851
CFLAGS="$CFLAGS -Wpointer-arith"
857
CFLAGS="$CFLAGS -Wall"
858
if test "$USE_MAINTAINER_MODE" = "yes"; then
859
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes"
860
CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
862
# If -Wno-missing-field-initializers is supported we can enable a
863
# a bunch of really useful warnings.
864
AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
865
_gcc_cflags_save=$CFLAGS
866
CFLAGS="-Wno-missing-field-initializers"
867
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
868
AC_MSG_RESULT($_gcc_wopt)
869
CFLAGS=$_gcc_cflags_save;
870
if test x"$_gcc_wopt" = xyes ; then
871
CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
872
CFLAGS="$CFLAGS -Wwrite-strings"
873
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
874
CFLAGS="$CFLAGS -Wno-missing-field-initializers"
875
CFLAGS="$CFLAGS -Wno-sign-compare"
878
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
879
_gcc_cflags_save=$CFLAGS
880
CFLAGS="-Wpointer-arith"
881
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
882
AC_MSG_RESULT($_gcc_wopt)
883
CFLAGS=$_gcc_cflags_save;
884
if test x"$_gcc_wopt" = xyes ; then
885
CFLAGS="$CFLAGS -Wpointer-arith"
855
891
# Check whether as(1) supports a noeexecstack feature. This test