~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to binutils/libiberty/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script
 
2
 
 
3
AC_PREREQ(2.13)
 
4
AC_INIT(pexecute.c)
 
5
 
 
6
# This works around the fact that libtool configuration may change LD
 
7
# for this particular configuration, but some shells, instead of
 
8
# keeping the changes in LD private, export them just because LD is
 
9
# exported.  We don't use libtool yet, but some day we might, so...
 
10
ORIGINAL_LD_FOR_MULTILIBS=$LD
 
11
 
 
12
dnl We use these options to decide which functions to include.
 
13
AC_ARG_WITH(target-subdir,
 
14
[  --with-target-subdir=SUBDIR      Configuring in a subdirectory for target])
 
15
AC_ARG_WITH(build-subdir,
 
16
[  --with-build-subdir=SUBDIR       Configuring in a subdirectory for build])
 
17
AC_ARG_WITH(cross-host,
 
18
[  --with-cross-host=HOST           Configuring with a cross compiler])
 
19
AC_ARG_WITH(newlib,
 
20
[  --with-newlib                    Configuring with newlib])
 
21
 
 
22
if test "${srcdir}" = "."; then
 
23
  if test -n "${with_build_subdir}"; then
 
24
    libiberty_topdir="${srcdir}/../.."
 
25
    with_target_subdir=
 
26
  elif test -z "${with_target_subdir}"; then
 
27
    libiberty_topdir="${srcdir}/.."
 
28
  else
 
29
    if test "${with_target_subdir}" != "."; then
 
30
      libiberty_topdir="${srcdir}/${with_multisrctop}../.."
 
31
    else
 
32
      libiberty_topdir="${srcdir}/${with_multisrctop}.."
 
33
    fi
 
34
  fi
 
35
else
 
36
  libiberty_topdir="${srcdir}/.."
 
37
fi
 
38
AC_CONFIG_AUX_DIR($libiberty_topdir)
 
39
 
 
40
dnl Very limited version of automake's enable-maintainer-mode
 
41
 
 
42
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
43
  dnl maintainer-mode is disabled by default
 
44
  AC_ARG_ENABLE(maintainer-mode,
 
45
[  --enable-maintainer-mode
 
46
                          enable make rules and dependencies not useful
 
47
                          (and sometimes confusing) to the casual installer],
 
48
      maintainer_mode=$enableval,
 
49
      maintainer_mode=no)
 
50
 
 
51
AC_MSG_RESULT($maintainer_mode)
 
52
 
 
53
if test "$maintainer_mode" = "yes"; then
 
54
  MAINT=''
 
55
  NOTMAINT='#'
 
56
else
 
57
  MAINT='#'
 
58
  NOTMAINT=''
 
59
fi
 
60
AC_SUBST(MAINT)dnl
 
61
AC_SUBST(NOTMAINT)dnl
 
62
 
 
63
# Do we have a single-tree copy of texinfo?  Even if we do, we can't
 
64
# rely on it - libiberty is built before texinfo.
 
65
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
 
66
if test "x$MAKEINFO" = "x"; then
 
67
    MAKEINFO="@echo makeinfo missing; true"
 
68
    BUILD_INFO=
 
69
else
 
70
    BUILD_INFO=info
 
71
    case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
 
72
      x*\ [[1-3]].* )
 
73
        MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
 
74
        BUILD_INFO=
 
75
        AC_MSG_WARN([
 
76
*** Makeinfo is too old. Info documentation will not be built.])
 
77
        ;;
 
78
    esac
 
79
fi
 
80
AC_SUBST(MAKEINFO)
 
81
AC_SUBST(BUILD_INFO)
 
82
 
 
83
AC_CHECK_PROG(PERL, perl, perl, )
 
84
if test x"$PERL" = x""; then
 
85
  HAVE_PERL='#'
 
86
else
 
87
  HAVE_PERL=''
 
88
fi
 
89
AC_SUBST(HAVE_PERL)
 
90
 
 
91
AC_CANONICAL_HOST
 
92
 
 
93
dnl When we start using automake:
 
94
dnl AM_INIT_AUTOMAKE(libiberty, 1.0)
 
95
 
 
96
dnl These must be called before AM_PROG_LIBTOOL, because it may want
 
97
dnl to call AC_CHECK_PROG.
 
98
AC_CHECK_TOOL(AR, ar)
 
99
AC_CHECK_TOOL(RANLIB, ranlib, :)
 
100
 
 
101
LIB_AC_PROG_CC
 
102
 
 
103
AC_PROG_CC_C_O
 
104
# autoconf is lame and doesn't give us any substitution variable for this.
 
105
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
 
106
  NO_MINUS_C_MINUS_O=yes
 
107
else
 
108
  OUTPUT_OPTION='-o $@'
 
109
fi
 
110
AC_SUBST(NO_MINUS_C_MINUS_O)
 
111
AC_SUBST(OUTPUT_OPTION)
 
112
 
 
113
AC_ISC_POSIX
 
114
AC_C_CONST
 
115
AC_C_INLINE
 
116
 
 
117
dnl When we start using libtool:
 
118
dnl Default to a non shared library.  This may be overridden by the
 
119
dnl configure option --enable-shared.
 
120
dnl AM_DISABLE_SHARED
 
121
 
 
122
dnl When we start using libtool:
 
123
dnl AM_PROG_LIBTOOL
 
124
 
 
125
dnl When we start using automake:
 
126
dnl AM_CONFIG_HEADER(config.h:config.in)
 
127
AC_CONFIG_HEADER(config.h:config.in)
 
128
 
 
129
dnl When we start using automake:
 
130
dnl AM_MAINTAINER_MODE
 
131
dnl AC_EXEEXT
 
132
 
 
133
dnl When we start using automake:
 
134
dnl AM_PROG_INSTALL
 
135
AC_PROG_INSTALL
 
136
 
 
137
. ${srcdir}/config.table
 
138
host_makefile_frag=${frag}
 
139
AC_SUBST_FILE(host_makefile_frag)
 
140
 
 
141
# It's OK to check for header files.  Although the compiler may not be
 
142
# able to link anything, it had better be able to at least compile
 
143
# something.
 
144
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 alloca.h dlfcn.h)
 
145
AC_HEADER_SYS_WAIT
 
146
AC_HEADER_TIME
 
147
 
 
148
libiberty_AC_DECLARE_ERRNO
 
149
 
 
150
AC_CHECK_TYPE(uintptr_t, unsigned long)
 
151
 
 
152
if test $ac_cv_type_uintptr_t = yes
 
153
then
 
154
  AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.])
 
155
fi
 
156
 
 
157
LIBIBERTY_HAVE_WEAK_SYMBOL
 
158
if test $libiberty_cv_have_weak_symbol = yes; then
 
159
  # demangler may use dlopen. 
 
160
  AC_SEARCH_LIBS(dlopen, dl,
 
161
                 libiberty_cv_have_dlopen=yes,
 
162
                 libiberty_cv_have_dlopen=no)
 
163
  if test $libiberty_cv_have_dlopen = yes; then
 
164
    AC_DEFINE(HAVE_DLOPEN, 1, [Define if dlopen exists.])
 
165
  fi
 
166
fi
 
167
 
 
168
AC_TYPE_PID_T
 
169
 
 
170
# This is the list of functions which libiberty will provide if they
 
171
# are not available on the host.
 
172
 
 
173
funcs="asprintf"
 
174
funcs="$funcs atexit"
 
175
funcs="$funcs basename"
 
176
funcs="$funcs bcmp"
 
177
funcs="$funcs bcopy"
 
178
funcs="$funcs bsearch"
 
179
funcs="$funcs bzero"
 
180
funcs="$funcs calloc"
 
181
funcs="$funcs clock"
 
182
funcs="$funcs ffs"
 
183
funcs="$funcs getcwd"
 
184
funcs="$funcs getpagesize"
 
185
funcs="$funcs index"
 
186
funcs="$funcs insque"
 
187
funcs="$funcs memchr"
 
188
funcs="$funcs memcmp"
 
189
funcs="$funcs memcpy"
 
190
funcs="$funcs memmove"
 
191
funcs="$funcs memset"
 
192
funcs="$funcs mkstemps"
 
193
funcs="$funcs putenv"
 
194
funcs="$funcs random"
 
195
funcs="$funcs rename"
 
196
funcs="$funcs rindex"
 
197
funcs="$funcs setenv"
 
198
funcs="$funcs sigsetmask"
 
199
funcs="$funcs strcasecmp"
 
200
funcs="$funcs strchr"
 
201
funcs="$funcs strdup"
 
202
funcs="$funcs strncasecmp"
 
203
funcs="$funcs strrchr"
 
204
funcs="$funcs strstr"
 
205
funcs="$funcs strtod"
 
206
funcs="$funcs strtol"
 
207
funcs="$funcs strtoul"
 
208
funcs="$funcs tmpnam"
 
209
funcs="$funcs vasprintf"
 
210
funcs="$funcs vfprintf"
 
211
funcs="$funcs vprintf"
 
212
funcs="$funcs vsprintf"
 
213
funcs="$funcs waitpid"
 
214
 
 
215
# Also in the old function.def file: alloca, vfork, getopt.
 
216
 
 
217
vars="sys_errlist sys_nerr sys_siglist"
 
218
 
 
219
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
 
220
 
 
221
# These are neither executed nor required, but they help keep
 
222
# autoheader happy without adding a bunch of text to acconfig.h.
 
223
if test "x" = "y"; then
 
224
  AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock)
 
225
  AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy)
 
226
  AC_CHECK_FUNCS(memmove memset putenv random rename rindex sigsetmask)
 
227
  AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr)
 
228
  AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
 
229
  AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
 
230
  AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs)
 
231
  AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
 
232
  AC_DEFINE(HAVE_SYS_NERR,    1, [Define if you have the sys_nerr variable.])
 
233
  AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
 
234
fi
 
235
 
 
236
# For each of these functions, if the host does not provide the
 
237
# function we want to put FN.o in LIBOBJS, and if the host does
 
238
# provide the function, we want to define HAVE_FN in config.h.
 
239
 
 
240
setobjs=
 
241
CHECK=
 
242
target_header_dir=
 
243
if test -n "${with_target_subdir}"; then
 
244
 
 
245
  # We are being configured as a target library.  AC_REPLACE_FUNCS
 
246
  # may not work correctly, because the compiler may not be able to
 
247
  # link executables.  Note that we may still be being configured
 
248
  # native.
 
249
 
 
250
  # If we are being configured for newlib, we know which functions
 
251
  # newlib provide and which ones we will be expected to provide.
 
252
 
 
253
  if test "x${with_newlib}" = "xyes"; then
 
254
    LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
 
255
 
 
256
    for f in $funcs; do
 
257
      case "$f" in
 
258
        asprintf | basename | insque | random | strdup | vasprintf)
 
259
          ;;
 
260
        *)
 
261
          n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
 
262
          AC_DEFINE_UNQUOTED($n)
 
263
          ;;
 
264
      esac
 
265
    done
 
266
 
 
267
    # newlib doesnt provide any of the variables in $vars, so we
 
268
    # dont have to check them here.
 
269
 
 
270
    # Of the functions in $checkfuncs, newlib only has strerror.
 
271
    AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
 
272
 
 
273
    setobjs=yes
 
274
 
 
275
  fi
 
276
 
 
277
  # We may wish to install the target headers somewhere.
 
278
  AC_ARG_ENABLE(install-libiberty,
 
279
  [  --enable-install-libiberty       Install headers for end users],
 
280
  enable_install_libiberty=$enableval,
 
281
  enable_install_libiberty=no)dnl
 
282
  
 
283
  # Option parsed, now set things appropriately.
 
284
  case x"$enable_install_libiberty" in
 
285
    xyes|x)
 
286
      target_header_dir=libiberty
 
287
      ;;
 
288
    xno)   
 
289
      target_header_dir=
 
290
      ;;
 
291
    *) 
 
292
      # This could be sanity-checked in various ways...
 
293
      target_header_dir="${enable_install_libiberty}"
 
294
      ;;
 
295
  esac
 
296
 
 
297
 
 
298
else
 
299
 
 
300
   # Not a target library, so we set things up to run the test suite.
 
301
   CHECK=check-cplus-dem
 
302
 
 
303
fi
 
304
 
 
305
AC_SUBST(CHECK)
 
306
AC_SUBST(target_header_dir)
 
307
 
 
308
case "${host}" in
 
309
  *-*-cygwin* | *-*-mingw*)
 
310
    AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST)
 
311
    AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR)
 
312
    ;;
 
313
esac
 
314
 
 
315
if test -z "${setobjs}"; then
 
316
  case "${host}" in
 
317
 
 
318
  *-*-vxworks*)
 
319
    # Handle VxWorks configuration specially, since on VxWorks the
 
320
    # libraries are actually on the target board, not in the file
 
321
    # system.
 
322
    LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
 
323
    LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
 
324
    for f in $funcs; do
 
325
      case "$f" in
 
326
        basename | getpagesize | insque | random | strcasecmp)
 
327
          ;;
 
328
        strncasecmp | strdup | vfork | waitpid | vasprintf)
 
329
          ;;
 
330
        *)
 
331
          n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
 
332
          AC_DEFINE_UNQUOTED($n)
 
333
          ;;
 
334
      esac
 
335
    done
 
336
 
 
337
    # VxWorks doesn't provide any of the variables in $vars, so we
 
338
    # don't have to check them here.
 
339
 
 
340
    # Of the functions in $checkfuncs, VxWorks only has strerror.
 
341
    AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
 
342
 
 
343
    setobjs=yes
 
344
    ;;
 
345
 
 
346
  esac
 
347
fi
 
348
 
 
349
if test -z "${setobjs}"; then
 
350
 
 
351
  case "${host}" in
 
352
 
 
353
  *-*-cygwin*)
 
354
    # The Cygwin library actually uses a couple of files from
 
355
    # libiberty when it is built.  If we are building a native
 
356
    # Cygwin, and we run the tests, we will appear to have these
 
357
    # files.  However, when we go on to build winsup, we will wind up
 
358
    # with a library which does not have the files, since they should
 
359
    # have come from libiberty.
 
360
 
 
361
    # We handle this by removing the functions the winsup library
 
362
    # provides from our shell variables, so that they appear to be
 
363
    # missing.
 
364
 
 
365
    # DJ - only if we're *building* cygwin, not just building *with* cygwin
 
366
  
 
367
    if test -n "${with_target_subdir}"
 
368
    then
 
369
      funcs="`echo $funcs | sed -e 's/random//'`"
 
370
      LIBOBJS="$LIBOBJS random.o"
 
371
      vars="`echo $vars | sed -e 's/sys_siglist//'`"
 
372
      checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
 
373
    fi
 
374
    ;;
 
375
 
 
376
  *-*-mingw32*)
 
377
    # Under mingw32, sys_nerr and sys_errlist exist, but they are
 
378
    # macros, so the test below won't find them.
 
379
    libiberty_cv_var_sys_nerr=yes
 
380
    libiberty_cv_var_sys_errlist=yes
 
381
    ;;
 
382
 
 
383
  *-*-uwin*)
 
384
    # Under some versions of uwin, vfork is notoriously buggy and the test 
 
385
    # can hang configure; on other versions, vfork exists just as a stub.
 
386
    # FIXME: This should be removed once vfork in uwin's runtime is fixed.
 
387
    ac_cv_func_vfork_works=no
 
388
    # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
 
389
    # macros (actually, these are imported from a DLL, but the end effect 
 
390
    # is the same), so the test below won't find them.
 
391
    libiberty_cv_var_sys_nerr=yes
 
392
    libiberty_cv_var_sys_errlist=yes
 
393
    ;;
 
394
 
 
395
  *-*-*vms*)
 
396
    # Under VMS, vfork works very different than on Unix. The standard test 
 
397
    # won't work, and it isn't easily adaptable. It makes more sense to
 
398
    # just force it.
 
399
    ac_cv_func_vfork_works=yes
 
400
    ;;
 
401
 
 
402
  esac
 
403
 
 
404
  # We haven't set the list of objects yet.  Use the standard autoconf
 
405
  # tests.  This will only work if the compiler works.
 
406
  AC_PROG_CC_WORKS
 
407
  AC_REPLACE_FUNCS($funcs)
 
408
  libiberty_AC_FUNC_C_ALLOCA
 
409
  AC_FUNC_VFORK
 
410
  if test $ac_cv_func_vfork_works = no; then
 
411
    LIBOBJS="$LIBOBJS vfork.o"
 
412
  fi
 
413
  # We only need _doprnt if we might use it to implement v*printf.
 
414
  if test $ac_cv_func_vprintf != yes \
 
415
     || test $ac_cv_func_vfprintf != yes \
 
416
     || test $ac_cv_func_vsprintf != yes; then
 
417
    AC_REPLACE_FUNCS(_doprnt)
 
418
  else
 
419
    AC_CHECK_FUNCS(_doprnt)
 
420
  fi
 
421
 
 
422
  for v in $vars; do
 
423
    AC_MSG_CHECKING([for $v])
 
424
    AC_CACHE_VAL(libiberty_cv_var_$v,
 
425
      [AC_TRY_LINK([int *p;], [extern int $v []; p = $v;],
 
426
                   [eval "libiberty_cv_var_$v=yes"],
 
427
                   [eval "libiberty_cv_var_$v=no"])])
 
428
    if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
 
429
      AC_MSG_RESULT(yes)
 
430
      n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
 
431
      AC_DEFINE_UNQUOTED($n)
 
432
    else
 
433
      AC_MSG_RESULT(no)
 
434
    fi
 
435
  done
 
436
  AC_CHECK_FUNCS($checkfuncs)
 
437
fi
 
438
 
 
439
libiberty_AC_FUNC_STRNCMP
 
440
 
 
441
# Install a library built with a cross compiler in $(tooldir) rather
 
442
# than $(libdir).
 
443
if test -z "${with_cross_host}"; then
 
444
  INSTALL_DEST=libdir
 
445
else
 
446
  INSTALL_DEST=tooldir
 
447
fi
 
448
AC_SUBST(INSTALL_DEST)
 
449
 
 
450
# We need multilib support, but only if configuring for the target.
 
451
AC_OUTPUT(Makefile testsuite/Makefile,
 
452
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 
453
if test -n "$CONFIG_FILES"; then
 
454
  if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
 
455
    # FIXME: We shouldn't need to set ac_file
 
456
    ac_file=Makefile
 
457
    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
 
458
    . ${libiberty_topdir}/config-ml.in
 
459
  fi
 
460
fi],
 
461
srcdir=${srcdir}
 
462
host=${host}
 
463
target=${target}
 
464
with_target_subdir=${with_target_subdir}
 
465
with_build_subdir=${with_build_subdir}
 
466
with_multisubdir=${with_multisubdir}
 
467
ac_configure_args="--enable-multilib ${ac_configure_args}"
 
468
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 
469
libiberty_topdir=${libiberty_topdir}
 
470
)