dnl $Id: configure.in,v 1.39 2003/05/28 18:30:33 aa5779 Exp $ dnl Copyright (C) 2001, 2002, 2003 by Artem V. Andreev dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl dnl Process this file with autoconf to produce a configure script. AC_INIT([libutils], [1.0.3]) AC_PREREQ([2.54]) AC_CONFIG_SRCDIR([dstring.c]) AM_INIT_AUTOMAKE AC_GNU_SOURCE AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_SYS_INTERPRETER AC_ARG_VAR(DOCSTRIP, [DocStrip utility from Tensile package]) if test "$interpval" = "yes"; then AC_CHECK_PROGS([DOCSTRIP], [docstrip], [$srcdir/fake_docstrip.sh]) else if test -z "$DOCSTRIP"; then AC_CACHE_CHECK([for docstrip script], [util_cv_prog_docstrip], [util_cv_prog_docstrip="$SHELL $srcdir/fake_docstrip.sh" if sl docstrip -- /dev/null 2>/dev/null; then utils_cv_prog_docstrip="sl docstrip -- " fi ] ) DOCSTRIP="$util_cv_prog_docstrip" fi fi aclocaldir=`aclocal --print-ac-dir || echo '${datadir}'/aclocal` AC_SUBST(aclocaldir) UTIL_COMMON_CFLAGS if test "$util_cv_prog_cc_comments" != "yes"; then AC_MSG_ERROR([C99 comments support is required]) fi if test "$ac_cv_c_char_unsigned" != "yes"; then AC_MSG_WARN([plain char is signed; wait for surprises]) fi AM_CONDITIONAL(PROFILE, test "$enable_profile" != "no") AC_ARG_ENABLE(objc, AC_HELP_STRING([--enable-objc], [enables Objective-C support]),, enable_objc=no) if test "$enable_objc" != "no"; then AC_CHECK_HEADERS([objc/objc-api.h], [AC_DEFINE([USE_OBJC_API], 1, [Defined if using ObjC API])], [AC_MSG_ERROR([GNU Objective C seems to be missing])]) fi AM_CONDITIONAL(OBJC, test "$enable_objc" != "no") AC_ARG_ENABLE(checksize, AC_HELP_STRING([--disable-checksize], [disable chunk size checking]),, enable_chksz=yes) if test "$enable_chksz" != "no"; then AC_DEFINE(ENABLE_CHECKSIZE, 1, [Defined if free_chunk should check chunk size]) fi AC_ARG_ENABLE(fp, AC_HELP_STRING([--disable-fp], [turn off `ds_fromdouble']),, enable_fp=yes) if test "$enable_fp" != "no"; then AC_CHECK_FUNCS(snprintf,, [AC_MSG_WARN([using 'sprintf' instead of 'snprintf' may cause security problems]) AC_CHECK_FUNC(sprintf,, AC_MSG_WARN([floating point cannot be supported]) enable_fp=no )] ) fi if test "$enable_fp" != "no"; then AC_DEFINE(ENABLE_FP, 1, [Defined when floating-point functions are enabled]) DS_FROMDOUBLE='dstring *ds_fromdouble(double val);' fi AC_SUBST(DS_FROMDOUBLE) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_SIZEOF([long long]) if test "$ac_cv_sizeof_long_long" -ne 0; then DS_FROMLLINT='dstring *ds_fromllint(long long val, int base, int len);' DS_FROMULLINT='dstring *ds_fromullint(unsigned long long val, int base, int len);' fi AC_SUBST([DS_FROMLLINT DS_FROMULLINT]) AC_CHECK_HEADERS([fcntl.h limits.h unistd.h],, [AC_MSG_ERROR([you are in trouble])] ) AC_CHECK_MEMBER([struct flock.l_type], [can_lock=yes], [AC_CHECK_FUNCS([flock], [can_lock=yes])], [#include ]) if test "$can_lock" = "yes"; then AC_DEFINE([CAN_LOCK], 1, [Defined when file locking is supported by OS]) fi AC_CHECK_HEADERS([sys/stat.h sys/types.h]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([void *]) AC_FUNC_STRCOLL AC_CHECK_FUNCS(strxfrm) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_TYPE_OFF_T dnl Checks for library functions. AC_FUNC_MMAP AC_CHECK_FUNCS(vsnprintf,, AC_MSG_WARN([using vsprintf may cause security problems])) AC_FUNC_VPRINTF if test "$ac_cv_func_vprintf" = "no"; then AC_MSG_WARN([vprintf unavailable, error reporting will be ugly]) fi AC_CHECK_FUNCS([strdup setenv fstat stat]) AC_CHECK_FUNCS([strcspn strerror strtoul lseek],, AC_MSG_ERROR([you are in trouble]) ) AC_CONFIG_FILES([Makefile dstring.h]) AC_OUTPUT