1AC_INIT([algol68g], [2.8.4], [Marcel van der Veer <algol68g@xs4all.nl>])
2#
3# Algol 68 Genie "configure.ac" from "a68g-tools".
4#
5
6AC_PREREQ([2.60])
7
8# Check whether compiler supports $1 as a command-line option.
9# If it does, add the string to CFLAGS.
10
11AC_DEFUN([A68G_AC_PROG_CC_CFLAGS],
12  [AC_MSG_CHECKING([whether $CC accepts $1])
13  a68g_ac_save_CFLAGS=$CFLAGS
14  CFLAGS="$a68g_ac_save_CFLAGS $1"
15  _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
16    AC_MSG_RESULT(yes),
17    [CFLAGS="$a68g_ac_save_CFLAGS"
18    AC_MSG_RESULT(no)])
19])
20
21# Check whether $1 is in GNU plotutils.
22
23AC_DEFUN([A68G_AC_PLOTUTILS],
24  [AC_CHECK_DECL([$1], [], [enable_plotutils=no], [
25#include <stdio.h>
26#include <plot.h>
27])
28  AC_CHECK_LIB([plot], [$1], [a68g_unexpected=yes], [enable_plotutils=no])
29])
30
31# Check whether $1 is in GNU GSL.
32
33AC_DEFUN([A68G_AC_GSL],
34  [AC_CHECK_DECL([$1], [], [enable_gsl=no], [
35#include <gsl/gsl_blas.h>
36#include <gsl/gsl_complex.h>
37#include <gsl/gsl_complex.h>
38#include <gsl/gsl_complex.h>
39#include <gsl/gsl_complex_math.h>
40#include <gsl/gsl_complex_math.h>
41#include <gsl/gsl_complex_math.h>
42#include <gsl/gsl_errno.h>
43#include <gsl/gsl_errno.h>
44#include <gsl/gsl_errno.h>
45#include <gsl/gsl_fft_complex.h>
46#include <gsl/gsl_integration.h>
47#include <gsl/gsl_linalg.h>
48#include <gsl/gsl_math.h>
49#include <gsl/gsl_math.h>
50#include <gsl/gsl_math.h>
51#include <gsl/gsl_matrix.h>
52#include <gsl/gsl_permutation.h>
53#include <gsl/gsl_sf.h>
54#include <gsl/gsl_sf.h>
55#include <gsl/gsl_sf.h>
56#include <gsl/gsl_vector.h>
57])
58  AC_CHECK_LIB([gsl], [$1], [a68g_unexpected=yes], [enable_gsl=no])
59])
60
61# Check whether $1 is in PostgreSQL.
62
63AC_DEFUN([A68G_AC_POSTGRESQL],
64  [AC_CHECK_DECL([$1], [], [enable_postgresql=no], [
65#include <libpq-fe.h>
66])
67  AC_CHECK_LIB([pq], [$1], [a68g_unexpected=yes], [enable_postgresql=no])
68  ])
69
70# Check whether $1 is in pthread.
71
72AC_DEFUN([A68G_AC_PTHREAD],
73  [AC_CHECK_DECL([$1], [], [enable_parallel=no], [
74#include <pthread.h>
75])
76  AC_CHECK_LIB([pthread], [$1], [a68g_unexpected=yes], [enable_parallel=no])
77  ])
78
79# Check whether $1 is in dl.
80
81AC_DEFUN([A68G_AC_DL],
82  [AC_CHECK_DECL([$1], [], [enable_compiler=no], [
83#include <dlfcn.h>
84])
85  AC_CHECK_LIB([dl], [$1], [a68g_unexpected=yes], [enable_compiler=no])
86  ])
87
88#
89# Platform ids.
90#
91
92AC_MSG_NOTICE([host system...])
93AC_CANONICAL_BUILD
94AC_CANONICAL_HOST
95AC_CANONICAL_TARGET
96
97AC_MSG_CHECKING([platform])
98case "$host" in
99#
100# Linux.
101#
102*86-*-gnu | *86_64-*-gnu | *86-*-linux* | *86_64-*-linux* | arm*-*-linux*)
103  AC_DEFINE(HAVE_LINUX, 1, [Define this if LINUX was detected])
104  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant])
105  AC_MSG_RESULT([linux])
106  ;;
107#
108# Cygwin.
109#
110*86-*-cygwin* | *86_64-*-cygwin*)
111  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant])
112  AC_MSG_RESULT([cygwin])
113  ;;
114#
115# Mac OS X.
116#
117*86-*-*darwin* | *86_64-*-*darwin*)
118  AC_DEFINE(HAVE_MAC_OS_X, 1, [Define this if DARWIN was detected])
119  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant])
120  AC_MSG_RESULT([mac os x])
121  ;;
122#
123# FreeBSD.
124#
125*86-*-freebsd* | *86_64-*-freebsd*)
126  AC_DEFINE(HAVE_FREEBSD, 1, [Define this if FreeBSD was detected])
127  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant])
128  AC_MSG_RESULT([freebsd])
129  ;;
130#
131# NetBSD.
132#
133*86-*-netbsd* | *86_64-*-netbsd*)
134  AC_DEFINE(HAVE_NETBSD, 1, [Define this if NetBSD was detected])
135  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant])
136  AC_MSG_RESULT([netbsd])
137  ;;
138#
139# OpenBSD.
140#
141*86-*-openbsd* | *86_64-*-openbsd*)
142  AC_DEFINE(HAVE_OPENBSD, 1, [Define this if OpenBSD was detected])
143  AC_MSG_WARN([configuring interpreter-only on OpenBSD])
144  AC_MSG_RESULT([openbsd])
145  enable_compiler=no
146  ;;
147#
148# Others, untested.
149#
150*)
151  AC_DEFINE(HAVE_UNTESTED, 1, [Define this if untested OS was detected])
152  AC_MSG_WARN([configuring interpreter-only on untested platform])
153  AC_MSG_RESULT([interpreter-only])
154  enable_compiler=no
155  ;;
156esac
157
158#
159# Extra options.
160#
161
162AC_ARG_ENABLE(arch, [AS_HELP_STRING([--enable-arch=cpu], [if using gcc, enable emitting architecture-tuned assembly code (default is "no")])], , enable_arch=no)
163AC_ARG_ENABLE(compiler, [AS_HELP_STRING([--enable-compiler], [enable unit compiler (default is "yes")])], , enable_compiler=yes)
164AC_ARG_ENABLE(curses, [AS_HELP_STRING([--enable-curses], [if installed, enable curses library (default is "yes")])], , enable_curses=yes)
165AC_ARG_ENABLE(readline, [AS_HELP_STRING([--enable-readline], [if installed, enable readline library (default is "yes")])], , enable_readline=yes)
166AC_ARG_ENABLE(gsl, [AS_HELP_STRING([--enable-gsl], [if installed, enable GNU Scientific Library (default is "yes")])], , enable_gsl=yes)
167AC_ARG_ENABLE(parallel, [AS_HELP_STRING([--enable-parallel], [enable Algol 68 parallel-clause (default is "yes")])], , enable_parallel=yes)
168AC_ARG_ENABLE(pic, [AS_HELP_STRING([--enable-pic=option], [if using gcc, enable option to generate PIC (default is "-fPIC")])], , enable_pic="-fPIC")
169AC_ARG_ENABLE(prescott, [AS_HELP_STRING([--enable-prescott], [if using gcc, enable optimisation for P4 Prescott (default is "no")])], , enable_prescott=no)
170AC_ARG_ENABLE(plotutils, [AS_HELP_STRING([--enable-plotutils], [if installed, enable GNU plotting utilities (default is "yes")])], , enable_plotutils=yes)
171AC_ARG_ENABLE(postgresql, [AS_HELP_STRING([--enable-postgresql], [if installed, enable PostgreSQL (default is "yes")])], , enable_postgresql=yes)
172
173#
174# Initialisation.
175#
176
177AC_MSG_NOTICE([initialising...])
178AM_INIT_AUTOMAKE([subdir-objects serial-tests])
179AC_PREFIX_DEFAULT(/usr/local)
180AC_CONFIG_SRCDIR([source/a68g.h])
181AC_CONFIG_HEADERS([source/a68g-config.h])
182AC_PROG_INSTALL
183AC_CHECK_PROG(a68g_exists, a68g, "yes")
184
185#
186# C compiler.
187#
188
189AC_MSG_NOTICE([C compiler...])
190AC_LANG(C)
191AC_PROG_CC([clang gcc cc])
192if test "x$GCC" != "xyes"; then
193  a68g_ac_compiler=no
194  AC_MSG_WARN([gcc is the preferred C compiler; configuring interpreter-only])
195else
196  AC_DEFINE(HAVE_GCC, 1, [Define this if GCC was detected])
197
198  if test "x$enable_prescott" != "xno"; then
199    CFLAGS="-O3 -fomit-frame-pointer -march=prescott -funroll-loops"
200    enable_pic="no"
201  fi
202
203  A68G_AC_PROG_CC_CFLAGS([-pedantic])
204  A68G_AC_PROG_CC_CFLAGS([-Wshadow])
205  A68G_AC_PROG_CC_CFLAGS([-Wstrict-prototypes])
206  A68G_AC_PROG_CC_CFLAGS([-Wunused-variable])
207  A68G_AC_PROG_CC_CFLAGS([-Wunused-parameter])
208  A68G_AC_PROG_CC_CFLAGS([-Wno-long-long])
209
210#
211# Test on gcc capabilities.
212#
213#
214# Check -Wl,--export-dynamic, needed for creating shared objects.
215#
216# Check whether we can link to a particular function, not just whether we can link.
217# In fact, we must actually check that the resulting program runs.
218#
219    a68g_ac_arg="-Wl,--export-dynamic"
220    AC_MSG_CHECKING([if $CC accepts $a68g_ac_arg])
221    a68g_ac_save_LDFLAGS=$LDFLAGS
222    LDFLAGS="$a68g_ac_save_LDFLAGS $a68g_ac_arg"
223    AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void exit (); void (*fptr) () = exit;],[])],
224      [AC_MSG_RESULT(yes)
225       AC_DEFINE(HAVE_EXPORT_DYNAMIC, 1, [Define this if EXPORT_DYNAMIC is recognised])
226      ],
227      [AC_MSG_RESULT(no)
228       AC_MSG_WARN([--export-dynamic is not accepted; configuring interpreter-only])
229       a68g_ac_compiler=no
230       LDFLAGS=$a68g_ac_save_LDFLAGS
231      ],
232      [AC_MSG_RESULT(assuming no)
233       AC_MSG_WARN([--export-dynamic is not accepted; configuring interpreter-only])
234       a68g_ac_compiler=no
235       LDFLAGS=$a68g_ac_save_LDFLAGS
236      ]
237    )
238  fi
239  AM_CONDITIONAL([EXPORT_DYNAMIC], [test "x$a68g_ac_compiler" = "xyes"])
240#
241# Optionally, tune for a specific processor.
242#
243  if test "x$enable_arch" != "xno"; then
244    AC_MSG_CHECKING([whether $CC accepts -march=$enable_arch])
245    a68g_ac_save_CFLAGS=$CFLAGS
246    a68g_ac_march="-march=$enable_arch"
247    CFLAGS="$a68g_ac_save_CFLAGS $a68g_ac_march"
248    _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
249      [AC_MSG_RESULT(yes)
250       AC_DEFINE_UNQUOTED(HAVE_TUNING, "$a68g_ac_march", [Define this if user wants to tune for a specific CPU])
251      ],
252      [AC_MSG_RESULT(no)
253       AC_MSG_WARN([your CPU name is not accepted; resetting to default])
254       CFLAGS="$a68g_ac_save_CFLAGS"
255      ]
256    )
257  fi
258#
259# Some platforms want another or no PIC option.
260#
261if test "x$enable_compiler" = "xyes"; then
262  if test "x$enable_pic" != "xno"; then
263    AC_MSG_CHECKING([whether $CC accepts $enable_pic])
264    a68g_ac_save_CFLAGS=$CFLAGS
265    CFLAGS="$a68g_ac_save_CFLAGS $enable_pic"
266    _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
267      [AC_MSG_RESULT(yes)
268       AC_DEFINE_UNQUOTED(HAVE_PIC, "$enable_pic", [Define this as PIC option])
269      ],
270      [AC_MSG_RESULT(no)
271       AC_MSG_WARN([your PIC option is not accepted; configuring interpreter-only])
272      ]
273    )
274    CFLAGS="$a68g_ac_save_CFLAGS"
275  fi
276fi
277
278AM_PROG_CC_C_O
279AC_PROG_CPP
280AC_MSG_NOTICE([types...])
281AC_C_CHAR_UNSIGNED
282AC_TYPE_MODE_T
283AC_TYPE_SIZE_T
284AC_TYPE_SSIZE_T
285AC_TYPE_UINT16_T
286
287AC_MSG_CHECKING([__off_t or off_t])
288AC_COMPILE_IFELSE(
289[AC_LANG_SOURCE([
290#include <unistd.h>
291#include <sys/types.h>
292__off_t dummy;
293])],
294  [AC_MSG_RESULT([__off_t])],
295  [AC_MSG_RESULT([off_t])
296   AC_DEFINE(__off_t, off_t, [Define this if we have no __off_t])]
297)
298
299AC_MSG_CHECKING([__pid_t or pid_t])
300AC_COMPILE_IFELSE(
301[AC_LANG_SOURCE[
302#include <unistd.h>
303#include <sys/types.h>
304__pid_t dummy;
305])],
306  [AC_MSG_RESULT([__pid_t])
307   AC_DEFINE(a68g_pid_t, __pid_t, [Define this if we have __pid_t])],
308  [AC_MSG_RESULT([pid_t])
309   AC_DEFINE(a68g_pid_t, pid_t, [Define this if we have no __pid_t])]
310)
311
312AC_MSG_CHECKING([__mode_t or mode_t])
313AC_COMPILE_IFELSE(
314[AC_LANG_SOURCE([
315#include <unistd.h>
316#include <sys/types.h>
317__mode_t dummy;
318])],
319  [AC_MSG_RESULT([__mode_t])],
320  [AC_MSG_RESULT([mode_t])
321   AC_DEFINE(__mode_t, mode_t, [Define this if we have no __mode_t])]
322)
323
324#
325# Extra include directories.
326#
327
328AC_MSG_NOTICE([extra include directories...])
329if test -d /usr/local/pgsql/include; then
330  AC_DEFINE(HAVE_USR_LOCAL_PGSQL_INCLUDE, 1, [Define this if /usr/local/pgsql/include was detected])
331  CFLAGS="$CFLAGS -I/usr/local/pgsql/include"
332  CPPFLAGS="$CPPFLAGS -I/usr/local/pgsql/include"
333  CXXFLAGS="$CXXFLAGS -I/usr/local/pgsql/include"
334  LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib"
335fi
336
337if test -d /usr/pkg/pgsql/include; then
338  AC_DEFINE(HAVE_USR_PKG_PGSQL_INCLUDE, 1, [Define this if /usr/pkg/pgsql/include was detected])
339  CFLAGS="$CFLAGS -I/usr/pkg/pgsql/include"
340  CPPFLAGS="$CPPFLAGS -I/usr/pkg/pgsql/include"
341  CXXFLAGS="$CXXFLAGS -I/usr/pkg/pgsql/include"
342  LDFLAGS="$LDFLAGS -L/usr/pkg/pgsql/lib"
343fi
344
345if test -d /opt/local/pgsql/include; then
346  AC_DEFINE(HAVE_OPT_LOCAL_PGSQL_INCLUDE, 1, [Define this if /opt/local/pgsql/include was detected])
347  CFLAGS="$CFLAGS -I/opt/local/pgsql/include"
348  CPPFLAGS="$CPPFLAGS -I/opt/local/pgsql/include"
349  CXXFLAGS="$CXXFLAGS -I/opt/local/pgsql/include"
350  LDFLAGS="$LDFLAGS -L/opt/local/pgsql/lib"
351fi
352
353if test -d /usr/include/postgresql; then
354  AC_DEFINE(HAVE_USR_INCLUDE_POSTGRESQL, 1, [Define this if /usr/include/postgresql was detected])
355  CFLAGS="$CFLAGS -I/usr/include/postgresql"
356  CPPFLAGS="$CPPFLAGS -I/usr/include/postgresql"
357  CXXFLAGS="$CXXFLAGS -I/usr/include/postgresql"
358  LDFLAGS="$LDFLAGS -L/usr/lib"
359fi
360#
361# Checks for header files.
362#
363
364AC_MSG_NOTICE([standard header files...])
365#
366# <math.h> test is GSL proof.
367#
368
369AC_CHECK_HEADERS([math.h])
370AC_CHECK_LIB([m], [cos])
371
372AC_HEADER_STDC
373AC_HEADER_ASSERT
374AC_HEADER_DIRENT
375AC_HEADER_SYS_WAIT
376AC_HEADER_TIOCGWINSZ
377
378AC_CHECK_HEADERS([assert.h ctype.h errno.h fcntl.h float.h limits.h netdb.h netinet/in.h regex.h setjmp.h signal.h stdarg.h stddef.h stdio.h sys/ioctl.h sys/resource.h sys/socket.h sys/time.h termios.h time.h])
379
380#
381# Functions we expect
382#
383
384AC_MSG_NOTICE([standard functions...])
385AC_CHECK_FUNCS(exit)
386AC_CHECK_FUNCS(fprintf)
387AC_CHECK_FUNCS(free)
388AC_CHECK_FUNCS(longjmp)
389AC_CHECK_FUNCS(malloc)
390AC_CHECK_FUNCS(memcpy)
391AC_CHECK_FUNCS(memmove)
392AC_CHECK_FUNCS(memset)
393AC_CHECK_FUNCS(printf)
394AC_CHECK_FUNCS(setjmp)
395AC_CHECK_FUNCS(signal)
396AC_CHECK_FUNCS(snprintf)
397AC_CHECK_FUNCS(strcmp)
398AC_CHECK_FUNCS(strncmp)
399AC_CHECK_FUNCS(strncpy)
400
401AC_MSG_NOTICE([optional headers and libraries...])
402
403if test "x$enable_curses" = "xyes"; then
404  AC_CHECK_HEADERS([curses.h], [], [enable_curses=no], [])
405  if test "x$enable_curses" = "xno"; then
406    AC_CHECK_HEADERS([ncurses/curses.h], [enable_curses=yes], [], [])
407  fi
408  if test "x$enable_curses" = "xyes"; then
409    AC_CHECK_LIB([ncurses], [initscr], [], [enable_curses=no])
410    if test "x$enable_curses" = "xyes"; then
411      if test "x$enable_readline" = "xyes"; then
412        AC_CHECK_HEADERS([readline/readline.h], [], [enable_readline=no], [])
413        AC_CHECK_HEADERS([readline/history.h], [], [enable_readline=no], [])
414        if test "x$enable_readline" = "xyes"; then
415          AC_CHECK_LIB([readline], [readline], [], [enable_readline=no], [-lcurses])
416          if test "x$enable_readline" = "xyes"; then
417            AC_DEFINE(HAVE_READLINE, 1, [Define this if readline was detected])
418          fi
419        fi
420      fi
421    fi
422    if test "x$enable_curses" = "xno"; then
423      AC_CHECK_LIB([curses], [initscr], [enable_curses=yes], [])
424    fi
425    if test "x$enable_curses" = "xyes"; then
426      AC_DEFINE(HAVE_CURSES, 1, [Define this if curses was detected])
427    fi
428  fi
429fi
430
431if test "x$enable_plotutils" = "xyes"; then
432  AC_MSG_NOTICE([GNU plotutils...])
433  AC_CHECK_HEADERS([plot.h], [], [enable_plotutils=no], [])
434  A68G_AC_PLOTUTILS(pl_alabel_r)
435  if test "x$enable_plotutils" = "xyes"; then
436    A68G_AC_PLOTUTILS(pl_bgcolor_r)
437    A68G_AC_PLOTUTILS(pl_bgcolorname_r)
438    A68G_AC_PLOTUTILS(pl_color_r)
439    A68G_AC_PLOTUTILS(pl_colorname_r)
440    A68G_AC_PLOTUTILS(pl_erase_r)
441    A68G_AC_PLOTUTILS(pl_fbox_r)
442    A68G_AC_PLOTUTILS(pl_fcircle_r)
443    A68G_AC_PLOTUTILS(pl_fillcolor_r)
444    A68G_AC_PLOTUTILS(pl_fillcolorname_r)
445    A68G_AC_PLOTUTILS(pl_filltype_r)
446    A68G_AC_PLOTUTILS(pl_fline_r)
447    A68G_AC_PLOTUTILS(pl_fmove_r)
448    A68G_AC_PLOTUTILS(pl_fontname_r)
449    A68G_AC_PLOTUTILS(pl_fontsize_r)
450    A68G_AC_PLOTUTILS(pl_fpoint_r)
451    A68G_AC_PLOTUTILS(pl_linemod_r)
452    A68G_AC_PLOTUTILS(pl_linewidth_r)
453    A68G_AC_PLOTUTILS(pl_newplparams)
454    A68G_AC_PLOTUTILS(pl_openpl_r)
455    A68G_AC_PLOTUTILS(pl_pencolor_r)
456    A68G_AC_PLOTUTILS(pl_pencolorname_r)
457    A68G_AC_PLOTUTILS(pl_setplparam)
458    A68G_AC_PLOTUTILS(pl_space_r)
459    A68G_AC_PLOTUTILS(pl_textangle_r)
460  fi
461  if test "x$enable_plotutils" = "xyes"; then
462    AC_CHECK_LIB([plot], [pl_alabel_r])
463    AC_DEFINE(HAVE_GNU_PLOTUTILS, 1, [Define this if a good GNU plotutils installation was detected])
464  fi
465fi
466
467if test "x$enable_gsl" = "xyes"; then
468  AC_MSG_NOTICE([GNU scientific library...])
469  AC_CHECK_HEADERS([gsl/gsl_blas.h gsl/gsl_complex.h gsl/gsl_complex_math.h gsl/gsl_errno.h gsl/gsl_fft_complex.h gsl/gsl_integration.h gsl/gsl_linalg.h gsl/gsl_math.h gsl/gsl_matrix.h gsl/gsl_permutation.h gsl/gsl_sf.h gsl/gsl_vector.h], [], [enable_gsl=no], [])
470  AC_CHECK_LIB([gslcblas], [cblas_dgemm], [], [enable_gsl=no])
471  A68G_AC_GSL(gsl_blas_ddot)
472  if test "x$enable_gsl" = "xyes"; then
473    A68G_AC_GSL(gsl_blas_dgemm)
474    A68G_AC_GSL(gsl_blas_dgemv)
475    A68G_AC_GSL(gsl_blas_zaxpy)
476    A68G_AC_GSL(gsl_blas_zdotc)
477    A68G_AC_GSL(gsl_blas_zdscal)
478    A68G_AC_GSL(gsl_blas_zgemm)
479    A68G_AC_GSL(gsl_blas_zgemv)
480    A68G_AC_GSL(gsl_blas_zscal)
481    A68G_AC_GSL(gsl_complex_arccosh)
482    A68G_AC_GSL(gsl_complex_arcsinh)
483    A68G_AC_GSL(gsl_complex_arctanh)
484    A68G_AC_GSL(gsl_complex_cosh)
485    A68G_AC_GSL(gsl_complex_inverse)
486    A68G_AC_GSL(gsl_complex_mul)
487    A68G_AC_GSL(gsl_complex_sinh)
488    A68G_AC_GSL(gsl_complex_tanh)
489    A68G_AC_GSL(gsl_fft_complex_backward)
490    A68G_AC_GSL(gsl_fft_complex_forward)
491    A68G_AC_GSL(gsl_fft_complex_inverse)
492    A68G_AC_GSL(gsl_fft_complex_wavetable_alloc)
493    A68G_AC_GSL(gsl_fft_complex_wavetable_free)
494    A68G_AC_GSL(gsl_fft_complex_workspace_alloc)
495    A68G_AC_GSL(gsl_fft_complex_workspace_free)
496    A68G_AC_GSL(gsl_integration_qagiu)
497    A68G_AC_GSL(gsl_integration_workspace_alloc)
498    A68G_AC_GSL(gsl_integration_workspace_free)
499    A68G_AC_GSL(gsl_linalg_LU_decomp)
500    A68G_AC_GSL(gsl_linalg_LU_det)
501    A68G_AC_GSL(gsl_linalg_LU_invert)
502    A68G_AC_GSL(gsl_linalg_LU_refine)
503    A68G_AC_GSL(gsl_linalg_LU_solve)
504    A68G_AC_GSL(gsl_linalg_QR_decomp)
505    A68G_AC_GSL(gsl_linalg_QR_lssolve)
506    A68G_AC_GSL(gsl_linalg_QR_solve)
507    A68G_AC_GSL(gsl_linalg_SV_decomp)
508    A68G_AC_GSL(gsl_linalg_SV_solve)
509    A68G_AC_GSL(gsl_linalg_cholesky_decomp)
510    A68G_AC_GSL(gsl_linalg_cholesky_solve)
511    A68G_AC_GSL(gsl_linalg_complex_LU_decomp)
512    A68G_AC_GSL(gsl_linalg_complex_LU_det)
513    A68G_AC_GSL(gsl_linalg_complex_LU_invert)
514    A68G_AC_GSL(gsl_linalg_complex_LU_refine)
515    A68G_AC_GSL(gsl_linalg_complex_LU_solve)
516    A68G_AC_GSL(gsl_matrix_add)
517    A68G_AC_GSL(gsl_matrix_alloc)
518    A68G_AC_GSL(gsl_matrix_complex_add)
519    A68G_AC_GSL(gsl_matrix_complex_alloc)
520    A68G_AC_GSL(gsl_matrix_complex_free)
521    A68G_AC_GSL(gsl_matrix_complex_get)
522    A68G_AC_GSL(gsl_matrix_complex_isnull)
523    A68G_AC_GSL(gsl_matrix_complex_scale)
524    A68G_AC_GSL(gsl_matrix_complex_set)
525    A68G_AC_GSL(gsl_matrix_complex_set_zero)
526    A68G_AC_GSL(gsl_matrix_complex_sub)
527    A68G_AC_GSL(gsl_matrix_complex_transpose)
528    A68G_AC_GSL(gsl_matrix_free)
529    A68G_AC_GSL(gsl_matrix_get)
530    A68G_AC_GSL(gsl_matrix_isnull)
531    A68G_AC_GSL(gsl_matrix_scale)
532    A68G_AC_GSL(gsl_matrix_set)
533    A68G_AC_GSL(gsl_matrix_set_zero)
534    A68G_AC_GSL(gsl_matrix_sub)
535    A68G_AC_GSL(gsl_matrix_transpose)
536    A68G_AC_GSL(gsl_permutation_alloc)
537    A68G_AC_GSL(gsl_permutation_free)
538    A68G_AC_GSL(gsl_permutation_get)
539    A68G_AC_GSL(gsl_set_error_handler)
540    A68G_AC_GSL(gsl_set_error_handler_off)
541    A68G_AC_GSL(gsl_sf_airy_Ai_deriv_e)
542    A68G_AC_GSL(gsl_sf_airy_Ai_e)
543    A68G_AC_GSL(gsl_sf_airy_Bi_deriv_e)
544    A68G_AC_GSL(gsl_sf_airy_Bi_e)
545    A68G_AC_GSL(gsl_sf_bessel_In_e)
546    A68G_AC_GSL(gsl_sf_bessel_In_scaled_e)
547    A68G_AC_GSL(gsl_sf_bessel_Inu_e)
548    A68G_AC_GSL(gsl_sf_bessel_Inu_scaled_e)
549    A68G_AC_GSL(gsl_sf_bessel_Jn_e)
550    A68G_AC_GSL(gsl_sf_bessel_Jnu_e)
551    A68G_AC_GSL(gsl_sf_bessel_Kn_e)
552    A68G_AC_GSL(gsl_sf_bessel_Kn_scaled_e)
553    A68G_AC_GSL(gsl_sf_bessel_Knu_e)
554    A68G_AC_GSL(gsl_sf_bessel_Knu_scaled_e)
555    A68G_AC_GSL(gsl_sf_bessel_Yn_e)
556    A68G_AC_GSL(gsl_sf_bessel_Ynu_e)
557    A68G_AC_GSL(gsl_sf_bessel_il_scaled_e)
558    A68G_AC_GSL(gsl_sf_bessel_jl_e)
559    A68G_AC_GSL(gsl_sf_bessel_kl_scaled_e)
560    A68G_AC_GSL(gsl_sf_bessel_yl_e)
561    A68G_AC_GSL(gsl_sf_beta_e)
562    A68G_AC_GSL(gsl_sf_beta_inc_e)
563    A68G_AC_GSL(gsl_sf_ellint_Ecomp_e)
564    A68G_AC_GSL(gsl_sf_ellint_Kcomp_e)
565    A68G_AC_GSL(gsl_sf_ellint_RC_e)
566    A68G_AC_GSL(gsl_sf_ellint_RD_e)
567    A68G_AC_GSL(gsl_sf_ellint_RF_e)
568    A68G_AC_GSL(gsl_sf_ellint_RJ_e)
569    A68G_AC_GSL(gsl_sf_erf_e)
570    A68G_AC_GSL(gsl_sf_erfc_e)
571    A68G_AC_GSL(gsl_sf_fact)
572    A68G_AC_GSL(gsl_sf_gamma_e)
573    A68G_AC_GSL(gsl_sf_gamma_inc_P_e)
574    A68G_AC_GSL(gsl_sf_lngamma_e)
575    A68G_AC_GSL(gsl_strerror)
576    A68G_AC_GSL(gsl_vector_add)
577    A68G_AC_GSL(gsl_vector_alloc)
578    A68G_AC_GSL(gsl_vector_complex_alloc)
579    A68G_AC_GSL(gsl_vector_complex_free)
580    A68G_AC_GSL(gsl_vector_complex_get)
581    A68G_AC_GSL(gsl_vector_complex_isnull)
582    A68G_AC_GSL(gsl_vector_complex_set)
583    A68G_AC_GSL(gsl_vector_complex_set_zero)
584    A68G_AC_GSL(gsl_vector_free)
585    A68G_AC_GSL(gsl_vector_get)
586    A68G_AC_GSL(gsl_vector_isnull)
587    A68G_AC_GSL(gsl_vector_scale)
588    A68G_AC_GSL(gsl_vector_set)
589    A68G_AC_GSL(gsl_vector_set_zero)
590    A68G_AC_GSL(gsl_vector_sub)
591  fi
592  if test "x$enable_gsl" = "xyes"; then
593    AC_CHECK_LIB([gsl], [gsl_blas_ddot])
594    AC_DEFINE(HAVE_GNU_GSL, 1, [Define this if a good GNU GSL installation was detected])
595  fi
596fi
597
598if test "x$enable_parallel" = "xyes"; then
599  AC_MSG_NOTICE([POSIX pthreads...])
600  AC_CHECK_HEADERS([pthread.h], [], [enable_parallel=no], [])
601  A68G_AC_PTHREAD(pthread_attr_getstacksize)
602  if test "x$enable_parallel" = "xyes"; then
603    A68G_AC_PTHREAD(pthread_attr_init)
604    A68G_AC_PTHREAD(pthread_attr_setstacksize)
605    A68G_AC_PTHREAD(pthread_create)
606    A68G_AC_PTHREAD(pthread_equal)
607    A68G_AC_PTHREAD(pthread_exit)
608    A68G_AC_PTHREAD(pthread_join)
609    A68G_AC_PTHREAD(pthread_mutex_lock)
610    A68G_AC_PTHREAD(pthread_mutex_unlock)
611    A68G_AC_PTHREAD(pthread_self)
612  fi
613  if test "x$enable_parallel" = "xyes"; then
614    AC_CHECK_LIB([pthread], pthread_attr_getstacksize)
615    AC_DEFINE(HAVE_PARALLEL_CLAUSE, 1, [Define this if a good pthread installation was detected])
616  fi
617fi
618
619if test "x$enable_postgresql" = "xyes"; then
620  AC_MSG_NOTICE([PostgreSQL...])
621  AC_CHECK_HEADERS([libpq-fe.h], [], [enable_postgresql=no], [])
622  A68G_AC_POSTGRESQL(PQbackendPID)
623  if test "x$enable_postgresql" = "xyes"; then
624    A68G_AC_POSTGRESQL(PQclear)
625    A68G_AC_POSTGRESQL(PQcmdStatus)
626    A68G_AC_POSTGRESQL(PQcmdTuples)
627    A68G_AC_POSTGRESQL(PQconnectdb)
628    A68G_AC_POSTGRESQL(PQdb)
629    A68G_AC_POSTGRESQL(PQerrorMessage)
630    A68G_AC_POSTGRESQL(PQexec)
631    A68G_AC_POSTGRESQL(PQfformat)
632    A68G_AC_POSTGRESQL(PQfinish)
633    A68G_AC_POSTGRESQL(PQfname)
634    A68G_AC_POSTGRESQL(PQfnumber)
635    A68G_AC_POSTGRESQL(PQgetisnull)
636    A68G_AC_POSTGRESQL(PQgetvalue)
637    A68G_AC_POSTGRESQL(PQhost)
638    A68G_AC_POSTGRESQL(PQnfields)
639    A68G_AC_POSTGRESQL(PQntuples)
640    A68G_AC_POSTGRESQL(PQoptions)
641    A68G_AC_POSTGRESQL(PQparameterStatus)
642    A68G_AC_POSTGRESQL(PQpass)
643    A68G_AC_POSTGRESQL(PQport)
644    A68G_AC_POSTGRESQL(PQprotocolVersion)
645    A68G_AC_POSTGRESQL(PQreset)
646    A68G_AC_POSTGRESQL(PQresultErrorMessage)
647    A68G_AC_POSTGRESQL(PQresultStatus)
648    A68G_AC_POSTGRESQL(PQserverVersion)
649    A68G_AC_POSTGRESQL(PQsocket)
650    A68G_AC_POSTGRESQL(PQstatus)
651    A68G_AC_POSTGRESQL(PQtty)
652    A68G_AC_POSTGRESQL(PQuser)
653  fi
654  if test "x$enable_postgresql" = "xyes"; then
655    AC_CHECK_LIB([pq], [PQbackendPID])
656    AC_DEFINE(HAVE_POSTGRESQL, 1, [Define this if a good PostgreSQL installation was detected])
657  fi
658fi
659
660if test "x$enable_compiler" = "xyes"; then
661  AC_MSG_NOTICE([Dynamic loader...])
662  AC_CHECK_HEADERS([dlfcn.h])
663  A68G_AC_DL(dlopen)
664  if test "x$enable_compiler" = "xyes"; then
665    A68G_AC_DL(dlsym)
666    A68G_AC_DL(dlerror)
667    A68G_AC_DL(dlclose)
668  fi
669  if test "x$enable_compiler" = "xyes"; then
670    AC_CHECK_LIB([dl], [dlopen])
671    AC_DEFINE(HAVE_DL, 1, [Define this if a good DL installation was detected])
672  fi
673fi
674
675#
676# Generate files.
677#
678
679AC_CONFIG_FILES([Makefile])
680AC_OUTPUT
681AC_MSG_NOTICE([])
682AC_MSG_NOTICE([AC_PACKAGE_NAME-AC_PACKAGE_VERSION by Marcel van der Veer <algol68g@xs4all.nl>])
683if test "x$a68g_exists" = "xyes"; then
684  AC_MSG_NOTICE([AC_PACKAGE_NAME already exists on this system])
685fi
686if test "x$enable_parallel" = "xyes"; then
687  AC_MSG_NOTICE([building with parallel clause])
688fi
689if test "x$enable_plotutils" = "xyes"; then
690  AC_MSG_NOTICE([building with GNU plotutils])
691fi
692if test "x$enable_gsl" = "xyes"; then
693  AC_MSG_NOTICE([building with GNU scientific library])
694fi
695if test "x$enable_postgresql" = "xyes"; then
696  AC_MSG_NOTICE([building with PostgreSQL])
697fi
698if test "x$enable_compiler" = "xyes"; then
699  AC_MSG_NOTICE([building compiler-interpreter])
700else
701  AC_MSG_NOTICE([building interpreter-only])
702fi
703AC_MSG_NOTICE([now type 'make' optionally followed by 'make check' or 'make install'])
704