Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -19,11 +19,11 @@ TCLCONFIGPATH = @TCLCONFIGPATH@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ tcllibdir = $(shell if echo "$(libdir)" | grep '^UNSPECIFIED' >/dev/null; then echo $(TCL_PACKAGE_PATH); else echo "$(libdir)"; fi) PACKAGE_INSTALL_DIR = $(tcllibdir)/$(PACKAGE_NAME)-$(PACKAGE_VERSION) -TCC_CONFIGURE_OPTS = --extra-cflags='$(CPPFLAGS) $(CFLAGS)' --with-tcl=$(TCLCONFIGPATH) +TCC_CONFIGURE_OPTS = --extra-cflags='$(CPPFLAGS) $(CFLAGS)' --with-tcl=$(TCLCONFIGPATH) --sysincludepaths='{B}/include' --libpaths='{B}/lib' srcdir = @srcdir@ all: $(TARGETS) tcc/config.h: @@ -52,19 +52,29 @@ cp tcc/libtcc.a tcltcc-static.new.a $(AR) rcu tcltcc-static.new.a tcltcc.o -$(RANLIB) tcltcc-static.new.a mv tcltcc-static.new.a tcltcc-static.a -install: $(TARGETS) pkgIndex.tcl tcc.tcl tcc/libtcc1.a $(shell echo tcc/include/*) +install: $(TARGETS) pkgIndex.tcl $(srcdir)/tcc.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk $(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)" $(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib" $(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include" $(INSTALL) -m 0755 $(TARGETS) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)" $(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)" - $(INSTALL) -m 0644 tcc.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)" + $(INSTALL) -m 0644 $(srcdir)/tcc.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)" $(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib" - $(INSTALL) -m 0644 $(shell echo tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include" + $(INSTALL) -m 0644 $(shell echo $(srcdir)/tcc/include/*) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include" + ( for file in tcl.h limits.h unistd.h; do echo "#include <$${file}>"; done ) | \ + $(CC) $(CPPFLAGS) $(CFLAGS) -I$(srcdir)/tcc/include -I$(srcdir)/tcc/include -E - | awk -f $(srcdir)/headers.awk | while read src dst; do \ + dst="$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/$$dst"; \ + if [ -e "$${dst}" ]; then continue; fi; \ + dstdir="$$(dirname "$$dst")"; \ + echo mkdir -p "$$dstdir"; \ + mkdir -p "$$dstdir"; \ + echo cp "$$src" "$$dst"; \ + cp "$$src" "$$dst"; \ + done clean: rm -f tcltcc.o rm -f tcltcc.@SHOBJEXT@ tcltcc-static.a rm -f tcltcc.@SHOBJEXT@.a tcltcc.@SHOBJEXT@.def ADDED headers.awk Index: headers.awk ================================================================== --- /dev/null +++ headers.awk @@ -0,0 +1,29 @@ +/^# [0-9][0-9]* /{ + file = $3; + + gsub(/^"/, "", file); + gsub(/"$/, "", file); + + destfile = file; + if (!gsub(/^.*\/include\//, "", destfile)) { + if (!gsub(/^.*\/include-fixed\//, "", destfile)) { + next + } + } + + if (file ~ /