File: configure.in

package info (click to toggle)
regina 2.2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,332 kB
  • ctags: 4,775
  • sloc: ansic: 38,518; sh: 2,552; lex: 1,878; yacc: 1,028; makefile: 771
file content (324 lines) | stat: -rw-r--r-- 7,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
dnl Process this file with autoconf to produce a configure script.
AC_INIT(rexxsaa.h)
AC_PREFIX_DEFAULT(/usr)

dnl ---------------------- check for C compiler -----------------
dnl Checks for one of the C compilers below - change if yours not there.
CC_LIST="gcc cc c89 acc"
MH_PROG_CC

AC_CONFIG_HEADER(config.h)
AC_ISC_POSIX

dnl Checks for system first
AC_CANONICAL_SYSTEM

mymakefile="Makefile"
on_qnx=no
on_beos=no
case "$target" in
	*hp-hpux*)
		SYS_DEFS="-D_HPUX_SOURCE"
		;;
	*ibm-aix*)
		SYS_DEFS="-D_ALL_SOURCE"
		mymakefile="Makefile.aix"
		;;
	*dec-osf*)
		;;
	*sequent-dynix*)
		;;
	*solaris*)
		;;
	sparc*sunos*)
		;;
	*linux*)
		;;
	*nto-qnx*)
		;;
	*qnx*)
		on_qnx=yes
		SYS_DEFS="-Q"
		;;
	*beos*)
		on_beos=yes
		;;
esac
AC_SUBST(SYS_DEFS)

dnl Check for dynamic shared library support libraries
MH_EXTRA_LIBS=""
MH_CHECK_LIB(dld dl)
SHLIBS="${MH_EXTRA_LIBS}"

dnl Check for extra required libraries - don't include libfl or libl
MH_EXTRA_LIBS=""
MH_CHECK_LIB(m nsl nsl_s socket)
dnl -- check for crypt library and function
MH_CHECK_CRYPT
AC_PROG_LEX
BOTHLIBS="${LEXLIB} ${MH_EXTRA_LIBS}"

MH_HAVE_PROTO
if test "$mh_have_proto" = "no"; then
        AC_MSG_ERROR(Regina requires an ANSI compiler; cannot continue)
fi

AC_PROG_GCC_TRADITIONAL
AC_PROG_RANLIB

dnl --------------------- Check for other programs. ---------------
AC_PROG_LN_S
AC_PROG_MAKE_SET

dnl -------------------- Checks for header files. -----------------
AC_HEADER_STDC
AC_CHECK_HEADERS( \
        stdio.h \
        stdlib.h \
        setjmp.h \
        unistd.h \
        ctype.h \
        pwd.h \
        grp.h \
        math.h \
        time.h \
        sys/time.h \
        assert.h \
        errno.h \
        stdarg.h \
        string.h \
        termios.h \
        signal.h \
        limits.h \
        fcntl.h \
        malloc.h \
        dlfcn.h \
        dl.h \
        sys/select.h \
        arpa/inet.h  \
        sys/socket.h \
        netinet/in.h \
        netdb.h
        )

AC_CHECK_FUNCS(putenv usleep random ftruncate memcpy memmove strerror strerror_r gettimeofday ftime _fullpath vsprintf _splitpath2 _splitpath sigaction)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
MH_CHECK_CC_O
MH_CHECK__SIGHANDLER_T
MH_STRUCT_RANDOM_DATA

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
if test $ac_cv_func_alloca_works = yes; then
        ALLOCA_SHO=""
else
        ALLOCA_SHO="alloca.sho"
fi
AC_SUBST(ALLOCA_SHO)

dnl --------------- allow --enable-debug to compile in debug mode --------
AC_ARG_ENABLE(debug,
        [  --enable-debug          turn on debugging],
        [with_debug=$enableval],
        [with_debug=no],
)
cflags_g="`echo $CFLAGS | grep -c '\-g'`"
cflags_O="`echo $CFLAGS | grep -c '\-O'`"

if test "$with_debug" = yes; then
        DEBUG="-DDEBUG"
        AC_SUBST(DEBUG)
        if test "$cflags_g" = "0"; then
                CFLAGS="${CFLAGS} -g"
        fi
        if test "$cflags_O" != "0"; then
                CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
        fi
else
        DEBUG="-DNDEBUG"
        AC_SUBST(DEBUG)
        if test "$cflags_O" = "0"; then
                CFLAGS="${CFLAGS} -O"
        fi
        if test "$cflags_g" != "0"; then
                CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
        fi
fi
if test "$ac_cv_prog_CC" = "gcc"; then
        if test "$with_debug" = yes; then
                CFLAGS="${CFLAGS} -Wall"
        else
                CFLAGS="-O3 -Wall -fomit-frame-pointer"
        fi
fi
if test "$on_qnx" = yes; then
        if test "$with_debug" = yes; then
                CFLAGS="-g"
        else
                CFLAGS="-Otax"
        fi
fi
if test "$on_beos" = yes; then
        if test "$with_debug" = yes; then
                CFLAGS="${CFLAGS} -Wall"
        else
                CFLAGS="-O2 -Wall"
        fi
fi

dnl --------------- allow --enable-purify to enable linking with Purify
AC_ARG_ENABLE(purify,
        [  --enable-purify         link with Purify (TM)],
        [with_purify=$enableval],
        [with_purify=no],
)
if test "$with_purify" = yes; then
        PURIFY="purify"
else
        PURIFY=""
fi
AC_SUBST(PURIFY)

dnl --------------- allow --enable-posix-threads to enable multi-threading
AC_ARG_ENABLE(posix-threads,
        [  --enable-posix-threads  enable POSIX-style multi-threading],
        [enable_posix_threads=$enableval],
        [enable_posix_threads=no],
)
MH_CHECK_POSIX_THREADS
if test "$mh_has_pthreads" = yes; then
	save_cflags="$CFLAGS"
	CFLAGS="$CFLAGS $THREADING_COMPILE"
#
# Where we know the format of getgrgid_r() function
# only test for that case
#
	case "$target" in
		*solaris*)
			MH_GETGRGID_R_STRUCT_RETURN
			;;
		*linux*)
			MH_GETGRGID_R_INT_RETURN_5_PARMS
			;;
		*dec-osf*)
			MH_GETGRGID_R_INT_RETURN_5_PARMS
			;;
		*)
			MH_GETGRGID_R_INT_RETURN_5_PARMS
			if test "$mh_cv_getgrgid_r_int5" = "no"; then
				MH_GETGRGID_R_INT_RETURN_4_PARMS
				if test "$mh_cv_getgrgid_r_int4" = "no"; then
					MH_GETGRGID_R_STRUCT_RETURN
				fi
			fi
	esac
	MH_GETPWUID_R_INT_RETURN
	if test "$mh_cv_getpwuid_r_int" = "no"; then
		MH_GETPWUID_R_STRUCT_RETURN
	fi
	CFLAGS="$save_CFLAGS"
fi

dnl --------------- allow --enable-tracemem to enable internal memory tracing
AC_ARG_ENABLE(tracemem,
        [  --enable-tracemem       enable memory tracing in debug mode],
        [with_tracemem=$enableval],
        [with_tracemem=no],
)
if test "$with_tracemem" = yes; then
        TRACEMEM="-DTRACEMEM"
else
        TRACEMEM=""
fi
AC_SUBST(TRACEMEM)

dnl --------------- allow --disable-flists to disable memory functions
AC_ARG_ENABLE(flists,
        [  --disable-flists        disable memory management functions],
        [with_flists=$enableval],
        [with_flists=yes],
)
if test "$with_flists" = no; then
        FLISTS="-DNOFLISTS"
else
        FLISTS=""
fi
AC_SUBST(FLISTS)

dnl --------------- allow --with-socket to specify socket for rxstack
AC_ARG_WITH(socket,
        [  --with-socket=9999      socket to use for external queues (default 5757)],
        [with_socket=$withval],
        [with_socket=no],
)
if test "$with_socket" = no; then
        REXXSOCKET=""
else
        REXXSOCKET="-DRXSOCKET=$with_socket"
fi
AC_SUBST(REXXSOCKET)

dnl --------------- allow --with-dlfcnincdir to enable compiling with dlfcn.h under AIX 3/4.1
AC_ARG_WITH(dlfcnincdir,
        [  --with-dlfcnincdir      location of dlfcn.h (AIX only)],
        [with_dlfcnincdir=$withval],
        [with_dlfcnincdir=no],
)
if test "$with_dlfcnincdir" = no; then
        DLFCNINCDIR=""
else
        DLFCNINCDIR="-I$with_dlfcnincdir"
        HAVE_DLFCN_H="1"
        AC_DEFINE(HAVE_DLFCN_H)
fi
AC_SUBST(DLFCNINCDIR)

dnl --------------- allow --with-dlfcnlibdir to enable compiling with dlfcn.h under AIX 3/4.1
AC_ARG_WITH(dlfcnlibdir,
        [  --with-dlfcnlibdir      location of libdl.a (AIX only)],
        [with_dlfcnlibdir=$withval],
        [with_dlfcnlibdir=no],
)
if test "$with_dlfcnlibdir" = no; then
        DLFCNLIBDIR=""
else
        DLFCNLIBDIR="-L$with_dlfcnlibdir -ldl"
fi
AC_SUBST(DLFCNLIBDIR)

dnl --------------- Check how to make shared libraries -------------------
MH_SHARED_LIBRARY

dnl --------------- Force definition of pre-compiler macro UNIX ----------
AC_DEFINE(UNIX)

dnl --------------- where to install startup/shutdown scripts ------------
STARTUPDIR="/etc"
if test -d /etc/rc.d/init.d; then
	STARTUPDIR="/etc/rc.d/init.d"
else
	if test -d /etc/init.d; then
		STARTUPDIR="/etc/init.d"
	fi
fi
AC_SUBST(STARTUPDIR)

dnl AC_OUTPUT(Makefile)

AC_OUTPUT($mymakefile)

case "$target" in
        *ibm-aix*)
                mv Makefile.aix Makefile
                AC_MSG_RESULT(renaming Makefile.aix to Makefile)
                ;;
        *)
                ;;
esac