Annotation of rpl/configure.in, revision 1.70

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

CVSweb interface <joel.bertrand@systella.fr>