dnl Copyright (C) 2000-2004 Peter Selinger. dnl This file is part of ccrypt. It is free software and it is covered dnl by the GNU general public license. See the file COPYING for details. dnl Process this file with autoconf to produce a configure script. dnl ---------------------------------------------------------------------- AC_INIT(src/ccrypt.c) AM_INIT_AUTOMAKE(ccrypt, 1.7) DATE="March 2004" AM_CONFIG_HEADER(config.h) dnl ---------------------------------------------------------------------- dnl Find lisp installation directory AC_ARG_WITH(lispdir, [ --with-lispdir=DIR override emacs site-lisp directory], lispdir=$withval, [AM_PATH_LISPDIR]) dnl ---------------------------------------------------------------------- dnl The names of the installed executables and the default suffix are in dnl principle configurable. However, they should not normally be changed, dnl because other scripts might depend on them. NAME=ccrypt NAMEENCRYPT=ccencrypt NAMEDECRYPT=ccdecrypt NAMECAT=ccat SUF=.cpt dnl Upper case name NAMEUC=`echo $NAME | tr a-z A-Z` dnl ---------------------------------------------------------------------- dnl Export some parameters to config file AC_DEFINE_UNQUOTED(NAME,"$NAME",Name of the ccrypt binary) AC_DEFINE_UNQUOTED(NAMEENCRYPT,"$NAMEENCRYPT",Name of the ccencrypt binary) AC_DEFINE_UNQUOTED(NAMEDECRYPT,"$NAMEDECRYPT",Name of the ccdecrypt binary) AC_DEFINE_UNQUOTED(NAMECAT,"$NAMECAT",Name of the ccat binary) AC_DEFINE_UNQUOTED(SUF,"$SUF",Default suffix for encrypted files) dnl ---------------------------------------------------------------------- dnl remember user's CFLAGS iCFLAGS="$CFLAGS" dnl ---------------------------------------------------------------------- dnl Check for programs. AC_PROG_CC dnl Note: CFLAGS can now be specified by the user at ./configure time, dnl but we enforce -O3, as this really makes a big difference in terms dnl of performance for ccrypt. (74% faster than -O0, 19% faster than dnl -O2). The space/time tradeoff is biased in favor of time for ccrypt. if test "$GCC" = "yes"; then if test "$iCFLAGS" = ""; then CFLAGS="-O3 -Wall" else CFLAGS="$iCFLAGS -O3" fi fi AC_CHECK_PROGS(TAR, gtar, tar) dnl ---------------------------------------------------------------------- dnl check for features AC_ARG_ENABLE(libcrypt, [ --disable-libcrypt don't link against libcrypt, use own replacement]) dnl ---------------------------------------------------------------------- dnl Checks for libraries. if test "$enable_libcrypt" != no; then AC_CHECK_LIB(crypt, crypt) fi if test "$ac_cv_lib_crypt_crypt" != yes; then EXTRA_OBJS="$EXTRA_OBJS unixcrypt3.o" fi dnl ---------------------------------------------------------------------- dnl Checks for header files. AC_CHECK_HEADERS(stdint.h) dnl ---------------------------------------------------------------------- dnl Checks for library functions. AC_CHECK_FUNC(getopt_long, , EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o") dnl ---------------------------------------------------------------------- dnl Find sizes of some types AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned long, 4) dnl Determine 32-bit unsigned integer type AC_MSG_CHECKING([for 32 bit unsigned integer type]) if test "$ac_cv_sizeof_unsigned_int" -eq 4; then UINT32_TYPE="unsigned int"; elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then UINT32_TYPE="unsigned long"; else AC_MSG_ERROR(cannot find 32 bit integer type) fi AC_MSG_RESULT($UINT32_TYPE) AC_DEFINE_UNQUOTED(UINT32_TYPE,$UINT32_TYPE,unsigned 32 bit integer type) dnl ---------------------------------------------------------------------- dnl Set up substitutions of non-standard configuration parameters AC_SUBST(NAME) AC_SUBST(NAMEENCRYPT) AC_SUBST(NAMEDECRYPT) AC_SUBST(NAMECAT) AC_SUBST(SUF) AC_SUBST(DATE) AC_SUBST(NAMEUC) AC_SUBST(EXTRA_OBJS) AC_SUBST(TAR) dnl ---------------------------------------------------------------------- AC_OUTPUT([doc/ccrypt.1 Makefile src/Makefile emacs/Makefile check/Makefile doc/Makefile ])