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