# Configuration for grep # # Alain Magloire # dnl Process this file with autoconf to produce a configure script AC_INIT(src/grep.c) AC_DEFINE(GREP) AC_PREREQ(2.12) dnl Automake stuff. AM_INIT_AUTOMAKE(grep, 2.2) AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB # From Paul Eggert. # If available, prefer support for large files unless the user specified # one of the CPPFLAGS, LDFLAGS, or LIBS variables. AC_MSG_CHECKING(whether large file support needs explicit enabling) ac_getconfs='' ac_result=yes ac_set='' ac_shellvars='CPPFLAGS LDFLAGS LIBS' for ac_shellvar in $ac_shellvars; do case $ac_shellvar in CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; *) ac_lfsvar=LFS_$ac_shellvar ;; esac eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } ac_getconf=`getconf $ac_lfsvar` ac_getconfs=$ac_getconfs$ac_getconf eval ac_test_$ac_shellvar=\$ac_getconf done case "$ac_result$ac_getconfs" in yes) ac_result=no ;; esac case "$ac_result$ac_set" in yes?*) ac_result="yes, but $ac_set is already set, so use its settings" esac AC_MSG_RESULT($ac_result) case $ac_result in yes) for ac_shellvar in $ac_shellvars; do eval $ac_shellvar=\$ac_test_$ac_shellvar done ;; esac dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_C_CONST dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(string.h stdlib.h sys/param.h memory.h unistd.h libintl.h) AC_CHECK_HEADERS(wctype.h wchar.h, USE_WCHAR=yes, USE_WCHAR=no) AC_HEADER_STAT dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_MMAP dnl getpagesize is checked for by AC_FUNC_MMAP. AC_CHECK_FUNCS(strerror valloc isascii) AC_REPLACE_FUNCS(memchr) dnl This test replaces the obsolescent AC_ISC_POSIX kludge. dnl AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) dnl Solaris put it in /usr/lib/libw.a AC_CHECK_LIB(w, wctype, [LIBS="$LIBS -lw"]) dnl Solaris 2.5 don't define btowc() in the wchar.h if test "$USE_WCHAR" = "yes"; then AC_REPLACE_FUNCS(btowc) fi dnl I18N ALL_LINGUAS="de es fr ko nl no pl ru sl sv" AM_GNU_GETTEXT AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) dnl some folks ask for this, that's fine by me dnl hope they know what they're doing ... AC_ARG_WITH(included-regex, [ --without-included-regex don't compile regex], USE_REGEX=$withval, USE_REGEX=yes) test "$USE_REGEX" = "yes" && LIBOBJS="$LIBOBJS regex.o" AC_OUTPUT(Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])