Annotation of rpl/configure.in, revision 1.71

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

CVSweb interface <joel.bertrand@systella.fr>