Check-in [0a6b909b1f]
Overview
Comment:Updated to install required basic headers
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0a6b909b1f7cc0f355db11577b13db34033356fd
User & Date: rkeene on 2014-05-02 05:34:45
Other Links: manifest | tags
Context
2014-05-02
05:39
Minor cleanup check-in: d2385ff774 user: rkeene tags: trunk
05:34
Updated to install required basic headers check-in: 0a6b909b1f user: rkeene tags: trunk
04:42
Updated to obey "--libdir" configure directive check-in: 05dbf4d097 user: rkeene tags: trunk
Changes

Modified Makefile.in from [05b26b611a] to [85aaa6526a].

    17     17   PACKAGE_NAME = @PACKAGE_NAME@
    18     18   PACKAGE_VERSION = @PACKAGE_VERSION@
    19     19   
    20     20   TCLCONFIGPATH = @TCLCONFIGPATH@
    21     21   TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
    22     22   tcllibdir = $(shell if echo "$(libdir)" | grep '^UNSPECIFIED' >/dev/null; then echo $(TCL_PACKAGE_PATH); else echo "$(libdir)"; fi)
    23     23   PACKAGE_INSTALL_DIR = $(tcllibdir)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
    24         -TCC_CONFIGURE_OPTS = --extra-cflags='$(CPPFLAGS) $(CFLAGS)' --with-tcl=$(TCLCONFIGPATH)
           24  +TCC_CONFIGURE_OPTS = --extra-cflags='$(CPPFLAGS) $(CFLAGS)' --with-tcl=$(TCLCONFIGPATH) --sysincludepaths='{B}/include' --libpaths='{B}/lib'
    25     25   srcdir = @srcdir@
    26     26   
    27     27   all: $(TARGETS)
    28     28   
    29     29   tcc/config.h:
    30     30   	if [ "$(srcdir)" = "." ]; then \
    31     31   		cd tcc && ./configure $(TCC_CONFIGURE_OPTS); \
................................................................................
    50     50   
    51     51   tcltcc-static.a: tcltcc.o tcc/libtcc.a
    52     52   	cp tcc/libtcc.a tcltcc-static.new.a
    53     53   	$(AR) rcu tcltcc-static.new.a tcltcc.o
    54     54   	-$(RANLIB) tcltcc-static.new.a
    55     55   	mv tcltcc-static.new.a tcltcc-static.a
    56     56   
    57         -install: $(TARGETS) pkgIndex.tcl tcc.tcl tcc/libtcc1.a $(shell echo tcc/include/*)
           57  +install: $(TARGETS) pkgIndex.tcl $(srcdir)/tcc.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk
    58     58   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    59     59   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
    60     60   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
    61     61   	$(INSTALL) -m 0755 $(TARGETS) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    62     62   	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    63         -	$(INSTALL) -m 0644 tcc.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
           63  +	$(INSTALL) -m 0644 $(srcdir)/tcc.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    64     64   	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
    65         -	$(INSTALL) -m 0644 $(shell echo tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
           65  +	$(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
           66  +	( for file in tcl.h limits.h unistd.h; do echo "#include <$${file}>"; done ) | \
           67  +		$(CC) $(CPPFLAGS) $(CFLAGS) -I$(srcdir)/tcc/include -I$(srcdir)/tcc/include -E - | awk -f $(srcdir)/headers.awk | while read src dst; do \
           68  +			dst="$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/$$dst"; \
           69  +			if [ -e "$${dst}" ]; then continue; fi; \
           70  +			dstdir="$$(dirname "$$dst")"; \
           71  +			echo mkdir -p "$$dstdir"; \
           72  +			mkdir -p "$$dstdir"; \
           73  +			echo cp "$$src" "$$dst"; \
           74  +			cp "$$src" "$$dst"; \
           75  +		done
    66     76   
    67     77   clean:
    68     78   	rm -f tcltcc.o
    69     79   	rm -f tcltcc.@SHOBJEXT@ tcltcc-static.a
    70     80   	rm -f tcltcc.@SHOBJEXT@.a tcltcc.@SHOBJEXT@.def
    71     81   	-$(MAKE) -C tcc clean
    72     82   

Added headers.awk version [4c335dbe1b].

            1  +/^# [0-9][0-9]* /{
            2  +	file = $3;
            3  +
            4  +	gsub(/^"/, "", file);
            5  +	gsub(/"$/, "", file);
            6  +
            7  +	destfile = file;
            8  +	if (!gsub(/^.*\/include\//, "", destfile)) {
            9  +		if (!gsub(/^.*\/include-fixed\//, "", destfile)) {
           10  +			next
           11  +		}
           12  +	}
           13  +
           14  +	if (file ~ /</) {
           15  +		next;
           16  +	}
           17  +
           18  +	if (file !~ /\.h$/) {
           19  +		next;
           20  +	}
           21  +
           22  +	copy[file] = destfile;
           23  +}
           24  +
           25  +END{
           26  +	for (key in copy) {
           27  +		print key, copy[key];
           28  +	}
           29  +}