From 1d989efa7012a320ce86a1c9b508afd779b93547 Mon Sep 17 00:00:00 2001 From: michaelh Date: Sun, 8 Jul 2001 01:34:13 +0000 Subject: [PATCH] Added defaults for cross compiling git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1043 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- packihx/configure | 54 ++++++++++++++++----------- packihx/configure.in | 15 +++++--- sim/ucsim/configure | 83 +++++++++++++++++++++++++----------------- sim/ucsim/configure.in | 12 ++++++ 4 files changed, 104 insertions(+), 60 deletions(-) diff --git a/packihx/configure b/packihx/configure index b01c173f..c15437d7 100755 --- a/packihx/configure +++ b/packihx/configure @@ -747,18 +747,24 @@ else fi +# Defaults are for gcc on a 32 bit machine +if test "$ac_cv_prog_cc_cross" = "yes"; then + echo "configure: warning: "Cannot determine the sizeof basic types while cross compiling. Using gcc on a 32 bit machine defaults."" 1>&2 +fi + echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:752: checking size of char" >&5 +echo "configure:757: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -767,7 +773,7 @@ main() exit(0); } EOF -if { (eval echo configure:771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -787,17 +793,18 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:791: checking size of short" >&5 +echo "configure:797: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + ac_cv_sizeof_short=2 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -806,7 +813,7 @@ main() exit(0); } EOF -if { (eval echo configure:810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -826,17 +833,18 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:830: checking size of int" >&5 +echo "configure:837: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -845,7 +853,7 @@ main() exit(0); } EOF -if { (eval echo configure:849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -865,17 +873,18 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:869: checking size of long" >&5 +echo "configure:877: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -884,7 +893,7 @@ main() exit(0); } EOF -if { (eval echo configure:888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -904,17 +913,18 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:908: checking size of long long" >&5 +echo "configure:917: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -923,7 +933,7 @@ main() exit(0); } EOF -if { (eval echo configure:927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -969,11 +979,11 @@ type_name() } echo $ac_n "checking type name for byte""... $ac_c" 1>&6 -echo "configure:973: checking type name for byte" >&5 +echo "configure:983: checking type name for byte" >&5 TYPE_BYTE=`type_name 1` echo "$ac_t""$TYPE_BYTE" 1>&6 echo $ac_n "checking type name for word""... $ac_c" 1>&6 -echo "configure:977: checking type name for word" >&5 +echo "configure:987: checking type name for word" >&5 TYPE_WORD=`type_name 2` echo "$ac_t""$TYPE_WORD" 1>&6 cat >> confdefs.h <&6 -echo "configure:2252: checking whether byte ordering is bigendian" >&5 +echo "configure:2263: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2266,11 +2277,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2281,7 +2292,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2301,7 +2312,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2341,7 +2352,7 @@ EOF fi echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6 -echo "configure:2345: checking whether preprocessor accepts -MM or -M" >&5 +echo "configure:2356: checking whether preprocessor accepts -MM or -M" >&5 if eval "test \"`echo '$''{'ucsim_cv_MM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2364,7 +2375,7 @@ M_OR_MM=$ucsim_cv_MM echo $ac_n "checking whether $CXX accepts -ggdb""... $ac_c" 1>&6 -echo "configure:2368: checking whether $CXX accepts -ggdb" >&5 +echo "configure:2379: checking whether $CXX accepts -ggdb" >&5 if eval "test \"`echo '$''{'ucsim_cv_CXXggdb'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2393,7 +2404,7 @@ fi echo $ac_n "checking whether $CXX accepts -pipe""... $ac_c" 1>&6 -echo "configure:2397: checking whether $CXX accepts -pipe" >&5 +echo "configure:2408: checking whether $CXX accepts -pipe" >&5 if eval "test \"`echo '$''{'ucsim_cv_CXXpipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2420,7 +2431,7 @@ PICOPT="" SHAREDLIB="no" echo $ac_n "checking whether $CXX accepts -fPIC""... $ac_c" 1>&6 -echo "configure:2424: checking whether $CXX accepts -fPIC" >&5 +echo "configure:2435: checking whether $CXX accepts -fPIC" >&5 if eval "test \"`echo '$''{'ucsim_cv_CXXfPIC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2444,7 +2455,7 @@ if test "$ucsim_cv_CXXfPIC" = "yes"; then else echo $ac_n "checking whether $CXX accepts -fpic""... $ac_c" 1>&6 -echo "configure:2448: checking whether $CXX accepts -fpic" >&5 +echo "configure:2459: checking whether $CXX accepts -fpic" >&5 if eval "test \"`echo '$''{'ucsim_cv_CXXfpic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2477,13 +2488,14 @@ fi # Checks for typedefs, structures, and compiler characteristics. # =========================================================================== + echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2482: checking return type of signal handlers" >&5 +echo "configure:2494: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2500,7 +2512,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2519,7 +2531,7 @@ EOF echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:2523: checking size of char" >&5 +echo "configure:2535: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2527,12 +2539,13 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -2541,7 +2554,7 @@ main() exit(0); } EOF -if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -2561,7 +2574,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2565: checking size of short" >&5 +echo "configure:2578: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2569,12 +2582,13 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -2583,7 +2597,7 @@ main() exit(0); } EOF -if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2603,7 +2617,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2607: checking size of int" >&5 +echo "configure:2621: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2611,12 +2625,13 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -2625,7 +2640,7 @@ main() exit(0); } EOF -if { (eval echo configure:2629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -2645,7 +2660,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2649: checking size of long" >&5 +echo "configure:2664: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2653,12 +2668,13 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -2667,7 +2683,7 @@ main() exit(0); } EOF -if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2687,7 +2703,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:2691: checking size of long long" >&5 +echo "configure:2707: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2695,12 +2711,13 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -2709,7 +2726,7 @@ main() exit(0); } EOF -if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -2755,15 +2772,15 @@ type_name() } echo $ac_n "checking type name for byte""... $ac_c" 1>&6 -echo "configure:2759: checking type name for byte" >&5 +echo "configure:2776: checking type name for byte" >&5 TYPE_BYTE=`type_name 1` echo "$ac_t""$TYPE_BYTE" 1>&6 echo $ac_n "checking type name for word""... $ac_c" 1>&6 -echo "configure:2763: checking type name for word" >&5 +echo "configure:2780: checking type name for word" >&5 TYPE_WORD=`type_name 2` echo "$ac_t""$TYPE_WORD" 1>&6 echo $ac_n "checking type name for dword""... $ac_c" 1>&6 -echo "configure:2767: checking type name for dword" >&5 +echo "configure:2784: checking type name for dword" >&5 TYPE_DWORD=`type_name 4` echo "$ac_t""$TYPE_DWORD" 1>&6 cat >> confdefs.h <" >_test_.c @@ -280,6 +291,7 @@ AC_SUBST(PICOPT) # Checks for typedefs, structures, and compiler characteristics. # =========================================================================== + AC_TYPE_SIGNAL AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) -- 2.30.2