Annotation of parser3/configure.in, revision 1.16

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