From: Boris Boesler Date: Wed, 14 Mar 2001 14:17:46 +0000 (+0000) Subject: added stuff to create a tar-archive for distribution X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=972ce44b525c5799ba51db5ad4af962990002361;p=libfirm added stuff to create a tar-archive for distribution [r132] --- diff --git a/MakeRules.in b/MakeRules.in index ef43c1393..9772e55df 100644 --- a/MakeRules.in +++ b/MakeRules.in @@ -29,6 +29,9 @@ endif AR := @AR@ ARFLAGS := rc +TAR := @TAR@ +TARFLAGS = -C $(top_srcdir) -uf $(topdir)/libfirm.tar + RANLIB := @RANLIB@ AUTODOC := @ROBODOC@ @@ -37,7 +40,8 @@ INDEXFILE := $(AUTODOCDIR)/index.html GLOBALXREFFILE := $(AUTODOCDIR)/libfirm.html.xrefs LOCALXREFSFILE := .xrefs -DISTFILES = $(SOURCES) +DISTFILES += $(addprefix $(srcdir)/, $(SOURCES)) +ARCHIVEDISTFILES += $(addprefix $(subdir)/, $(SOURCES)) CFILES = $(filter %.c,$(SOURCES) $(GENFILES)) HFILES = $(filter %.h,$(SOURCES) $(GENFILES)) OFILES = $(CFILES:.c=.o) @@ -99,4 +103,4 @@ test -z "$$fail" endef endif -targets = all clean depend echodist echogen echosrc realclean tags install autodoc autodoc_xref autodoc_html +targets = all clean depend realclean tags install autodoc autodoc_xref autodoc_html dist diff --git a/MakeTargets b/MakeTargets index a3ffd5342..bd30fb399 100644 --- a/MakeTargets +++ b/MakeTargets @@ -11,8 +11,12 @@ all : subdir_all # partial linking of a subdir's $(OFILES) into one file subdir.o: $(OFILES) +ifeq ($(strip $(OFILES)),) + >$@ +else rm -f $@ $(LD) $(LDFLAGS) -r -o $@ $^ +endif clean: subdir_clean local_clean .PHONY: local_clean @@ -40,6 +44,16 @@ autodoc_html: subdir_autodoc_html local_autodoc_html local_autodoc_html: $(HTMLFILES) +# generate an archive for distribution +dist: subdir_dist local_dist +# @echo create archive with $(DISTFILES) +# @echo tar -C $(top_srcdir) -uf libfirm.tar $(ARCHIVEDISTFILES) + $(TAR) $(TARFLAGS) $(ARCHIVEDISTFILES) +.PHONY: local_dist +local_dist: $(DISTFILES) + + +# dont know about this # Recurse into $(subdirs) for $(targets) $(addprefix subdir_,$(targets)): $(subdirs) +$(recurse) diff --git a/Makefile.in b/Makefile.in index 0c67a62fe..3324899b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -21,17 +21,31 @@ exec_prefix := @exec_prefix@ bindir = $(exec_prefix)/bin datadir = $(prefix)/lib -subdirs := ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr +subdirs := ir ir/adt ir/debug ir/tv ir/common ir/ident ir/ir ir/tr SOURCES := Makefile.in MakeRules.in MakeTargets\ aclocal.m4 config.h.in\ config.guess config.sub configure.in \ - stamp-h.in + stamp-h.in install-sh INSTALL_LIBS = libfirm.a GENFILES := stamp-h config.log config.cache +# init +ARCHIVEDISTFILES := testprograms/Makefile.in \ + testprograms/array-heap_example.c testprograms/if_example.c \ + testprograms/array-stack_example.c testprograms/if_while_example.c \ + testprograms/call_str_example.c testprograms/inheritance_example.c \ + testprograms/cond_example.c testprograms/irr_cf_example.c \ + testprograms/const_eval_example.c testprograms/irr_loop_example.c \ + testprograms/dead_block_example.c testprograms/memory_example.c \ + testprograms/empty.c testprograms/oo_program_example.c \ + testprograms/global_var_example.c testprograms/three_cfpred_example.c \ + testprograms/if_else_example.c testprograms/while_example.c \ + +DISTFILES = $(addprefix ../, $(ARCHIVEDISTFILES)) + # config.status config.h.in $(srcdir)/stamp-h.in include $(topdir)/MakeRules diff --git a/configure b/configure index f8a217065..2f5be80cb 100755 --- a/configure +++ b/configure @@ -559,7 +559,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -ac_output_file="Makefile MakeRules ir/.dummy ir/adt/Makefile ir/debug/Makefile \ +ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile \ ir/tv/Makefile ir/common/Makefile ir/ident/Makefile ir/ir/Makefile \ ir/tr/Makefile testprograms/Makefile" @@ -1059,11 +1059,45 @@ if test "$AR" != "ar"; then { echo "configure: error: need ar for creating archives" 1>&2; exit 1; } fi +# Extract the first word of "tar", so it can be a program name with args. +set dummy tar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1066: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_TAR=""tar"" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_TAR" && ac_cv_prog_TAR="""" +fi +fi +TAR="$ac_cv_prog_TAR" +if test -n "$TAR"; then + echo "$ac_t""$TAR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "$TAR" != "tar"; then + { echo "configure: error: need tar for creating archives in distribution" 1>&2; exit 1; } +fi + # 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:1067: checking for $ac_word" >&5 +echo "configure:1101: 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 @@ -1103,7 +1137,7 @@ fi # 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:1107: checking for a BSD compatible install" >&5 +echo "configure:1141: 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 @@ -1160,7 +1194,7 @@ if test "$enable_auto_documentation" = yes; then # Extract the first word of "robodoc", so it can be a program name with args. set dummy robodoc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1164: checking for $ac_word" >&5 +echo "configure:1198: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ROBODOC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1194,7 +1228,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1198: checking how to run the C preprocessor" >&5 +echo "configure:1232: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1209,13 +1243,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:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1253: \"$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 : @@ -1226,13 +1260,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:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1270: \"$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 : @@ -1243,13 +1277,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:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1287: \"$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 : @@ -1274,12 +1308,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1278: checking for ANSI C header files" >&5 +echo "configure:1312: 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 @@ -1287,7 +1321,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1325: \"$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* @@ -1304,7 +1338,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 @@ -1322,7 +1356,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 @@ -1343,7 +1377,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1354,7 +1388,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1383,17 +1417,17 @@ for ac_hdr in math.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1387: checking for $ac_hdr" >&5 +echo "configure:1421: 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:1397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1431: \"$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* @@ -1430,17 +1464,17 @@ for ac_hdr in gmp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1434: checking for $ac_hdr" >&5 +echo "configure:1468: 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:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1478: \"$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* @@ -1477,17 +1511,17 @@ for ac_hdr in obstack.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1481: checking for $ac_hdr" >&5 +echo "configure:1515: 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:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1525: \"$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* @@ -1522,7 +1556,7 @@ fi echo $ac_n "checking for main in -lgmp""... $ac_c" 1>&6 -echo "configure:1526: checking for main in -lgmp" >&5 +echo "configure:1560: checking for main in -lgmp" >&5 ac_lib_var=`echo gmp'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1530,14 +1564,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1575: \"$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 @@ -1564,7 +1598,7 @@ fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:1568: checking for main in -lm" >&5 +echo "configure:1602: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1572,14 +1606,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1617: \"$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 @@ -1610,12 +1644,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:1614: checking for strerror" >&5 +echo "configure:1648: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+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:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -1814,6 +1848,7 @@ s%@build_os@%$build_os%g s%@LD@%$LD%g s%@libfirm_cv_prog_ld_r@%$libfirm_cv_prog_ld_r%g s%@AR@%$AR%g +s%@TAR@%$TAR%g s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g diff --git a/configure.in b/configure.in index e06532399..026eb1b62 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_REVISION($Id$) AC_INIT(ir/ir/ircons.c) dnl if other files should be generated just add them to ac_output_files -ac_output_file="Makefile MakeRules ir/.dummy ir/adt/Makefile ir/debug/Makefile \ +ac_output_file="Makefile MakeRules ir/Makefile ir/adt/Makefile ir/debug/Makefile \ ir/tv/Makefile ir/common/Makefile ir/ident/Makefile ir/ir/Makefile \ ir/tr/Makefile testprograms/Makefile" @@ -79,6 +79,13 @@ if test "$AR" != "ar"; then AC_MSG_ERROR(need ar for creating archives) fi +dnl check for tar +dnl ------------- +AC_CHECK_PROG(TAR, tar, "tar", "") +if test "$TAR" != "tar"; then + AC_MSG_ERROR(need tar for creating archives in distribution) +fi + dnl check wether ar can handle option -s dnl if not then ranlib is needed dnl for simpliticity we use ranlib every time