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