1 dnl Process this file with autoconf to produce a configure script.
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)
11 VERSION_NODOT=\"$VER\"
13 VER_DATE=\"$VER_DATE\"
15 AC_SUBST(VERSION_NODOT)
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"
26 AC_CONFIG_HEADER(config.h)
29 dnl Checks for system first
36 GCI_CONVERT_HEADER="gci_convert.unsupported"
39 SYS_DEFS="-D_HPUX_SOURCE"
42 SYS_DEFS="-D_ALL_SOURCE"
43 # mymakefile="Makefile.aix"
47 SYS_DEFS="$valid_arch_flags"
48 EEXTRA="$valid_arch_flags"
55 GCI_CONVERT_HEADER="gci_convert.solaris.i86"
59 GCI_CONVERT_HEADER="gci_convert.solaris.sparc"
65 GCI_CONVERT_HEADER="gci_convert.linux.i86"
69 GCI_CONVERT_HEADER="gci_convert.linux.86_64"
73 GCI_CONVERT_HEADER="gci_convert.linux.alpha"
77 GCI_CONVERT_HEADER="gci_convert.linux.powerpc64"
81 GCI_CONVERT_HEADER="gci_convert.cygwin.i86"
97 dnl include our 32/64bit tests
99 sinclude(common/inclibarch.m4)
101 AC_SUBST(GCI_CONVERT_HEADER)
103 dnl Check for dynamic shared library support libraries
106 SHLIBS="${MH_EXTRA_LIBS}"
108 dnl Check for extra required libraries - don't include libfl or libl
110 MH_CHECK_LIB(m nsl nsl_s socket net)
111 dnl -- check for crypt library and function
113 if test "$on_qnx4" = "no"; then
116 BOTHLIBS="${LEXLIB} ${MH_EXTRA_LIBS}"
119 if test "$mh_have_proto" = "no"; then
120 AC_MSG_ERROR(Regina requires an ANSI compiler; cannot continue)
125 dnl --------------------- Check for other programs. ---------------
129 dnl -------------------- Checks for header files. -----------------
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.
193 MH_CHECK__SIGHANDLER_T
194 MH_STRUCT_RANDOM_DATA
195 MH_CHECK_BUILTIN_RETURN_ADDRESS
197 MH_CHECK_TYPE_SOCKLEN_T
198 AC_CHECK_TYPES([union semun],[],[],
199 [#include <sys/types.h>
201 #include <sys/sem.h>])
203 MH_CHECK_F_MNTFROMNAME
205 dnl Checks for library functions.
208 if test $ac_cv_func_alloca_works = yes; then
214 ALLOCA_SHO="alloca.so.o"
215 ALLOCA_TSO="alloca.tso.o"
223 if test $ac_cv_header_fnmatch_h = yes; then
229 FNMATCH_SHO="fnmatch.so.o"
230 FNMATCH_TSO="fnmatch.tso.o"
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],
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
265 [ --disable-gci disable General Call Interface],
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)"
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
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
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
317 CFLAGS="$save_cflags"
318 REGINAMULTITHREAD="yes"
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],
330 if test "$with_tracemem" = yes; then
331 TRACEMEM="-DTRACEMEM"
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],
343 if test "$with_flists" = no; then
350 dnl --------------- allow --with-socket to specify socket for rxstack
352 [ --with-socket=9999 socket to use for external queues (default 5757)],
353 [with_socket=$withval],
356 if test "$with_socket" = no; then
359 REXXSOCKET="-DRXSOCKET=$with_socket"
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)
379 dnl --------------- Check how to make shared libraries -------------------
380 dnl MH_SHARED_LIBRARY must be called after determining if POSIX threads is specified
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)
392 dnl --------------- Force definition of pre-compiler macro 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
403 echo "Regina has now been configured with the following options:"
405 if test "x$SHL_TARGETS" = "x"; then
406 echo " Dynamic Loading Support: none"
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
433 if test "$with_flists" = no; then
434 myopts="$myopts NO_FLISTS"
436 if test "$with_socket" = no; then
439 myopts="$myopts SOCKET=$with_socket"
442 if test "$with_staticfunctions" = "yes"; then
444 if test "$with_testpackage" = "yes"; then
445 myfuncs="$myfuncs test"
447 if test "$with_regutil" = "yes"; then
448 myfuncs="$myfuncs regutil"
450 if test "$with_rexxcurses" = "yes"; then
451 myfuncs="$myfuncs rexxcurses"
453 if test "$with_rexxtk" = "yes"; then
454 myfuncs="$myfuncs rexxtk"
456 if test "$with_rexxgd" = "yes"; then
457 myfuncs="$myfuncs rexxgd"
459 if test "$with_rexxcurl" = "yes"; then
460 myfuncs="$myfuncs rexxcurl"
462 if test "$with_rexxsql" = "yes"; then
463 myfuncs="$myfuncs rexxsql"
465 if test "$with_rexxeec" = "yes"; then
466 myfuncs="$myfuncs rexxeec"
468 if test "$with_rexxisam" = "yes"; then
469 myfuncs="$myfuncs rexxisam"
471 if test "$with_rxsock" = "yes"; then
472 myfuncs="$myfuncs rxsock"
474 if test "$with_rexxdw" = "yes"; then
475 myfuncs="$myfuncs rexxdw"
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"
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'"