1 |
dnl Process this file with autoconf to produce a configure script |
dnl Process this file with autoconf to produce a configure script |
2 |
|
|
3 |
AC_PREREQ(2.12.1) |
AC_PREREQ(2.13) |
4 |
AC_INIT(pexecute.c) |
AC_INIT(pexecute.c) |
5 |
|
|
6 |
dnl We use these options to decide which functions to include. |
dnl We use these options to decide which functions to include. |
36 |
AC_CHECK_TOOL(AR, ar) |
AC_CHECK_TOOL(AR, ar) |
37 |
AC_CHECK_TOOL(RANLIB, ranlib, :) |
AC_CHECK_TOOL(RANLIB, ranlib, :) |
38 |
|
|
|
# FIXME: We temporarily define our own version of AC_PROG_CC. This is |
|
|
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We |
|
|
# are probably using a cross compiler, which will not be able to fully |
|
|
# link an executable. This should really be fixed in autoconf |
|
|
# itself. |
|
|
|
|
|
AC_DEFUN(LIB_AC_PROG_CC, |
|
|
[AC_BEFORE([$0], [AC_PROG_CPP])dnl |
|
|
AC_PROVIDE([AC_PROG_CC]) |
|
|
AC_CHECK_PROG(CC, gcc, gcc) |
|
|
if test -z "$CC"; then |
|
|
AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) |
|
|
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
|
|
fi |
|
|
|
|
|
AC_PROG_CC_GNU |
|
|
|
|
|
if test $ac_cv_prog_gcc = yes; then |
|
|
GCC=yes |
|
|
dnl Check whether -g works, even if CFLAGS is set, in case the package |
|
|
dnl plays around with CFLAGS (such as to build both debugging and |
|
|
dnl normal versions of a library), tasteless as that idea is. |
|
|
ac_test_CFLAGS="${CFLAGS+set}" |
|
|
ac_save_CFLAGS="$CFLAGS" |
|
|
CFLAGS= |
|
|
AC_PROG_CC_G |
|
|
if test "$ac_test_CFLAGS" = set; then |
|
|
CFLAGS="$ac_save_CFLAGS" |
|
|
elif test $ac_cv_prog_cc_g = yes; then |
|
|
CFLAGS="-g -O2" |
|
|
else |
|
|
CFLAGS="-O2" |
|
|
fi |
|
|
else |
|
|
GCC= |
|
|
test "${CFLAGS+set}" = set || CFLAGS="-g" |
|
|
fi |
|
|
]) |
|
|
|
|
39 |
LIB_AC_PROG_CC |
LIB_AC_PROG_CC |
40 |
|
|
41 |
AC_ISC_POSIX |
AC_ISC_POSIX |
42 |
|
AC_C_CONST |
43 |
|
AC_C_INLINE |
44 |
|
|
45 |
dnl When we start using libtool: |
dnl When we start using libtool: |
46 |
dnl Default to a non shared library. This may be overridden by the |
dnl Default to a non shared library. This may be overridden by the |
69 |
# It's OK to check for header files. Although the compiler may not be |
# It's OK to check for header files. Although the compiler may not be |
70 |
# able to link anything, it had better be able to at least compile |
# able to link anything, it had better be able to at least compile |
71 |
# something. |
# something. |
72 |
AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h) |
AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h) |
73 |
AC_HEADER_SYS_WAIT |
AC_HEADER_SYS_WAIT |
74 |
|
AC_HEADER_TIME |
75 |
|
|
76 |
|
libiberty_AC_DECLARE_ERRNO |
77 |
|
|
78 |
# This is the list of functions which libiberty will provide if they |
# This is the list of functions which libiberty will provide if they |
79 |
# are not available on the host. |
# are not available on the host. |
83 |
funcs="$funcs basename" |
funcs="$funcs basename" |
84 |
funcs="$funcs bcmp" |
funcs="$funcs bcmp" |
85 |
funcs="$funcs bcopy" |
funcs="$funcs bcopy" |
86 |
|
funcs="$funcs bsearch" |
87 |
funcs="$funcs bzero" |
funcs="$funcs bzero" |
88 |
funcs="$funcs calloc" |
funcs="$funcs calloc" |
89 |
funcs="$funcs clock" |
funcs="$funcs clock" |
128 |
# These are neither executed nor required, but they help keep |
# These are neither executed nor required, but they help keep |
129 |
# autoheader happy without adding a bunch of text to acconfig.h. |
# autoheader happy without adding a bunch of text to acconfig.h. |
130 |
if test "x" = "y"; then |
if test "x" = "y"; then |
131 |
AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bzero calloc clock getcwd) |
AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock) |
132 |
AC_CHECK_FUNCS(getpagesize index insque mkstemps memchr memcmp memcpy memmove) |
AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy) |
133 |
AC_CHECK_FUNCS(memset putenv random rename rindex sigsetmask strcasecmp) |
AC_CHECK_FUNCS(memmove memset putenv random rename rindex sigsetmask) |
134 |
AC_CHECK_FUNCS(setenv strchr strdup strncasecmp strrchr strstr strtod strtol) |
AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr) |
135 |
AC_CHECK_FUNCS(strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid) |
AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) |
136 |
AC_DEFINE(HAVE_SYS_ERRLIST) |
AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) |
137 |
AC_DEFINE(HAVE_SYS_NERR) |
AC_CHECK_FUNCS(sysconf times sbrk gettimeofday) |
138 |
AC_DEFINE(HAVE_SYS_SIGLIST) |
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) |
139 |
AC_CHECK_FUNCS(getrusage on_exit psignal strerror strsignal sysconf times) |
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) |
140 |
AC_CHECK_FUNCS(sbrk gettimeofday) |
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) |
141 |
fi |
fi |
142 |
|
|
143 |
# For each of these functions, if the host does not provide the |
# For each of these functions, if the host does not provide the |
176 |
# dont have to check them here. |
# dont have to check them here. |
177 |
|
|
178 |
# Of the functions in $checkfuncs, newlib only has strerror. |
# Of the functions in $checkfuncs, newlib only has strerror. |
179 |
AC_DEFINE(HAVE_STRERROR) |
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR) |
180 |
|
|
181 |
setobjs=yes |
setobjs=yes |
182 |
|
|
191 |
|
|
192 |
AC_SUBST(CHECK) |
AC_SUBST(CHECK) |
193 |
|
|
194 |
|
case "${host}" in |
195 |
|
*-*-cygwin*) |
196 |
|
AC_DEFINE(HAVE_SYS_ERRLIST) |
197 |
|
AC_DEFINE(HAVE_SYS_NERR) |
198 |
|
;; |
199 |
|
esac |
200 |
|
|
201 |
if test -z "${setobjs}"; then |
if test -z "${setobjs}"; then |
202 |
case "${host}" in |
case "${host}" in |
203 |
|
|
224 |
# don't have to check them here. |
# don't have to check them here. |
225 |
|
|
226 |
# Of the functions in $checkfuncs, VxWorks only has strerror. |
# Of the functions in $checkfuncs, VxWorks only has strerror. |
227 |
AC_DEFINE(HAVE_STRERROR) |
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR) |
228 |
|
|
229 |
setobjs=yes |
setobjs=yes |
230 |
;; |
;; |
248 |
# provides from our shell variables, so that they appear to be |
# provides from our shell variables, so that they appear to be |
249 |
# missing. |
# missing. |
250 |
|
|
251 |
funcs="`echo $funcs | sed -e 's/random//'`" |
# DJ - only if we're *building* cygwin, not just building *with* cygwin |
252 |
LIBOBJS="$LIBOBJS random.o" |
|
253 |
vars="`echo $vars | sed -e 's/sys_siglist//'`" |
if test -n "${with_target_subdir}" |
254 |
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" |
then |
255 |
|
funcs="`echo $funcs | sed -e 's/random//'`" |
256 |
|
LIBOBJS="$LIBOBJS random.o" |
257 |
|
vars="`echo $vars | sed -e 's/sys_siglist//'`" |
258 |
|
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" |
259 |
|
fi |
260 |
;; |
;; |
261 |
|
|
262 |
*-*-mingw32*) |
*-*-mingw32*) |
263 |
# Under mingw32, sys_nerr and sys_errlist exist, but they are |
# Under mingw32, sys_nerr and sys_errlist exist, but they are |
264 |
# macros, so the test below won't find them. |
# macros, so the test below won't find them. |
265 |
vars="`echo $vars | sed -e 's/sys_nerr//' -e 's/sys_errlist//'`" |
libiberty_cv_var_sys_nerr=yes |
266 |
AC_DEFINE(HAVE_SYS_NERR) |
libiberty_cv_var_sys_errlist=yes |
|
AC_DEFINE(HAVE_SYS_ERRLIST) |
|
267 |
;; |
;; |
268 |
|
|
269 |
*-*-uwin*) |
*-*-uwin*) |
274 |
# Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are |
# Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are |
275 |
# macros (actually, these are imported from a DLL, but the end effect |
# macros (actually, these are imported from a DLL, but the end effect |
276 |
# is the same), so the test below won't find them. |
# is the same), so the test below won't find them. |
277 |
AC_DEFINE(HAVE_SYS_NERR) |
libiberty_cv_var_sys_nerr=yes |
278 |
AC_DEFINE(HAVE_SYS_ERRLIST) |
libiberty_cv_var_sys_errlist=yes |
279 |
;; |
;; |
280 |
|
|
281 |
esac |
esac |
327 |
AC_CHECK_FUNCS($checkfuncs) |
AC_CHECK_FUNCS($checkfuncs) |
328 |
fi |
fi |
329 |
|
|
330 |
|
libiberty_AC_FUNC_STRNCMP |
331 |
|
|
332 |
# Install a library built with a cross compiler in $(tooldir) rather |
# Install a library built with a cross compiler in $(tooldir) rather |
333 |
# than $(libdir). |
# than $(libdir). |
334 |
if test -z "${with_cross_host}"; then |
if test -z "${with_cross_host}"; then |