Summary of what was changed or added so far: These won't work on Win32 * --disable-static option builds libtcca.so.1.0 and associated simlinks. This replaces libtcca.a, which is a static library with a dynamic one. * --with-selinux option uses mmap to enable tcc -run to work with Selinux. * attempt to build tcc1.def on i386 / x86_64 when --enable-cross is used. If successful, this gets around the "_start not found" or "_winstart not found" messages when i386-win32-tcc is run on these systems. I say "if" because it gave me fits of trouble on my system and not all others have been tested yet. tcc1.def is not a real .def file by the way, but it works, so it's kind of a dancing bear at this point. We're not concerned that it's getting the steps wrong. We're just happy it's not eating us for lunch.
Unified · Split
| @@ -114,22 +114,24 @@ endif · 113 unmodified lines | ||
| 114 | 114 | endif |
| 115 | 115 | endif |
| 116 | 116 | |
| 117 | +# LIBTCCB decides whether libtcc is installed static or dynamic | |
| 117 | 118 | LIBTCCB=libtcc.a |
| 118 | 119 | ifdef DISABLE_STATIC |
| 119 | 120 | CFLAGS+=-fPIC |
| 120 | 121 | LIBTCCL=-L. -ltcc |
| 121 | 122 | LIBTCCB=libtcc.so.1.0 |
| 122 | 123 | endif |
| 123 | −LIBTCCPROGS=$(LIBTCCB) | |
| 124 | +LIBTCCLIBS=$(LIBTCCB) | |
| 124 | 125 | |
| 125 | 126 | ifdef CONFIG_CROSS |
| 126 | 127 | PROGS+=$(PROGS_CROSS) |
| 128 | +# Try to build win32 cross-compiler lib on *nix | |
| 127 | 129 | ifndef CONFIG_WIN32 |
| 128 | −LIBTCCPROGS+=tcc1.def | |
| 130 | +LIBTCCLIBS+=tcc1.def | |
| 129 | 131 | endif |
| 130 | 132 | endif |
| 131 | 133 | |
| 132 | −all: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCPROGS) tcc-doc.html tcc.1 libtcc_test$(EXESUF) | |
| 134 | +all: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCLIBS) tcc-doc.html tcc.1 libtcc_test$(EXESUF) | |
| 133 | 135 | |
| 134 | 136 | # Host Tiny C Compiler |
| 135 | 137 | tcc$(EXESUF): tcc.o $(LIBTCCB) |
| @@ -182,7 +184,10 @@ libtcc.so.1.0: $(LIBTCC_OBJ) · 46 unmodified lines | ||
| 182 | 184 | |
| 183 | 185 | libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB) |
| 184 | 186 | $(CC) -o $@ $^ -I. $(CFLAGS) $(LIBS) $(LIBTCCL) |
| 185 | − | |
| 187 | + | |
| 188 | +# To build cross-compilers on Linux we must make a fake 32 bit tcc.exe | |
| 189 | +# and use it to build ELF objects into libtcc1.a which is then | |
| 190 | +# renamed to tcc1.def in order to have another target in the Makefile | |
| 186 | 191 | tcc1.def: |
| 187 | 192 | mv config.mak config.mak.bak |
| 188 | 193 | mv config.h config.h.bak |
| @@ -240,7 +245,7 @@ TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h · 51 unmodified lines | ||
| 240 | 245 | INSTALL=install |
| 241 | 246 | |
| 242 | 247 | ifndef CONFIG_WIN32 |
| 243 | −install: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCPROGS) tcc.1 tcc-doc.html | |
| 248 | +install: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCLIBS) tcc.1 tcc-doc.html | |
| 244 | 249 | mkdir -p "$(bindir)" |
| 245 | 250 | $(INSTALL) -s -m755 $(PROGS) "$(bindir)" |
| 246 | 251 | mkdir -p "$(mandir)/man1" |