Check-in [4e6359ae47]
Overview
Comment:Fixed incorrectly applied previous commit
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4e6359ae47b826637f4a3104a3c46ab9672a2550
User & Date: rkeene on 2014-05-05 16:29:34
Other Links: manifest | tags
Context
2014-05-05
17:16
Updated to keep GCC headers into gcc directory check-in: e8cbf3c10e user: rkeene tags: trunk
16:29
Fixed incorrectly applied previous commit check-in: 4e6359ae47 user: rkeene tags: trunk
16:22
Merged in alternate trunk from old development check-in: 75e4d5fbed user: rkeene tags: trunk
Changes

Modified Makefile.in from [a2cdbe9632] to [a463bb46e0].

            1  +prefix = UNSPECIFIED
            2  +exec_prefix = @exec_prefix@
            3  +libdir = @libdir@
            4  +
            5  +TARGET = @TARGET@
            6  +
     1      7   CC = @CC@
            8  +CPP = @CPP@
     2      9   AR = @AR@
     3     10   RANLIB = @RANLIB@
     4     11   CFLAGS = @CFLAGS@ @SHOBJFLAGS@
     5         -CPPFLAGS = @CPPFLAGS@ -I@srcdir@ @DEFS@
           12  +CPPFLAGS = @CPPFLAGS@ -I@srcdir@ -I@srcdir@/tcc -Itcc @DEFS@
     6     13   LDFLAGS =
     7     14   SHOBJLDFLAGS = @SHOBJLDFLAGS@
     8     15   LIBS = @LIBS@
     9     16   INSTALL = @INSTALL@
           17  +
    10     18   PACKAGE_NAME = @PACKAGE_NAME@
    11     19   PACKAGE_VERSION = @PACKAGE_VERSION@
           20  +
           21  +TCLCONFIGPATH = @TCLCONFIGPATH@
    12     22   TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
    13         -PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
    14         -TARGETS = @TARGETS@
           23  +tcllibdir = $(shell if echo "$(libdir)" | grep '^UNSPECIFIED' >/dev/null; then echo $(TCL_PACKAGE_PATH); else echo "$(libdir)"; fi)
           24  +PACKAGE_INSTALL_DIR = $(tcllibdir)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
           25  +TCC_CONFIGURE_OPTS = --extra-cflags='$(CPPFLAGS) $(CFLAGS)' --with-tcl=$(TCLCONFIGPATH) --sysincludepaths='{B}/include' --libpaths='{B}/lib' @TCC_CONFIGURE_OPTS@
           26  +INSTALL_HEADERS = tcl.h assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h time.h wctype.h
    15     27   srcdir = @srcdir@
           28  +host_os = @host_os@
           29  +@SET_MAKE@
           30  +
           31  +all: $(TARGET)
           32  +
           33  +tcc/config.h:
           34  +	if [ "$(srcdir)" = "." ]; then \
           35  +		cd tcc && ./configure $(TCC_CONFIGURE_OPTS); \
           36  +	else \
           37  +		mkdir tcc >/dev/null 2>/dev/null; \
           38  +		cd tcc && $(shell cd $(srcdir) && pwd)/tcc/configure $(TCC_CONFIGURE_OPTS); \
           39  +	fi
           40  +
           41  +tcc/libtcc.a: tcc/config.h
           42  +	$(MAKE) -C tcc libtcc.a
           43  +
           44  +tcc/libtcc1.a: tcc/config.h
           45  +	$(MAKE) -C tcc libtcc1.a
    16     46   
    17         -all: $(TARGETS)
           47  +tcc4tcl.o: $(srcdir)/tcc4tcl.c $(srcdir)/tcc/tcc.h $(srcdir)/tcc/libtcc.h tcc/config.h
           48  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o tcc4tcl.o -c $(srcdir)/tcc4tcl.c
    18     49   
    19         -tcltcc.o: $(srcdir)/tcltcc.c
    20         -	$(CC) $(CPPFLAGS) $(CFLAGS) -o tcltcc.o -c $(srcdir)/tcltcc.c
           50  +tcc4tcl.@SHOBJEXT@: tcc4tcl.o tcc/libtcc.a
           51  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o tcc4tcl.@SHOBJEXT@ tcc4tcl.o tcc/libtcc.a $(LIBS)
           52  +	-@WEAKENSYMS@ tcc4tcl.@SHOBJEXT@
           53  +	-@REMOVESYMS@ tcc4tcl.@SHOBJEXT@
    21     54   
    22         -tcltcc-shared.@SHOBJEXT@: tcltcc.o
    23         -	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o tcltcc-shared.@SHOBJEXT@ tcltcc.o $(LIBS)
           55  +tcc4tcl-static.a: tcc4tcl.o tcc/libtcc.a
           56  +	cp tcc/libtcc.a tcc4tcl-static.new.a
           57  +	$(AR) rcu tcc4tcl-static.new.a tcc4tcl.o
           58  +	-$(RANLIB) tcc4tcl-static.new.a
           59  +	mv tcc4tcl-static.new.a tcc4tcl-static.a
    24     60   
    25         -tcltcc-static.a: tcltcc.o
    26         -	$(AR) rcu tcltcc-static.a tcltcc.o
    27         -	-$(RANLIB) tcltcc-static.a
    28         -
    29         -install: $(TARGETS) pkgIndex.tcl
           61  +install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk
    30     62   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
           63  +	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
           64  +	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
           65  +	$(INSTALL) -m 0755 $(TARGET) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    31     66   	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    32         -	$(INSTALL) -m 0755 $(TARGETS) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
           67  +	$(INSTALL) -m 0644 $(srcdir)/tcc4tcl.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
           68  +	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
           69  +	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
           70  +	@if ! echo "_WIN32" | $(CPP) $(CPPFLAGS) - | grep '^_WIN32$$' >/dev/null; then \
           71  +		echo cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
           72  +		cp -r $(srcdir)/tcc/win32/include/* "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/"; \
           73  +		echo cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
           74  +		cp -r $(srcdir)/tcc/win32/lib/*.def "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib/"; \
           75  +	fi
           76  +	( for file in $(INSTALL_HEADERS); do echo "#include <$${file}>"; done ) | \
           77  +		$(CPP) $(CPPFLAGS) $(CFLAGS) -I$(srcdir)/tcc/include -I$(srcdir)/tcc/include - | awk -f $(srcdir)/headers.awk | while read src dst; do \
           78  +			dst="$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/$$dst"; \
           79  +			if [ -e "$${dst}" ]; then continue; fi; \
           80  +			dstdir="$$(dirname "$$dst")"; \
           81  +			echo mkdir -p "$$dstdir"; \
           82  +			mkdir -p "$$dstdir"; \
           83  +			echo cp "$$src" "$$dst"; \
           84  +			cp "$$src" "$$dst"; \
           85  +		done
           86  +
           87  +test:
           88  +	rm -rf __TMP__
           89  +	$(MAKE) install tcllibdir=$(shell pwd)/__TMP__
           90  +	cd __TMP__/* && ../../test
           91  +	echo Tests Completed OK > TEST-STATUS
           92  +	rm -rf __TMP__
    33     93   
    34     94   clean:
    35         -	rm -f tcltcc.o
    36         -	rm -f tcltcc-shared.@SHOBJEXT@ tcltcc-static.a
    37         -	rm -f tcltcc-shared.@SHOBJEXT@.a tcltcc-shared.@SHOBJEXT@.def
           95  +	rm -f tcc4tcl.o
           96  +	rm -f tcc4tcl.@SHOBJEXT@ tcc4tcl-static.a
           97  +	rm -f tcc4tcl.@SHOBJEXT@.a tcc4tcl.@SHOBJEXT@.def
           98  +	rm -rf __TMP__
           99  +	rm -f TEST-STATUS
          100  +	-$(MAKE) -C tcc clean
    38    101   
    39    102   distclean: clean
    40    103   	rm -rf autom4te.cache
    41    104   	rm -f config.log config.status
    42         -	rm -f pkgIndex.tcl
          105  +	rm -f pkgIndex.tcl tcc4tcl.syms tcc4tcl.vers
    43    106   	rm -f Makefile
          107  +	-$(MAKE) -C tcc distclean
    44    108   
    45    109   mrproper: distclean
    46         -	rm -rf __TMP__ tcc
          110  +	rm -rf tcc
    47    111   	rm -f configure aclocal.m4
    48    112   	rm -f config.guess config.sub install-sh
    49    113   
    50         -.PHONY: all install clean distclean mrproper
          114  +.PHONY: all install test clean distclean mrproper

Modified build/pre.sh from [29bd57d26a] to [a84ae705c9].

     2      2   
     3      3   cd "$(dirname "$(which "$0")")/.." || exit 1
     4      4   
     5      5   # Generate configure script
     6      6   ./build/autogen.sh
     7      7   
     8      8   # Download TCC
            9  +tcc_version='0.9.26'
           10  +tcc_url="http://download.savannah.gnu.org/releases/tinycc/tcc-${tcc_version}.tar.bz2"
           11  +tcc_sha256='521e701ae436c302545c3f973a9c9b7e2694769c71d9be10f70a2460705b6d71'
     9     12   (
    10         -	TCC_VERSION="0.9.26"
    11         -	TCC_URL="http://download.savannah.gnu.org/releases/tinycc/tcc-${TCC_VERSION}.tar.bz2"
    12         -	TCC_SHA256='521e701ae436c302545c3f973a9c9b7e2694769c71d9be10f70a2460705b6d71'
    13         -
    14     13   	rm -rf __TMP__
    15     14   	mkdir __TMP__ || exit 1
    16     15   	cd __TMP__ || exit 1
    17         -	wget -O tcc.tar.bz2.new "${TCC_URL}" || rm -f tcc.tar.bz2.new
    18         -	TCC_NEW_SHA256="$(openssl sha256 < tcc.tar.bz2.new | sed 's@.*= *@@')"
           16  +
           17  +	wget -O 'new' "${tcc_url}" || rm -f new
           18  +	new_sha256="$(openssl sha256 new | sed 's@.*= *@@')"
           19  +
           20  +	if [ "${new_sha256}" != "${tcc_sha256}" ]; then
           21  +		echo "Checksum Mismatch: Downloaded: ${new_sha256}; Expected: ${tcc_sha256}" >&2
           22  +
           23  +		rm -f new
    19     24   
    20         -	if [ "${TCC_NEW_SHA256}" = "${TCC_SHA256}" ]; then
    21         -		mv tcc.tar.bz2.new tcc.tar.bz2
           25  +		exit 1
    22     26   	fi
    23     27   
    24         -	tar -xf tcc.tar.bz2
    25         -	rm -f tcc.tar.bz2
           28  +	mv new "tcc-${tcc_version}.tar.bz2"
           29  +
           30  +	bzip2 -dc "tcc-${tcc_version}.tar.bz2" | tar -xf -
           31  +
           32  +	rm -f "tcc-${tcc_version}.tar.bz2"
           33  +
           34  +	## Apply patches
           35  +	for patchfile in ../build/tcc-patches/${tcc_version}/*.diff; do
           36  +		( cd * && patch -p1 ) < "${patchfile}"
           37  +	done
    26     38   
    27     39   	rm -rf ../tcc
    28     40   	mkdir ../tcc || exit 1
    29     41   	mv */* ../tcc/
    30     42   )
    31     43   rm -rf __TMP__

Modified configure.ac from [4fb589986a] to [ed00a008d9].

     2      2   AC_INIT(tcc4tcl, @@VERS@@)
     3      3   
     4      4   dnl Checks for programs.
     5      5   AC_PROG_CC
     6      6   AC_PROG_MAKE_SET
     7      7   AC_PROG_INSTALL
     8      8   AC_GNU_SOURCE
            9  +AC_LANG(C)
     9     10   
    10     11   dnl Determine system information
    11     12   DC_CHK_OS_INFO
    12     13   
    13     14   dnl Determine if a shared or static build is requested
    14     15   AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [build static library instead of shared library]), [
    15     16   	if test "$enableval" = "no"; then
    16         -		target=shared
           17  +		TCC4TCL_TARGET=static
    17     18   	else
    18         -		target=static
           19  +		TCC4TCL_TARGET=shared
    19     20   	fi
    20     21   ], [
    21         -	target=shared
           22  +	TCC4TCL_TARGET=shared
    22     23   ])
    23     24   
    24         -if test "${target}" = "shared"; then
           25  +dnl Configure TCC build options
           26  +AC_SUBST(TCC_CONFIGURE_OPTS)
           27  +TCC_CONFIGURE_OPTS=""
           28  +
           29  +dnl -- If cross-compiling, specify a "--cross-prefix" and define the CPU
           30  +if test "${host}" != "${build}"; then
           31  +	TCC_CONFIGURE_OPTS="${TCC_CONFIGURE_OPTS} --cross-prefix=${host_alias}- --cpu=${host_cpu} --os=${host_os}"
           32  +fi
           33  +
           34  +if test "${TCC4TCL_TARGET}" = "shared"; then
    25     35   	dnl Determine how to make shared objects
    26     36   	DC_GET_SHOBJFLAGS
    27     37   
    28         -	TARGETS="tcltcc-shared.${SHOBJEXT}"
           38  +	dnl Only export symbols we wish to expose
           39  +	TARGET="tcc4tcl.${SHOBJEXT}"
           40  +
           41  +	AC_CHECK_HEADERS(windows.h)
           42  +	AC_CHECK_HEADERS(psapi.h,,, [
           43  +#ifdef HAVE_WINDOWS_H
           44  +#  include <windows.h>
           45  +#endif
           46  +])
           47  +
           48  +	AC_MSG_CHECKING([for EnumProcessModules in -lpsapi])
           49  +	SAVE_LIBS="$LIBS"
           50  +	LIBS="-lpsapi $LIBS"
           51  +	AC_LINK_IFELSE([AC_LANG_PROGRAM([
           52  +#ifdef HAVE_WINDOWS_H
           53  +#  include <windows.h>
           54  +#endif
           55  +#ifdef HAVE_PSAPI_H
           56  +#  include <psapi.h>
           57  +#endif
           58  +], [
           59  +	EnumProcessModules(NULL, NULL, 0, NULL);
           60  +])], [
           61  +	AC_MSG_RESULT([found])
           62  +], [
           63  +	AC_MSG_RESULT([not found])
           64  +	LIBS="$SAVE_LIBS"
           65  +])
    29     66   else
    30         -	TARGETS="tcltcc-static.a"
           67  +	TARGET="tcc4tcl-static.a"
    31     68   fi
    32         -AC_SUBST(TARGETS)
           69  +AC_SUBST(TARGET)
           70  +AC_SUBST(TCC4TCL_TARGET)
    33     71   
    34     72   dnl Find out if we have the functions needed to open shared objects
    35     73   AC_SEARCH_LIBS(dlopen, dl,, [
    36     74           AC_SEARCH_LIBS(shl_load, dld dl)
    37     75   ])
    38     76   AC_CHECK_FUNCS(dlopen shl_load)
    39     77   
    40     78   dnl Look for appropriate headers
    41     79   AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h dlfcn.h dl.h)
    42     80   
    43     81   dnl Perform Tcl Extension required stuff
    44     82   TCLEXT_INIT
           83  +
           84  +dnl This must be done last since it breaks the compilation
           85  +if test "${TCC4TCL_TARGET}" = "shared"; then
           86  +	DC_SETVERSIONSCRIPT([tcc4tcl.syms], [tcc4tcl.vers])
           87  +	DC_FIND_STRIP_AND_REMOVESYMS([tcc4tcl.syms])
           88  +fi
    45     89   
    46     90   dnl Produce output
    47         -AC_OUTPUT(Makefile pkgIndex.tcl)
           91  +AC_OUTPUT(Makefile pkgIndex.tcl tcc4tcl.syms)