Copy icons and docs.
[AROS-Contrib.git] / regina / configure.in
blob785ed53c94b4784f15f3f276499594313ac3f43a
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl *******************WARNING****************************
4 dnl Using an autoconf later than 2.61 will result in configure
5 dnl failing to run on QNX4
6 dnl *******************WARNING****************************
7 AC_INIT(Regina REXX Interpreter, "", mark@rexx.org, Regina-REXX)
8 AC_PREFIX_DEFAULT(/usr/local)
10 . $srcdir/regina.ver
11 VERSION_NODOT=\"$VER\"
12 VERSION=\"$VER_DOT\"
13 VER_DATE=\"$VER_DATE\"
14 AC_SUBST(VERSION)
15 AC_SUBST(VERSION_NODOT)
16 AC_SUBST(VER_DATE)
17 AC_SUBST(VER_MAJOR)
18 AC_SUBST(VER_MINOR)
19 AC_SUBST(VER_SUPP)
21 dnl ---------------------- check for C compiler -----------------
22 dnl Checks for one of the C compilers below - change if yours not there.
23 CC_LIST="xlC xlc gcc cc c89 acc"
24 MH_PROG_CC
26 AC_CONFIG_HEADER(config.h)
27 AC_ISC_POSIX
29 dnl Checks for system first
30 AC_CANONICAL_SYSTEM
32 mymakefile="Makefile"
33 on_qnx4=no
34 on_beos=no
35 gci_available=no
36 GCI_CONVERT_HEADER="gci_convert.unsupported"
37 case "$target" in
38    *hp-hpux*)
39       SYS_DEFS="-D_HPUX_SOURCE"
40       ;;
41    *ibm-aix*)
42       SYS_DEFS="-D_ALL_SOURCE"
43 #     mymakefile="Makefile.aix"
44       ;;
45    *apple-darwin*)
46       MH_CHECK_OSX_ARCH()
47       SYS_DEFS="$valid_arch_flags"
48       EEXTRA="$valid_arch_flags"
49       ;;
50    *dec-osf*)
51       ;;
52    *sequent-dynix*)
53       ;;
54    i*86*solaris*)
55       GCI_CONVERT_HEADER="gci_convert.solaris.i86"
56       gci_available=yes
57       ;;
58    *solaris*)
59       GCI_CONVERT_HEADER="gci_convert.solaris.sparc"
60       gci_available=yes
61       ;;
62    sparc*sunos*)
63       ;;
64    i*86-*linux*)
65       GCI_CONVERT_HEADER="gci_convert.linux.i86"
66       gci_available=yes
67       ;;
68    *86_64-*linux*)
69       GCI_CONVERT_HEADER="gci_convert.linux.86_64"
70       gci_available=yes
71       ;;
72    alpha*-*linux*)
73       GCI_CONVERT_HEADER="gci_convert.linux.alpha"
74       gci_available=yes
75       ;;
76    powerpc64-*linux*)
77       GCI_CONVERT_HEADER="gci_convert.linux.powerpc64"
78       gci_available=yes
79       ;;
80    *cygwin*)
81       GCI_CONVERT_HEADER="gci_convert.cygwin.i86"
82       gci_available=yes
83       ;;
84    *nto-qnx*)
85       ;;
86    *qnx*)
87       on_qnx4=yes
88       SYS_DEFS="-Q"
89       ;;
90    *beos*)
91       on_beos=yes
92       ;;
93 esac
94 AC_SUBST(SYS_DEFS)
96 dnl
97 dnl include our 32/64bit tests
98 dnl
99 sinclude(common/inclibarch.m4)
101 AC_SUBST(GCI_CONVERT_HEADER)
103 dnl Check for dynamic shared library support libraries
104 MH_EXTRA_LIBS=""
105 MH_CHECK_LIB(dld dl)
106 SHLIBS="${MH_EXTRA_LIBS}"
108 dnl Check for extra required libraries - don't include libfl or libl
109 MH_EXTRA_LIBS=""
110 MH_CHECK_LIB(m nsl nsl_s socket net)
111 dnl -- check for crypt library and function
112 MH_CHECK_CRYPT
113 if test "$on_qnx4" = "no"; then
114   AC_PROG_LEX
116 BOTHLIBS="${LEXLIB} ${MH_EXTRA_LIBS}"
118 MH_HAVE_PROTO
119 if test "$mh_have_proto" = "no"; then
120    AC_MSG_ERROR(Regina requires an ANSI compiler; cannot continue)
123 AC_PROG_RANLIB
125 dnl --------------------- Check for other programs. ---------------
126 AC_PROG_LN_S
127 AC_PROG_MAKE_SET
129 dnl -------------------- Checks for header files. -----------------
130 AC_HEADER_STDC
131 AC_CHECK_HEADERS( \
132    arpa/inet.h  \
133    assert.h \
134    ctype.h \
135    crypt.h \
136    dl.h \
137    errno.h \
138    fcntl.h \
139    fnmatch.h \
140    grp.h \
141    iconv.h \
142    limits.h \
143    malloc.h \
144    math.h \
145    ncurses.h \
146    netdb.h \
147    netinet/in.h \
148    paths.h \
149    poll.h \
150    process.h \
151    pwd.h \
152    setjmp.h \
153    share.h \
154    signal.h \
155    socket.h \
156    stdarg.h \
157    stdio.h \
158    statvfs.h \
159    stdlib.h \
160    stdint.h \
161    string.h \
162    sys/mount.h \
163    sys/poll.h \
164    sys/resource.h \
165    sys/select.h \
166    sys/socket.h \
167    sys/stat.h \
168    sys/statfs.h \
169    sys/statvfs.h \
170    sys/mman.h \
171    sys/time.h \
172    sys/utsname.h \
173    sys/wait.h \
174    termcap.h \
175    time.h \
176    unistd.h \
177    vfs.h
178    )
180 AC_CHECK_FUNCS(sysconf div raise putenv usleep random ftruncate \
181    memcpy memmove strerror strerror_r gettimeofday ftime poll \
182    _fullpath vsprintf _splitpath2 _splitpath sigaction \
183    lstat mkstemp inet_ntop gmtime_r localtime_r \
184    getgrgid_r getpwuid_r gethostbyname_r \
185    readlink realpath getbootfile tgetstr statfs mbstowcs mmap iconv)
187 dnl Checks for typedefs, structures, and compiler characteristics.
188 AC_C_CONST
189 AC_TYPE_SIZE_T
190 AC_HEADER_TIME
191 AC_STRUCT_TM
192 MH_CHECK_CC_O
193 MH_CHECK__SIGHANDLER_T
194 MH_STRUCT_RANDOM_DATA
195 MH_CHECK_BUILTIN_RETURN_ADDRESS
196 MH_C_LONG_LONG
197 MH_CHECK_TYPE_SOCKLEN_T
198 AC_CHECK_TYPES([union semun],[],[],
199 [#include <sys/types.h>
200 #include <sys/ipc.h>
201 #include <sys/sem.h>])
203 MH_CHECK_F_MNTFROMNAME
205 dnl Checks for library functions.
206 AC_FUNC_MEMCMP
207 AC_FUNC_ALLOCA
208 if test $ac_cv_func_alloca_works = yes; then
209    ALLOCA=""
210    ALLOCA_SHO=""
211    ALLOCA_TSO=""
212 else
213    ALLOCA="alloca.o"
214    ALLOCA_SHO="alloca.so.o"
215    ALLOCA_TSO="alloca.tso.o"
217 AC_SUBST(ALLOCA)
218 AC_SUBST(ALLOCA_SHO)
219 AC_SUBST(ALLOCA_TSO)
221 dnl Test for fnmatch
223 if test $ac_cv_header_fnmatch_h = yes; then
224    FNMATCH=""
225    FNMATCH_SHO=""
226    FNMATCH_TSO=""
227 else
228    FNMATCH="fnmatch.o"
229    FNMATCH_SHO="fnmatch.so.o"
230    FNMATCH_TSO="fnmatch.tso.o"
232 AC_SUBST(FNMATCH)
233 AC_SUBST(FNMATCH_SHO)
234 AC_SUBST(FNMATCH_TSO)
236 dnl where are termcap functions
237 AC_SEARCH_LIBS(tgetent, [ncurses termcap curses termlib],REGUTIL_TERM_LIB="$ac_cv_search_tgetent",REGUTIL_TERM_LIB="")
238 AC_SUBST(REGUTIL_TERM_LIB)
241 dnl include our debugging switch checking
243 sinclude(common/incdebug.m4)
245 dnl --------------- allow --enable-orexx-binary-compatible to enable binary compatibility with ORexx
246 AC_ARG_ENABLE(orexx-binary-compatible,
247    [  --enable-orexx-binary-compatible   enable binary compatibility with ORexx],
248    [with_orexx_bc=$enableval],
249    [with_orexx_bc=no],
251 if test "$with_orexx_bc" = yes; then
252    OREXX_BINARY_COMPATIBLE="1"
253    AC_DEFINE(OREXX_BINARY_COMPATIBLE)
256 dnl --------------- allow --disable-posix-threads to disable multi-threading
257 AC_ARG_ENABLE(posix-threads,
258         [  --disable-posix-threads disable POSIX-style multi-threading],
259         [enable_posix_threads=no],
260         [enable_posix_threads=yes],
263 dnl --------------- allow --disable-gci to disable General Call Interface
264 AC_ARG_ENABLE(gci,
265    [  --disable-gci           disable General Call Interface],
266    [with_gci=no],
267    [with_gci=$gci_available],
269 if test "$with_gci" = yes; then
270    GCI_SHO="gci_call.so.o gci_convert.so.o gci_execute.so.o gci_helper.so.o gci_prepare.so.o gci_reginabridge.so.o gci_rxfuncdefine.so.o gci_tree.so.o"
271    HAVE_GCI="-DHAVE_GCI -I\$(gcidir)"
272 else
273    GCI_SHO=""
274    HAVE_GCI=""
276 AC_SUBST(GCI_SHO)
277 AC_SUBST(HAVE_GCI)
279 if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++"; then
280    MH_CHECK_GCC_VERSION_SCRIPT
283 dnl enable_posix_threads="yes"
284 MH_CHECK_POSIX_THREADS
285 if test "$mh_has_pthreads" = yes; then
286    save_cflags="$CFLAGS"
287    CFLAGS="$CFLAGS $THREADING_COMPILE"
289 # Where we know the format of getgrgid_r() function
290 # only test for that case
292    if test "$ac_cv_func_getgrgid_r" = yes; then
293       MH_GETGRGID_R_INT_RETURN_5_PARAMS
294       if test "$mh_cv_getgrgid_r_int5" = "no"; then
295          MH_GETGRGID_R_INT_RETURN_4_PARAMS
296          if test "$mh_cv_getgrgid_r_int4" = "no"; then
297             MH_GETGRGID_R_STRUCT_RETURN
298             if test "$mh_cv_getgrgid_r_int4" = "no"; then
299                MH_GETGRGID_R_STRUCT_RETURN
300             fi
301          fi
302       fi
303    fi
304    if test "$ac_cv_func_getpwuid_r" = yes; then
305       MH_GETPWUID_R_INT_RETURN
306       if test "$mh_cv_getpwuid_r_int" = "no"; then
307          MH_GETPWUID_R_STRUCT_RETURN
308       fi
309    fi
310    if test "$ac_cv_func_gethostbyname_r" = yes; then
311       MH_GETHOSTBYNAME_R_INT_RETURN_6_PARAMS
312       if test "$mh_cv_gethostbyname_r_int6" = "no"; then
313          MH_GETHOSTBYNAME_R_STRUCT_RETURN_5_PARAMS
314       fi
315    fi
317    CFLAGS="$save_cflags"
318    REGINAMULTITHREAD="yes"
319 else
320    REGINAMULTITHREAD="no"
322 AC_SUBST(REGINAMULTITHREAD)
324 dnl --------------- allow --enable-tracemem to enable internal memory tracing
325 AC_ARG_ENABLE(tracemem,
326    [  --enable-tracemem       enable memory tracing in debug mode],
327    [with_tracemem=$enableval],
328    [with_tracemem=no],
330 if test "$with_tracemem" = yes; then
331    TRACEMEM="-DTRACEMEM"
332 else
333    TRACEMEM=""
335 AC_SUBST(TRACEMEM)
337 dnl --------------- allow --disable-flists to disable memory functions
338 AC_ARG_ENABLE(flists,
339    [  --disable-flists        disable memory management functions],
340    [with_flists=$enableval],
341    [with_flists=yes],
343 if test "$with_flists" = no; then
344    FLISTS="-DNOFLISTS"
345 else
346    FLISTS=""
348 AC_SUBST(FLISTS)
350 dnl --------------- allow --with-socket to specify socket for rxstack
351 AC_ARG_WITH(socket,
352    [  --with-socket=9999      socket to use for external queues (default 5757)],
353    [with_socket=$withval],
354    [with_socket=no],
356 if test "$with_socket" = no; then
357    REXXSOCKET=""
358 else
359    REXXSOCKET="-DRXSOCKET=$with_socket"
361 AC_SUBST(REXXSOCKET)
363 dnl --------------- allow --with-staticfunctions to enable linking external function packages statically
364 dnl must be called before MH_SHARED_LIBRARY
365 AC_ARG_WITH(staticfunctions,
366    [  --with-staticfunctions  enable static linking of external function packages],
367    [with_staticfunctions=$withval],
368    [with_staticfunctions=no],
370 if test "$with_staticfunctions" = "yes" -o "$on_qnx4" = "yes"; then
371    STATICLD_SHO="staticld.so.o rxpack.so.o"
372    if test "$with_staticfunctions" = "no"; then
373       MH_STATIC_LOADING(regutil)
374    else
375       MH_STATIC_LOADING
376    fi
377 else
378    STATICLD_SHO=""
379 dnl --------------- Check how to make shared libraries -------------------
380 dnl MH_SHARED_LIBRARY must be called after determining if POSIX threads is specified
381    MH_SHARED_LIBRARY
383 dnl --------------- Check if underscore is needed in loadable modules ----
384 dnl MH_CHECK_LEADING_USCORE must be called after processing --with-dlfcn[inc,lib]dir switches
385    MH_CHECK_LEADING_USCORE
387 AC_SUBST(STATICLD_SHO)
388 MH_SET_SHLPST
390 MH_CHECK_RPM
392 dnl --------------- Force definition of pre-compiler macro UNIX ----------
393 AC_DEFINE(UNIX)
395 dnl --------------- Check what compiler switch sets unsigned char ----------
396 MH_CHECK_UNSIGNED_CHAR_COMPILER_SWITCH()
398 dnl AC_OUTPUT(Makefile)
400 AC_OUTPUT($mymakefile regina-config rxstack.init.d)
401 chmod 755 regina-config
402 echo
403 echo "Regina has now been configured with the following options:"
404 echo
405 if test "x$SHL_TARGETS" = "x"; then
406    echo "         Dynamic Loading Support: none"
407 else
408    echo "         Dynamic Loading Support: supported. Extra components: $SHL_TARGETS"
410 if test "$with_dlfcnincdir" != no ; then
411    echo "                dlfcn headers in: $with_dlfcnincdir"
413 if test "$with_dlfcnlibdir" != no ; then
414    echo "              dlfcn libraries in: $with_dlfcnlibdir"
417 myopts="${bitflag}BIT"
418 if test "$with_debug" = yes ; then
419    myopts="$myopts DEBUG"
421 if test "$with_purify" = yes ; then
422    myopts="$myopts PURIFY"
424 if test "$with_efence" = yes; then
425    myopts="$myopts EFENCE"
427 if test "$with_orexx_bc" = yes; then
428    myopts="$myopts OREXX_BINARY"
430 if test "$with_gci" = yes; then
431    myopts="$myopts GCI"
433 if test "$with_flists" = no; then
434    myopts="$myopts NO_FLISTS"
436 if test "$with_socket" = no; then
437    myopts="$myopts"
438 else
439    myopts="$myopts SOCKET=$with_socket"
442 if test "$with_staticfunctions" = "yes"; then
443    myfuncs=""
444    if test "$with_testpackage" = "yes"; then
445       myfuncs="$myfuncs test"
446    fi
447    if test "$with_regutil" = "yes"; then
448       myfuncs="$myfuncs regutil"
449    fi
450    if test "$with_rexxcurses" = "yes"; then
451       myfuncs="$myfuncs rexxcurses"
452    fi
453    if test "$with_rexxtk" = "yes"; then
454       myfuncs="$myfuncs rexxtk"
455    fi
456    if test "$with_rexxgd" = "yes"; then
457       myfuncs="$myfuncs rexxgd"
458    fi
459    if test "$with_rexxcurl" = "yes"; then
460       myfuncs="$myfuncs rexxcurl"
461    fi
462    if test "$with_rexxsql" = "yes"; then
463       myfuncs="$myfuncs rexxsql"
464    fi
465    if test "$with_rexxeec" = "yes"; then
466       myfuncs="$myfuncs rexxeec"
467    fi
468    if test "$with_rexxisam" = "yes"; then
469       myfuncs="$myfuncs rexxisam"
470    fi
471    if test "$with_rxsock" = "yes"; then
472       myfuncs="$myfuncs rxsock"
473    fi
474    if test "$with_rexxdw" = "yes"; then
475       myfuncs="$myfuncs rexxdw"
476    fi
477    echo "          Static Loaded Packages: $myfuncs"
480 if test "$on_beos" = yes; then
481    bindir="/boot/home/config/bin"
482    libdir="/boot/home/config/lib"
485 echo "                   Build options: $myopts"
486 echo "   binaries will be installed in: $bindir"
487 if test "x$binarybitprefix" = "x32"; then
488    echo "   binaries will have '32' appended to them. eg rexx32, regina32"
490 echo "  libraries will be installed in: $libdir"
491 echo "                        {prefix}: $prefix"
492 echo "                   {exec_prefix}: $exec_prefix"
493 echo "                      RPM topdir: $RPMTOPDIR"
494 echo
495 echo "To build the Regina binaries, and dynamically loadable libraries, type 'make'"
496 echo "To install Regina in the above directories, type 'make install'"
497 echo