diff options
author | Roland McGrath <roland@gnu.org> | 1995-07-27 09:00:07 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-07-27 09:00:07 +0000 |
commit | b8dc6a10ee55180805ea956ec5be3d001169c4ba (patch) | |
tree | 3ff4f01583cd3d9bfcd63fef31c85572e9396098 | |
parent | 4e1bac76a81d99ff4658fb86edb04356d357017d (diff) | |
download | glibc-b8dc6a10ee55180805ea956ec5be3d001169c4ba.tar glibc-b8dc6a10ee55180805ea956ec5be3d001169c4ba.tar.gz glibc-b8dc6a10ee55180805ea956ec5be3d001169c4ba.tar.bz2 glibc-b8dc6a10ee55180805ea956ec5be3d001169c4ba.zip |
* csu/Makefile [$(elf)=yes] (have-initfini): Set to yes.
[$(have-initfini)=yes]: Test this rather than $(elf) for crtstuff.
[start-installed-name-rule]: If this is defined, elide rule for
$(objpfx)$(start-installed-name).
* sysdeps/unix/sysv/sco3.2.4/Makefile [$(subdir)=csu]
(start-installed-rule, start-installed-name-rule): New variables;
specify crt1.o, created by our own rule.
($(objpfx)crt1.o): New rule.
* configure.in: Require autoconf 2.4.2 or later. Change all
AC_CACHE_VAL uses to use new AC_CACHE_CHECK macro instead;
prettify some messages.
[$elf!=yes] (libc_cv_have_initfini): New test for `.init' and `.fini'
sections.
* munch-tmpl.c [HAVE_INITFINI]: Call _init and atexit (_fini) in
this case rather than #ifdef HAVE_ELF.
* config.h.in (HAVE_INITFINI): New macro.
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 255 | ||||
-rw-r--r-- | configure.in | 47 | ||||
-rw-r--r-- | csu/Makefile | 7 | ||||
-rw-r--r-- | munch-tmpl.c | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sco3.2.4/Makefile | 14 |
7 files changed, 276 insertions, 73 deletions
@@ -1,5 +1,22 @@ Wed Jul 26 02:00:29 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + * csu/Makefile [$(elf)=yes] (have-initfini): Set to yes. + [$(have-initfini)=yes]: Test this rather than $(elf) for crtstuff. + [start-installed-name-rule]: If this is defined, elide rule for + $(objpfx)$(start-installed-name). + * sysdeps/unix/sysv/sco3.2.4/Makefile [$(subdir)=csu] + (start-installed-rule, start-installed-name-rule): New variables; + specify crt1.o, created by our own rule. + ($(objpfx)crt1.o): New rule. + * configure.in: Require autoconf 2.4.2 or later. Change all + AC_CACHE_VAL uses to use new AC_CACHE_CHECK macro instead; + prettify some messages. + [$elf!=yes] (libc_cv_have_initfini): New test for `.init' and `.fini' + sections. + * munch-tmpl.c [HAVE_INITFINI]: Call _init and atexit (_fini) in + this case rather than #ifdef HAVE_ELF. + * config.h.in (HAVE_INITFINI): New macro. + * stdio/vfscanf.c (conv_error): Simplify expression to avoid "value computed is not used" warning. diff --git a/config.h.in b/config.h.in index 0b5a034329..800fe15720 100644 --- a/config.h.in +++ b/config.h.in @@ -11,6 +11,9 @@ linker being used. Set by --with-weak-symbols. */ #undef HAVE_WEAK_SYMBOLS +/* Define if not using ELF, but `.init' and `.fini' sections are available. */ +#undef HAVE_INITFINI + /* Define if using the GNU assembler, gas. */ #undef HAVE_GNU_AS @@ -2,7 +2,7 @@ # From configure.in CVSid # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.4 +# Generated automatically using autoconf version 2.4.2 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -54,6 +54,18 @@ target=NONE verbose= x_includes=NONE x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' # Initialize some other variables. subdirs= @@ -78,9 +90,14 @@ do case "$ac_option" in - -build | --build | --buil | --bui | --bu | --b) + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) + -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ @@ -90,6 +107,12 @@ do | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. @@ -140,12 +163,26 @@ Configuration: Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] - --exec-prefix=PREFIX install architecture-dependent files in PREFIX + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names +EOF + cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] @@ -166,6 +203,44 @@ EOF -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; @@ -178,6 +253,15 @@ EOF | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) @@ -218,6 +302,23 @@ EOF | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) @@ -228,6 +329,13 @@ EOF -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) @@ -237,7 +345,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.4" + echo "configure generated by autoconf version 2.4.2" exit 0 ;; -with-* | --with-*) @@ -402,9 +510,12 @@ fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' +ac_cpp='echo $CPP $CPPFLAGS 1>&5; +$CPP $CPPFLAGS' +ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; +${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; +${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -434,8 +545,8 @@ config_vars= # Check for a --with-gmp argument and set gmp-srcdir in config.make. # Check whether --with-gmp or --without-gmp was given. -withval="$with_gmp" -if test -n "$withval"; then +if test "${with_gmp+set}" = set; then + withval="$with_gmp" case "$with_gmp" in yes) { echo "configure: error: --with-gmp requires an argument; use --with-gmp=DIRECTORY" 1>&2; exit 1; } ;; ''|no) ;; @@ -447,32 +558,32 @@ fi # Check whether --with-fp or --without-fp was given. -withval="$with_fp" -if test -n "$withval"; then +if test "${with_fp+set}" = set; then + withval="$with_fp" with_fp=$withval else with_fp=yes fi # Check whether --with-gnu-binutils or --without-gnu-binutils was given. -withval="$with_gnu_binutils" -if test -n "$withval"; then +if test "${with_gnu_binutils+set}" = set; then + withval="$with_gnu_binutils" gnu_binutils=$withval else gnu_binutils=no fi # Check whether --with-gnu-ld or --without-gnu-ld was given. -withval="$with_gnu_ld" -if test -n "$withval"; then +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" gnu_ld=$withval else gnu_ld=no fi # Check whether --with-gnu-as or --without-gnu-as was given. -withval="$with_gnu_as" -if test -n "$withval"; then +if test "${with_gnu_as+set}" = set; then + withval="$with_gnu_as" gnu_as=$withval else gnu_as=no @@ -480,16 +591,16 @@ fi test $gnu_binutils = yes && gnu_as=yes gnu_ld=yes # Check whether --with-elf or --without-elf was given. -withval="$with_elf" -if test -n "$withval"; then +if test "${with_elf+set}" = set; then + withval="$with_elf" elf=$withval else elf=no fi # Check whether --with-weak-symbols or --without-weak-symbols was given. -withval="$with_weak_symbols" -if test -n "$withval"; then +if test "${with_weak_symbols+set}" = set; then + withval="$with_weak_symbols" weak=$withval else weak=no @@ -497,24 +608,24 @@ fi # Check whether --enable-shared or --disable-shared was given. -enableval="$enable_shared" -if test -n "$enableval"; then +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" shared=$enableval else shared=default fi # Check whether --enable-profile or --disable-profile was given. -enableval="$enable_profile" -if test -n "$enableval"; then +if test "${enable_profile+set}" = set; then + enableval="$enable_profile" profile=$enableval else profile=yes fi # Check whether --enable-omitfp or --disable-omitfp was given. -enableval="$enable_omitfp" -if test -n "$enableval"; then +if test "${enable_omitfp+set}" = set; then + enableval="$enable_omitfp" omitfp=$enableval else omitfp=no @@ -777,8 +888,8 @@ done libc_cv_sysdirs="$sysnames" fi +echo "$ac_t""$libc_cv_sysdirs" 1>&4 sysnames="$libc_cv_sysdirs" -echo "$ac_t""${sysnames}" 1>&4 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -819,10 +930,17 @@ else esac done IFS="$ac_save_ifs" - # As a last resort, use the slow shell script. - test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" + fi - INSTALL="$ac_cv_path_install" + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi fi echo "$ac_t""$INSTALL" 1>&4 @@ -870,7 +988,7 @@ else ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + for ac_dir in gcc; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="${ac_tool_prefix}gcc" @@ -900,7 +1018,7 @@ else ac_cv_prog_AR="$AR" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + for ac_dir in ar; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AR="${ac_tool_prefix}ar" @@ -960,7 +1078,7 @@ else ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + for ac_dir in :; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" @@ -998,7 +1116,7 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1002 "configure" +#line 1120 "configure" #include "confdefs.h" #include <assert.h> Syntax Error @@ -1012,7 +1130,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1016 "configure" +#line 1134 "configure" #include "confdefs.h" #include <assert.h> Syntax Error @@ -1038,7 +1156,7 @@ fi echo "$ac_t""$CPP" 1>&4 -echo $ac_n "checking signed size_t type""... $ac_c" 1>&4 +echo $ac_n "checking for signed size_t type""... $ac_c" 1>&4 if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&4 else @@ -1061,12 +1179,12 @@ if test $libc_cv_signed_size_t = yes; then EOF fi -echo $ac_n "checking libc-friendly stddef.h""... $ac_c" 1>&4 +echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&4 if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&4 else cat > conftest.$ac_ext <<EOF -#line 1070 "configure" +#line 1188 "configure" #include "confdefs.h" #define __need_size_t #define __need_wchar_t @@ -1183,6 +1301,40 @@ EOF fi +if test $elf != yes; then + echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&4 +if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&4 +else + cat > conftest.$ac_ext <<EOF +#line 1311 "configure" +#include "confdefs.h" + +int main() { return 0; } +int t() { +asm (".section .init"); + asm (".section .fini"); +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + libc_cv_have_initfini=yes +else + rm -rf conftest* + libc_cv_have_initfini=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$libc_cv_have_initfini" 1>&4 + if test $libc_cv_have_initfini = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_INITFINI 1 +EOF + + fi +fi # sysdeps configure fragments may set these with files to be linked below. libc_link_dests= @@ -1214,7 +1366,7 @@ if test "$uname" = generic; then fi echo $ac_n "checking OS release for uname""... $ac_c" 1>&4 - if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then +if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&4 else kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` @@ -1231,11 +1383,11 @@ else fi fi - echo "$ac_t""$libc_cv_uname_release" 1>&4 +echo "$ac_t""$libc_cv_uname_release" 1>&4 uname_release="$libc_cv_uname_release" echo $ac_n "checking OS version for uname""... $ac_c" 1>&4 - if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then +if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&4 else kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` @@ -1246,7 +1398,7 @@ else fi fi - echo "$ac_t""$libc_cv_uname_version" 1>&4 +echo "$ac_t""$libc_cv_uname_version" 1>&4 uname_version="$libc_cv_uname_version" config_uname=config-name.h:config-name.in @@ -1373,7 +1525,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.4" + echo "$CONFIG_STATUS generated by autoconf version 2.4.2" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1400,6 +1552,18 @@ s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g @@ -1417,6 +1581,7 @@ s%@CC@%$CC%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g s%@CPP@%$CPP%g +s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g s%@uname_sysname@%$uname_sysname%g s%@uname_release@%$uname_release%g s%@uname_version@%$uname_version%g diff --git a/configure.in b/configure.in index a35378ab37..319513b100 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_REVISION([$CVSid$]) -AC_PREREQ(2.2)dnl dnl Minimum Autoconf version required. +AC_PREREQ(2.4.2)dnl dnl Minimum Autoconf version required. AC_INIT(features.h) AC_CONFIG_HEADER(config.h) @@ -72,8 +72,7 @@ esac # Compute the list of sysdep directories for this configuration. sysdep_dir=$srcdir/sysdeps -AC_MSG_CHECKING(sysdep dirs) -AC_CACHE_VAL(libc_cv_sysdirs, [dnl +AC_CACHE_CHECK(sysdep dirs, libc_cv_sysdirs, [dnl machine=$config_machine vendor=$config_vendor os=$config_os @@ -267,7 +266,6 @@ $name" done libc_cv_sysdirs="$sysnames"]) AC_SUBST(sysnames) sysnames="$libc_cv_sysdirs" -AC_MSG_RESULT(${sysnames}) AC_PROG_INSTALL if test "$INSTALL" = "${srcdir}/install-sh"; then @@ -280,8 +278,7 @@ AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_PROG_CPP -AC_MSG_CHECKING(signed size_t type) -AC_CACHE_VAL(libc_cv_signed_size_t, [dnl +AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl echo '#include <stddef.h> FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c if eval "$ac_cpp conftest.c 2>/dev/null" \ @@ -291,7 +288,6 @@ else libc_cv_signed_size_t=yes fi rm -f conftest*]) -AC_MSG_RESULT($libc_cv_signed_size_t) if test $libc_cv_signed_size_t = yes; then dnl Do this by hand instead of AC_DEFINE so can add #undef to avoid warnings. cat >> confdefs.h <<\EOF @@ -300,8 +296,7 @@ if test $libc_cv_signed_size_t = yes; then EOF fi -AC_MSG_CHECKING(libc-friendly stddef.h) -AC_CACHE_VAL(libc_cv_friendly_stddef, [dnl +AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl AC_TRY_COMPILE(dnl [#define __need_size_t #define __need_wchar_t @@ -314,14 +309,13 @@ AC_TRY_COMPILE(dnl if (&size == NULL || &wchar == NULL) abort ();], libc_cv_friendly_stddef=yes, libc_cv_friendly_stddef=no)]) -AC_MSG_RESULT($libc_cv_friendly_stddef) if test $libc_cv_friendly_stddef = yes; then config_vars="$config_vars override stddef.h = # The installed <stddef.h> seems to be libc-friendly." fi -AC_MSG_CHECKING(whether we need to use -P to assemble .S files) -AC_CACHE_VAL(libc_cv_need_minus_P, [dnl +AC_CACHE_CHECK(whether we need to use -P to assemble .S files, + libc_cv_need_minus_P, [dnl cat > conftest.S <<EOF #include "confdefs.h" /* Nothing whatsoever. */ @@ -332,14 +326,13 @@ else libc_cv_need_minus_P=yes fi rm -f conftest*]) -AC_MSG_RESULT($libc_cv_need_minus_P) if test $libc_cv_need_minus_P = yes; then config_vars="$config_vars asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." fi -AC_MSG_CHECKING(for assembler global-symbol directive) -AC_CACHE_VAL(libc_cv_asm_global_directive, [dnl +AC_CACHE_CHECK(for assembler global-symbol directive, + libc_cv_asm_global_directive, [dnl libc_cv_asm_global_directive=UNKNOWN for ac_globl in .globl .global; do cat > conftest.s <<EOF @@ -353,15 +346,13 @@ EOF rm -f conftest* test $libc_cv_asm_global_directive != UNKNOWN && break done]) -AC_MSG_RESULT($libc_cv_asm_global_directive) if test $libc_cv_asm_global_directive = UNKNOWN; then AC_MSG_ERROR(cannot determine asm global directive) else AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${libc_cv_asm_global_directive}) fi -AC_MSG_CHECKING(for .set assembler directive) -AC_CACHE_VAL(libc_cv_asm_set_directive, [dnl +AC_CACHE_CHECK(for .set assembler directive, libc_cv_asm_set_directive, [dnl cat > conftest.s <<EOF .text foo: .long 0 @@ -381,11 +372,21 @@ else libc_cv_asm_set_directive=no fi rm -f conftest*]) -AC_MSG_RESULT($libc_cv_asm_set_directive) if test $libc_cv_asm_set_directive = yes; then AC_DEFINE(HAVE_ASM_SET_DIRECTIVE) fi +if test $elf != yes; then + AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini, + [AC_TRY_COMPILE(, [asm (".section .init"); + asm (".section .fini");], + libc_cv_have_initfini=yes, + libc_cv_have_initfini=no)]) + AC_SUBST(libc_cv_have_initfini)dnl + if test $libc_cv_have_initfini = yes; then + AC_DEFINE(HAVE_INITFINI) + fi +fi # sysdeps configure fragments may set these with files to be linked below. libc_link_dests= @@ -428,8 +429,7 @@ AC_DEFUN(LIBC_KERNEL_ID, [dnl fi ])dnl - AC_MSG_CHECKING(OS release for uname) - AC_CACHE_VAL(libc_cv_uname_release, [dnl + AC_CACHE_CHECK(OS release for uname, libc_cv_uname_release, [dnl AC_REQUIRE([LIBC_KERNEL_ID])dnl changequote(,)dnl kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'` @@ -445,11 +445,9 @@ changequote([,])dnl else libc_cv_uname_release=unknown fi]) - AC_MSG_RESULT($libc_cv_uname_release) uname_release="$libc_cv_uname_release" - AC_MSG_CHECKING(OS version for uname) - AC_CACHE_VAL(libc_cv_uname_version, [dnl + AC_CACHE_CHECK(OS version for uname, libc_cv_uname_version, [dnl AC_REQUIRE([LIBC_KERNEL_ID])dnl changequote(,)dnl kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'` @@ -459,7 +457,6 @@ changequote([,])dnl else libc_cv_uname_version=unknown fi]) - AC_MSG_RESULT($libc_cv_uname_version) uname_version="$libc_cv_uname_version" AC_SUBST(uname_sysname) AC_SUBST(uname_release) AC_SUBST(uname_version)dnl diff --git a/csu/Makefile b/csu/Makefile index 31b0f0ab7c..8f97624240 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -48,6 +48,11 @@ else # In the ELF universe, crt0.o is called crt1.o, and there are # some additional bizarre files. start-installed-name = crt1.o +have-initfini = yes + +endif + +ifeq (yes,$(have-initfini)) # These are the special initializer/finalizer files. They are always the # first and last file in the link. crti.o ... crtn.o define the global @@ -82,11 +87,13 @@ endif include ../Rules +ifndef start-installed-name-rule # The startfile is installed under different names, so we just call our # source file `start.c' and copy to the installed name after compiling. $(objpfx)$(start-installed-name): $(objpfx)start.o -rm -f $@ ln $< $@ +endif # These extra files are sometimes expected by system standard linking # procedures, but we have nothing for them to do. So compile empty files. diff --git a/munch-tmpl.c b/munch-tmpl.c index 731583a6fc..2ef2139752 100644 --- a/munch-tmpl.c +++ b/munch-tmpl.c @@ -29,12 +29,12 @@ __libc_init (argc, argv, envp) { CALLS -#ifdef HAVE_ELF +#ifdef HAVE_INITFINI { /* These functions are defined in crti.o to run the .init and .fini - sections, which are used for initializers in ELF. */ + sections, which are used for initializers and finalizers. */ extern void _init __P ((void)), _fini __P ((void)); - atexit (_fini); /* Arrange for _fini to run at exit. */ + atexit (&_fini); /* Arrange for _fini to run at exit. */ _init (); } #endif diff --git a/sysdeps/unix/sysv/sco3.2.4/Makefile b/sysdeps/unix/sysv/sco3.2.4/Makefile index 23525e527d..a199ba9003 100644 --- a/sysdeps/unix/sysv/sco3.2.4/Makefile +++ b/sysdeps/unix/sysv/sco3.2.4/Makefile @@ -1,3 +1,17 @@ ifeq (posix,$(subdir)) sysdep_routines := $(sysdep_routines) pgrpsys sco_getgrp endif + +ifeq (csu,$(subdir)) + +# SCO uses crt1.o, and expects that single initializer file to also start +# the .init and .fini sections as crti.o normally does. +start-installed-name = crt1.o +start-installed-name-rule = yes + +# Link together start.o and crti.o into the expected crt1.o. +# Now crt1.o as initializer and crtn.o as finalizer will work. +$(objpfx)crt1.o: $(objpfx)start.o $(objpfx)crti.o + $(CC) -nostdlib -nostartfiles -Wl,-r -o $@ $^ + +endif |