Annotation of parser3/configure.in, revision 1.3

1.1       paf         1: dnl Process this file with autoconf to produce a configure script.
                      2: AC_INIT(README)
                      3: AM_INIT_AUTOMAKE(parser, 3.0b, nodefine)
                      4: 
                      5: dnl not perfect, but would do
                      6: P3S=`pwd`
                      7: AC_SUBST(P3S)
                      8: 
                      9: PARSER_VERSION=$VERSION
                     10: echo "/* automatically generated by configure */" > src/include/pa_version.h.new
                     11: echo "/* edit configure.in to change version number */" >> src/include/pa_version.h.new
                     12: echo "#define PARSER_VERSION \"$PARSER_VERSION\"" >> src/include/pa_version.h.new
                     13: cmp src/include/pa_version.h.new src/include/pa_version.h >/dev/null 2>&1
                     14: if test $? -ne 0 ; then
                     15:     rm -f src/include/pa_version.h && mv src/include/pa_version.h.new src/include/pa_version.h && \
                     16:     echo 'Updated src/include/pa_version.h'
                     17: else
                     18:        rm -f src/include/pa_version.h.new
                     19: fi
                     20: 
                     21: AC_PROG_INSTALL
                     22: AC_PROG_CC
                     23: AC_LANG_C AC_C_INLINE
                     24: AC_PROG_CXX
                     25: AC_LANG_CPLUSPLUS
                     26: 
                     27: 
                     28: dnl Arguments
                     29: 
                     30: AC_ARG_ENABLE(string-origins, [  --disable-string-origins to switch off string origin tracking],
                     31: [
                     32: if test "$enableval" = "no"; then
                     33:        AC_DEFINE(NO_STRING_ORIGIN,,no string origin tracking)
                     34: fi
                     35: ]
                     36: )
                     37: 
                     38: AC_ARG_WITH(apache13,[  --with-apache13[=D]     D is the Apache13 source distribution directory
                     39:                           builds library for apache_module using that dir
                     40:                           (do not add /src)],
                     41:        APACHE13=$withval
                     42:     if test \! -f "$APACHE13/src/include/httpd.h"; then
                     43:        AC_MSG_ERROR($APACHE13 does not seem to be valid Apache13 source distribution directory)
                     44:     fi
                     45: )
                     46: AC_SUBST(APACHE13)
                     47: AM_CONDITIONAL(COMPILE_APACHE13_MODULE, test -n "$APACHE13")
                     48: 
                     49: 
                     50: AC_ARG_WITH(pathlink,[  --with-pathlink[=LKEY]  put dynamic libraries paths to binary
                     51:                           using linker key (-R, -rpath-link)],
                     52:        LD_PATHLINK=$withval
                     53: )
                     54: 
                     55: AC_ARG_WITH(gnome-xml,[  --with-gnome-xml[=D]    D is the directory where
                     56:                           Gnome XML libraries are installed],[
                     57:     GNOME_XML=$withval
                     58:     XMLBIN_DIR="$GNOME_XML/bin"
                     59:     XMLINC_DIR="$GNOME_XML/include"
                     60:     XMLLIB_DIR="$GNOME_XML/lib"
                     61: 
                     62:     if test \! -d $XMLBIN_DIR -o \! -d $XMLINC_DIR -o \! -d $XMLLIB_DIR; then
                     63:        AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
                     64:     fi
                     65: 
                     66:     AC_DEFINE(XML,,xml-abled parser)
                     67:     
                     68:     LIBXML2_SO_NAME=`cd $XMLLIB_DIR ; ls libxml2.?? libxml2.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     69:     if test -z "$LIBXML2_SO_NAME"; then
                     70:        AC_MSG_ERROR($LIBXML_DIR does not containt XML2 dynamic library)
                     71:     fi
                     72:     LIBGDOME_SO_NAME=`cd $XMLLIB_DIR ; ls libgdome.?? libgdome.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     73:     if test -z "$LIBGDOME_SO_NAME"; then
                     74:        AC_MSG_ERROR($LIBXML_DIR does not containt GDOME dynamic library)
                     75:     fi
                     76:     LIBXSLT_SO_NAME=`cd $XMLLIB_DIR ; ls libxslt.?? libxslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     77:     if test -z "$LIBXSLT_SO_NAME"; then
                     78:        AC_MSG_ERROR($LIBXML_DIR does not containt XSLT dynamic library)
                     79:     fi
                     80:     LIBEXSLT_SO_NAME=`cd $XMLLIB_DIR ; ls libexslt.?? libexslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     81:     if test -z "$LIBEXSLT_SO_NAME"; then
                     82:        AC_MSG_ERROR($LIBXML_DIR does not containt EXSLT dynamic library)
                     83:     fi
                     84:                    
                     85:     GLIB_CONFIG=$XMLBIN_DIR/glib-config
                     86:     if test \! -x $GLIB_CONFIG; then
                     87:         GLIB_CONFIG=glib-config
                     88:     fi
                     89:     GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
                     90:     GLIB_LIBS=`$GLIB_CONFIG --libs`
                     91: 
                     92:     XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC_DIR -I$XMLINC_DIR/libgdome -I$XMLINC_DIR/libxml2"
                     93:     XML_LIBS="-L$XMLLIB_DIR -lglib -l$LIBXML2_SO_NAME -l$LIBGDOME_SO_NAME -l$LIBXSLT_SO_NAME -l$LIBEXSLT_SO_NAME"
                     94:     if test \! -z "$LD_PATHLINK"; then
                     95:        XML_LIBS="$XML_LIBS -Wl,$LD_PATHLINK -Wl,$XMLLIB_DIR"
                     96:     fi
                     97: ])
                     98: AC_SUBST(XML_INCLUDES)
                     99: AC_SUBST(XML_LIBS)
                    100: 
                    101: AC_ARG_WITH(db2,[  --with-db2[=D]          D is the DB2 installation directory
                    102:                           DO NOT FORGET TO COMPILE DB2 WITH EXCEPTIONS SUPPORT!],
                    103:        DB2_INST=$withval
                    104:     if test \! -f "$DB2_INST/include/db.h"; then
                    105:        AC_MSG_ERROR($DB2_INST does not seem to be valid DB2 installation directory)
                    106:     fi
                    107:     if test \! -f "$DB2_INST/lib/libdb.a"; then
                    108:        AC_MSG_ERROR($DB2_INST does not seem to be valid DB2 installation directory)
                    109:     fi
                    110: 
                    111:     AC_MSG_CHECKING(version of LIBDB)
                    112:     AC_TRY_COMPILE(
                    113:     #include <$DB2_INST/include/db.h>
                    114:     ,
                    115:     #ifdef DB_VERSION_MAJOR
                    116:     #  if DB_VERSION_MAJOR!=2
                    117:     #          error Parser needs LIBDB of 2.x.x version to compile
                    118:     #  endif
                    119:     #else
                    120:     #  error DB_VERSION_MAJOR not defined
                    121:     #endif
                    122:     ,[
                    123:         AC_MSG_RESULT(ok)
                    124:        DB2=1
                    125:        AC_DEFINE(DB2,,DB2-abled parser)
                    126:         DB2_INCLUDES="-I$DB2_INST/include"
                    127:         DB2_LIBS="-L$DB2_INST/lib -ldb"
                    128:     ],
                    129:         AC_MSG_ERROR(bad, we need 2.x.x version)
                    130:     ) 
                    131: )
                    132: AC_SUBST(DB2_INCLUDES)
                    133: AC_SUBST(DB2_LIBS)
                    134: 
                    135: dnl AC_CANONICAL_SYSTEM
                    136: AC_CANONICAL_HOST
                    137: AC_SUBST(host_os)
                    138: 
                    139: dnl Checks for programs.
                    140: AC_PROG_INSTALL
                    141: AC_PROG_MAKE_SET
                    142: AC_PROG_RANLIB
                    143: AC_PROG_AWK
                    144: 
                    145: AC_PROG_YACC
                    146: if test "$YACC" != "bison -y"; then
                    147:     AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
                    148: else
                    149:     AC_MSG_CHECKING(bison version)
                    150:     oldIFS=$IFS; IFS=.
                    151:     set `bison -V | sed -e 's/^GNU Bison version //'`
                    152:     IFS=$oldIFS
                    153:     if test "$1" = "1" -a "$2" -lt "25"; then
                    154:         AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
                    155:     fi
                    156:     AC_MSG_RESULT($1.$2 (ok))
                    157: fi
                    158: 
                    159: dnl Enable building of the convenience library
                    160: dnl and set LIBLTDL accordingly
                    161: AC_LIBLTDL_CONVENIENCE(src/libltdl)
                    162: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
                    163: AC_SUBST(INCLTDL)
                    164: AC_SUBST(LIBLTDL)
                    165: AC_SUBST(LIBADD_DL)
                    166: dnl Configure libtool
                    167: AM_PROG_LIBTOOL
                    168: AC_SUBST(LIBTOOL_DEPS)
                    169: 
                    170: dnl Configure libltdl
                    171: AC_CONFIG_SUBDIRS(src/libltdl)
                    172: 
                    173: dnl Checks for typedefs, structures, and compiler characteristics.
                    174: 
                    175: AC_TYPE_SIZE_T
                    176: 
                    177: dnl Checks for header files.
                    178: 
                    179: AC_CHECK_HEADERS(
                    180: unistd.h \
                    181: process.h \
                    182: stddef.h \
                    183: stdarg.h \
                    184: fcntl.h \
                    185: sys/stat.h \
                    186: io.h \
                    187: stdio.h \
                    188: errno.h \
                    189: ctype.h \
                    190: math.h \
1.3     ! paf       191: time.h sys/time.h \
1.1       paf       192: stdlib.h \
                    193: string.h \
                    194: direct.h \
                    195: setjmp.h \
                    196: memory.h \
                    197: new \
                    198: sys/file.h \
                    199: sys/locking.h \
1.3     ! paf       200: sys/types.h \
        !           201: sys/select.h
1.1       paf       202: )
                    203: 
                    204: dnl Checks for libraries.
                    205: 
                    206: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
                    207: case "$host" in
                    208:   *-sunos5.6* | *-solaris2.6*)
                    209:       AC_CHECK_LIB(xnet, main)
                    210:   ;;
                    211:   *-sunos5* | *-solaris2*)
                    212:       AC_CHECK_LIB(socket, main)
                    213:       AC_CHECK_LIB(nsl, main)
                    214:   ;;
                    215:   *-nec-sysv4*)
                    216:       AC_CHECK_LIB(nsl, gethostbyname)
                    217:       AC_CHECK_LIB(socket, socket)
                    218:   ;;
                    219:   *-cygwin*)
                    220:       AC_DEFINE(WIN32,,Windows32 target platform)
                    221:       AC_CHECK_LIB(wsock32, socket)
                    222:   ;;
                    223: esac
                    224: 
                    225: AC_CHECK_LIB(m, sin)
                    226: 
                    227: dnl Checks for functions.
                    228: 
                    229: AC_CHECK_FUNCS(
                    230: trunc \
                    231: round \
                    232: sign \
                    233: flock \
                    234: _locking \
                    235: lockf
                    236: )
1.3     ! paf       237: 
        !           238: dnl We require qsort(3) and select(2).
        !           239: 
        !           240: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
        !           241: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1       paf       242: 
                    243: AC_MSG_CHECKING(whether compiler supports pragma pack)
                    244: AC_TRY_COMPILE(
                    245: ,
                    246: #pragma pack(1)
                    247: struct must_be_1_byte {
                    248:        char c;
                    249: };
                    250: #pragma pack()
                    251: if(sizeof(must_be_1_byte)!=1)
                    252:        return 1;
                    253: ,[
                    254:     AC_MSG_RESULT(yes)
                    255:        AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
                    256: ],             
                    257:     AC_MSG_RESULT(no)
                    258: )
                    259: 
                    260: AC_MSG_CHECKING(for set_new_handler)
                    261: AC_TRY_COMPILE(
                    262: #ifdef HAVE_NEW
                    263: #include <new>
                    264: #endif
                    265: void failed_new() {}
                    266: ,
                    267: std::set_new_handler(failed_new);
                    268: ,[
                    269:     AC_MSG_RESULT(yes)
                    270:        AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
                    271: ],             
                    272:     AC_MSG_RESULT(no)
                    273: )
                    274: 
                    275: 
                    276: dnl AC_ARG_ENABLE(db, [  --enable-db             to enable 'hashfile' parser class],
                    277: dnl [
                    278: dnl if test "$enableval" != "no"; then
                    279: dnl AC_CHECK_HEADERS(db.h)
                    280: dnl AC_CHECK_LIB(db, __db_open)
                    281: dnl fi
                    282: dnl ]
                    283: dnl )
                    284: 
                    285: dnl Apache libs
                    286: APACHE_LIBS=$LIBS
                    287: AC_CHECK_LIB(stdc++, __builtin_new,
                    288:        APACHE_LIBS="$APACHE_LIBS -lstdc++"
                    289: )
                    290: AC_SUBST(APACHE_LIBS)
                    291: 
                    292: 
                    293: dnl install directories
                    294: 
                    295: # expand apostrophed
                    296: e_sysconfdir=$sysconfdir
                    297: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${prefix}/etc"
                    298: 
                    299: dnl this is used in targets/cgi/parser3.C to load root config
                    300: 
1.2       paf       301: rootconfigdir=$e_sysconfdir
                    302: AC_SUBST(rootconfigdir)
1.1       paf       303: 
                    304: dnl these are used to fill in etc/parser3.conf
                    305: 
                    306: charsetsdir=$e_sysconfdir/parser3.charsets
                    307: AC_SUBST(charsetsdir)
                    308: 
                    309: # expand apostrophed
                    310: e_libdir=$libdir
                    311: if test "$e_libdir" = "\${exec_prefix}/lib"; then
                    312: 
                    313:     # Let make expand exec_prefix.
                    314:     e_exec_prefix=$exec_prefix
                    315:     test "x$e_exec_prefix" = xNONE && e_exec_prefix=$prefix
                    316: 
                    317:     # expand apostrophed
                    318:     test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
                    319: fi
                    320: 
                    321: sqldriversdir=$e_libdir
                    322: AC_SUBST(sqldriversdir)
                    323: 
                    324: 
                    325: dnl Output makefiles
                    326: 
                    327: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
                    328: AC_OUTPUT(Makefile src/Makefile src/libltdl/Makefile src/types/Makefile src/classes/Makefile src/classes/gd/Makefile src/main/Makefile src/pcre/Makefile src/targets/Makefile src/targets/cgi/pa_config_paths.h src/targets/cgi/Makefile src/targets/apache13/Makefile src/targets/apache13/p3runConfigure etc/parser3.charsets/Makefile etc/parser3.conf etc/Makefile)

E-mail: