From 9962ed990753c6d301e814ab4497509782bf468d Mon Sep 17 00:00:00 2001 From: okuji Date: Fri, 27 Dec 2002 14:14:06 +0000 Subject: [PATCH] 2002-12-27 Yoshinori K. Okuji * configure.ac: Check ld. Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS respectively, before checking endianness and sizes. * Makefile.in (LD): New variable. --- ChangeLog | 8 +++++ Makefile.in | 1 + NEWS | 4 +++ configure | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 11 +++++-- 5 files changed, 111 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ab0deefe..7fd12f963 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-12-27 Yoshinori K. Okuji + + * configure.ac: Check ld. + Replace CFLAGS and CPPFLAGS with BUILD_CFLAGS and BUILD_CPPFLAGS + respectively, before checking endianness and sizes. + + * Makefile.in (LD): New variable. + 2002-12-27 Yoshinori K. Okuji * Makefile.in (BUILD_CC): CC -> BUILD_CC. diff --git a/Makefile.in b/Makefile.in index 06ff43eed..81eb3db4e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -65,6 +65,7 @@ BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ +LD = @LD@ RUBY = @RUBY@ ### General variables. diff --git a/NEWS b/NEWS index 65ce9a0dc..032e2dd75 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in 0.7: + +* Problems in cross-compiling PUPA are fixed. + New in 0.6 - 2002-12-27, Yoshinori K. Okuji: * The chainloader and the FAT filesystem are modularized. diff --git a/configure b/configure index 45a328b60..9c619bbc8 100644 --- a/configure +++ b/configure @@ -3179,6 +3179,85 @@ else NM="$ac_cv_prog_NM" fi +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. +set dummy ${ac_tool_prefix}ld; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LD="${ac_tool_prefix}ld" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LD=$ac_cv_prog_LD +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_LD"; then + ac_ct_LD=$LD + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_LD"; then + ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LD="ld" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_LD=$ac_cv_prog_ac_ct_LD +if test -n "$ac_ct_LD"; then + echo "$as_me:$LINENO: result: $ac_ct_LD" >&5 +echo "${ECHO_T}$ac_ct_LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + LD=$ac_ct_LD +else + LD="$ac_cv_prog_LD" +fi + # This is not a "must". # Extract the first word of "ruby", so it can be a program name with args. @@ -3272,8 +3351,12 @@ echo "$as_me: error: none of gcc, egcs and cc is found. set BUILD_CC manually." fi # Test the C compiler for the build environment. -pupa_tmp_CC="$CC" +tmp_CC="$CC" +tmp_CFLAGS="$CFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" CC="$BUILD_CC" +CFLAGS="$BUILD_CFLAGS" +CPPFLAGS="$BUILD_CPPFLAGS" echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then @@ -4598,7 +4681,9 @@ cat >>confdefs.h <<_ACEOF _ACEOF -CC="$pupa_tmp_CC" +CC="$tmp_CC" +CFLAGS="$tmp_CFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" # Output files. ac_config_links="$ac_config_links include/pupa/cpu:include/pupa/$host_cpu include/pupa/machine:include/pupa/$host_cpu/$host_vendor" @@ -5193,6 +5278,8 @@ s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@NM@,$NM,;t t s,@ac_ct_NM@,$ac_ct_NM,;t t +s,@LD@,$LD,;t t +s,@ac_ct_LD@,$ac_ct_LD,;t t s,@RUBY@,$RUBY,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@CPP@,$CPP,;t t diff --git a/configure.ac b/configure.ac index 524fc1420..6e63db47c 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,7 @@ AC_CHECK_TOOL(OBJCOPY, objcopy) pupa_PROG_OBJCOPY_ABSOLUTE AC_CHECK_TOOL(STRIP, strip) AC_CHECK_TOOL(NM, nm) +AC_CHECK_TOOL(LD, ld) # This is not a "must". AC_PATH_PROG(RUBY, ruby) @@ -109,12 +110,18 @@ else fi # Test the C compiler for the build environment. -pupa_tmp_CC="$CC" +tmp_CC="$CC" +tmp_CFLAGS="$CFLAGS" +tmp_CPPFLAGS="$CPPFLAGS" CC="$BUILD_CC" +CFLAGS="$BUILD_CFLAGS" +CPPFLAGS="$BUILD_CPPFLAGS" AC_C_BIGENDIAN AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) -CC="$pupa_tmp_CC" +CC="$tmp_CC" +CFLAGS="$tmp_CFLAGS" +CPPFLAGS="$tmp_CPPFLAGS" # Output files. AC_CONFIG_LINKS([include/pupa/cpu:include/pupa/$host_cpu