Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/libiberty/configure.in

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    22
    33AC_PREREQ(2.13)
    4 AC_INIT(pexecute.c)
     4AC_INIT(xmalloc.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...
     10ORIGINAL_LD_FOR_MULTILIBS=$LD
    511
    612dnl We use these options to decide which functions to include.
    713AC_ARG_WITH(target-subdir,
    8 [  --with-target-subdir=SUBDIR      Configuring in a subdirectory])
     14[  --with-target-subdir=SUBDIR      Configuring in a subdirectory for target])
     15AC_ARG_WITH(build-subdir,
     16[  --with-build-subdir=SUBDIR       Configuring in a subdirectory for build])
    917AC_ARG_WITH(cross-host,
    1018[  --with-cross-host=HOST           Configuring with a cross compiler])
     
    1321
    1422if test "${srcdir}" = "."; then
    15   if test -z "${with_target_subdir}"; 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
    1627    libiberty_topdir="${srcdir}/.."
    1728  else
     
    2536  libiberty_topdir="${srcdir}/.."
    2637fi
     38AC_SUBST(libiberty_topdir)
    2739AC_CONFIG_AUX_DIR($libiberty_topdir)
     40
     41dnl Very limited version of automake's enable-maintainer-mode
     42
     43AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
     44  dnl maintainer-mode is disabled by default
     45  AC_ARG_ENABLE(maintainer-mode,
     46[  --enable-maintainer-mode
     47                          enable make rules and dependencies not useful
     48                          (and sometimes confusing) to the casual installer],
     49      maintainer_mode=$enableval,
     50      maintainer_mode=no)
     51
     52AC_MSG_RESULT($maintainer_mode)
     53
     54if test "$maintainer_mode" = "yes"; then
     55  MAINT=''
     56  NOTMAINT='#'
     57else
     58  MAINT='#'
     59  NOTMAINT=''
     60fi
     61AC_SUBST(MAINT)dnl
     62AC_SUBST(NOTMAINT)dnl
     63
     64# Do we have a single-tree copy of texinfo?  Even if we do, we can't
     65# rely on it - libiberty is built before texinfo.
     66AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
     67if test "x$MAKEINFO" = "x"; then
     68    MAKEINFO="@echo makeinfo missing; true"
     69    BUILD_INFO=
     70else
     71    BUILD_INFO=info
     72    case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
     73      x*\ [[1-3]].* )
     74        MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
     75        BUILD_INFO=
     76        AC_MSG_WARN([
     77*** Makeinfo is too old. Info documentation will not be built.])
     78        ;;
     79    esac
     80fi
     81AC_SUBST(MAKEINFO)
     82AC_SUBST(BUILD_INFO)
     83
     84AC_CHECK_PROG(PERL, perl, perl, )
     85if test x"$PERL" = x""; then
     86  HAVE_PERL='#'
     87else
     88  HAVE_PERL=''
     89fi
     90AC_SUBST(HAVE_PERL)
    2891
    2992AC_CANONICAL_HOST
     
    39102LIB_AC_PROG_CC
    40103
     104AC_PROG_CC_C_O
     105# autoconf is lame and doesn't give us any substitution variable for this.
     106if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
     107  NO_MINUS_C_MINUS_O=yes
     108else
     109  OUTPUT_OPTION='-o $@'
     110fi
     111AC_SUBST(NO_MINUS_C_MINUS_O)
     112AC_SUBST(OUTPUT_OPTION)
     113
    41114AC_ISC_POSIX
    42115AC_C_CONST
     
    70143# able to link anything, it had better be able to at least compile
    71144# something.
    72 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)
     145AC_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 sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
    73146AC_HEADER_SYS_WAIT
    74147AC_HEADER_TIME
    75148
    76149libiberty_AC_DECLARE_ERRNO
     150
     151AC_CHECK_TYPE(uintptr_t, unsigned long)
     152# Given the above check, we always have uintptr_t or a fallback
     153# definition.  So define HAVE_UINTPTR_T in case any imported code
     154# relies on it.
     155AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.])
     156
     157AC_TYPE_PID_T
    77158
    78159# This is the list of functions which libiberty will provide if they
     
    88169funcs="$funcs calloc"
    89170funcs="$funcs clock"
     171funcs="$funcs ffs"
    90172funcs="$funcs getcwd"
    91173funcs="$funcs getpagesize"
     
    96178funcs="$funcs memcpy"
    97179funcs="$funcs memmove"
     180funcs="$funcs mempcpy"
    98181funcs="$funcs memset"
    99182funcs="$funcs mkstemps"
     
    103186funcs="$funcs rindex"
    104187funcs="$funcs setenv"
     188funcs="$funcs snprintf"
    105189funcs="$funcs sigsetmask"
     190funcs="$funcs stpcpy"
     191funcs="$funcs stpncpy"
    106192funcs="$funcs strcasecmp"
    107193funcs="$funcs strchr"
     
    117203funcs="$funcs vfprintf"
    118204funcs="$funcs vprintf"
     205funcs="$funcs vsnprintf"
    119206funcs="$funcs vsprintf"
    120207funcs="$funcs waitpid"
     
    122209# Also in the old function.def file: alloca, vfork, getopt.
    123210
    124 vars="sys_errlist sys_nerr sys_siglist"
     211vars="sys_errlist sys_nerr sys_siglist _system_configuration"
    125212
    126213checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
     214checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
     215checkfuncs="$checkfuncs getsysinfo table sysctl"
    127216
    128217# These are neither executed nor required, but they help keep
     
    131220  AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock)
    132221  AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy)
    133   AC_CHECK_FUNCS(memmove memset putenv random rename rindex sigsetmask)
    134   AC_CHECK_FUNCS(strcasecmp setenv strchr strdup strncasecmp strrchr strstr)
     222  AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask)
     223  AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr)
    135224  AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
    136225  AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
    137   AC_CHECK_FUNCS(sysconf times sbrk gettimeofday)
     226  AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf)
     227  AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl)
     228  AC_CHECK_FUNCS(realpath canonicalize_file_name)
    138229  AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
    139230  AC_DEFINE(HAVE_SYS_NERR,    1, [Define if you have the sys_nerr variable.])
    140231  AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
     232  AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])
    141233fi
    142234
    143235# For each of these functions, if the host does not provide the
    144236# function we want to put FN.o in LIBOBJS, and if the host does
    145 # provide the function, we want to define HAVE_FN in config.h.  Also,
    146 # if the host does not provide alloca, we set ALLOCA to alloca.o
     237# provide the function, we want to define HAVE_FN in config.h.
    147238
    148239setobjs=
    149240CHECK=
     241target_header_dir=
    150242if test -n "${with_target_subdir}"; then
    151243
     
    159251
    160252  if test "x${with_newlib}" = "xyes"; then
    161     ALLOCA="alloca.o"
    162253    LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
    163254
     
    183274  fi
    184275
     276  # We may wish to install the target headers somewhere.
     277  AC_ARG_ENABLE(install-libiberty,
     278  [  --enable-install-libiberty       Install headers for end users],
     279  enable_install_libiberty=$enableval,
     280  enable_install_libiberty=no)dnl
     281 
     282  # Option parsed, now set things appropriately.
     283  case x"$enable_install_libiberty" in
     284    xyes|x)
     285      target_header_dir=libiberty
     286      ;;
     287    xno)   
     288      target_header_dir=
     289      ;;
     290    *)
     291      # This could be sanity-checked in various ways...
     292      target_header_dir="${enable_install_libiberty}"
     293      ;;
     294  esac
     295
     296
    185297else
    186298
     
    191303
    192304AC_SUBST(CHECK)
     305AC_SUBST(target_header_dir)
     306
     307case "${host}" in
     308  *-*-cygwin* | *-*-mingw*)
     309    AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST)
     310    AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR)
     311    ;;
     312esac
    193313
    194314if test -z "${setobjs}"; then
     
    272392    ;;
    273393
     394  *-*-*vms*)
     395    # Under VMS, vfork works very different than on Unix. The standard test
     396    # won't work, and it isn't easily adaptable. It makes more sense to
     397    # just force it.
     398    ac_cv_func_vfork_works=yes
     399    ;;
     400
    274401  esac
    275402
     
    278405  AC_PROG_CC_WORKS
    279406  AC_REPLACE_FUNCS($funcs)
    280 
    281   case "${host}" in
    282   *-*-interix)
    283     # On Interix, it wrongly concludes that the MSVC compiler supports alloca.
    284     # (MSVC does on Win32, not on Interix.)
    285     # This should be temporary.
    286 
    287     ac_cv_header_alloca_h=no
    288     ac_cv_func_alloca_works=no
    289     ALLOCA=alloca.o
    290     cat >> confdefs.h <<\EOF
    291 #define C_ALLOCA 1
    292 EOF
    293     cat >> confdefs.h <<EOF
    294 #define STACK_DIRECTION -1
    295 EOF
    296     ;;
    297   *)
    298     AC_FUNC_ALLOCA
    299     ;;
    300   esac
    301 
     407  libiberty_AC_FUNC_C_ALLOCA
    302408  AC_FUNC_VFORK
    303409  if test $ac_cv_func_vfork_works = no; then
    304410    LIBOBJS="$LIBOBJS vfork.o"
    305411  fi
     412  # We only need _doprnt if we might use it to implement v*printf.
     413  if test $ac_cv_func_vprintf != yes \
     414     || test $ac_cv_func_vfprintf != yes \
     415     || test $ac_cv_func_vsprintf != yes; then
     416    AC_REPLACE_FUNCS(_doprnt)
     417  else
     418    AC_CHECK_FUNCS(_doprnt)
     419  fi
     420
    306421  for v in $vars; do
    307422    AC_MSG_CHECKING([for $v])
    308423    AC_CACHE_VAL(libiberty_cv_var_$v,
    309       [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;],
     424      [AC_TRY_LINK([int *p;], [extern int $v []; p = $v;],
    310425                   [eval "libiberty_cv_var_$v=yes"],
    311426                   [eval "libiberty_cv_var_$v=no"])])
     
    319434  done
    320435  AC_CHECK_FUNCS($checkfuncs)
    321 fi
     436  libiberty_NEED_DECLARATION(canonicalize_file_name)
     437fi
     438
     439# Figure out which version of pexecute to use.
     440case "${host}" in
     441     *-*-mingw* | *-*-winnt*)   pexecute=pex-win32.o  ;;
     442     *-*-msdosdjgpp*)           pexecute=pex-djgpp.o  ;;
     443     *-*-msdos*)                pexecute=pex-msdos.o  ;;
     444     *-*-os2-emx*)              pexecute=pex-os2.o    ;;
     445     *)                         pexecute=pex-unix.o   ;;
     446esac
     447AC_SUBST(pexecute)
    322448
    323449libiberty_AC_FUNC_STRNCMP
     
    336462[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
    337463if test -n "$CONFIG_FILES"; then
    338   if test -n "${with_target_subdir}"; then
     464  if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
    339465    # FIXME: We shouldn't need to set ac_file
    340466    ac_file=Makefile
     467    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
    341468    . ${libiberty_topdir}/config-ml.in
    342469  fi
     
    346473target=${target}
    347474with_target_subdir=${with_target_subdir}
     475with_build_subdir=${with_build_subdir}
    348476with_multisubdir=${with_multisubdir}
    349477ac_configure_args="--enable-multilib ${ac_configure_args}"
    350478CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
     479ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
    351480libiberty_topdir=${libiberty_topdir}
    352481)
Note: See TracChangeset for help on using the changeset viewer.