dnl configure.ac dnl dnl Version information m4_define([libdbh_file_compatibility], ["DBH_1.0"]) m4_define([libdbh_version_major], [1]) m4_define([libdbh_version_minor], [0]) m4_define([libdbh_version_micro], [24]) m4_define([libdbh_version], [libdbh_version_major().libdbh_version_minor().libdbh_version_micro()]) AC_INIT([dbh],[libdbh_version()],[dbh-users@lists.sourceforge.net]) AM_INIT_AUTOMAKE([dbh], [libdbh_version()]) AM_CONFIG_HEADER([config.h]) AM_MAINTAINER_MODE AC_PROG_LIBTOOL dnl AC_DEFINE([DBH_FILE_VERSION],"DBH_1.0",dbh file compatibility) DBH_FILE_VERSION=libdbh_file_compatibility() AC_SUBST([DBH_FILE_VERSION]) DBH_VERSION_MAJOR=libdbh_version_major() AC_SUBST([DBH_VERSION_MAJOR]) DBH_VERSION_MINOR=libdbh_version_minor() AC_SUBST([DBH_VERSION_MINOR]) DBH_VERSION_MICRO=libdbh_version_micro() AC_SUBST([DBH_VERSION_MICRO]) DBH_VERSION=libdbh_version() AC_SUBST([DBH_VERSION]) dnl Initialize libtool AC_CANONICAL_HOST # libtool.m4 is a bit outof sync. AC_PROG_LIBTOOL AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_STDC AC_HEADER_STDC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_SUBST(LIBTOOL_DEPS) AC_SYS_LARGEFILE # Taken from Jamie Zawinski's configure script for xscreensaver : # # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'. # That's wrong: it should be set to '${INSTALL}', so that one can # implement the "install-strip" target properly (strip executables, # but do not try to strip scripts.) # INSTALL_SCRIPT='${INSTALL}' AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) AC_CHECK_HEADERS(limits.h machine/limits.h math.h stdio.h time.h) AC_HEADER_STAT AC_HEADER_DIRENT AC_C_CONST AC_C_INLINE AC_HEADER_TIME AC_TYPE_SIGNAL #AC_CHECK_FUNCS(wait3 wait4 waitpid) AC_CHECK_FUNCS(snprintf vsnprintf strcasecmp strncasecmp) AC_CHECK_FUNCS(memcpy memmove memset) #AC_CHECK_FUNC(scandir, AC_DEFINE(HAVE_SCANDIR,1,HAVE_SCANDIR),) compiler_warnings=yes AC_MSG_CHECKING(if we want compiler warnings) AC_ARG_ENABLE( warnings, [ --enable-warnings [default=yes] enable gcc compiler warnings], compiler_warnings="$enableval", compiler_warnings="yes" ) AC_MSG_RESULT($compiler_warnings) case xyes in x$ac_cv_c_bigendian) echo "Checking integer bit order... bigendian" CFLAGS="$CFLAGS -DTURN" ;; *) echo "Checking integer bit order... littleendian" ;; esac # At present, only 32 bit system. #AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(unsigned char *) AC_CHECK_SIZEOF(long long) m4_define([sizeof_file_pointer], [$ac_cv_sizeof_unsigned_char_p]) SIZEOF_FILE_POINTER=sizeof_file_pointer() AC_SUBST(SIZEOF_FILE_POINTER) case $ac_cv_sizeof_int in 2) CFLAGS="$CFLAGS -DI16_32" ;; 4) I32_32=1 AC_SUBST(I32_32) AC_DEFINE_UNQUOTED(I32_32,1,file size support) CFLAGS="$CFLAGS -DI32_32" ;; 8) CFLAGS="$CFLAGS -DI64_32" ;; esac AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc=PFX [default=no] enable dmalloc library], [ DMALLOC_LIB=$enableval/libdmalloc.a AC_DEFINE(DMALLOC,"$DMALLOC",dmalloc)], ) AC_SUBST(DMALLOC_LIB) AC_MSG_CHECKING(if prototype for gethostname exists) AC_EGREP_CPP(gethostname,[#include ], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GETHOSTNAME_PROTO,1,HAVE_GETHOSTNAME_PROTO), AC_MSG_RESULT(no) ) dnl Check whether to build with debugging support BM_DEBUG_SUPPORT dnl Build ldflags for pkg-config file BM_PKG_LDFLAGS(PKG) AC_OUTPUT([ Makefile dbh.spec src/Makefile src/dbh-1.0.pc src/dbh_config.h ]) echo "CFLAGS -> $CFLAGS" AC_MSG_RESULT(configure step complete: now do a "make" followed by a make "install")