1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREFIX_DEFAULT(/usr)
8 dnl ---------------------- check for C compiler -----------------
9 dnl Checks for one of the C compilers below - change if yours not there.
10 CC_LIST="gcc cc c89 acc"
13 AC_CONFIG_HEADER(config.h)
16 dnl Checks for system first
24 SYS_DEFS="-D_HPUX_SOURCE"
27 SYS_DEFS="-D_ALL_SOURCE"
28 mymakefile="Makefile.aix"
52 dnl Check for dynamic shared library support libraries
55 SHLIBS="${MH_EXTRA_LIBS}"
57 dnl Check for extra required libraries - don't include libfl or libl
59 MH_CHECK_LIB(m nsl nsl_s socket)
60 dnl -- check for crypt library and function
63 BOTHLIBS="${LEXLIB} ${MH_EXTRA_LIBS}"
66 if test "$mh_have_proto" = "no"; then
67 AC_MSG_ERROR(Regina requires an ANSI compiler; cannot continue)
70 AC_PROG_GCC_TRADITIONAL
73 dnl --------------------- Check for other programs. ---------------
77 dnl -------------------- Checks for header files. -----------------
111 AC_CHECK_FUNCS(sysconf putenv usleep random ftruncate memcpy memmove strerror strerror_r gettimeofday ftime _fullpath vsprintf _splitpath2 _splitpath sigaction mkstemp)
113 dnl Checks for typedefs, structures, and compiler characteristics.
119 MH_CHECK__SIGHANDLER_T
120 MH_STRUCT_RANDOM_DATA
122 dnl Checks for library functions.
125 if test $ac_cv_func_alloca_works = yes; then
128 ALLOCA_SHO="alloca.sho"
132 dnl --------------- allow --enable-debug to compile in debug mode --------
134 [ --enable-debug turn on debugging],
135 [with_debug=$enableval],
138 cflags_g="`echo $CFLAGS | grep -c '\-g'`"
139 cflags_O="`echo $CFLAGS | grep -c '\-O'`"
141 if test "$with_debug" = yes; then
144 if test "$cflags_g" = "0"; then
145 CFLAGS="${CFLAGS} -g"
147 if test "$cflags_O" != "0"; then
148 CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
153 if test "$cflags_O" = "0"; then
154 CFLAGS="${CFLAGS} -O"
156 if test "$cflags_g" != "0"; then
157 CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
160 if test "$ac_cv_prog_CC" = "gcc"; then
161 if test "$with_debug" = yes; then
162 CFLAGS="${CFLAGS} -Wall"
164 CFLAGS="-O3 -Wall -fomit-frame-pointer"
167 if test "$on_qnx" = yes; then
168 if test "$with_debug" = yes; then
174 if test "$on_beos" = yes; then
175 if test "$with_debug" = yes; then
176 CFLAGS="${CFLAGS} -Wall"
180 sharedir="/boot/home/config/add-ons/rexx"
182 if test "x$prefix" != xNONE; then
183 sharedir="$prefix/share/regina"
185 sharedir="$ac_default_prefix/share/regina"
190 dnl --------------- allow --enable-purify to enable linking with Purify
191 AC_ARG_ENABLE(purify,
192 [ --enable-purify link with Purify (TM)],
193 [with_purify=$enableval],
196 if test "$with_purify" = yes; then
203 dnl --------------- allow --enable-posix-threads to enable multi-threading
204 AC_ARG_ENABLE(posix-threads,
205 [ --enable-posix-threads enable POSIX-style multi-threading],
206 [enable_posix_threads=$enableval],
207 [enable_posix_threads=no],
209 MH_CHECK_POSIX_THREADS
210 if test "$mh_has_pthreads" = yes; then
211 save_cflags="$CFLAGS"
212 CFLAGS="$CFLAGS $THREADING_COMPILE"
214 # Where we know the format of getgrgid_r() function
215 # only test for that case
219 MH_GETGRGID_R_STRUCT_RETURN
222 MH_GETGRGID_R_INT_RETURN_5_PARMS
225 MH_GETGRGID_R_INT_RETURN_5_PARMS
228 MH_GETGRGID_R_INT_RETURN_5_PARMS
229 if test "$mh_cv_getgrgid_r_int5" = "no"; then
230 MH_GETGRGID_R_INT_RETURN_4_PARMS
231 if test "$mh_cv_getgrgid_r_int4" = "no"; then
232 MH_GETGRGID_R_STRUCT_RETURN
236 MH_GETPWUID_R_INT_RETURN
237 if test "$mh_cv_getpwuid_r_int" = "no"; then
238 MH_GETPWUID_R_STRUCT_RETURN
240 CFLAGS="$save_CFLAGS"
241 REGINAMULTITHREAD="yes"
243 REGINAMULTITHREAD="no"
245 AC_SUBST(REGINAMULTITHREAD)
247 dnl --------------- allow --enable-tracemem to enable internal memory tracing
248 AC_ARG_ENABLE(tracemem,
249 [ --enable-tracemem enable memory tracing in debug mode],
250 [with_tracemem=$enableval],
253 if test "$with_tracemem" = yes; then
254 TRACEMEM="-DTRACEMEM"
260 dnl --------------- allow --disable-flists to disable memory functions
261 AC_ARG_ENABLE(flists,
262 [ --disable-flists disable memory management functions],
263 [with_flists=$enableval],
266 if test "$with_flists" = no; then
273 dnl --------------- allow --with-socket to specify socket for rxstack
275 [ --with-socket=9999 socket to use for external queues (default 5757)],
276 [with_socket=$withval],
279 if test "$with_socket" = no; then
282 REXXSOCKET="-DRXSOCKET=$with_socket"
286 dnl --------------- allow --with-dlfcnincdir to enable compiling with dlfcn.h on platforms that don't provide dl*() functions natively
287 AC_ARG_WITH(dlfcnincdir,
288 [ --with-dlfcnincdir location of dlfcn.h],
289 [with_dlfcnincdir=$withval],
290 [with_dlfcnincdir=no],
292 if test "$with_dlfcnincdir" = no; then
294 AC_CHECK_HEADERS( dlfcn.h )
296 if test -f "$with_dlfcnincdir/dlfcn.h"; then
297 DLFCNINCDIR="-I$with_dlfcnincdir"
299 AC_DEFINE(HAVE_DLFCN_H)
301 AC_MSG_ERROR(dlfcn.h not found in \"$with_dlfcnincdir\" as specified in --with-dlfcnincdir switch; cannot continue)
304 AC_SUBST(DLFCNINCDIR)
306 dnl --------------- allow --with-dlfcnlibdir to enable compiling with dlfcn.h on platforms that don't provide dl*() functions natively
307 AC_REQUIRE([MH_SHLPST])
308 AC_ARG_WITH(dlfcnlibdir,
309 [ --with-dlfcnlibdir location of libdl.a(AIX) libdl.dylib(MacOSX)],
310 [with_dlfcnlibdir=$withval],
311 [with_dlfcnlibdir=no],
313 if test "$with_dlfcnlibdir" = no; then
316 if test -f "$with_dlfcnlibdir/libdl$SHLPST"; then
317 DLFCNLIBDIR="-L$with_dlfcnlibdir -ldl"
319 AC_MSG_ERROR(libdl$SHLPST not found in \"$with_dlfcnlibdir\" as specified in --with-dlfcnlibdir switch; cannot continue)
322 AC_SUBST(DLFCNLIBDIR)
324 dnl --------------- Check how to make shared libraries -------------------
325 dnl MH_SHARED_LIBRARY must be called after determining if POSIX threads is specified
328 dnl --------------- Check if underscore is needed in loadable modules ----
329 dnl MH_CHECK_LEADING_USCORE must be called after processing --with-dlfcn[inc,lib]dir switches
330 MH_CHECK_LEADING_USCORE
332 dnl --------------- Force definition of pre-compiler macro UNIX ----------
335 dnl --------------- where to install startup/shutdown scripts ------------
337 if test -d /etc/rc.d/init.d; then
338 STARTUPDIR="/etc/rc.d/init.d"
340 if test -d /etc/init.d; then
341 STARTUPDIR="/etc/init.d"
346 AC_SUBST(VERSION_NODOT)
348 dnl AC_OUTPUT(Makefile)
350 AC_OUTPUT($mymakefile regina-config rxstack.init.d)
351 chmod 755 regina-config
355 mv Makefile.aix Makefile
356 AC_MSG_RESULT(renaming Makefile.aix to Makefile)