Check-in [016eb686f9]
Overview
Comment:Added script to perform known header corrections
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 016eb686f910d3aaadb77c7a05e6bc8e5fb03539
User & Date: rkeene on 2014-05-18 02:20:46
Other Links: manifest | tags
Context
2014-05-18
02:21
tcc4tcl 0.10 check-in: ef02f1b927 user: rkeene tags: trunk, 0.10
02:20
Added script to perform known header corrections check-in: 016eb686f9 user: rkeene tags: trunk
01:08
More work on getting headers correctly made available check-in: 76ee8b8d3d user: rkeene tags: trunk
Changes

Modified Makefile.in from [3232e8d81e] to [d1e42a6427].

    54     54   
    55     55   tcc4tcl-static.a: tcc4tcl.o tcc/libtcc.a
    56     56   	cp tcc/libtcc.a tcc4tcl-static.new.a
    57     57   	$(AR) rcu tcc4tcl-static.new.a tcc4tcl.o
    58     58   	-$(RANLIB) tcc4tcl-static.new.a
    59     59   	mv tcc4tcl-static.new.a tcc4tcl-static.a
    60     60   
    61         -install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk
           61  +install: $(TARGET) pkgIndex.tcl $(srcdir)/tcc4tcl.tcl tcc/libtcc1.a $(shell echo $(srcdir)/tcc/include/*) $(srcdir)/headers.awk $(srcdir)/patch-headers.sh
    62     62   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    63     63   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
    64     64   	$(INSTALL) -d "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
    65     65   	$(INSTALL) -m 0755 $(TARGET) "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    66     66   	$(INSTALL) -m 0644 pkgIndex.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    67     67   	$(INSTALL) -m 0644 $(srcdir)/tcc4tcl.tcl "$(DESTDIR)$(PACKAGE_INSTALL_DIR)"
    68     68   	$(INSTALL) -m 0644 tcc/libtcc1.a "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/lib"
................................................................................
    78     78   			dst="$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include/$$dst"; \
    79     79   			if [ -e "$${dst}" ]; then continue; fi; \
    80     80   			dstdir="$$(dirname "$$dst")"; \
    81     81   			mkdir -p "$$dstdir"; \
    82     82   			echo cp "$$src" "$$dst"; \
    83     83   			cp "$$src" "$$dst"; \
    84     84   		done
           85  +	$(srcdir)/patch-headers.sh "$(DESTDIR)$(PACKAGE_INSTALL_DIR)/include"
    85     86   
    86     87   test:
    87     88   	rm -rf __TMP__
    88     89   	$(MAKE) install tcllibdir=$(shell pwd)/__TMP__
    89     90   	-if [ "$(PACKAGE_VERSION)" = '@@VERS@@' ]; then cd __TMP__/* && sed -i 's|@@VERS@@|0.0.0.11|g' tcc4tcl.@SHOBJEXT@ pkgIndex.tcl; fi
    90     91   	tclsh test
    91     92   	echo Tests Completed OK > TEST-STATUS

Added patch-headers.sh version [3d4b689176].

            1  +#! /bin/bash
            2  +
            3  +headers_dir="$1"
            4  +
            5  +cd "${headers_dir}" || exit 1
            6  +
            7  +# Android header fix-ups
            8  +## Do not abort compilation at header include time
            9  +if grep '^#error "No function renaming possible"' sys/cdefs.h >/dev/null 2>/dev/null; then
           10  +	awk '
           11  +/#error "No function renaming possible"/{
           12  +	print "#define __RENAME(x) no renaming on this platform"
           13  +	next
           14  +}
           15  +{print}
           16  +	' sys/cdefs.h > sys/cdefs.h.new
           17  +	cat sys/cdefs.h.new > sys/cdefs.h
           18  +	rm -f sys/cdefs.h.new
           19  +fi
           20  +
           21  +## loff_t depends on __GNUC__ for some reason
           22  +if awk -v retval=1 '/__GNUC__/{ getline; if ($0 ~ /__kernel_loff_t/) {retval=0} } END{exit retval}' asm/posix_types.h >/dev/null 2>/dev/null; then
           23  +	awk '/__GNUC__/{ getline; if ($0 ~ /__kernel_loff_t/) { print "#if 1"; print; next } } { print }' asm/posix_types.h > asm/posix_types.h.new
           24  +	cat asm/posix_types.h.new > asm/posix_types.h
           25  +	rm -f asm/posix_types.h.new
           26  +fi
           27  +
           28  +# Busted wrapper fix-up
           29  +if grep '__STDC_HOSTED__' stdint.h >/dev/null 2>/dev/null && grep '_GCC_WRAP_STDINT_H' stdint.h >/dev/null 2>/dev/null; then
           30  +	echo '#include_next <stdint.h>' > stdint.h
           31  +fi