-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
355 lines (343 loc) · 11.6 KB
/
configure.ac
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
dnl# -*- Autoconf -*-
dnl# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([apple-gdb],[1824],[jmolenda@apple.com])
AC_CONFIG_SRCDIR([template.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])dnl
pushd .profile.d || (echo "cannot enter subdir for profiles!" >&2 && exit 1)
# The change in versioning in Big Sur has required some updating here:
if test -x "`which sw_vers 2>&AS_MESSAGE_LOG_FD`"; then
mac_vers_major="$(sw_vers -productVersion | cut -d\. -f1 2>&AS_MESSAGE_LOG_FD)"
mac_vers_minor="$(sw_vers -productVersion | cut -d\. -f2 2>&AS_MESSAGE_LOG_FD)"
if test -n "${mac_vers_major}"; then
if test ${mac_vers_major} -ge 12; then
AC_MSG_WARN([support for Monterey and later still needs to be written])
if test -e ./.profile_generic; then
AC_MSG_NOTICE([falling back to ./.profile_generic])
. ./.profile_generic
else
AC_MSG_WARN([you will have to find out what to do here yourself.])
fi
elif test ${mac_vers_major} -eq 11; then
if test -e ./.profile_big_sur; then
AC_MSG_NOTICE([sourcing ./.profile_big_sur])
. ./.profile_big_sur
else
AC_MSG_WARN([there are some environment variables that you will have to set manually for this to work properly (on Big Sur but missing file for Big Sur).])
fi
elif test ${mac_vers_major} -eq 10; then
if test -n "${mac_vers_minor}"; then
if test ${mac_vers_minor} -eq 15; then
if test -e ./.profile_catalina; then
AC_MSG_NOTICE([sourcing ./.profile_catalina])
. ./.profile_catalina
else
AC_MSG_WARN([there are some environment variables that you will have to set manually for this to work properly (on Catalina but missing file for Catalina).])
fi
elif test ${mac_vers_minor} -eq 6; then
if test -e ./.profile_snowleopard; then
AC_MSG_NOTICE([sourcing ./.profile_snowleopard])
. ./.profile_snowleopard
else
AC_MSG_WARN([there are some environment variables that you will have to set manually for this to work properly (on Snow Leopard but missing file for Snow Leopard).])
fi
elif test ${mac_vers_minor} -eq 5; then
if test -e ./.profile_leopard; then
AC_MSG_NOTICE([sourcing ./.profile_leopard])
. ./.profile_leopard
else
AC_MSG_WARN([there are some environment variables that you will have to set manually for this to work properly (on Leopard but missing file for Leopard).])
fi
else
AC_MSG_WARN([you will have to find out what to do for this platform yourself (version info: ${mac_vers_major}.${mac_vers_minor}).])
fi
else
AC_MSG_WARN([you will have to find out what to do for this platform yourself (major vers is 10).])
fi
else
AC_MSG_WARN([you will have to find out what to do for this platform yourself (version info: ${mac_vers_major}).])
fi
else
AC_MSG_WARN([you will have to find out what to do for this platform yourself.])
fi
else
if test -e ./.profile_generic; then
AC_MSG_NOTICE([sourcing ./.profile_generic])
. ./.profile_generic
else
AC_MSG_WARN([you will have to find out what to do for this platform yourself.])
fi
fi
popd || (echo "cannot restore working directory!" >&2 && exit 1)
AC_SUBST([mac_vers_major])dnl
AC_SUBST([mac_vers_minor])dnl
AC_CANONICAL_TARGET
AC_SYS_INTERPRETER
# Automake is just for one subdir; switching any other subdirs to use
# automake could potentially be disastrous:
AC_MSG_CHECKING([automake things])
AC_MSG_RESULT([ ])
AM_INIT_AUTOMAKE([foreign no-dist dejagnu no-define no-dependencies std-options tar-pax])dnl
AM_MAINTAINER_MODE
AM_SANITY_CHECK
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AM_MAKE_INCLUDE
AC_ARG_ENABLE([opts-test],
[AS_HELP_STRING([--disable-opts-test],
[Do not try to run a test AutoOpts program
(only relevant in src subdir)])dnl
])dnl# (for the autoconf macro for checking for autogen)
# Checks for programs.
AC_MSG_CHECKING([programs])
AC_MSG_RESULT([ ])
AM_PROG_AR
AS_IF([test "x${AR}" = "x"],[
test -z "${AR}" || unset AR
AC_CHECK_TOOLS([AR],[ar gar])dnl
## might want to switch around these checks...
AS_IF([test "x${ac_cv_prog_AR}" = "x"],[
test -z "${ac_cv_prog_AR}" || unset ac_cv_prog_AR
m4_ifdef([AC_PROG_AR],[
AC_PROG_AR
],[
test -x "`which ar`"
])
],[
test -x "`which ar`"
])
],[
test -n "${AR}" && export AR
])
AS_IF([test "x${AWK}" = "x" && test "x${ac_cv_prog_AWK}" = "x"],[
test -z "${AWK}" && test -z "${ac_cv_prog_AWK}"
AC_PROG_AWK
],[
test -n "${AWK}" || test -n "${ac_cv_prog_AWK}"
])dnl
##FIXME: might need to move some stuff in here:
AS_IF([test "x${CC}" = "x"],[
test -z "${CC}"
AC_PROG_CC
],[
test -n "${CC}" && export CC
])dnl
## ...uh... this comment is apparently necessary.
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_GREP
AC_PROG_EGREP
AC_PROG_INSTALL
AC_PROG_LEX([yywrap])
AM_PROG_LEX
AC_PROG_LN_S
AS_IF([test "x${ac_cv_prog_make_make_set}" = "x"],[
test -z "${ac_cv_prog_make_make_set}"
AC_PROG_MAKE_SET
])dnl
AC_PROG_MKDIR_P
AC_PROG_OBJC
AC_PROG_OBJCPP
AC_PROG_OBJCXX
AC_PROG_OBJCXXCPP
AC_PROG_RANLIB
AC_PROG_SED
AC_PROG_YACC
AC_PATH_PROG([BUILDIT],[buildit])dnl
AC_SUBST([BUILDIT])dnl
# Checks for libraries.
AC_MSG_CHECKING([libraries])
AC_MSG_RESULT([ ])
AC_MSG_CHECKING([for linker flag to verify linked libraries have the correct architecture])
if test "x${acl_cv_wl}" = "x"; then
test -z "${acl_cv_wl}" && export acl_cv_wl='-Wl,'
fi
pre_saved_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${acl_cv_wl}-arch_errors_fatal"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[LD_ARCHFLAGS="${acl_cv_wl}-arch_errors_fatal"],[])
LDFLAGS="${pre_saved_LDFLAGS}"
if test "x${LD_ARCHFLAGS}" != "x"; then
test -n "${LD_ARCHFLAGS}"
AC_MSG_RESULT([${LD_ARCHFLAGS}])
if test "x${ERROR_ON_WARNING}" = "xyes"; then
if test "x${WARN_LDFLAGS}" = "x"; then
test -z "${WARN_LDFLAGS}" && WARN_LDFLAGS="${LD_ARCHFLAGS}"
fi
fi
AC_SUBST([LD_ARCHFLAGS])dnl
## that should be all we need to do with them for now...
else
test -z "${LD_ARCHFLAGS}"
AC_MSG_RESULT([none])
fi
AC_CHECK_LIB([c],[printf])dnl
AC_CHECK_LIB([dl],[dlopen])dnl
## might want to pick a better symbol to check for:
AC_CHECK_LIB([gmp],[gmp_version],[],[
PRE_GMP_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
AC_CHECK_LIB([gmp],[main])dnl
## reset:
LDFLAGS="${PRE_GMP_LDFLAGS}"
])dnl
## might want to ensure we find the in-tree one:
AC_CHECK_LIB([iberty],[xmalloc],[],[
PRE_LIBERTY_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
AC_CHECK_LIB([iberty],[main])dnl
## reset:
LDFLAGS="${PRE_LIBERTY_LDFLAGS}"
])dnl
AC_CHECK_LIB([iconv],[iconv],[],[
AC_CHECK_LIB([iconv],[libiconv],[],[
PRE_ICONV_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
AC_CHECK_LIB([iconv],[main])dnl
## reset:
LDFLAGS="${PRE_ICONV_LDFLAGS}"
])dnl
])dnl
## might want to ensure we find the in-tree one:
AC_CHECK_LIB([intl],[gettext],[],[
PRE_INTL_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
AC_CHECK_LIB([intl],[main],[],[])dnl
## reset:
LDFLAGS="${PRE_INTL_LDFLAGS}"
])dnl
AC_CHECK_LIB([m],[sqrt])
m4_ifdef([LT_LIB_M],[
LT_LIB_M
],[
LIBM=""
AC_CHECK_LIB([m],[cos],[LIBM=-lm])dnl
AC_SUBST([LIBM])dnl
])dnl
## might want to pick a better symbol to check for:
AC_CHECK_LIB([mpfr],[mpfr_get_version],[],[
PRE_MPFR_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
AC_CHECK_LIB([mpfr],[main])dnl
## reset:
LDFLAGS="${PRE_MPFR_LDFLAGS}"
])dnl
## might want to ensure we find the in-tree one:
AC_CHECK_LIB([readline],[rl_initialize])dnl
AC_CHECK_LIB([sqlite3],[sqlite3_initialize])dnl
## might want to ensure we find the in-tree one:
AC_CHECK_LIB([z],[gzopen])dnl
# Checks for header files.
AC_MSG_CHECKING([headers])
AC_MSG_RESULT([ ])
AC_HEADER_STAT
AC_HEADER_STDBOOL dnl# also "_CHECK"s it
AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h argz.h \
fcntl.h float.h gettext.h langinfo.h libgettext.h \
libintl.h limits.h locale.h mach/mach.h \
malloc.h malloc/malloc.h netinet/in.h nl_types.h \
sgtty.h stddef.h stdio.h stdio_ext.h sys/file.h \
sys/ioctl.h sys/socket.h sys/time.h \
termio.h termios.h wchar.h wctype.h])
if test "x${ac_cv_header_inttypes_h}" = "x"; then
test -z "${ac_cv_header_inttypes_h}" || unset ac_cv_header_inttypes_h
AC_CHECK_HEADERS([inttypes.h])dnl
## should have been checked anyways, but whatever...
fi
if test "x${ac_cv_header_stdint_h}" = "x"; then
test -z "${ac_cv_header_stdint_h}" || unset ac_cv_header_stdint_h
AC_CHECK_HEADERS([stdint.h])dnl
## should have been checked anyways, but whatever...
fi
if test "x${ac_cv_header_sys_param_h}" = "x"; then
test -z "${ac_cv_header_sys_param_h}" || unset ac_cv_header_sys_param_h
AC_CHECK_HEADERS([sys/param.h])dnl
## should have been checked anyways, but whatever...
fi
if test "x${ac_cv_header_unistd_h}" = "x"; then
test -z "${ac_cv_header_unistd_h}" || unset ac_cv_header_unistd_h
AC_CHECK_HEADERS([unistd.h])dnl
## should have been checked anyways, but whatever...
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_MSG_CHECKING([C compiler charactersistics])
AC_MSG_RESULT([ ])
AC_C_CONST
AC_C_BIGENDIAN
AC_C_INLINE
AC_C_PROTOTYPES
AC_C_RESTRICT
AC_MSG_CHECKING([types])
AC_MSG_RESULT([ ])
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_CHECK_TYPES([ptrdiff_t])dnl
AC_STRUCT_TIMEZONE dnl# also does the "_TM" one
dnl# Begin what used to be AC\_TYPE\_SIGNAL
AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <signal.h>
]],[[
return *(signal (0, 0)) (0) == 1;
]])],[ac_cv_type_signal=int],[ac_cv_type_signal=void])dnl
])dnl
## corresponding define:
AC_DEFINE_UNQUOTED([RETSIGTYPE],[${ac_cv_type_signal}],
[Define as the return type of signal handlers
(`int' or `void').])
dnl# End what used to be AC\_TYPE\_SIGNAL
# Checks for library functions.
AC_MSG_CHECKING([functions])
AC_MSG_RESULT([ ])
AC_FUNC_ALLOCA
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_FUNC_LSTAT dnl# also checks whether it "_FOLLOWS_SLASHED_SYMLINK"
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MBRTOWC
AC_FUNC_MMAP
AC_FUNC_OBSTACK
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify bzero \
dcgettext getcwd gettimeofday localeconv mblen mbrlen \
memchr memmove mempcpy memset munmap nl_langinfo \
re_comp regcomp setenv setlocale stpcpy strcasecmp \
strchr strcspn strdup strerror strpbrk strrchr strstr \
strtol strtoul strtoull strverscmp])dnl
# Gettext checks:
AC_MSG_CHECKING([gettext])
AC_MSG_RESULT([ ])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.7])dnl
# Output:
AC_CONFIG_FILES([libcheckpoint/Makefile])
AC_CONFIG_SUBDIRS([src])dnl
AC_OUTPUT
# The name "configure" is also a make target in Apple's
# hand-written Makefile, so rename the configure file once
# we are done with it so that `make(1)` will not think that the
# target has already been made.
# Use a separate script for this.
if test -e rename-configure.sh; then
echo "Running a separate script to rename this configure script..."
${SHELL} ./rename-configure.sh
else
echo "Warning: The Makefile might think there is nothing to be done."
fi