History

Summary of commits + added some brief comments to Makefile

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.

Henry Kroll III committed 16 years ago

Commit 209caee1 parent ac0b7d81 file · +10 −5Browse files

Unified · Split

Makefile+10−5
@@ -114,22 +114,24 @@ endif · 113 unmodified lines
114114 endif
115115 endif
116116
117+# LIBTCCB decides whether libtcc is installed static or dynamic
117118 LIBTCCB=libtcc.a
118119 ifdef DISABLE_STATIC
119120 CFLAGS+=-fPIC
120121 LIBTCCL=-L. -ltcc
121122 LIBTCCB=libtcc.so.1.0
122123 endif
123−LIBTCCPROGS=$(LIBTCCB)
124+LIBTCCLIBS=$(LIBTCCB)
124125
125126 ifdef CONFIG_CROSS
126127 PROGS+=$(PROGS_CROSS)
128+# Try to build win32 cross-compiler lib on *nix
127129 ifndef CONFIG_WIN32
128−LIBTCCPROGS+=tcc1.def
130+LIBTCCLIBS+=tcc1.def
129131 endif
130132 endif
131133
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)
133135
134136 # Host Tiny C Compiler
135137 tcc$(EXESUF): tcc.o $(LIBTCCB)
@@ -182,7 +184,10 @@ libtcc.so.1.0: $(LIBTCC_OBJ) · 46 unmodified lines
182184
183185 libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB)
184186 $(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
186191 tcc1.def:
187192 mv config.mak config.mak.bak
188193 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
240245 INSTALL=install
241246
242247 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
244249 mkdir -p "$(bindir)"
245250 $(INSTALL) -s -m755 $(PROGS) "$(bindir)"
246251 mkdir -p "$(mandir)/man1"