From 077b749d5960a27f04ff64024b3edc05f0fd0c77 Mon Sep 17 00:00:00 2001 From: Boris Boesler Date: Mon, 6 Dec 2004 14:27:33 +0000 Subject: [PATCH] *** empty log message *** [r4575] --- MakeTargets | 3 + Makefile.in | 12 ++- configure | 222 ++++++++++++++++++++++++++++++++++++++- configure.in | 40 ++++++- ir/common/statistics.c | 4 + ir/config/Makefile.in | 5 +- ir/external/Makefile.in | 6 +- ir/ir/Makefile.in | 8 +- ir/opt/Makefile.in | 3 +- testprograms/Makefile.in | 3 +- 10 files changed, 285 insertions(+), 21 deletions(-) diff --git a/MakeTargets b/MakeTargets index d355eaa20..c57c0188d 100644 --- a/MakeTargets +++ b/MakeTargets @@ -82,6 +82,9 @@ local_install_headers: ifneq ($(strip $(INSTALL_HEADERS)),) $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS)) $(INCLUDEDIR) endif +ifneq ($(strip $(INSTALL_GENERATED_HEADERS)),) + $(INSTALL) -m u+rw,a+r $(INSTALL_GENERATED_HEADERS) $(INCLUDEDIR) +endif ifneq ($(strip $(INSTALL_HEADERS_ADT)),) $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS_ADT)) $(INCLUDEDIR)/adt endif diff --git a/Makefile.in b/Makefile.in index 231062c63..a86cffc09 100644 --- a/Makefile.in +++ b/Makefile.in @@ -21,9 +21,16 @@ topdir := . subdir := . # do we want statistics enable_statistics := @enable_statistics@ +# do we want external description of effects +enable_external_effects := @enable_external_effects@ -build_subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/opt ir/tr ir/ana \ - ir/stat ir/external ir/ana2 +ifeq (@enable_external_effects@,yes) +build_subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir \ + ir/opt ir/tr ir/ana ir/stat ir/ana2 ir/external +else +build_subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir \ + ir/opt ir/tr ir/ana ir/stat ir/ana2 +endif subdirs := $(build_subdirs) ir/config @@ -61,6 +68,7 @@ libfirm.a: $(XOFILES) $(OFILES) mv -f $@.new $@ $(RANLIB) $@ +# dont know about xml here libfirm.so: subdir_all $(XOFILES) $(OFILES) ld -Bshareable -o ./libfirm.so $(XOFILES) -lm -L/usr/public/libxml2/lib -lxml2 diff --git a/configure b/configure index 96441a0c8..3c6f0d9b7 100755 --- a/configure +++ b/configure @@ -832,6 +832,7 @@ Optional Features: --enable-heapanalysis Compile with heap analysis. --disable-libiberty disable own libiberty parts --enable-statistics enable Firm statistics + --disable-effects disable descriptions of external effects in XML Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1214,14 +1215,14 @@ ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile testprograms/Makefile firmjni/Makefile firmjni/testprograms/Makefile \ libfirm.doxygen" -CONF_DIR_NAME=`dirname $0` - ac_config_headers="$ac_config_headers config.h" libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}" +CONF_DIR_NAME=`dirname $0` + # Check whether --with-includedir or --without-includedir was given. if test "${with_includedir+set}" = set; then @@ -1352,6 +1353,27 @@ fi fi; +echo "$as_me:$LINENO: checking for using external effects in xml2" >&5 +echo $ECHO_N "checking for using external effects in xml2... $ECHO_C" >&6 +# Check whether --enable-external-effects or --disable-external-effects was given. +if test "${enable_external_effects+set}" = set; then + enableval="$enable_external_effects" + if test "$enableval"=no; then + enable_external_effects=no +fi +else + enable_external_effects=yes +fi; + +if test "$enable_external_effects" == "no"; then + echo "$as_me:$LINENO: result: disabled" >&5 +echo "${ECHO_T}disabled" >&6 +else + echo "$as_me:$LINENO: result: enabled" >&5 +echo "${ECHO_T}enabled" >&6 +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3604,6 +3626,130 @@ echo "$as_me: error: jni header file not found. (IPD: add --with-includedir=/usr fi +if test "$enable_external_effects" == "yes"; then + +for ac_header in libxml/parser.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ac_xml_headers="yes" +else + ac_xml_headers="no" +fi + +done + + if test "$ac_xml_headers" != yes; then + { { echo "$as_me:$LINENO: error: xml header files not found. (IPD: add --with-includedir=/usr/public/libxml2/include/libxml2/ to configure flags)" >&5 +echo "$as_me: error: xml header files not found. (IPD: add --with-includedir=/usr/public/libxml2/include/libxml2/ to configure flags)" >&2;} + { (exit 1); exit 1; }; } + fi +fi + #dnl check for the gnu multiprecission (gmp) library @@ -3676,6 +3822,77 @@ echo "$as_me: error: \"standard math library not found\"" >&2;} fi +if test "$enable_external_effects" == "yes"; then + echo "$as_me:$LINENO: checking for xmlParseFile in -lxml2" >&5 +echo $ECHO_N "checking for xmlParseFile in -lxml2... $ECHO_C" >&6 +if test "${ac_cv_lib_xml2_xmlParseFile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxml2 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char xmlParseFile (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +xmlParseFile (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_xml2_xmlParseFile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_xml2_xmlParseFile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseFile" >&5 +echo "${ECHO_T}$ac_cv_lib_xml2_xmlParseFile" >&6 +if test $ac_cv_lib_xml2_xmlParseFile = yes; then + ac_xml_library="yes" +else + ac_xml_library="no" +fi + + if test "$ac_m_library" != yes; then + { { echo "$as_me:$LINENO: error: \"xml2 library not found (IPD: add --with-libdir=/usr/public/libxml2/lib/ to configure flags)\"" >&5 +echo "$as_me: error: \"xml2 library not found (IPD: add --with-libdir=/usr/public/libxml2/lib/ to configure flags)\"" >&2;} + { (exit 1); exit 1; }; } + else + LIBS=$LIBS" -lxml2" + fi +fi + echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then @@ -4888,6 +5105,7 @@ s,@enable_firm_jni@,$enable_firm_jni,;t t s,@enable_heapanalysis@,$enable_heapanalysis,;t t s,@disable_libiberty@,$disable_libiberty,;t t s,@enable_statistics@,$enable_statistics,;t t +s,@enable_external_effects@,$enable_external_effects,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t diff --git a/configure.in b/configure.in index 76e46956f..e68777297 100644 --- a/configure.in +++ b/configure.in @@ -25,9 +25,6 @@ ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile testprograms/Makefile firmjni/Makefile firmjni/testprograms/Makefile \ libfirm.doxygen" -dnl where is the configure file -CONF_DIR_NAME=`dirname $0` - dnl generate the config header file AC_CONFIG_HEADER(config.h) @@ -35,6 +32,9 @@ dnl keep track of the environment set by the user libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}" AC_SUBST(libfirm_conf_env) +dnl where is the configure file +CONF_DIR_NAME=`dirname $0` + dnl check for additional include dirs AC_ARG_WITH(includedir, [ --with-includedir=add colon seperated list of directories to include search path], CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`, T_FLAG="") @@ -129,6 +129,24 @@ AC_ARG_ENABLE(statistics, fi]) AC_SUBST(enable_statistics) +dnl disable external effects in XML +dnl ------------------------------- +AC_MSG_CHECKING([for using external effects in xml2]) +AC_ARG_ENABLE(external-effects, +[ --disable-effects disable descriptions of external effects in XML], +[if test "$enableval"=no; then + enable_external_effects=no +fi], +[enable_external_effects=yes]) +AC_SUBST(enable_external_effects) +if test "$enable_external_effects" == "no"; then + AC_MSG_RESULT([disabled]) +else + AC_MSG_RESULT([enabled]) +fi +dnl check for header and library below + + dnl Checks for programs. dnl ==================== @@ -257,6 +275,13 @@ if test "$enable_firm_jni" = yes; then fi +if test "$enable_external_effects" == "yes"; then + AC_CHECK_HEADERS(libxml/parser.h, ac_xml_headers="yes", ac_xml_headers="no") + if test "$ac_xml_headers" != yes; then + AC_MSG_ERROR(xml header files not found. (IPD: add --with-includedir=/usr/public/libxml2/include/libxml2/ to configure flags)) + fi +fi + dnl Checks for libraries. dnl ===================== @@ -276,6 +301,15 @@ if test "$ac_m_library" != yes; then fi +if test "$enable_external_effects" == "yes"; then + AC_CHECK_LIB(xml2, xmlParseFile, ac_xml_library="yes", ac_xml_library="no") + if test "$ac_m_library" != yes; then + AC_MSG_ERROR("xml2 library not found (IPD: add --with-libdir=/usr/public/libxml2/lib/ to configure flags)") + else + LIBS=$LIBS" -lxml2" + fi +fi + dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_C_CONST diff --git a/ir/common/statistics.c b/ir/common/statistics.c index 113829582..89c2e0569 100644 --- a/ir/common/statistics.c +++ b/ir/common/statistics.c @@ -10,6 +10,10 @@ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "statistics.h" #include "irgraph_t.h" #include "irnode_t.h" diff --git a/ir/config/Makefile.in b/ir/config/Makefile.in index 341599d62..fd920b736 100644 --- a/ir/config/Makefile.in +++ b/ir/config/Makefile.in @@ -15,9 +15,10 @@ srcdir = @srcdir@ topdir = ../.. subdir := ir/common -INSTALL_HEADERS := firm_config.h +# generated header file +INSTALL_GENERATED_HEADERS := firm_config.h -SOURCES = $(INSTALL_HEADERS) +SOURCES = $(INSTALL_GENERATED_HEADERS) include $(topdir)/MakeRules diff --git a/ir/external/Makefile.in b/ir/external/Makefile.in index e589779d1..8ce551d3a 100644 --- a/ir/external/Makefile.in +++ b/ir/external/Makefile.in @@ -10,10 +10,6 @@ # Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE. # -# set LIBXML2 to the installation directory of libxml2 -# temporary fix until libxml2 is integrated: -LIBXML2 ?= /usr/public/libxml2 - top_srcdir := @top_srcdir@ srcdir = @srcdir@ topdir = ../.. @@ -31,7 +27,7 @@ include $(topdir)/MakeRules CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \ -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr -I$(top_srcdir)/ir/tv \ -I$(top_srcdir)/ir/debug -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st \ - -I$(top_srcdir)/ir/stat -I$(topdir)/ir/config -I$(LIBXML2)/include/libxml2 + -I$(top_srcdir)/ir/stat -I$(topdir)/ir/config include $(top_srcdir)/MakeTargets diff --git a/ir/ir/Makefile.in b/ir/ir/Makefile.in index 88200621e..7e742a5e2 100644 --- a/ir/ir/Makefile.in +++ b/ir/ir/Makefile.in @@ -17,8 +17,8 @@ subdir := ir/ir INSTALL_HEADERS = irprog.h irgraph.h irnode.h irmode.h irop.h ircons.h \ irflag.h irvrfy.h irgwalk.h irgmod.h iropt.h irdump.h \ - irgopt.h ircgcons.h ircgopt.h irreflect.h irarch.h irprintf.h \ - irlwrdw.h + irgopt.h ircgcons.h ircgopt.h irreflect.h irarch.h irprintf.h + SOURCES = $(INSTALL_HEADERS) @@ -26,8 +26,8 @@ SOURCES += Makefile.in \ ircons.c ircons_t.h irgmod.c irgraph_t.h irnode.c iropt.c iropt_t.h irvrfy.c \ irgwalk.c irgwalk_blk.c irdump.c irdumptxt.c irgopt.c irgopt_t.h irnode_t.h \ irmode.c irop.c irprog.c irflag.c irflag_t.h irgraph.c irprintf_t.h \ - irmode_t.h irop_t.h irprog_t.h ircgcons.c ircgopt.c irreflect.c irarch.c irprintf.c \ - irlwrdw.c + irmode_t.h irop_t.h irprog_t.h ircgcons.c ircgopt.c irreflect.c irarch.c irprintf.c + include $(topdir)/MakeRules diff --git a/ir/opt/Makefile.in b/ir/opt/Makefile.in index b5bd66e14..63ec1b8fa 100644 --- a/ir/opt/Makefile.in +++ b/ir/opt/Makefile.in @@ -22,7 +22,8 @@ SOURCES = $(INSTALL_HEADERS) SOURCES += Makefile.in \ cfopt.c tailrec.c strength_red.c ldstopt.c reassoc.c \ - loop_unrolling.c funccall.c + loop_unrolling.c + include $(topdir)/MakeRules diff --git a/testprograms/Makefile.in b/testprograms/Makefile.in index f6bf6d39f..da1238274 100644 --- a/testprograms/Makefile.in +++ b/testprograms/Makefile.in @@ -1,4 +1,3 @@ - # # Project: libFIRM # File name: testprograms/Makefile.in @@ -62,7 +61,7 @@ CPPFLAGS += -I$(top_srcdir)/ir/adt -I$(top_srcdir)/ir/common -I$(top_srcdir)/ir/ LDFLAGS = -L$(topdir) LDFLAGS+= @LDFLAGS@ -LDLIBS += -lfirm -liberty -L/usr/public/libxml2 -lxml2 +LDLIBS += -lfirm -liberty @LIBS@ # @@@ TODO replace hand crafted stuff (xml2) for configure GENFILES := $(bin_EXAMPLES) *.vcg -- 2.20.1