diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2001-11-28 01:37:24 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-11-28 01:37:24 +0000 |
commit | e490616e338de38ffb90494e9d2091b65ea43eed (patch) | |
tree | e1dc68a1dd3eda602d655c2a861ed8f415a0163c /libiberty/configure | |
parent | 215e11524b766abfb266cbce99be3a5a175a4c4e (diff) | |
download | gcc-e490616e338de38ffb90494e9d2091b65ea43eed.zip gcc-e490616e338de38ffb90494e9d2091b65ea43eed.tar.gz gcc-e490616e338de38ffb90494e9d2091b65ea43eed.tar.bz2 |
top level:
2001-11-27 DJ Delorie <dj@redhat.com>
Zack Weinberg <zack@codesourcery.com>
When build != host, create libiberty for the build machine.
* Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace
CONFIG_ARGUMENTS.
(ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR):
New variables.
(ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables
and rules.
(all.normal): Depend on ALL_BUILD_MODULES.
(CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS.
(all-build-libiberty): Depend on configure-build-libiberty.
* configure: Calculate and substitute proper value for
ALL_BUILD_MODULES.
* configure.in: Create the build subdirectory.
Calculate and substitute TARGET_CONFIGARGS (formerly
CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new).
libiberty:
2001-11-27 Zack Weinberg <zack@codesourcery.com>
* _doprnt.c: Moved here from gcc/doprint.c. Adjust to build
in libiberty context. Fix typo in leading comment.
* configure.in: Fix various AC_DEFINEs so autoheader works.
If any of vprintf, vsprintf, vfprintf is missing from libc,
then AC_REPLACE_FUNCS(_doprnt).
From-SVN: r47393
Diffstat (limited to 'libiberty/configure')
-rwxr-xr-x | libiberty/configure | 122 |
1 files changed, 86 insertions, 36 deletions
diff --git a/libiberty/configure b/libiberty/configure index 8800349..72f2538 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1965,7 +1965,7 @@ fi case "${host}" in - *-*-cygwin*) + *-*-cygwin*) cat >> confdefs.h <<\EOF #define HAVE_SYS_ERRLIST 1 EOF @@ -2653,21 +2653,84 @@ fi if test $ac_cv_func_vfork_works = no; then LIBOBJS="$LIBOBJS vfork.o" fi + # We only need _doprnt if we might use it to implement v*printf. + if test $ac_cv_func_vprintf != yes \ + || test $ac_cv_func_vfprintf != yes \ + || test $ac_cv_func_vsprintf != yes; then + for ac_func in _doprnt +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2664: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2669 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" +fi +done + + + fi + for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2659: checking for $v" >&5 +echo "configure:2722: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2664 "configure" +#line 2727 "configure" #include "confdefs.h" int *p; int main() { extern int $v; p = &$v; ; return 0; } EOF -if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2693,12 +2756,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2697: checking for $ac_func" >&5 +echo "configure:2760: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2702 "configure" +#line 2765 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2721,7 +2784,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2747,21 +2810,21 @@ done fi -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h +for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2755: checking for $ac_hdr" >&5 +echo "configure:2818: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2760 "configure" +#line 2823 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2790,12 +2853,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2794: checking for $ac_func" >&5 +echo "configure:2857: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2799 "configure" +#line 2862 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2818,7 +2881,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2843,7 +2906,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2847: checking for working mmap" >&5 +echo "configure:2910: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2851,7 +2914,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 2855 "configure" +#line 2918 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -2879,24 +2942,11 @@ else #include <fcntl.h> #include <sys/mman.h> -#if HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif - -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif - -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif - -#if HAVE_UNISTD_H -# include <unistd.h> -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3004,7 +3054,7 @@ main() } EOF -if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3028,7 +3078,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3032: checking for working strncmp" >&5 +echo "configure:3082: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3036,7 +3086,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <<EOF -#line 3040 "configure" +#line 3090 "configure" #include "confdefs.h" /* Test by Jim Wilson and Kaveh Ghazi. @@ -3097,7 +3147,7 @@ main () } EOF -if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else |