Annotation of parser3/configure.in, revision 1.11

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: 
1.8       paf         5: dnl expand srcdir
                      6: P3S=`cd $srcdir ; pwd`
1.1       paf         7: AC_SUBST(P3S)
                      8: 
                      9: PARSER_VERSION=$VERSION
1.8       paf        10: echo "/* automatically generated by configure */" > $srcdir/src/include/pa_version.h.new
                     11: echo "/* edit configure.in to change version number */" >> $srcdir/src/include/pa_version.h.new
                     12: echo "#define PARSER_VERSION \"$PARSER_VERSION\"" >> $srcdir/src/include/pa_version.h.new
                     13: cmp $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h >/dev/null 2>&1
1.1       paf        14: if test $? -ne 0 ; then
1.8       paf        15:     rm -f $srcdir/src/include/pa_version.h && mv $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h && \
                     16:     echo Updated $srcdir/src/include/pa_version.h
1.1       paf        17: else
1.8       paf        18:        rm -f $srcdir/src/include/pa_version.h.new
1.1       paf        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: 
1.9       paf        38: AC_ARG_WITH(apache13,[  --with-apache13=D       D is the Apache13 source distribution directory
1.1       paf        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: 
1.9       paf        50: AC_ARG_WITH(pathlink,[  --with-pathlink=LKEY    put dynamic libraries paths to binary
1.1       paf        51:                           using linker key (-R, -rpath-link)],
                     52:        LD_PATHLINK=$withval
                     53: )
                     54: 
1.9       paf        55: AC_ARG_WITH(glib-config,[  --with-glib-config=FILE FILE is glib library
                     56:                           configuration file (search for glib*-config)],
                     57:        GLIB_CONFIG=$withval
                     58: )
                     59: 
                     60: AC_ARG_WITH(gnome-xml,[  --with-gnome-xml=D      D is the directory where
1.1       paf        61:                           Gnome XML libraries are installed],[
                     62:     GNOME_XML=$withval
                     63:     XMLBIN_DIR="$GNOME_XML/bin"
                     64:     XMLINC_DIR="$GNOME_XML/include"
                     65:     XMLLIB_DIR="$GNOME_XML/lib"
                     66: 
                     67:     if test \! -d $XMLBIN_DIR -o \! -d $XMLINC_DIR -o \! -d $XMLLIB_DIR; then
                     68:        AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
                     69:     fi
                     70: 
                     71:     AC_DEFINE(XML,,xml-abled parser)
                     72:     
                     73:     LIBXML2_SO_NAME=`cd $XMLLIB_DIR ; ls libxml2.?? libxml2.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     74:     if test -z "$LIBXML2_SO_NAME"; then
                     75:        AC_MSG_ERROR($LIBXML_DIR does not containt XML2 dynamic library)
                     76:     fi
                     77:     LIBGDOME_SO_NAME=`cd $XMLLIB_DIR ; ls libgdome.?? libgdome.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     78:     if test -z "$LIBGDOME_SO_NAME"; then
                     79:        AC_MSG_ERROR($LIBXML_DIR does not containt GDOME dynamic library)
                     80:     fi
                     81:     LIBXSLT_SO_NAME=`cd $XMLLIB_DIR ; ls libxslt.?? libxslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     82:     if test -z "$LIBXSLT_SO_NAME"; then
                     83:        AC_MSG_ERROR($LIBXML_DIR does not containt XSLT dynamic library)
                     84:     fi
                     85:     LIBEXSLT_SO_NAME=`cd $XMLLIB_DIR ; ls libexslt.?? libexslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                     86:     if test -z "$LIBEXSLT_SO_NAME"; then
                     87:        AC_MSG_ERROR($LIBXML_DIR does not containt EXSLT dynamic library)
                     88:     fi
1.9       paf        89: 
                     90:     if test -z "$GLIB_CONFIG"; then
                     91:            GLIB_CONFIG=$XMLBIN_DIR/glib-config
                     92:            if test \! -x $GLIB_CONFIG; then
                     93:                GLIB_CONFIG=glib-config
                     94:            fi
1.1       paf        95:     fi
                     96:     GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
                     97:     GLIB_LIBS=`$GLIB_CONFIG --libs`
                     98: 
                     99:     XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC_DIR -I$XMLINC_DIR/libgdome -I$XMLINC_DIR/libxml2"
1.9       paf       100:     XML_LIBS="$GLIB_LIBS -L$XMLLIB_DIR -l$LIBXML2_SO_NAME -l$LIBGDOME_SO_NAME -l$LIBXSLT_SO_NAME -l$LIBEXSLT_SO_NAME"
1.1       paf       101:     if test \! -z "$LD_PATHLINK"; then
                    102:        XML_LIBS="$XML_LIBS -Wl,$LD_PATHLINK -Wl,$XMLLIB_DIR"
                    103:     fi
                    104: ])
                    105: AC_SUBST(XML_INCLUDES)
                    106: AC_SUBST(XML_LIBS)
                    107: 
                    108: dnl AC_CANONICAL_SYSTEM
                    109: AC_CANONICAL_HOST
                    110: AC_SUBST(host_os)
                    111: 
                    112: dnl Checks for programs.
                    113: AC_PROG_INSTALL
                    114: AC_PROG_MAKE_SET
                    115: AC_PROG_RANLIB
                    116: AC_PROG_AWK
                    117: 
                    118: AC_PROG_YACC
                    119: if test "$YACC" != "bison -y"; then
                    120:     AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
                    121: else
                    122:     AC_MSG_CHECKING(bison version)
                    123:     oldIFS=$IFS; IFS=.
                    124:     set `bison -V | sed -e 's/^GNU Bison version //'`
                    125:     IFS=$oldIFS
                    126:     if test "$1" = "1" -a "$2" -lt "25"; then
                    127:         AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
                    128:     fi
                    129:     AC_MSG_RESULT($1.$2 (ok))
                    130: fi
                    131: 
                    132: dnl Enable building of the convenience library
                    133: dnl and set LIBLTDL accordingly
                    134: AC_LIBLTDL_CONVENIENCE(src/libltdl)
                    135: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
                    136: AC_SUBST(INCLTDL)
                    137: AC_SUBST(LIBLTDL)
                    138: 
                    139: dnl Configure libltdl
                    140: AC_CONFIG_SUBDIRS(src/libltdl)
1.10      paf       141: dnl moved from src/libltdl/configure.in
                    142: LIBADD_DL=
                    143: AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
                    144: [AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
                    145: AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
                    146: [AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
                    147: AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
                    148: test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
                    149: AC_SUBST(LIBADD_DL)
                    150: 
                    151: if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
                    152:  LIBS_SAVE="$LIBS"
                    153:  LIBS="$LIBS $LIBADD_DL"
                    154:  AC_CHECK_FUNCS(dlerror)
                    155:  LIBS="$LIBS_SAVE"
                    156: fi
1.1       paf       157: 
                    158: dnl Checks for typedefs, structures, and compiler characteristics.
                    159: 
                    160: AC_TYPE_SIZE_T
                    161: 
                    162: dnl Checks for header files.
                    163: 
1.10      paf       164: AC_HEADER_TIME
                    165: 
1.1       paf       166: AC_CHECK_HEADERS(
                    167: unistd.h \
                    168: process.h \
                    169: stddef.h \
                    170: stdarg.h \
                    171: fcntl.h \
                    172: sys/stat.h \
                    173: io.h \
                    174: stdio.h \
                    175: errno.h \
                    176: ctype.h \
                    177: math.h \
1.3       paf       178: time.h sys/time.h \
1.1       paf       179: stdlib.h \
                    180: string.h \
                    181: direct.h \
                    182: setjmp.h \
                    183: memory.h \
                    184: new \
                    185: sys/file.h \
                    186: sys/locking.h \
1.3       paf       187: sys/types.h \
1.5       paf       188: sys/select.h \
                    189: sys/resource.h
1.1       paf       190: )
                    191: 
                    192: dnl Checks for libraries.
                    193: 
                    194: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
                    195: case "$host" in
                    196:   *-sunos5.6* | *-solaris2.6*)
                    197:       AC_CHECK_LIB(xnet, main)
                    198:   ;;
                    199:   *-sunos5* | *-solaris2*)
                    200:       AC_CHECK_LIB(socket, main)
                    201:       AC_CHECK_LIB(nsl, main)
                    202:   ;;
                    203:   *-nec-sysv4*)
                    204:       AC_CHECK_LIB(nsl, gethostbyname)
                    205:       AC_CHECK_LIB(socket, socket)
                    206:   ;;
                    207:   *-cygwin*)
                    208:       AC_DEFINE(WIN32,,Windows32 target platform)
                    209:       AC_CHECK_LIB(wsock32, socket)
                    210:   ;;
                    211: esac
                    212: 
                    213: AC_CHECK_LIB(m, sin)
                    214: 
                    215: dnl Checks for functions.
                    216: 
                    217: AC_CHECK_FUNCS(
                    218: trunc \
                    219: round \
                    220: sign \
                    221: flock \
                    222: _locking \
1.7       paf       223: fcntl \
1.4       paf       224: lockf \
                    225: getrusage
1.1       paf       226: )
1.3       paf       227: 
                    228: dnl We require qsort(3) and select(2).
                    229: 
                    230: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
                    231: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1       paf       232: 
                    233: AC_MSG_CHECKING(whether compiler supports pragma pack)
                    234: AC_TRY_COMPILE(
                    235: ,
                    236: #pragma pack(1)
                    237: struct must_be_1_byte {
                    238:        char c;
                    239: };
                    240: #pragma pack()
                    241: if(sizeof(must_be_1_byte)!=1)
                    242:        return 1;
                    243: ,[
                    244:     AC_MSG_RESULT(yes)
                    245:        AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
                    246: ],             
                    247:     AC_MSG_RESULT(no)
                    248: )
                    249: 
                    250: AC_MSG_CHECKING(for set_new_handler)
                    251: AC_TRY_COMPILE(
                    252: #ifdef HAVE_NEW
                    253: #include <new>
                    254: #endif
                    255: void failed_new() {}
                    256: ,
                    257: std::set_new_handler(failed_new);
                    258: ,[
                    259:     AC_MSG_RESULT(yes)
                    260:        AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
                    261: ],             
                    262:     AC_MSG_RESULT(no)
                    263: )
                    264: 
                    265: 
                    266: dnl AC_ARG_ENABLE(db, [  --enable-db             to enable 'hashfile' parser class],
                    267: dnl [
                    268: dnl if test "$enableval" != "no"; then
                    269: dnl AC_CHECK_HEADERS(db.h)
                    270: dnl AC_CHECK_LIB(db, __db_open)
                    271: dnl fi
                    272: dnl ]
                    273: dnl )
                    274: 
                    275: dnl Apache libs
1.10      paf       276: APACHE_LIBS="$LIBS $LIBADD_DL"
1.9       paf       277: dnl append stdc++ to libs list commented
                    278: dnl 1. because binary seem to work without it
                    279: dnl purpose of this: remove strange name dependance
                    280: dnl for linker creates reference not for libstc++.xx but
                    281: dnl for something specific to local system,
                    282: dnl thus reducing binary compatibility
                    283: dnl 2. for same reason linker of targets/cgi/parser3 changed to
                    284: dnl "C" compiler from "C++" compiler
                    285: dnl AC_CHECK_LIB(stdc++, __builtin_new,
                    286: dnl    APACHE_LIBS="$APACHE_LIBS -lstdc++"
                    287: dnl )
1.1       paf       288: AC_SUBST(APACHE_LIBS)
                    289: 
                    290: 
                    291: dnl install directories
                    292: 
                    293: # expand apostrophed
1.6       paf       294: e_prefix=$prefix
                    295: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
                    296: 
1.1       paf       297: e_sysconfdir=$sysconfdir
1.6       paf       298: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1       paf       299: 
                    300: dnl this is used in targets/cgi/parser3.C to load root config
                    301: 
1.2       paf       302: rootconfigdir=$e_sysconfdir
                    303: AC_SUBST(rootconfigdir)
1.1       paf       304: 
                    305: dnl these are used to fill in etc/parser3.conf
                    306: 
                    307: charsetsdir=$e_sysconfdir/parser3.charsets
                    308: AC_SUBST(charsetsdir)
                    309: 
                    310: # expand apostrophed
                    311: e_libdir=$libdir
                    312: if test "$e_libdir" = "\${exec_prefix}/lib"; then
                    313: 
                    314:     # Let make expand exec_prefix.
                    315:     e_exec_prefix=$exec_prefix
                    316:     test "x$e_exec_prefix" = xNONE && e_exec_prefix=$prefix
                    317: 
                    318:     # expand apostrophed
                    319:     test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
                    320: fi
                    321: 
                    322: sqldriversdir=$e_libdir
                    323: AC_SUBST(sqldriversdir)
                    324: 
                    325: 
                    326: dnl Output makefiles
                    327: 
                    328: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.8       paf       329: AC_OUTPUT(Makefile src/Makefile src/libltdl/Makefile src/types/Makefile src/classes/Makefile src/classes/gd/Makefile src/classes/smtp/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/patches/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 src/targets/isapi/Makefile etc/parser3.charsets/Makefile etc/parser3.conf etc/Makefile)

E-mail: