History

make win32 version of libtcc1.a for cross-compiler on x86 / x86_64

Henry Kroll III committed 16 years ago

Commit 80b4c691 parent b0b29d82 files · +28 −4Browse files

Unified · Split

2 files
  1. Makefile +6 −4
  2. make_libtcc1_win32.sh +22 −0
Makefile+6−4
@@ -10,7 +10,6 @@ CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC · 9 unmodified lines
1010 LIBS_P=
1111 LIBS=.
1212
13−# My distro wants shared libs, not static ones
1413 LIBTCCA=libtcc.a
1514 ifdef DISABLE_STATIC
1615 CFLAGS+=-fPIC
@@ -111,11 +110,11 @@ PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(C67_CROSS) · 94 unmodified lines
111110 else
112111 ifeq ($(ARCH),i386)
113112 NATIVE_FILES=$(I386_FILES)
114−PROGS_CROSS=$(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
113+PROGS_CROSS=$(X64_CROSS) libtcc1_win32 $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
115114 else
116115 ifeq ($(ARCH),x86-64)
117116 NATIVE_FILES=$(X86_64_FILES)
118−PROGS_CROSS=$(I386_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
117+PROGS_CROSS=$(I386_CROSS) libtcc1_win32 $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS)
119118 else
120119 ifeq ($(ARCH),arm)
121120 NATIVE_FILES=$(ARM_FILES)
@@ -126,6 +125,7 @@ endif · 4 unmodified lines
126125 endif
127126
128127 ifdef CONFIG_CROSS
128+
129129 PROGS+=$(PROGS_CROSS)
130130 endif
131131
@@ -179,7 +179,9 @@ libtcc.so.1: $(LIBTCC_OBJ) · 47 unmodified lines
179179 $(CC) -shared -Wl,-soname,$@ -o $@.0 $^
180180 ln -sf libtcc.so.1.0 libtcc.so.1
181181 ln -sf libtcc.so.1.0 libtcc.so
182−
182+libtcc1_win32:
183+ ./make_libtcc1_win32.sh
184+
183185 libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCA)
184186 $(CC) -o $@ $^ -I. $(CFLAGS) $(LIBS) $(LIBTCCL)
185187
make_libtcc1_win32.sh+22−0
@@ -0,0 +1,22 @@
1+#!/bin/bash
2+a=$(mktemp)
3+b=$(mktemp)
4+c=$(mktemp)
5+cp config.h $a
6+cp config.mak $b
7+# force 386 build on x86_64
8+./configure --cpu=x86
9+# configure doesn't provide a way to set tccdir
10+tccdir=$(grep TCCDIR $a|awk '{gsub("\"","",$3);print $3}')
11+grep -v CONFIG_TCCDIR $a > $c
12+echo "#define CONFIG_TCCDIR \"${tccdir}/win32\"" >> $c
13+mv $c config.h
14+make i386-win32-tcc
15+mv i386-win32-tcc tcc.exe
16+sync
17+make CONFIG_WIN32=1 libtcc1.a
18+cp include/* win32/include
19+mv libtcc1.a win32/lib
20+mv $a config.h
21+mv $b config.mak
22+rm tcc.exe

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t