From: stevewilliams Date: Sat, 4 Nov 2000 18:16:24 +0000 (+0000) Subject: Add support for the --disable-boehm-gc flag for systems that lack -lgc. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=4726c45887ee4dd2fc2a58b94ff5abc2fd4cd6fd;p=fw%2Fsdcc Add support for the --disable-boehm-gc flag for systems that lack -lgc. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@485 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Makefile b/Makefile index 1b3c8d23..e24d2706 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,14 @@ # # + SHELL = /bin/sh AUTOCONF = autoconf PRJDIR = . +srcdir = . +include $(srcdir)/Makefile.common + SDCC_MISC = debugger/mcs51 sim/ucsim SDCC_LIBS = support/cpp SDCC_ASLINK = as/mcs51 as link @@ -17,7 +21,6 @@ PKGS_TINI = $(SDCC_LIBS) $(SDCC_ASLINK) \ src device/include $(SDCC_PACKIHX) PORTS = mcs51 z80 -srcdir = . # Compiling entire program or any subproject # ------------------------------------------ @@ -26,10 +29,14 @@ all: checkconf sdcc tini: checkconf sdcc-tini sdcc-libs: +ifeq ($(DISABLE_GC),1) + : skip boehm library when disabled by hand. +else ifeq ($(CROSS_LIBGC),1) $(MAKE) -C support/gc -f Makefile.cross else $(MAKE) -C support/gc +endif endif for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done diff --git a/Makefile.common.in b/Makefile.common.in index 0a8a494d..21371161 100644 --- a/Makefile.common.in +++ b/Makefile.common.in @@ -35,12 +35,17 @@ srcdir = @srcdir@ # Flags HAVE_LIBGC = @HAVE_LIBGC@ +DISABLE_GC = @DISABLE_GC@ DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@) CPPFLAGS = @CPPFLAGS@ -I$(PRJDIR) +ifeq ($(DISABLE_GC),1) +# Skip the Boehm GC library in special, manually configured cases. +else ifeq ($(HAVE_LIBGC),1) else CPPFLAGS += -I$(PRJDIR)/support endif +endif CFLAGS = @CFLAGS@ -Wall M_OR_MM = @M_OR_MM@ diff --git a/configure b/configure index 336f8341..fea9739a 100755 --- a/configure +++ b/configure @@ -19,6 +19,8 @@ ac_help="$ac_help --disable-mcs51-port: Excludes the Intel mcs51 port" ac_help="$ac_help --disable-avr-port: Excludes the AVR port" +ac_help="$ac_help +--disable-boehm-gc: Excludes sdcc use of libgc." # Initialize some variables set by options. # The variables have the same names as the options, with @@ -531,12 +533,12 @@ fi -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:540: checking for $ac_word" >&5 +echo "configure:542: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -567,7 +569,7 @@ done echo $ac_n "checking version of the package""... $ac_c" 1>&6 -echo "configure:571: checking version of the package" >&5 +echo "configure:573: checking version of the package" >&5 if test -f .version; then VERSION=`cat .version` elif test -f ../.version; then @@ -609,7 +611,7 @@ sdcc_cv_versionp=$VERSIONP # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:613: checking for $ac_word" >&5 +echo "configure:615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -639,7 +641,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:643: checking for $ac_word" >&5 +echo "configure:645: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -690,7 +692,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:694: checking for $ac_word" >&5 +echo "configure:696: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -722,7 +724,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:726: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -733,12 +735,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 737 "configure" +#line 739 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -764,12 +766,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:773: checking whether we are using GNU C" >&5 +echo "configure:775: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -778,7 +780,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -797,7 +799,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:801: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:803: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -833,7 +835,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:837: checking for $ac_word" >&5 +echo "configure:839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -865,7 +867,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:869: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:871: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -876,12 +878,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 880 "configure" +#line 882 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -907,12 +909,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:911: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:913: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:916: checking whether we are using GNU C++" >&5 +echo "configure:918: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -921,7 +923,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -940,7 +942,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:944: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:946: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -972,7 +974,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:976: checking how to run the C preprocessor" >&5 +echo "configure:978: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -987,13 +989,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:999: \"$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 : @@ -1004,13 +1006,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1016: \"$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 : @@ -1021,13 +1023,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1033: \"$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 : @@ -1082,7 +1084,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1086: checking for a BSD compatible install" >&5 +echo "configure:1088: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1137,7 +1139,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1141: checking for $ac_word" >&5 +echo "configure:1143: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1167,7 +1169,7 @@ fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1171: checking for $ac_word" >&5 +echo "configure:1173: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1201,7 +1203,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1205: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1207: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1209,7 +1211,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1245,7 +1247,7 @@ fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1249: checking for $ac_word" >&5 +echo "configure:1251: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1275,7 +1277,7 @@ fi # Extract the first word of "autoconf", so it can be a program name with args. set dummy autoconf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1279: checking for $ac_word" >&5 +echo "configure:1281: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AUTOCONF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1305,7 +1307,7 @@ fi # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1309: checking for $ac_word" >&5 +echo "configure:1311: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1335,7 +1337,7 @@ fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1339: checking for $ac_word" >&5 +echo "configure:1341: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1385,12 +1387,12 @@ cross_compiling=$ac_cv_prog_cc_cross # Checking for header files. # =========================================================================== echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1389: checking for ANSI C header files" >&5 +echo "configure:1391: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1398,7 +1400,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1404: \"$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* @@ -1415,7 +1417,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1433,7 +1435,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1454,7 +1456,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1465,7 +1467,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1492,17 +1494,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1496: checking for $ac_hdr" >&5 +echo "configure:1498: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1508: \"$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* @@ -1532,17 +1534,17 @@ 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:1536: checking for $ac_hdr" >&5 +echo "configure:1538: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1548: \"$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* @@ -1572,17 +1574,17 @@ for ac_hdr in endian.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1576: checking for $ac_hdr" >&5 +echo "configure:1578: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1588: \"$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* @@ -1612,17 +1614,17 @@ for ac_hdr in sys/isa_defs.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1616: checking for $ac_hdr" >&5 +echo "configure:1618: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1628: \"$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* @@ -1652,17 +1654,17 @@ for ac_hdr in sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1656: checking for $ac_hdr" >&5 +echo "configure:1658: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1668: \"$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* @@ -1693,12 +1695,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1697: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1699: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1706,7 +1708,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1731,7 +1733,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1735: checking for opendir in -ldir" >&5 +echo "configure:1737: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1739,7 +1741,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1772,7 +1774,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1776: checking for opendir in -lx" >&5 +echo "configure:1778: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1780,7 +1782,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1817,13 +1819,13 @@ fi # This must be after CPP echo $ac_n "checking which header file defines FD_ macros""... $ac_c" 1>&6 -echo "configure:1821: checking which header file defines FD_ macros" >&5 +echo "configure:1823: checking which header file defines FD_ macros" >&5 if eval "test \"`echo '$''{'s51_cv_fd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else sdcc_cv_fd="unknown" cat > conftest.$ac_ext < @@ -1839,7 +1841,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -1855,7 +1857,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < @@ -1935,12 +1937,12 @@ EOF for ac_func in strlen strcpy strcat strstr strcmp strerror strtok strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1939: checking for $ac_func" >&5 +echo "configure:1941: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1969: \"$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 @@ -1990,12 +1992,12 @@ done for ac_func in strchr memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1994: checking for $ac_func" >&5 +echo "configure:1996: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2024: \"$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 @@ -2045,12 +2047,12 @@ done for ac_func in fgets do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2049: checking for $ac_func" >&5 +echo "configure:2051: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2079: \"$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 @@ -2100,12 +2102,12 @@ done for ac_func in yylex do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2104: checking for $ac_func" >&5 +echo "configure:2106: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2134: \"$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 @@ -2156,14 +2158,14 @@ done # check if -lsocket && -lxnet is required to compile socket stuff echo $ac_n "checking for library containing socket""... $ac_c" 1>&6 -echo "configure:2160: checking for library containing socket" >&5 +echo "configure:2162: checking for library containing socket" >&5 if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_socket="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socket="none required" else @@ -2185,7 +2187,7 @@ rm -f conftest* test "$ac_cv_search_socket" = "no" && for i in socket; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socket="-l$i" break @@ -2218,14 +2220,14 @@ else : fi echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6 -echo "configure:2222: checking for library containing inet_addr" >&5 +echo "configure:2224: checking for library containing inet_addr" >&5 if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_inet_addr="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_inet_addr="none required" else @@ -2247,7 +2249,7 @@ rm -f conftest* test "$ac_cv_search_inet_addr" = "no" && for i in nsl xnet; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_inet_addr="-l$i" break @@ -2292,7 +2294,7 @@ fi # Checking characteristics of compilers and other programs # -------------------------------------------------------- echo $ac_n "checking whether preprocessor accepts -MM or -M""... $ac_c" 1>&6 -echo "configure:2296: checking whether preprocessor accepts -MM or -M" >&5 +echo "configure:2298: checking whether preprocessor accepts -MM or -M" >&5 if eval "test \"`echo '$''{'sdcc_cv_MM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2314,7 +2316,7 @@ M_OR_MM=$sdcc_cv_MM # This is the first time when CFLAGS are set/modified!! echo $ac_n "checking whether $CC accepts -ggdb""... $ac_c" 1>&6 -echo "configure:2318: checking whether $CC accepts -ggdb" >&5 +echo "configure:2320: checking whether $CC accepts -ggdb" >&5 if eval "test \"`echo '$''{'sdcc_cv_CCggdb'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2339,7 +2341,7 @@ fi echo $ac_n "checking whether $CC accepts -pipe""... $ac_c" 1>&6 -echo "configure:2343: checking whether $CC accepts -pipe" >&5 +echo "configure:2345: checking whether $CC accepts -pipe" >&5 if eval "test \"`echo '$''{'sdcc_cv_CCpipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2366,12 +2368,12 @@ fi # Checks for typedefs, structures, and compiler characteristics. # =========================================================================== echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2370: checking return type of signal handlers" >&5 +echo "configure:2372: 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 @@ -2388,7 +2390,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2467,7 +2469,7 @@ EOF # mlh: dont compile libgc if it's available locally echo $ac_n "checking for GC_malloc in -lgc""... $ac_c" 1>&6 -echo "configure:2471: checking for GC_malloc in -lgc" >&5 +echo "configure:2473: checking for GC_malloc in -lgc" >&5 ac_lib_var=`echo gc'_'GC_malloc | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2475,7 +2477,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2581,6 +2583,27 @@ EOF fi +# Check whether --enable-boehm-gc or --disable-boehm-gc was given. +if test "${enable_boehm_gc+set}" = set; then + enableval="$enable_boehm_gc" + : +fi + + +if test "$enable_boehm_gc" = "no"; then + cat >> confdefs.h <<\EOF +#define OPT_DISABLE_GC 1 +EOF + + DISABLE_GC=1 +else + cat >> confdefs.h <<\EOF +#define OPT_DISABLE_GC 0 +EOF + + DISABLE_GC=0 +fi + # Generating output files # =========================================================================== subdirs="sim/ucsim" @@ -2753,6 +2776,7 @@ s%@AS@%$AS%g s%@CP@%$CP%g s%@M_OR_MM@%$M_OR_MM%g s%@HAVE_LIBGC@%$HAVE_LIBGC%g +s%@DISABLE_GC@%$DISABLE_GC%g s%@subdirs@%$subdirs%g CEOF diff --git a/configure.in b/configure.in index ffbeae5e..b3c478a3 100755 --- a/configure.in +++ b/configure.in @@ -232,6 +232,16 @@ else AC_DEFINE_UNQUOTED(OPT_DISABLE_AVR, 0) fi +AC_ARG_ENABLE(boehm-gc,--disable-boehm-gc: Excludes sdcc use of libgc.) +AC_SUBST(DISABLE_GC,1) +if test "$enable_boehm_gc" = "no"; then + AC_DEFINE(OPT_DISABLE_GC, 1) + DISABLE_GC=1 +else + AC_DEFINE(OPT_DISABLE_GC, 0) + DISABLE_GC=0 +fi + # Generating output files # =========================================================================== AC_CONFIG_SUBDIRS(sim/ucsim) diff --git a/link/z80/lklibr.c b/link/z80/lklibr.c index 14c9ee04..e5999621 100644 --- a/link/z80/lklibr.c +++ b/link/z80/lklibr.c @@ -399,7 +399,7 @@ search() /* First entry in the library object symbol cache */ mlibraryfile libr = { - "", NULL, NULL + 0, "", NULL, NULL }; int fndsym( char *name ) diff --git a/sdccconf_in.h b/sdccconf_in.h index 70ca5cfc..d8cebd48 100644 --- a/sdccconf_in.h +++ b/sdccconf_in.h @@ -32,6 +32,7 @@ #undef OPT_DISABLE_GBZ80 #undef OPT_DISABLE_MCS51 #undef OPT_DISABLE_AVR +#undef OPT_DISABLE_GC #endif diff --git a/src/Makefile.in b/src/Makefile.in index ff320931..279f7576 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -11,12 +11,16 @@ USE_ALT_LEX = 0 PORTS = mcs51 z80 avr ds390 PORT_LIBS = $(PORTS:%=%/port.a) +ifeq ($(DISABLE_GC),1) +LIBS = -lm @LIBS@ +else LIBS = -lgc -lm @LIBS@ ifeq ($(HAVE_LIBGC), 1) else LIBDIRS = -L$(PRJDIR)/support/gc LIBGC = $(PRJDIR)/support/gc/libgc.a endif +endif #CFLAGS += -Werror diff --git a/src/SDCCast.c b/src/SDCCast.c index 893ad8b9..c2b4cd7b 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -85,7 +85,7 @@ ast *newAst (int type, void *op ) ex->opval.val = (value *) op; break ; case EX_OP : - ex->opval.op = (int) op ; + ex->opval.op = (long) op ; break ; case EX_LINK : ex->opval.lnk = (link *) op; @@ -100,7 +100,7 @@ ast *newAst (int type, void *op ) /*-----------------------------------------------------------------*/ /* newNode - creates a new node */ /*-----------------------------------------------------------------*/ -ast *newNode ( int op, ast *left, ast *right ) +ast *newNode ( long op, ast *left, ast *right ) { ast *ex ; diff --git a/src/SDCCast.h b/src/SDCCast.h index 58888c33..c0eb2bb5 100644 --- a/src/SDCCast.h +++ b/src/SDCCast.h @@ -157,7 +157,7 @@ extern FILE *codeOutFile; /* forward definitions for functions */ ast *newAst (int , void * ); void initAst ( ); -ast *newNode (int ,ast * ,ast * ); +ast *newNode (long ,ast * ,ast * ); ast *copyAst (ast * ); value *sizeofOp (link * ); value *evalStmnt (ast * ); diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 6cb18929..d0427133 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -16,17 +16,7 @@ #define NATIVE_WIN32 1 #endif -#ifdef _NO_GC - -#define GC_malloc malloc -#define GC_free free -#define GC_realloc realloc -#define GC_malloc_atomic malloc -#else - -#include "./gc/gc.h" - -#endif +# include "SDCCalloc.h" #define SPACE ' ' #define ZERO 0 @@ -106,17 +96,6 @@ typedef int bool; #define EMPTY(x) (x##StackPtr == 0 ? 1 : 0) #endif -#define ALLOC(x,sz) if (!(x = GC_malloc(sz))) \ - { \ - werror(E_OUT_OF_MEM,__FILE__,(long) sz);\ - exit (1); \ - } - -#define ALLOC_ATOMIC(x,sz) if (!(x = GC_malloc_atomic(sz))) \ - { \ - werror(E_OUT_OF_MEM,__FILE__,(long) sz); \ - exit (1); \ - } #define COPYTYPE(start,end,from) (end = getSpec (start = from)) diff --git a/src/SDCChasht.h b/src/SDCChasht.h index 2d853631..344cab94 100644 --- a/src/SDCChasht.h +++ b/src/SDCChasht.h @@ -26,37 +26,7 @@ #ifndef SDCCHASHT_H #define SDCCHASHT_H -#ifdef _NO_GC - -#include -#define GC_malloc malloc -#define GC_free free -#define GC_realloc realloc -#define GC_malloc_atomic malloc - -#else - -#include "./gc/gc.h" - -#endif - -#ifndef ALLOC - -#define ALLOC(x,sz) if (!(x = GC_malloc(sz))) \ - { \ - fprintf(stderr,"out of virtual memory %s , %d",__FILE__,__LINE__);\ - exit (1); \ - } - -#define ALLOC_ATOMIC(x,sz) if (!(x = GC_malloc_atomic(sz))) \ - { \ - fprintf(stderr,"out of virtual memory %s , %d",__FILE__,__LINE__);\ - exit (1); \ - } - - - -#endif +#include "SDCCalloc.h" /* hashtable item */ diff --git a/src/SDCCset.c b/src/SDCCset.c index a4844a37..2b2648bc 100644 --- a/src/SDCCset.c +++ b/src/SDCCset.c @@ -402,10 +402,11 @@ int applyToSet ( set *list , int (*somefunc)(void *, va_list ), ...) va_list ap; int rvalue = 0 ; - va_start(ap,somefunc); - for (lp = list ; lp ; lp = lp->next ) - rvalue += (*somefunc)(lp->item,ap) ; - va_end(ap); + for (lp = list ; lp ; lp = lp->next ) { + va_start(ap,somefunc); + rvalue += (*somefunc)(lp->item,ap) ; + va_end(ap); + } return rvalue; } @@ -419,11 +420,13 @@ int applyToSetFTrue ( set *list , int (*somefunc)(void *, va_list ), ...) va_list ap; int rvalue = 0 ; - va_start(ap,somefunc); - for (lp = list ; lp ; lp = lp->next ) - if (rvalue += (*somefunc)(lp->item,ap)) - break; - va_end(ap); + for (lp = list ; lp ; lp = lp->next ) { + va_start(ap,somefunc); + rvalue += (*somefunc)(lp->item,ap); + va_end(ap); + if (rvalue) + break; + } return rvalue; } diff --git a/src/SDCCset.h b/src/SDCCset.h index f236b570..f6768867 100644 --- a/src/SDCCset.h +++ b/src/SDCCset.h @@ -25,26 +25,9 @@ #ifndef SDCCSET_H #define SDCCSET_H #include -#ifdef _NO_GC +#include "sdccconf.h" +#include "SDCCalloc.h" -#define GC_malloc malloc -#define GC_free free -#define GC_realloc realloc - -#else - -#include "./gc/gc.h" - -#endif - -#ifndef ALLOC -#define ALLOC(x,sz) if (!(x = GC_malloc(sz))) \ - { \ - fprintf(stderr,"out of virtual memory %s , %d",__FILE__,__LINE__);\ - exit (1); \ - } - -#endif #ifndef THROWS #define THROWS diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 6916dd2b..53284941 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -134,7 +134,7 @@ void deleteSym ( bucket **stab, void *sym, char *sname) bp->prev->next = bp->next ; } - + } /*-----------------------------------------------------------------*/