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