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