Annotation of rpl/configure.in, revision 1.66

1.1       bertrand    1: dnl Process this file with autoconf to produce a configure script.
1.65      bertrand    2: AC_INIT([rpl],[4.1.0])
1.1       bertrand    3: AC_CANONICAL_TARGET
                      4: AC_CANONICAL_TARGET
                      5: AM_INIT_AUTOMAKE
                      6: AC_SUBST(target_cpu)
                      7: AC_CONFIG_HEADERS([rplconfig.h])
                      8: 
                      9: dnl Libraries
1.56      bertrand   10: NCURSES=ncurses-5.9
1.52      bertrand   11: READLINE=readline-6.2
1.31      bertrand   12: UNITS=units-1.88
1.59      bertrand   13: GSL=gsl-1.15
1.1       bertrand   14: GPP=gpp-2.24
1.54      bertrand   15: GNUPLOT=gnuplot-4.4.3
1.1       bertrand   16: FILE=file-5.03
                     17: ICONV=libiconv-1.13.1
1.59      bertrand   18: SQLITE=sqlite-3.7.6.3
1.52      bertrand   19: OPENSSL=openssl-1.0.0d
1.1       bertrand   20: 
1.57      bertrand   21: GMP=gmp-5.0.1
                     22: MPFR=mpfr-3.0.1
1.58      bertrand   23: NTL=ntl-5.5.2
                     24: COCOA=CoCoALib-0.9943
                     25: PARI=pari-2.3.5
1.63      bertrand   26: GIAC=giac-0.9.1
1.57      bertrand   27: 
1.1       bertrand   28: dnl Checks for C compiler
1.24      bertrand   29: AC_PROG_CC(gcc)
1.1       bertrand   30: 
1.31      bertrand   31: EXT_SQL=
                     32: 
1.1       bertrand   33: if test x"$CC" != x""; then
                     34:    GCC_VERSION_MAJEURE=`$CC -v 2>&1 | awk '/^gcc/ { print $3; }' | \
                     35:            awk -F. '{ printf("%s", $1);}'`
                     36:    GCC_VERSION_MINEURE=`$CC -v 2>&1 | awk '/^gcc/ { print $3; }' | \
                     37:            awk -F. '{ printf("%s", $2);}'`
1.24      bertrand   38:    if test $GCC_VERSION_MAJEURE -ge 5; then
1.1       bertrand   39:        OPTIMISATION_C=-O3
                     40:    else
1.24      bertrand   41:        if test $GCC_VERSION_MAJEURE -ge 4 -a $GCC_VERSION_MINEURE -ge 4; \
                     42:                then
1.1       bertrand   43:            OPTIMISATION_C=-O3
                     44:        else
1.24      bertrand   45:            if test $GCC_VERSION_MAJEURE -ge 2; then
                     46:                OPTIMISATION_C=-O2
                     47:            else
                     48:                AC_MSG_ERROR([Cannot find decent or recent gcc (gcc-4.2 or better)!])
                     49:            fi
1.1       bertrand   50:        fi
                     51:    fi
                     52: fi
                     53: 
                     54: AM_PROG_CC_C_O
                     55: 
                     56: if test "$GCC" != yes; then
                     57:    AC_MSG_ERROR([Cannot find gcc! You have to install it.])
                     58: fi
                     59: 
                     60: dnl Checks for C++ compiler
1.24      bertrand   61: AC_PROG_CXX(g++)
1.1       bertrand   62: 
                     63: if test "$GXX" != yes; then
                     64:    AC_MSG_ERROR([Cannot find g++! You have to install it.])
                     65: fi
                     66: 
                     67: dnl Checks for Fortran 77 compiler
1.24      bertrand   68: AC_PROG_F77(gfortran)
1.1       bertrand   69: 
                     70: if test "$F77" != gfortran -a "$F77" != gfortran-4.4; then
                     71:    AC_MSG_ERROR([Cannot find gfortran! You have to install it.])
                     72: fi
                     73: 
                     74: dnl Check for Fortran 9* compiler
1.24      bertrand   75: AC_PROG_FC(gfortran)
1.1       bertrand   76: 
                     77: if test "$FC" != gfortran -a "$FC" != gfortran-4.4; then
                     78:    AC_MSG_ERROR([Cannot find gfortran! You have to install it.])
                     79: fi
                     80: 
                     81: if test x"$FC" != x""; then
                     82:    GCC_VERSION_MAJEURE=`$FC -v 2>&1 | awk '/^gcc/ { print $3; }' | \
                     83:            awk -F. '{ printf("%s", $1);}'`
                     84:    GCC_VERSION_MINEURE=`$FC -v 2>&1 | awk '/^gcc/ { print $3; }' | \
                     85:            awk -F. '{ printf("%s", $2);}'`
1.24      bertrand   86:    if test $GCC_VERSION_MAJEURE -ge 5; then
1.1       bertrand   87:        OPTIMISATION_F=-O3
                     88:    else
1.24      bertrand   89:        if test $GCC_VERSION_MAJEURE -ge 4 -a $GCC_VERSION_MINEURE -ge 4; then
1.1       bertrand   90:            OPTIMISATION_F=-O3
                     91:        else
1.24      bertrand   92:            if test $GCC_VERSION_MAJEURE -ge 3; then
                     93:                OPTIMISATION_F=-O2
                     94:            else
                     95:                AC_MSG_ERROR([Cannot find decent or recent gfortran (gfortran-4.3 or better)!])
                     96:            fi
1.1       bertrand   97:        fi
                     98:    fi
                     99: fi
                    100: 
                    101: dnl X paths
                    102: AC_PATH_X
                    103: AC_PATH_XTRA
                    104: 
                    105: if test "$ac_x_includes" != "no"; then
                    106:    if test x"$ac_x_includes" != x; then
                    107:        X_CFLAGS="$X_CFLAGS -I$ac_x_includes"
                    108:        includeX="-I$ac_x_includes"
                    109:    fi
                    110: fi
                    111: if test "$ac_x_libraries" != "no"; then
                    112:    if test x"$ac_x_libraries" != x; then
                    113:        X_LIBS="$X_LIBS -L$ac_x_libraries"
                    114:    fi
                    115: fi
                    116: 
1.66    ! bertrand  117: dnl 32 bits ABI
        !           118: AC_ARG_WITH(32bits,
        !           119: [  --with-32bits-abi       force 32bits ABI (multilib)],[
        !           120: if test "$with-32bits-abi" = "no"; then
        !           121:    CFLAGS=
        !           122:    FFLAGS=
        !           123:    CXXFLAGS=
        !           124:    FCFLAGS=
        !           125: else
        !           126:    CFLAGS="$CFLAGS -m32"
        !           127:    FFLAGS="$FFLAGS -m32"
        !           128:    FCFLAGS="$FCFLAGS -m32"
        !           129: ],[
        !           130:    CFLAGS="$CFLAGS -m32"
        !           131:    FFLAGS="$FFLAGS -m32"
        !           132:    FCFLAGS="$FCFLAGS -m32"
        !           133:    ]
        !           134: )
        !           135: 
1.1       bertrand  136: dnl Options
                    137: AC_ARG_ENABLE(optimization,
                    138: [  --enable-optimization   set compiler flags [[default=environment variables -O3]]], [
                    139: if test "$enableval" = "no"; then
                    140:    CFLAGS=
                    141:    FFLAGS=
                    142:    CXXFLAGS=
                    143:    FCFLAGS=
                    144: else
                    145:    CFLAGS="$CFLAGS $enable_optimization"
                    146:    FFLAGS="$FFLAGS $enable_optimization"
                    147:    FCFLAGS="$FCFLAGS $enable_optimization"
                    148: fi],[
                    149:    CFLAGS="$CFLAGS $OPTIMISATION_C"
                    150:    FFLAGS="$FFLAGS $OPTIMISATION_F"
                    151:    FCFLAGS="$FCFLAGS $OPTIMISATION_F"
                    152:    ]
                    153: )
                    154: 
1.38      bertrand  155: AC_ARG_ENABLE(sysv-semaphores,
                    156: [  --enable-sysv-ipcs      use SystemV IPC functions [[default=no]]], [
                    157: if test "$enableval" = "no"; then
                    158:    IPCS_SYSV=no
                    159: else
                    160:    IPCS_SYSV=yes
                    161: fi],
                    162: IPCS_SYSV=no)
                    163: 
1.31      bertrand  164: AC_ARG_ENABLE(full-static,
                    165: [  --enable-full-static    build static RPL/2 engine [[default=shared]]], [
                    166: if test "$enableval" = "no"; then
                    167:    STATIC=no
                    168: else
                    169:    STATIC=yes
                    170: fi],
                    171: STATIC=no)
                    172: 
1.1       bertrand  173: AC_ARG_ENABLE(final-encoding,
                    174: [  --enable-final-encoding force final encoding [[default=guessed]]], [
                    175: if test "$enableval" = "no"; then
1.8       bertrand  176:    FINAL_ENCODING="\$(shell locale charmap | \
1.14      bertrand  177:        \$(AWK) '/\=/ { print \$\$3;} !/\=/ { print \$\$1;}')"
1.37      bertrand  178:    FORCED_FINAL_ENCODING=0
1.1       bertrand  179: else
                    180:    FINAL_ENCODING="$enable_final_encoding"
1.37      bertrand  181:    FORCED_FINAL_ENCODING=1
                    182: fi], [
                    183: FORCED_FINAL_ENCODING=0
1.8       bertrand  184: FINAL_ENCODING="\$(shell locale charmap | \
1.37      bertrand  185:    \$(AWK) '/\=/ { print \$\$3;} !/\=/ { print \$\$1;}')"])
1.1       bertrand  186: 
                    187: AC_ARG_ENABLE(tex,
                    188: [  --enable-tex            provide the TeX support [[default=guessed]]], [
                    189: if test "$enableval" = "no"; then
                    190:    TEX_SUPPORT=no
                    191: else
                    192:    TEX_SUPPORT=yes
                    193: fi],
                    194: TEX_SUPPORT=guessed)
                    195: 
                    196: AC_ARG_ENABLE(vim,
                    197: [  --enable-vim            provide the vim support [[default=guessed]]], [
                    198: if test "$enableval" = "no"; then
                    199:    VIM_SUPPORT=no
                    200: else
                    201:    VIM_SUPPORT=yes
                    202: fi],
                    203: VIM_SUPPORT=guessed)
                    204: 
                    205: AC_ARG_ENABLE(embedded-gnuplot,
                    206: [  --enable-embedded-gnuplot build gnuplot provided by this package [[default=yes]]], [
                    207: if test "$enableval" = "no"; then
                    208:    MYGNUPLOT=no
                    209: else
                    210:    MYGNUPLOT=yes
                    211: fi], [
                    212: MYGNUPLOT=yes])
                    213: 
                    214: AC_ARG_ENABLE(gnuplot,
                    215: [  --enable-gnuplot        provide the GnuPlot support [[default=guessed]]],
                    216: [
                    217: if test "$enableval" = "no"; then
                    218:    GNUPLOT_SUPPORT=no
                    219:    MYGNUPLOT=no
                    220:    FORCE_GNUPLOT_PATH=-UFORCE_GNUPLOT_PATH
                    221: else
                    222:    GNUPLOT_SUPPORT=yes
                    223:    FORCE_GNUPLOT_PATH=-DFORCE_GNUPLOT_PATH
                    224: fi], [
                    225: if test "$MYGNUPLOT" = "yes"; then
                    226:    GNUPLOT_SUPPORT=yes
                    227:    FORCE_GNUPLOT_PATH=-DFORCE_GNUPLOT_PATH
                    228: else
                    229:    GNUPLOT_SUPPORT=guessed
                    230:    FORCE_GNUPLOT_PATH=-UFORCE_GNUPLOT_PATH
                    231: fi])
                    232: 
                    233: AC_ARG_ENABLE(motif,
                    234: [  --enable-motif          provide the Motif support [[default=guessed]]], [
                    235: if test "$enableval" = "no"; then
                    236:    MOTIF_SUPPORT="-UMOTIF_SUPPORT"
                    237: else
                    238:    CFLAGS_ORIG=$CFLAGS
                    239:    LIBS_ORIG=$LIBS
                    240:    CFLAGS="$CFLAGS $X_CFLAGS"
                    241:    LIBS="$LIB $X_LIBS"
                    242:    AC_CHECK_LIB(Xm, main, MOTIF_SUPPORT="-DMOTIF_SUPPORT", MOTIF_SUPPORT="-UMOTIF_SUPPORT")
                    243:    if test "$MOTIF_SUPPORT" = "-UMOTIF_SUPPORT"; then
                    244:        AC_MSG_WARN([Can not find Motif! You may install it.
                    245: Motif flag is disabled.
                    246: ])
                    247:    fi
                    248:    LIBS=$LIBS_ORIG
                    249:    CFLAGS=$CFLAGS_ORIG
                    250: fi],
                    251: MOTIF_SUPPORT=guessed)
                    252: 
                    253: AC_ARG_ENABLE(experimental,
                    254: [  --enable-experimental   enable experimental code [[default=no]]], [
                    255: if test "$enableval" = "no"; then
                    256:    EXPERIMENTAL_CODE="-UEXPERIMENTAL_CODE"
                    257: else
                    258:    EXPERIMENTAL_CODE="-DEXPERIMENTAL_CODE"
                    259: fi],
                    260: EXPERIMENTAL_CODE="-UEXPERIMENTAL_CODE")
                    261: 
                    262: AC_ARG_ENABLE(debug,
                    263: [  --enable-debug          enable debug code [[default=no]]], [
                    264: if test "$enableval" = "no"; then
1.25      bertrand  265:    DEBUG="-UDEBUG_MEMOIRE -UDEBUG_ERREURS"
1.1       bertrand  266: else
1.25      bertrand  267:    DEBUG="-DDEBUG_MEMOIRE -UDEBUG_ERREURS"
1.45      bertrand  268: fi], [DEBUG="-UDEBUG_MEMOIRE -UDEBUG_ERREURS"])
1.1       bertrand  269: 
                    270: AC_ARG_ENABLE(profile,
                    271: [  --enable-profile        enable profile code [[default=no]]], [
                    272: if test "$enableval" = "no"; then
                    273:    PROFILAGE=""
                    274: else
                    275:    PROFILAGE="-pg"
                    276: fi], [PROFILAGE=""])
                    277: 
                    278: AC_SUBST(PROFILAGE)
                    279: 
                    280: if test ! -d tools; then
                    281:    mkdir tools
                    282: fi
                    283: if test ! -d "$srcdir"/tools/$NCURSES; then
                    284:    gunzip -c "$srcdir"/tools/$NCURSES.tar.gz | \
                    285:            (cd "$srcdir/tools" && tar -xf -)
1.53      bertrand  286:    (cd "$srcdir/tools/"$NCURSES && \
                    287:            for i in ../$NCURSES*.patch.gz;
                    288:            do gunzip -c $i | patch -p1;
                    289:            done);
1.1       bertrand  290: fi
                    291: if test ! -d "$srcdir"/tools/$READLINE; then
                    292:    gunzip -c "$srcdir"/tools/$READLINE.tar.gz | \
                    293:            (cd "$srcdir/tools" && tar -xf -)
                    294: fi
                    295: if test ! -d "$srcdir"/tools/$UNITS; then
                    296:    gunzip -c "$srcdir"/tools/$UNITS.tar.gz | \
                    297:            (cd "$srcdir/tools" && tar -xf -)
                    298: fi
                    299: if test ! -d "$srcdir"/tools/$GSL; then
                    300:    gunzip -c "$srcdir"/tools/$GSL.tar.gz | \
                    301:            (cd "$srcdir/tools" && tar -xf -)
1.34      bertrand  302:    if test $(uname) = "OS/2"; then
                    303:        (cd "$srcdir"/tools/$GSL; \
                    304:                TMP=$(mktemp tmp.XXXXXXXXXX); \
                    305:                sed -e '1,$s/\${1+"\$@"}/"\$@"/g' ltmain.sh > $TMP; \
                    306:                \mv -f $TMP ltmain.sh)
                    307:    fi
1.1       bertrand  308: fi
                    309: if test ! -d "$srcdir"/tools/$GPP; then
                    310:    gunzip -c "$srcdir"/tools/$GPP.tar.gz | \
                    311:            (cd "$srcdir/tools" && tar -xf -)
                    312: fi
                    313: if test ! -d "$srcdir"/tools/$FILE; then
                    314:    gunzip -c "$srcdir"/tools/$FILE.tar.gz | \
1.3       bertrand  315:            (cd "$srcdir/tools" && tar -xf - )
1.4       bertrand  316:    (cd "$srcdir/tools"/$FILE && gunzip -c ../$FILE.diff.gz | patch -p1)
1.1       bertrand  317: fi
                    318: if test ! -d "$srcdir"/tools/$ICONV; then
                    319:    gunzip -c "$srcdir"/tools/$ICONV.tar.gz | \
                    320:            (cd "$srcdir/tools" && tar -xf -)
                    321: fi
1.10      bertrand  322: if test ! -d "$srcdir"/tools/$SQLITE; then
                    323:    gunzip -c "$srcdir"/tools/$SQLITE.tar.gz | \
                    324:            (cd "$srcdir/tools" && tar -xf -)
                    325: fi
                    326: if test ! -d tools/$OPENSSL; then
                    327:    gunzip -c "$srcdir"/tools/$OPENSSL.tar.gz | \
1.15      bertrand  328:            (cd tools && tar -xf -)
1.10      bertrand  329: fi
1.57      bertrand  330: if test ! -d rplcas; then
                    331:    mkdir rplcas
                    332: fi
                    333: if test ! -d "$srcdir"/rplcas/$GMP; then
                    334:    gunzip -c "$srcdir"/rplcas/$GMP.tar.gz | \
                    335:            (cd "$srcdir/rplcas" && tar -xf -)
                    336: fi
                    337: if test ! -d "$srcdir"/rplcas/$MPFR; then
                    338:    gunzip -c "$srcdir"/rplcas/$MPFR.tar.gz | \
                    339:            (cd "$srcdir/rplcas" && tar -xf -)
                    340: fi
1.58      bertrand  341: if test ! -d rplcas/$NTL; then
                    342:    gunzip -c "$srcdir"/rplcas/$NTL.tar.gz | \
                    343:            (cd rplcas && tar -xf -)
                    344: fi
                    345: if test ! -d rplcas/$COCOA; then
                    346:    gunzip -c "$srcdir"/rplcas/$COCOA.tar.gz | \
                    347:            (cd rplcas && tar -xf -)
                    348: fi
                    349: if test ! -d rplcas/$PARI; then
                    350:    gunzip -c "$srcdir"/rplcas/$PARI.tar.gz | \
                    351:            (cd rplcas && tar -xf -)
                    352: fi
                    353: if test ! -d "$srcdir"/rplcas/$GIAC; then
                    354:    gunzip -c "$srcdir"/rplcas/$GIAC.tar.gz | \
                    355:            (cd "$srcdir/rplcas" && tar -xf -)
                    356: fi
1.1       bertrand  357: 
                    358: dnl Default installation directory
                    359: AC_PREFIX_DEFAULT(/usr/local)
                    360: 
                    361: dnl Set final install path
                    362: AC_ARG_ENABLE(final-run-path,
                    363:              [  --enable-final-run-path=PATH enable another final run path than PREFIX], [
                    364:    if test "x$enable_final_run_path" = "x"; then
                    365:        AC_MSG_NOTICE("No path with --enable-final-run-path.")
                    366:        AC_MSG_ERROR("You should specify final path !")
                    367:    else
                    368:        RUNPATH="$enable_final_run_path"
                    369:    fi
                    370: ],
                    371: RUNPATH="\${prefix}"
                    372: )
                    373: AC_SUBST(RUNPATH)
                    374: 
                    375: dnl Checks for programs
                    376: AC_PROG_INSTALL
                    377: AC_PROG_LN_S
                    378: AC_PROG_MAKE_SET
                    379: AC_PROG_RANLIB
                    380: 
1.13      bertrand  381: dnl Checks for nawk
                    382: AC_CHECK_PROG(AWK, nawk, yes, no)
1.1       bertrand  383: if test "$AWK" = no; then
1.41      bertrand  384:    AC_CHECK_PROG(AWK, gawk, yes, no)
                    385:    if test "$AWK" = no; then
                    386:        AC_MSG_ERROR([Can not find nawk !])
                    387:    fi
1.1       bertrand  388: fi
                    389: 
                    390: dnl Checks for sed
                    391: AC_CHECK_PROG(SED, sed, yes, no)
                    392: if test "$SED" = no; then
                    393:    AC_MSG_ERROR([Can not find sed !])
                    394: fi
                    395: 
                    396: dnl Checks for TeX, LaTeX, dvips, gs, gv, vim and gnuplot
                    397: if test "$TEX_SUPPORT" = guessed; then
                    398:    POSTSCRIPT_SUPPORT="-DPOSTSCRIPT_SUPPORT"
                    399: 
                    400:    AC_CHECK_PROG(TEX, tex, yes, no)
                    401:    if test "$TEX" = no; then
                    402:        AC_MSG_WARN([Cannot find TeX! You may install it.
                    403: Download at http://tex.loria.fr/
                    404: ])
                    405:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    406:    fi
                    407: 
                    408:    AC_CHECK_PROG(LATEX, latex, yes, no)
                    409:    if test "$LATEX" = no; then
                    410:        AC_MSG_WARN([Cannot find LaTeX! You may install it.
                    411: Download at http://tex.loria.fr/
                    412: ])
                    413:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    414:    fi
                    415: 
                    416:    AC_CHECK_PROG(DVIPS, dvips, yes, no)
                    417:    if test "$DVIPS" = no; then
                    418:        AC_MSG_WARN([Cannot find dvips! You may install it.
                    419: Download at http://tex.loria.fr/
                    420: ])
                    421:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    422:    fi
                    423: 
                    424:    AC_CHECK_PROG(GS, gs, yes, no)
                    425:    if test "$GS" = no; then
                    426:        AC_MSG_WARN([Cannot find gs! You may install it.
                    427: Download at http://ftp.lip6.fr/
                    428: ])
                    429:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    430:    fi
                    431: 
                    432:    AC_CHECK_PROG(GV, gv, yes, no)
                    433:    if test "$GV" = no; then
                    434:        AC_MSG_WARN([Cannot find gv! You may install it.
                    435: Download at http://ftp.lip6.fr/
                    436: ])
                    437:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    438:    fi
                    439: else
                    440:    if test "$TEX_SUPPORT" = no; then
                    441:        POSTSCRIPT_SUPPORT="-UPOSTSCRIPT_SUPPORT"
                    442:    else
                    443:        POSTSCRIPT_SUPPORT="-DPOSTSCRIPT_SUPPORT"
                    444:    fi
                    445: fi
                    446: 
                    447: if test "$GNUPLOT_SUPPORT" = guessed; then
                    448:    AC_CHECK_PROG(GNUPLOT_P, gnuplot, yes, no)
                    449:    if test "$GNUPLOT_P" = no; then
                    450:        AC_MSG_WARN([Cannot find gnuplot! You may install it.
                    451: Download at http://www.gnuplot.vt.edu/
                    452: ])
                    453:        GNUPLOT_SUPPORT="-UGNUPLOT_SUPPORT"
                    454:    else
                    455:        GNUPLOT_SUPPORT="-DGNUPLOT_SUPPORT"
                    456:    fi
                    457: else
                    458:    if test "$GNUPLOT_SUPPORT" = no; then
                    459:        GNUPLOT_SUPPORT="-UGNUPLOT_SUPPORT"
                    460:    else
                    461:        GNUPLOT_SUPPORT="-DGNUPLOT_SUPPORT"
                    462:    fi
                    463: fi
                    464: 
                    465: if test "$VIM_SUPPORT" = guessed; then
                    466:    AC_CHECK_PROG(VIM, vim, yes, no)
                    467:    if test "$VIM" = no; then
                    468:        AC_MSG_WARN([Cannot find vim! You may install it.
                    469: Download at http://www.vim.org/
                    470: ])
                    471:        VIM_SUPPORT="-UVIM_SUPPORT"
                    472:    else
                    473:        VIM_SUPPORT="-DVIM_SUPPORT"
                    474:    fi
                    475: else
                    476:    if test "$VIM_SUPPORT" = no; then
                    477:        VIM_SUPPORT="-UVIM_SUPPORT"
                    478:    else
                    479:        VIM_SUPPORT="-DVIM_SUPPORT"
                    480:    fi
                    481: fi
                    482: 
                    483: if test "$MOTIF_SUPPORT" = guessed; then
                    484:    CFLAGS_ORIG=$CFLAGS
                    485:    LIBS_ORIG=$LIBS
                    486:    CFLAGS="$CFLAGS $X_CFLAGS"
                    487:    LIBS="$LIB $X_LIBS"
                    488:    AC_CHECK_LIB(Xm, main, MOTIF_SUPPORT="-DMOTIF_SUPPORT", MOTIF_SUPPORT="-UMOTIF_SUPPORT")
                    489:    if test "$MOTIF_SUPPORT" = "-UMOTIF_SUPPORT"; then
                    490:        AC_MSG_WARN([Cannot find Motif! You may install it.
                    491: Motif flag is disabled.
                    492: ])
                    493:    fi
                    494:    LIBS=$LIBS_ORIG
                    495:    CFLAGS=$CFLAGS_ORIG
                    496: fi
                    497: 
                    498: if test "$MOTIF_SUPPORT" = "-DMOTIF_SUPPORT"; then
                    499:    CFLAGS_ORIG=$CFLAGS
                    500:    LIBS_ORIG=$LIBS
                    501:    CFLAGS="$CFLAGS $X_CFLAGS"
                    502:    LIBS="$LIB $X_LIBS"
                    503:    AC_CHECK_LIB(Xpm, main, MOTIF_SUPPORT="-DMOTIF_SUPPORT", MOTIF_SUPPORT="-UMOTIF_SUPPORT")
                    504:    if test "$MOTIF_SUPPORT" = "-DMOTIF_SUPPORT"; then
                    505:        libX="$X_LIBS -lXm -lXpm -lXt -lX11"
                    506:    else
                    507:        libX=""
                    508:        AC_MSG_WARN([Cannot find libXpm! You may install it.
                    509: Motif flag is disabled.
                    510: ])
                    511:    fi
                    512:    LIBS=$LIBS_ORIG
                    513:    CFLAGS=$CFLAGS_ORIG
                    514: else
                    515:    libX=""
                    516: fi
                    517: 
                    518: dnl Substitutions
                    519: AC_SUBST(GNUPLOT_SUPPORT)
                    520: AC_SUBST(FORCE_GNUPLOT_PATH)
                    521: AC_SUBST(POSTSCRIPT_SUPPORT)
                    522: AC_SUBST(VIM_SUPPORT)
                    523: AC_SUBST(EXPERIMENTAL_CODE)
                    524: AC_SUBST(DEBUG)
                    525: AC_SUBST(MOTIF_SUPPORT)
                    526: AC_SUBST(libX)
                    527: AC_SUBST(includeX)
                    528: 
                    529: dnl Date
                    530: DATE=$(LANG=C date +"%A, %e %B %Y %T %z")
                    531: AC_SUBST(DATE)
                    532: 
                    533: dnl Checks for libraries
                    534: AC_CHECK_LIB(m, main,, AC_MSG_ERROR([Can not find libm !]))
                    535: AC_CHECK_LIB(pthread, main,, AC_MSG_ERROR([Can not find libpthread !]))
                    536: 
1.34      bertrand  537: dnl Check for union semun
                    538: AC_CHECK_TYPE([union semun], SEMUN=-DUNION_SEMUN, SEMUN=-UUNION_SEMUN, [[
                    539: #include <sys/sem.h>
                    540: ]])
                    541: 
1.35      bertrand  542: dnl Check for IPv6 support
                    543: AC_CHECK_TYPE([struct sockaddr_in6], IPV6=-DIPV6, IPV6=-UIPV6, [[
1.37      bertrand  544: #include <sys/types.h>
1.35      bertrand  545: #include <netinet/in.h>
                    546: ]])
                    547: 
1.1       bertrand  548: dnl Do we need to use -ldl?
                    549: if test "$CYGWIN" != yes; then
                    550:    AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl",
                    551:            AC_MSG_WARN([libdl doesn't seem to be needed on this system.]))
                    552: fi
                    553: 
                    554: dnl Do we need to use -lrt?
                    555: AC_CHECK_LIB(rt, nanosleep, LIBS="$LIBS -lrt",
                    556:        AC_MSG_WARN([librt doesn't seem to be needed on this system.]))
                    557: 
                    558: dnl Do we need to use -lsocket?
                    559: AC_CHECK_LIB(socket, bind, LIBS="$LIBS -lsocket",
                    560:        AC_MSG_WARN([libsocket doesn't seem to be needed on this system.]))
                    561: 
                    562: dnl Check for SQL libraries
                    563: MYSQL_SUPPORT="-UMYSQL_SUPPORT"
                    564: AC_ARG_WITH(mysql,
                    565: [  --with-mysql=PATH         specify directory for installed mysql],
                    566: [], [with_mysql=check])
                    567: 
                    568: if test "x$with_mysql" = xcheck -o "x$with_mysql" = yes; then
                    569:    libMySQLinc="-I/usr/include"
1.31      bertrand  570:    libMySQLlib="/usr/lib"
1.1       bertrand  571: 
                    572:    AC_MSG_CHECKING(for libmysql includes in /usr/include)
                    573:    saved_CFLAGS="$CFLAGS"
1.31      bertrand  574:    CFLAGS="$CFLAGS -L/$libMySQLinc"
1.1       bertrand  575:    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    576:                    libMySQLinc=$libMySQLinc/mysql],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    577:    CFLAGS=$saved_CFLAGS
                    578: 
                    579:    if test "$MYSQL_SUPPORT" = "-UMYSQL_SUPPORT"; then
                    580:        AC_MSG_CHECKING(for libmysql includes in /usr/include/mysql)
                    581:        saved_CFLAGS="$CFLAGS"
                    582:        CFLAGS="$CFLAGS $libMySQLinc/mysql"
                    583:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    584:                        libMySQLinc=$libMySQLinc],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    585:        CFLAGS=$saved_CFLAGS
                    586:        libMySQLinc=$libMySQLinc/mysql
                    587:    fi
                    588: 
                    589:    if test "$MYSQL_SUPPORT" = "-UMYSQL_SUPPORT"; then
                    590:        AC_MSG_CHECKING(for libmysql includes in /usr/local/include)
                    591:        saved_CFLAGS="$CFLAGS"
                    592:        CFLAGS="$CFLAGS $libMySQLinc/../local/include"
                    593:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    594:                        libMySQLinc=$libMySQLinc/mysql],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    595:        CFLAGS=$saved_CFLAGS
                    596:        libMySQLinc=$libMySQLinc/../local/include
                    597:        libMySQLlib=$libMySQLlib/../local/lib
                    598:    fi
                    599: 
                    600:    if test "$MYSQL_SUPPORT" = "-UMYSQL_SUPPORT"; then
                    601:        AC_MSG_CHECKING(for libmysql includes in /usr/local/include/mysql)
                    602:        saved_CFLAGS="$CFLAGS"
                    603:        CFLAGS="$CFLAGS $libMySQLinc/../local/include/mysql"
                    604:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    605:                        libMySQLinc=$libMySQLinc/mysql],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    606:        CFLAGS=$saved_CFLAGS
                    607:        libMySQLinc=$libMySQLinc/../local/include/mysql
                    608:        libMySQLlib=$libMySQLlib/../local/lib
                    609:    fi
                    610: else
                    611:    if test "x$with_mysql" != xno; then
                    612:        libMySQLinc="-I$with_mysql/include"
1.31      bertrand  613:        libMySQLlib="$with_mysql/lib"
1.1       bertrand  614: 
                    615:        AC_MSG_CHECKING(for libmysql includes in $with_mysql)
                    616:        saved_CFLAGS="$CFLAGS"
                    617:        CFLAGS="$CFLAGS $libMySQLinc"
                    618:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    619:                        libMySQLinc=$libMySQLinc/mysql],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    620:        CFLAGS=$saved_CFLAGS
                    621: 
                    622:        if test "$MYSQL_SUPPORT" = "-UMYSQL_SUPPORT"; then
                    623:            AC_MSG_CHECKING(for libmysql includes in $with_mysql/mysql)
                    624:            saved_CFLAGS="$CFLAGS"
                    625:            CFLAGS="$CFLAGS $libMySQLinc/mysql"
                    626:            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[]])],[AC_MSG_RESULT([yes]); MYSQL_SUPPORT="-DMYSQL_SUPPORT";
                    627:                            libMySQLinc=$libMySQLinc],[AC_MSG_RESULT([no]); MYSQL_SUPPORT="-UMYSQL_SUPPORT"])
                    628:            CFLAGS=$saved_CFLAGS
                    629:            libMySQLinc=$libMySQLinc/mysql
                    630:        fi
                    631:    else
                    632:        MYSQL_SUPPORT="-UMYSQL_SUPPORT"
                    633:    fi
                    634: fi
                    635: 
                    636: if test "$MYSQL_SUPPORT" = "-DMYSQL_SUPPORT"; then
                    637:    MYSQL_LIB=no
                    638: 
                    639:    if test $MYSQL_LIB = no; then
                    640:        AC_MSG_CHECKING(for libmysql libraries in $libMySQLlib)
                    641:        saved_LIBS="$LIBS"
1.31      bertrand  642:        if test $STATIC = no; then
                    643:            LIBS="$LIBS -L/$libMySQLlib -lmysqlclient_r $libMySQLinc"
                    644:        else
                    645:            LIBS="$LIBS $libMySQLlib/libmysqlclient_r.a -lz $libMySQLinc"
                    646:        fi
1.1       bertrand  647:        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "mysql.h"]], [[MYSQL mysql; mysql_init(&mysql);]])],[AC_MSG_RESULT([yes]); MYSQL_LIB="yes"],[AC_MSG_RESULT([no]); MYSQL_LIB="no"])
                    648:        LIBS=$saved_LIBS;
1.31      bertrand  649:        if test $STATIC = no; then
                    650:            libMySQLlib="-L/$libMySQLlib -lmysqlclient_r"
                    651:        else
                    652:            libMySQLlib="$libMySQLlib/libmysqlclient_r.a"
                    653:            EXT_SQL="$EXT_SQL $libMySQLlib"
                    654:        fi
1.1       bertrand  655:    fi
                    656: 
                    657:    if test $MYSQL_LIB = no; then
                    658:        MYSQL_SUPPORT="-UMYSQL_SUPPORT"
                    659:    fi
                    660: fi
                    661: 
                    662: if test "$MYSQL_SUPPORT" != "-DMYSQL_SUPPORT"; then
                    663:    libMySQLinc=
                    664:    libMySQLlib=
                    665: fi
                    666: 
                    667: AC_SUBST(MYSQL_SUPPORT)
                    668: AC_SUBST(libMySQLinc)
                    669: AC_SUBST(libMySQLlib)
                    670: 
                    671: POSTGRESQL_SUPPORT=-UPOSTGRESQL_SUPPORT
                    672: AC_ARG_WITH(postgresql,
                    673: [  --with-postgresql=PATH    specify directory for installed postgresql],
                    674: [], [with_postgresql=check])
                    675: 
                    676: # with_postgresql : check [pas défini], yes [uniquement --with],
                    677: # no [--without], valeur [--with=valeur].
                    678: 
                    679: if test "x$with_postgresql" = xcheck -o "x$with_postgresql" = xyes; then
                    680:    libPgSQLinc="-I/usr/include"
1.31      bertrand  681:    libPgSQLlib="/usr/lib"
1.1       bertrand  682: 
                    683:    AC_MSG_CHECKING(for libpq includes in /usr/include)
                    684:    saved_CFLAGS="$CFLAGS"
                    685:    CFLAGS="$CFLAGS $libPgSQLinc"
                    686:    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]); POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]); POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    687:    CFLAGS=$saved_CFLAGS
                    688: 
                    689:    if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    690:        AC_MSG_CHECKING(for libpq includes in /usr/include/postgresql)
                    691:        saved_CFLAGS="$CFLAGS"
                    692:        CFLAGS="$CFLAGS $libPgSQLinc/postgresql"
                    693:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    694:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    695:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    696:        CFLAGS=$saved_CFLAGS
                    697:        libPgSQLinc=$libPgSQLinc/postgresql
                    698:    fi
                    699: 
                    700:    if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    701:        AC_MSG_CHECKING(for libpq includes in /usr/include/pgsql)
                    702:        saved_CFLAGS="$CFLAGS"
                    703:        CFLAGS="$CFLAGS $libPgSQLinc/pgsql"
                    704:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    705:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    706:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    707:        CFLAGS=$saved_CFLAGS
                    708:        libPgSQLinc=$libPgSQLinc/pgsql
                    709:    fi
                    710: 
                    711:    if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    712:        AC_MSG_CHECKING(for libpq includes in /usr/local/include)
                    713:        saved_CFLAGS="$CFLAGS"
                    714:        CFLAGS="$CFLAGS $libPgSQLinc/../local/include"
                    715:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    716:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    717:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    718:        CFLAGS=$saved_CFLAGS
                    719:        libPgSQLinc=$libPgSQLinc/../local/include
                    720:        libPgSQLlib=$libPgSQLlib/../local/lib
                    721:    fi
                    722: 
                    723:    if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    724:        AC_MSG_CHECKING(for libpq includes in /usr/local/include/postgresql)
                    725:        saved_CFLAGS="$CFLAGS"
                    726:        CFLAGS="$CFLAGS $libPgSQLinc/../local/include/postgresql"
                    727:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    728:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    729:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    730:        CFLAGS=$saved_CFLAGS
                    731:        libPgSQLinc=$libPgSQLinc/../local/include/postgresql
                    732:        libPgSQLlib=$libPgSQLlib/../local/lib
                    733:    fi
                    734: 
                    735:    if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    736:        AC_MSG_CHECKING(for libpq includes in /usr/local/include/pgsql)
                    737:        saved_CFLAGS="$CFLAGS"
                    738:        CFLAGS="$CFLAGS $libPgSQLinc/../local/include/pgsql"
                    739:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    740:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    741:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    742:        CFLAGS=$saved_CFLAGS
                    743:        libPgSQLinc=$libPgSQLinc/local/include/pgsql
                    744:        libPgSQLlib=$libPgSQLlib/../local/lib
                    745:    fi
                    746: else
                    747:    if test "x$with_postgresql" != xno; then
                    748:        libPgSQLinc="-I$with_postgresql/include"
1.31      bertrand  749:        libPgSQLlib="$with_postgresql/lib"
1.1       bertrand  750: 
                    751:        AC_MSG_CHECKING(for libpq includes in $libPgSQLinc)
                    752:        saved_CFLAGS="$CFLAGS"
                    753:        CFLAGS="$CFLAGS $libPgSQLinc"
                    754:        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    755:                POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    756:                POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    757:        CFLAGS=$saved_CFLAGS
                    758: 
                    759:        if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    760:            AC_MSG_CHECKING(for libpq includes in $libPgSQLinc/postgresql)
                    761:            saved_CFLAGS="$CFLAGS"
                    762:            CFLAGS="$CFLAGS $libPgSQLinc/postgresql"
                    763:            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    764:                    POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    765:                    POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    766:            CFLAGS=$saved_CFLAGS
                    767:            libPgSQLinc=$libPgSQLinc/postgresql
                    768:        fi
                    769: 
                    770:        if test "$POSTGRESQL_SUPPORT" = "-UPOSTGRESQL_SUPPORT"; then
                    771:            AC_MSG_CHECKING(for libpq includes in $libPgSQLinc/pgsql)
                    772:            saved_CFLAGS="$CFLAGS"
                    773:            CFLAGS="$CFLAGS $libPgSQLinc/pgsql"
                    774:            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[]])],[AC_MSG_RESULT([yes]);
                    775:                    POSTGRESQL_SUPPORT="-DPOSTGRESQL_SUPPORT"],[AC_MSG_RESULT([no]);
                    776:                    POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"])
                    777:            CFLAGS=$saved_CFLAGS
                    778:            libPgSQLinc=$libPgSQLinc/pgsql
                    779:        fi
                    780:    else
                    781:        POSTGRESQL_SUPPORT="-UPOSTGRESQL_SUPPORT"
                    782:    fi
                    783: fi
                    784: 
                    785: if test "$POSTGRESQL_SUPPORT" = "-DPOSTGRESQL_SUPPORT"; then
                    786:    POSTGRESQL_LIB=no
                    787: 
                    788:    if test $POSTGRESQL_LIB = no; then
                    789:        AC_MSG_CHECKING(for libpq libraries in $libPgSQLlib)
                    790:        saved_LIBS="$LIBS"
1.31      bertrand  791:        if test $STATIC = no; then
                    792:            LIBS="$LIBS -L/$libPgSQLlib $libPgSQLinc -lpq"
                    793:        else
                    794:            LIBS="$LIBS $libPgSQLlib/libpq.a $libPgSQLinc"
                    795:        fi
1.1       bertrand  796:        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "libpq-fe.h"]], [[PGconn *conn; const char *conninfo="dbname=postgres"; conn =
                    797:             PQconnectdb(conninfo);]])],[AC_MSG_RESULT([yes]); POSTGRESQL_LIB="yes"],[AC_MSG_RESULT([no]); POSTGRESQL_LIB="no"])
                    798:        LIBS=$saved_LIBS;
1.31      bertrand  799:        if test $STATIC = no; then
                    800:            libPgSQLlib="-L/$libPgSQLlib -lpq"
                    801:        else
                    802:            libPgSQLlib="$libPgSQLlib/libpq.a"
                    803:            EXT_SQL="$EXT_SQL $libPgSQLlib"
                    804:        fi
1.1       bertrand  805:    fi
                    806: fi
                    807: 
                    808: if test "$POSTGRESQL_SUPPORT" != "-DPOSTGRESQL_SUPPORT"; then
                    809:    libPgSQLinc=
                    810:    libPgSQLlib=
                    811: fi
                    812: 
                    813: AC_SUBST(POSTGRESQL_SUPPORT)
                    814: AC_SUBST(libPgSQLinc)
                    815: AC_SUBST(libPgSQLlib)
                    816: 
1.42      bertrand  817: # with_postgresql : check [pas défini], yes [uniquement --with],
                    818: # no [--without], valeur [--with=valeur].
                    819: AC_ARG_WITH(bourne_shell,
                    820: [  --with-bourne-shell=PATH  specify path for OS/2 bourne shell],
                    821: [], [with_bourne_shell=no])
                    822: 
                    823: if test "x$with_bourne_shell" = xyes; then
                    824:    AC_MSG_ERROR([You have to specify a valide shell path !])
                    825: fi
                    826: 
                    827: if test "x$with_bourne_shell" = xno; then
                    828:    if test $(uname) = "OS/2"; then
                    829:        AC_MSG_ERROR([With OS/2 or eComstation, you have to specify a valide shell path !])
                    830:    fi
                    831: 
                    832:    BSH_PATH=
                    833: else
                    834:    if test ! -x $with_bourne_shell; then
                    835:        AC_MSG_ERROR([$with_bourne_shell is not executable !])
                    836:    fi
                    837: 
                    838:    if test $(uname) = "OS/2"; then
1.43      bertrand  839:        with_os2_bourne_shell=$(echo $with_bourne_shell | \
                    840:                sed -e '1,$s/\//\\\\\\\\/g')
                    841:        BSH_PATH=-DBOURNE_SHELL=\"\\\"$with_os2_bourne_shell\\\"\"
1.42      bertrand  842:    else
                    843:        AC_MSG_WARN([--with-bourne-shell ignored])
                    844:        BSH_PATH=
                    845:    fi
                    846: fi
                    847: 
1.1       bertrand  848: dnl Checks for sizes
                    849: AC_CHECK_SIZEOF(void *, 4)
                    850: AC_CHECK_SIZEOF(char, 1)
                    851: AC_CHECK_SIZEOF(short int, 2)
                    852: AC_CHECK_SIZEOF(int, 4)
                    853: AC_CHECK_SIZEOF(long int, 4)
                    854: AC_CHECK_SIZEOF(long long int, 8)
                    855: AC_CHECK_SIZEOF(float, 4)
                    856: AC_CHECK_SIZEOF(double, 8)
                    857: AC_CHECK_SIZEOF(long double, 12)
                    858: 
                    859: dnl Checks for header files.
                    860: AC_HEADER_DIRENT
                    861: AC_HEADER_STDC
                    862: AC_HEADER_SYS_WAIT
                    863: AC_CHECK_HEADERS(dlfcn.h fcntl.h math.h pwd.h signal.h string.h termios.h \
                    864:        time.h unistd.h sys/resource.h sys/stat.h sys/time.h sys/timeb.h \
                    865:        sys/types.h sys/select.h sys/wait.h stdio.h stdlib.h pthread.h)
                    866: 
                    867: dnl Checks for typedefs, structures, and compiler characteristics.
                    868: AC_C_CONST
                    869: AC_TYPE_UID_T
                    870: AC_TYPE_PID_T
                    871: AC_TYPE_SIZE_T
                    872: AC_HEADER_TIME
                    873: AC_STRUCT_TM
                    874: 
                    875: dnl Checks for library functions.
                    876: AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
                    877: Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
                    878: AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
                    879: [AC_LANG_PROGRAM([#include <sys/types.h>
                    880: #include <signal.h>
                    881: ],
                    882:         [return *(signal (0, 0)) (0) == 1;])],
                    883:           [ac_cv_type_signal=int],
                    884:           [ac_cv_type_signal=void])])
                    885: AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
                    886:            (`int' or `void').])
                    887: 
1.37      bertrand  888: dnl Checks for broken siginfo structure
                    889: AC_MSG_CHECKING([for broken siginfo->si_pid])
                    890: AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
                    891: #include <signal.h>
                    892: int flag;
                    893: void handler(int signal, siginfo_t *siginfo, void *context)
1.41      bertrand  894: { flag = ((*siginfo).si_pid == getpid()) ? 0 : 1; }],
1.37      bertrand  895: [struct sigaction    action;
                    896: action.sa_sigaction = handler;
                    897: action.sa_flags = SA_SIGINFO;
                    898: sigaction(SIGUSR1, &action, NULL);
                    899: raise(SIGUSR1);
                    900: return(flag);])],
                    901: [BROKEN_SIGINFO=-U_BROKEN_SIGINFO; AC_MSG_RESULT(no)],
                    902: [BROKEN_SIGINFO=-D_BROKEN_SIGINFO; AC_MSG_RESULT(yes)])
                    903: 
1.1       bertrand  904: AC_FUNC_STRCOLL
                    905: AC_FUNC_STRFTIME
                    906: AC_FUNC_VPRINTF
                    907: AC_CHECK_FUNCS(ftime getcwd putenv select strcspn strdup \
                    908:        strerror strspn strstr strtod)
                    909: 
1.16      bertrand  910: dnl Check for OpenSSL os/comp
                    911: AC_ARG_WITH(openssl_arch,
                    912: [  --with-openssl-arch=ARCH  specify os and compiler for openssl (ARCH or list)],
                    913: [], [with_openssl_arch=none])
                    914: 
1.32      bertrand  915: if test $(uname) = "OS/2"; then
1.36      bertrand  916:    bash -c "cd tools/$OPENSSL && os2/OS2-EMX.cmd"
1.16      bertrand  917: else
1.32      bertrand  918:    if test "x$with_openssl_arch" = xnone; then
                    919:        (cd tools/$OPENSSL && ./config)
                    920:    elif test "x$with_openssl_arch" = xyes -o "x$with_openssl_arch" = xno; then
                    921:        (cd tools/$OPENSSL && ./Configure)
                    922:        AC_MSG_ERROR([OS/COMP informations are required!])
                    923:    elif test "x$with_openssl_arch" = xlist; then
                    924:        (cd tools/$OPENSSL && ./Configure)
                    925:        AC_MSG_ERROR([Please specify OS and Architecture])
                    926:    else
                    927:        (cd tools/$OPENSSL && ./Configure $with_openssl_arch)
                    928:    fi
1.16      bertrand  929: fi
1.1       bertrand  930: 
1.36      bertrand  931: AC_CONFIG_SUBDIRS(tools/$NCURSES)
                    932: AC_CONFIG_SUBDIRS(tools/$READLINE)
                    933: AC_CONFIG_SUBDIRS(tools/$GSL)
                    934: AC_CONFIG_SUBDIRS(tools/$GPP)
                    935: AC_CONFIG_SUBDIRS(tools/$FILE)
                    936: AC_CONFIG_SUBDIRS(tools/$ICONV)
                    937: AC_CONFIG_SUBDIRS(tools/$SQLITE)
                    938: AC_CONFIG_SUBDIRS(tools/$UNITS)
                    939: 
1.1       bertrand  940: if test "$MYGNUPLOT" = "yes"; then
                    941:    if test ! -d "$srcdir"/tools/$GNUPLOT; then
                    942:        gunzip -c "$srcdir"/tools/$GNUPLOT.tar.gz | \
                    943:                (cd "$srcdir/tools" && tar -xf -)
                    944:    fi
                    945:    AC_CONFIG_SUBDIRS(tools/$GNUPLOT)
                    946:    GNUPLOT_COMPILATION=$GNUPLOT
                    947: else
                    948:    GNUPLOT_COMPILATION=
                    949: fi
                    950: 
                    951: AC_SUBST(GNUPLOT_COMPILATION)
                    952: 
                    953: case $host_cpu in
                    954: 
                    955:     i?86)
                    956:    CFLAGS="$CFLAGS -malign-double -mieee-fp -Wall -funsigned-char \
                    957:            -Wno-pointer-sign"
                    958:    FFLAGS="$FFLAGS -malign-double -mieee-fp -Wall -fno-f2c"
                    959:    FCFLAGS="$FCFLAGS -malign-double -mieee-fp -Wall -fno-f2c"
                    960:    break ;;
                    961: 
                    962:    x86_64*)
                    963:    CFLAGS="$CFLAGS -malign-double -mieee-fp -Wall -funsigned-char \
                    964:            -Wno-pointer-sign"
                    965:    FFLAGS="$FFLAGS -malign-double -mieee-fp -Wall -fno-f2c"
                    966:    FCFLAGS="$FCFLAGS -malign-double -mieee-fp -Wall -fno-f2c"
                    967:    break ;;
                    968: 
                    969:     alpha*)
                    970:    CFLAGS="$CFLAGS -mieee -funsigned-char -Wall \
                    971:            -Wno-pointer-sign"
                    972:    FFLAGS="$FFLAGS -mieee -Wall"
                    973:    FCFLAGS="$FCFLAGS -mieee -Wall"
                    974:    break ;;
                    975: 
                    976:     sparc*)
                    977:    CFLAGS="$CFLAGS -Wall -funsigned-char \
                    978:            -Wno-pointer-sign"
                    979:    FFLAGS="$FFLAGS -Wall"
                    980:    FCFLAGS="$FCFLAGS -Wall"
                    981:    break ;;
                    982: 
                    983: esac
                    984: 
1.9       bertrand  985: case $host_os in
                    986: 
                    987:    cygwin*)
                    988:        OS=Cygwin
                    989:    break ;;
                    990: 
                    991:    interix*)
                    992:        OS=Interix
                    993:    break ;;
                    994: 
                    995:    *)
                    996:        OS=$(uname)
                    997:    break ;;
                    998: 
                    999: esac
                   1000: 
                   1001: AC_SUBST(OS)
                   1002: 
1.1       bertrand 1003: DATE_FR=$(env LC_ALL=fr_FR date +'%A %x, %X %Z')
                   1004: DATE=$(env LC_ALL=C date +'%A %x, %X %Z')
1.51      bertrand 1005: MALLOC=
1.1       bertrand 1006: 
1.23      bertrand 1007: case $OS in
1.18      bertrand 1008: 
                   1009:     Darwin)
1.32      bertrand 1010:        EXPORT_DYNAMIC=-Wl,-flat_namespace
1.18      bertrand 1011:        NESTED_FUNCTIONS=-fnested-functions
                   1012:        SEMAPHORES_NOMMES=-DSEMAPHORES_NOMMES
1.38      bertrand 1013:        IPCS_SYSV=-UIPCS_SYSV
1.24      bertrand 1014:        CXXFLAGS="$CXXFLAGS -D_GLIBCXX_FULLY_DYNAMIC_STRING"
1.32      bertrand 1015:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1016:                --disable-shared --enable-static --enable-threads"
1.34      bertrand 1017:        C_STANDARD=-std=gnu99
1.18      bertrand 1018:    break ;;
                   1019: 
1.32      bertrand 1020:     Cygwin)
                   1021:        EXPORT_DYNAMIC=-Wl,--export-all-symbols
1.18      bertrand 1022:        NESTED_FUNCTIONS=
                   1023:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
1.38      bertrand 1024:        IPCS_SYSV=-UIPCS_SYSV
1.32      bertrand 1025:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1026:                --disable-shared --enable-static --enable-threads"
1.34      bertrand 1027:        C_STANDARD=-std=gnu99
1.18      bertrand 1028:    break ;;
                   1029: 
1.35      bertrand 1030:    Interix)
                   1031:        EXPORT_DYNAMIC=-Wl,--export-all-symbols
                   1032:        NESTED_FUNCTIONS=
                   1033:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
1.38      bertrand 1034:        IPCS_SYSV=-UIPCS_SYSV
1.35      bertrand 1035:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1036:                --disable-shared --enable-static --enable-threads"
1.35      bertrand 1037:        C_STANDARD=-std=gnu99
                   1038:    break;;
                   1039: 
1.32      bertrand 1040:     AIX)
                   1041:        EXPORT_DYNAMIC=-Wl,--export-dynamic
1.19      bertrand 1042:        NESTED_FUNCTIONS=
                   1043:        SEMAPHORES_NOMMES=-DSEMAPHORES_NOMMES
1.38      bertrand 1044:        IPCS_SYSV=-UIPCS_SYSV
1.32      bertrand 1045:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1046:                --disable-shared --enable-static --enable-threads"
1.34      bertrand 1047:        C_STANDARD=-std=gnu99
1.19      bertrand 1048:    break ;;
                   1049: 
1.32      bertrand 1050:     OS/2)
1.39      bertrand 1051:        if test $FORCED_FINAL_ENCODING -eq 0; then \
1.37      bertrand 1052:            FINAL_ENCODING=CP850; \
                   1053:        fi;
1.32      bertrand 1054:        OS=OS2
                   1055:        NESTED_FUNCTIONS=
                   1056:        EXPORT_DYNAMIC=-Zmap
                   1057:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
1.38      bertrand 1058:        IPCS_SYSV=-DIPCS_SYSV
1.32      bertrand 1059:        ac_configure_args="$ac_configure_args --without-readline \
1.51      bertrand 1060:                --without-cairo --disable-shared --enable-static \
                   1061:                --enable-threads"
1.34      bertrand 1062:        C_STANDARD=
1.32      bertrand 1063:    break;;
                   1064: 
1.37      bertrand 1065:    OpenBSD)
1.39      bertrand 1066:        if test $FORCED_FINAL_ENCODING -eq 0; then \
1.37      bertrand 1067:            FINAL_ENCODING=UTF-8; \
                   1068:        fi;
                   1069:        EXPORT_DYNAMIC=-Wl,--export-dynamic
                   1070:        NESTED_FUNCTIONS=
                   1071:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
1.38      bertrand 1072:        IPCS_SYSV=-DIPCS_SYSV
1.37      bertrand 1073:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1074:                --disable-shared --enable-static --enable-threads"
1.37      bertrand 1075:        C_STANDARD=-std=gnu99
                   1076:    break;;
                   1077: 
1.51      bertrand 1078:     SunOS)
                   1079:        EXPORT_DYNAMIC=-Wl,--export-dynamic
                   1080:        NESTED_FUNCTIONS=
                   1081:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
                   1082: 
                   1083:        if test $IPCS_SYSV = no; then
                   1084:            IPCS_SYSV=-UIPCS_SYSV
                   1085:        else
                   1086:            IPCS_SYSV=-DIPCS_SYSV
                   1087:        fi
                   1088: 
                   1089:        ac_configure_args="$ac_configure_args --with-readline=builtin \
                   1090:                --disable-shared --enable-static --enable-threads"
                   1091:        C_STANDARD=-std=gnu99
                   1092:        MALLOC=-lumem
                   1093:    break ;;
                   1094: 
1.18      bertrand 1095:     *)
1.32      bertrand 1096:        EXPORT_DYNAMIC=-Wl,--export-dynamic
1.18      bertrand 1097:        NESTED_FUNCTIONS=
                   1098:        SEMAPHORES_NOMMES=-USEMAPHORES_NOMMES
1.38      bertrand 1099: 
                   1100:        if test $IPCS_SYSV = no; then
                   1101:            IPCS_SYSV=-UIPCS_SYSV
                   1102:        else
                   1103:            IPCS_SYSV=-DIPCS_SYSV
                   1104:        fi
                   1105: 
1.32      bertrand 1106:        ac_configure_args="$ac_configure_args --with-readline=builtin \
1.51      bertrand 1107:                --disable-shared --enable-static --enable-threads"
1.34      bertrand 1108:        C_STANDARD=-std=gnu99
1.18      bertrand 1109:    break ;;
                   1110: 
                   1111: esac
                   1112: 
1.34      bertrand 1113: AC_SUBST(C_STANDARD)
1.18      bertrand 1114: AC_SUBST(EXPORT_DYNAMIC)
                   1115: AC_SUBST(NESTED_FUNCTIONS)
                   1116: AC_SUBST(SEMAPHORES_NOMMES)
1.38      bertrand 1117: AC_SUBST(IPCS_SYSV)
1.34      bertrand 1118: AC_SUBST(SEMUN)
1.35      bertrand 1119: AC_SUBST(IPV6)
1.37      bertrand 1120: AC_SUBST(BROKEN_SIGINFO)
1.42      bertrand 1121: AC_SUBST(BSH_PATH)
1.1       bertrand 1122: 
                   1123: AC_SUBST(NCURSES)
                   1124: AC_SUBST(READLINE)
                   1125: AC_SUBST(UNITS)
                   1126: AC_SUBST(GSL)
                   1127: AC_SUBST(GPP)
                   1128: AC_SUBST(GNUPLOT)
                   1129: AC_SUBST(FILE)
                   1130: AC_SUBST(ICONV)
1.10      bertrand 1131: AC_SUBST(SQLITE)
                   1132: AC_SUBST(OPENSSL)
1.1       bertrand 1133: AC_SUBST(FINAL_ENCODING)
                   1134: AC_SUBST(DATE)
                   1135: AC_SUBST(DATE_FR)
1.31      bertrand 1136: AC_SUBST(EXT_SQL)
1.51      bertrand 1137: AC_SUBST(MALLOC)
1.57      bertrand 1138: AC_SUBST(GMP)
                   1139: AC_SUBST(MPFR)
1.58      bertrand 1140: AC_SUBST(NTL)
                   1141: AC_SUBST(COCOA)
                   1142: AC_SUBST(PARI)
                   1143: AC_SUBST(GIAC)
1.1       bertrand 1144: 
                   1145: AC_SUBST(CFLAGS)
                   1146: AC_SUBST(CXXFLAGS)
                   1147: AC_SUBST(FFLAGS)
                   1148: AC_SUBST(FCFLAGS)
                   1149: 
                   1150: AC_CONFIG_FILES(Makefile)
                   1151: AC_CONFIG_FILES(COPYING)
                   1152: AC_CONFIG_FILES(tools/Makefile)
                   1153: AC_CONFIG_FILES(src/Makefile)
                   1154: AC_CONFIG_FILES(man/Makefile)
                   1155: AC_CONFIG_FILES(man/fr_FR/Makefile)
                   1156: AC_CONFIG_FILES(doc/Makefile)
                   1157: AC_CONFIG_FILES(scripts/Makefile)
                   1158: AC_CONFIG_FILES(scripts/mkrplso)
                   1159: AC_CONFIG_FILES(scripts/rplcc)
                   1160: AC_CONFIG_FILES(scripts/rpllink)
                   1161: AC_CONFIG_FILES(rpltags/Makefile)
                   1162: AC_CONFIG_FILES(rpliconv/Makefile)
1.10      bertrand 1163: AC_CONFIG_FILES(rplsums/Makefile)
1.57      bertrand 1164: AC_CONFIG_FILES(rplcas/Makefile)
1.41      bertrand 1165: AC_CONFIG_FILES(rplawk/Makefile)
1.1       bertrand 1166: AC_CONFIG_FILES(lapack/lapack/Makefile)
                   1167: AC_CONFIG_FILES(lapack/blas/Makefile)
                   1168: 
                   1169: AC_CONFIG_FILES(man/rpl.1)
                   1170: AC_CONFIG_FILES(man/rplcc.1)
                   1171: AC_CONFIG_FILES(man/rpllink.1)
                   1172: AC_CONFIG_FILES(man/rpltags.1)
                   1173: AC_CONFIG_FILES(man/mkrplso.1)
                   1174: AC_CONFIG_FILES(man/fr_FR/rpl.1)
                   1175: AC_CONFIG_FILES(man/fr_FR/rplcc.1)
                   1176: AC_CONFIG_FILES(man/fr_FR/rpllink.1)
                   1177: AC_CONFIG_FILES(man/fr_FR/rpltags.1)
                   1178: AC_CONFIG_FILES(man/fr_FR/mkrplso.1)
                   1179: 
                   1180: AC_OUTPUT

CVSweb interface <joel.bertrand@systella.fr>