1dnl integrit - file integrity verification system -*- m4 -*- 2dnl Copyright (C) 2006 Ed L. Cashin 3dnl 4dnl This program is free software; you can redistribute it and/or 5dnl modify it under the terms of the GNU General Public License 6dnl as published by the Free Software Foundation; either version 2 7dnl of the License, or (at your option) any later version. 8dnl 9dnl This program is distributed in the hope that it will be useful, 10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12dnl GNU General Public License for more details. 13dnl 14dnl You should have received a copy of the GNU General Public License 15dnl along with this program; if not, write to the Free Software 16dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17dnl 18 19dnl Process this file with autoconf to produce a configure script. 20AC_PREREQ(2.53) 21AC_INIT(hashtbl.c) 22AC_CONFIG_HEADER(config.h) 23 24dnl AC_CONFIG_AUX_DIR(..) 25 26# ----- you can override these values by setting environment variables 27# CC=my-compiler ./configure 28CC=${CC:-"gcc"} 29# CFLAGS="-g foo -x bar" ./configure 30CFLAGS=${CFLAGS:-"-g -Wall -O2"} 31STATIC=${STATIC:-"-static"} 32 33dnl Checks for programs. 34AC_PROG_CC 35AC_PROGRAM_PATH(RM, rm , rm) 36dnl syncing is the job of the O.S., and users can always do "make; sync" 37dnl AC_PROGRAM_PATH(SYNC, sync, sync) 38AC_PROGRAM_PATH(AR, ar, ar) 39AC_PROG_MAKE_SET 40AC_PROG_RANLIB 41 42dnl for compilers that do not provide __FUNCTION__ 43AC_MSG_CHECKING(for __FUNCTION__ symbol) 44AC_TRY_COMPILE([#include <stdio.h>] , [printf ("%s\n", __FUNCTION__);] , 45 [HAVE__FUNCTION__=1 46 AC_MSG_RESULT(yes)], 47 [AC_MSG_RESULT(no) 48 CFLAGS="$CFLAGS -D__FUNCTION__=__FILE__" 49 HAVE__FUNCTION__=0]) 50 51dnl support compilers that do not support inline keyword (standard since C99) 52AC_C_INLINE 53 54dnl ---------- let users override the install that configure finds 55AC_ARG_WITH(install, 56[ --with-install=INSTALL manually specify a BSD-compatable install program]) 57if test "$with_install" != ""; then 58 if test "`echo $with_install | sed 's/\(.\).*/\1/'`" != "/"; then 59 echo configure Error: install program '"'$with_install'"' is not a full path 1>&2 60 exit 1 61 fi 62 echo setting install program with $with_install 63 INSTALL=$with_install 64else 65 AC_PROG_INSTALL 66fi 67 68dnl Checks for libraries. 69 70dnl Checks for header files. 71AC_HEADER_STDC 72AC_CHECK_HEADERS(unistd.h limits.h) 73AC_CHECK_HEADERS(stdint.h inttypes.h) 74dnl see below for more work after type sizes are checked 75 76dnl Checks for typedefs, structures, and compiler characteristics. 77AC_C_CONST 78AC_TYPE_SIZE_T 79 80AC_CHECK_SIZEOF(unsigned short, 2) 81AC_CHECK_SIZEOF(unsigned int, 4) 82AC_CHECK_SIZEOF(unsigned long, 4) 83AC_CHECK_SIZEOF(unsigned long long, 0) 84AC_CHECK_HEADER(stdint.h, have_stdint_h=yes, have_stdint_h=no) 85AC_CHECK_HEADER(inttypes.h, have_inttypes_h=yes, have_inttypes_h=no) 86if test "$have_stdint_h" = "no" && test "$have_inttypes_h" = "no"; then 87 echo no system stdint.h or inttypes.h. using stdint.h.in instead. 88 cp stdint.h.in stdint.h 89 AC_DEFINE(HAVE_STDINT_H,, [use stdint.h.in instead of stdint.h]) 90fi 91 92dnl Checks for library functions. 93AC_FUNC_MALLOC 94AC_CHECK_FUNC(strerror,, [cat <<ELCEOF 95 96 Your system doesn't have strerror. exiting. 97 98ELCEOF 99exit 1 100]) 101 102dnl check for dictionary file for hashtest 103AC_MSG_CHECKING(for system dictionary) 104system_dict=no 105for f in /usr/dict/words /usr/share/dict/words; do 106 if test -r $f; then 107 system_dict=$f 108 break 109 fi 110done 111AC_MSG_RESULT($system_dict) 112if test "$system_dict" = "no"; then 113 system_dict="no_dictionary_found" 114fi 115AC_DEFINE_UNQUOTED(SYSTEM_DICTIONARY,"$system_dict",the system dictionary) 116 117dnl ---------------- make hashtbl not error out on large files if the 118dnl system supports it. 119dnl 120dnl user can say "--disable-largefile" to turn large file 121dnl support off. 122dnl 123AC_SYS_LARGEFILE 124 125dnl ----------let the user do ./configure --enable-debug 126dnl 127AC_ARG_ENABLE(debug, 128 [ --enable-debug compile with runtime diagnostics enabled], 129 AC_DEFINE(DEBUG,, [enable debugging])) 130 131dnl ----------let ambitious users do ./configure --with-leakfind 132dnl 133AC_ARG_WITH(leakfind, 134[ --with-leakfind=DIR compile with Boehm gc runtime memory-leak debugging (for developers)], 135 AC_DEFINE(ELC_FIND_LEAKS,, [enable leakfind])) 136dnl -----------... and add to the appropriate variables 137if test "$with_leakfind" != ""; then 138 LIBS="$LIBS -lgc" 139 CPPFLAGS="$CPPFLAGS -I$with_leakfind" 140 LDFLAGS="$LDFLAGS -L$with_leakfind" 141fi 142 143dnl if they want debugging, then don't strip the binaries on install 144dnl 145if test "$enable_debug" != ""; then 146 STRIP= 147else 148 STRIP=-s 149fi 150 151AC_SUBST(CC) 152AC_SUBST(RM) 153AC_SUBST(AR) 154AC_SUBST(RANLIB) 155AC_SUBST(EXTRA_DEFS) 156AC_SUBST(STRIP) 157AC_OUTPUT(Makefile) 158