# Copyright (C) 1999, 2000, Lorenzo Bettini # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl Process this file with autoconf to produce a configure script. AC_INIT(reconf) dnl for automake AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(cpp2html,1.1) AC_SUBST(cpp2htmldatadir) AC_SUBST(cpp2htmldocdir) cpp2htmldatadir=$datadir/cpp2html cpp2htmldocdir=$datadir/doc/cpp2html dnl Checks for C compiler. AC_PROG_CC dnl for Cygwin32 environment dnl AM_CYGWIN32 (obsolete) dnl AC_CYGWIN AC_EXEEXT dnl Checks for C++ compiler. AC_PROG_CXX AC_LANG_CPLUSPLUS AC_PROG_AWK dnl test for --enable-warnings command line option AC_ARG_ENABLE( warnings, [ --enable-warnings enable compiler warnings], AC_COMPILE_WARNINGS ) dnl for txtc (Text-to-C compiler) LF_PROG_TXTC dnl for yacc or bison AC_PROG_YACC dnl for lex or flex AM_PROG_LEX dnl Checks for libraries. dnl Replace `main' with a function in -lfl: AC_CHECK_LIB(fl, main) dnl if (f)lex library is not present (yywrap won't be found) we provide dnl a simple implementation (see yywrap.cc) which will be included in dnl LIBOBJS and linked against the program (see src/Makefile.am) dnl this works with flex generated files (I don't know about others) AC_REPLACE_FUNCS(yywrap) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_CHECK_FUNCS(strdup) dnl check for getopt in standard library AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) dnl this is only for developers who change src/cmdline.ggo file dnl GNU gengetopt can be found at http://www.gnu.org/software/gengetopt AC_PATH_PROGS(GENGETOPT, gengetopt) AM_CONDITIONAL(NO_GENGETOPT, test -z "$ac_cv_path_GENGETOPT" ) dnl ******************* dnl added by me dnl ******************* dnl -l force yacc or bison not to generate #line dnl this may disturb when using srcdir, and building in another directory dnl -L is the same for lex and flex dnl set some flags if it's flex AC_SUBST(LFLAGS)dnl AC_MSG_CHECKING( checking if it's flex ) if test "$ac_cv_prog_LEX" = "flex"; then LFLAGS="$LFLAGS -l -L" AC_MSG_RESULT( $ac_cv_prog_LEX ) else LFLAGS="$LFLAGS -L" AC_MSG_RESULT( no: it's $LEX ) fi dnl set some flags if it's bison AC_SUBST(YFLAGS)dnl YFLAGS="$YFLAGS -d" AC_MSG_CHECKING( checking if it's bison ) if test "$ac_cv_prog_YACC" = "bison -y"; then YFLAGS="$YFLAGS -o y.tab.c -l" AC_MSG_RESULT( $ac_cv_prog_YACC ) else YFLAGS="$YFLAGS -l" AC_MSG_RESULT( no: it's $YACC ) fi AC_MSG_CHECKING( checking for strstream.h ) strstream=no CPPFLAGS="$CPPFLAGS $INCLUDE" AC_TRY_CPP( [#include ], AC_DEFINE( HAVE_STRSTREAM_H ) strstream=yes ) AC_MSG_RESULT( $strstream ) if test $strstream = no; then AC_MSG_CHECKING( trying with strstrea.h ) strstrea=no AC_TRY_CPP( [#include ], AC_DEFINE( HAVE_STRSTREA_H ) strstrea=yes ) AC_MSG_RESULT( $strstrea ) fi CXXFLAGS="-DCPP2HTML_DATA_DIR=\\\"$cpp2htmldatadir\\\" $CXXFLAGS" AC_PATH_PROGS(TAR, tar gtar) AC_OUTPUT(Makefile txtc.sh src/Makefile doc/Makefile doc/cpp2html.html)