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 | endif | 114 | endif |
| 115 | endif | 115 | endif |
| 116 | 116 | ||
| 117 | # LIBTCCB decides whether libtcc is installed static or dynamic | ||
| 117 | LIBTCCB=libtcc.a | 118 | LIBTCCB=libtcc.a |
| 118 | ifdef DISABLE_STATIC | 119 | ifdef DISABLE_STATIC |
| 119 | CFLAGS+=-fPIC | 120 | CFLAGS+=-fPIC |
| 120 | LIBTCCL=-L. -ltcc | 121 | LIBTCCL=-L. -ltcc |
| 121 | LIBTCCB=libtcc.so.1.0 | 122 | LIBTCCB=libtcc.so.1.0 |
| 122 | endif | 123 | endif |
| 123 | LIBTCCPROGS=$(LIBTCCB) | 124 | LIBTCCLIBS=$(LIBTCCB) |
| 124 | 125 | ||
| 125 | ifdef CONFIG_CROSS | 126 | ifdef CONFIG_CROSS |
| 126 | PROGS+=$(PROGS_CROSS) | 127 | PROGS+=$(PROGS_CROSS) |
| 128 | # Try to build win32 cross-compiler lib on *nix | ||
| 127 | ifndef CONFIG_WIN32 | 129 | ifndef CONFIG_WIN32 |
| 128 | LIBTCCPROGS+=tcc1.def | 130 | LIBTCCLIBS+=tcc1.def |
| 129 | endif | 131 | endif |
| 130 | endif | 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 | # Host Tiny C Compiler | 136 | # Host Tiny C Compiler |
| 135 | tcc$(EXESUF): tcc.o $(LIBTCCB) | 137 | tcc$(EXESUF): tcc.o $(LIBTCCB) |
| @@ -182,7 +184,10 @@ libtcc.so.1.0: $(LIBTCC_OBJ) · 46 unmodified lines | |||
| 182 | 184 | ||
| 183 | libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB) | 185 | libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB) |
| 184 | $(CC) -o $@ $^ -I. $(CFLAGS) $(LIBS) $(LIBTCCL) | 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 | tcc1.def: | 191 | tcc1.def: |
| 187 | mv config.mak config.mak.bak | 192 | mv config.mak config.mak.bak |
| 188 | mv config.h config.h.bak | 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 | INSTALL=install | 245 | INSTALL=install |
| 241 | 246 | ||
| 242 | ifndef CONFIG_WIN32 | 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 | mkdir -p "$(bindir)" | 249 | mkdir -p "$(bindir)" |
| 245 | $(INSTALL) -s -m755 $(PROGS) "$(bindir)" | 250 | $(INSTALL) -s -m755 $(PROGS) "$(bindir)" |
| 246 | mkdir -p "$(mandir)/man1" | 251 | mkdir -p "$(mandir)/man1" |