History

win32 configure

bellard committed 22 years ago

Commit 13affef1 parent c50af836 files · +92 −51Browse files

Unified · Split

6 files
  1. Changelog +1 −0
  2. Makefile +40 −36
  3. VERSION +1 −1
  4. configure +48 −11
  5. libtcc_test.c +1 −1
  6. tcc.c +1 −2
Changelog+1−0
@@ -6,6 +6,7 @@ version 0.9.21: · 5 unmodified lines
6- fixed assignment of const struct in struct6- fixed assignment of const struct in struct
7- line comment fix (reported by Bertram Felgenhauer)7- line comment fix (reported by Bertram Felgenhauer)
8- initial TMS320C67xx target support (TK)8- initial TMS320C67xx target support (TK)
9- win32 configure
9 10
10version 0.9.20:11version 0.9.20:
11 12
Makefile+40−36
@@ -4,7 +4,10 @@ · 3 unmodified lines
4include config.mak4include config.mak
5 5
6CFLAGS=-O2 -g -Wall6CFLAGS=-O2 -g -Wall
7ifndef CONFIG_WIN32
7LIBS=-ldl8LIBS=-ldl
9BCHECK_O=bcheck.o
10endif
8CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC11CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
9LIBS_P=12LIBS_P=
10 13
@@ -17,11 +20,13 @@ endif · 6 unmodified lines
17 20
18DISAS=objdump -d21DISAS=objdump -d
19INSTALL=install22INSTALL=install
20 23PROGS=tcc$(EXESUF) c67-tcc$(EXESUF) arm-tcc$(EXESUF)
21# run local version of tcc with local libraries and includes24# run local version of tcc with local libraries and includes
22TCC=./tcc -B. -I.25TCC=./tcc -B. -I.
23 26
24all: tcc libtcc1.a bcheck.o tcc-doc.html tcc.1 libtcc.a libtcc_test27all: $(PROGS) \
28 libtcc1$(LIBSUF) $(BCHECK_O) tcc-doc.html tcc.1 libtcc$(LIBSUF) \
29 libtcc_test$(EXESUF)
25 30
26Makefile: config.mak31Makefile: config.mak
27 32
@@ -108,23 +113,23 @@ ex3: ex3.c · 80 unmodified lines
108 113
109# Native Tiny C Compiler114# Native Tiny C Compiler
110 115
111tcc_g: tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h Makefile116tcc_g$(EXESUF): tcc.c i386-gen.c tccelf.c tccasm.c i386-asm.c tcctok.h libtcc.h i386-asm.h Makefile
112 $(CC) $(CFLAGS) -o $@ $< $(LIBS)117 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
113 118
114tcc: tcc_g Makefile119tcc$(EXESUF): tcc_g$(EXESUF) Makefile
115 strip -s -R .comment -R .note -o $@ $<120 $(STRIP) -o $@ $<
116 121
117c67-tcc: tcc.c c67-gen.c tccelf.c tccasm.c tcctok.h libtcc.h tcccoff.c Makefile122c67-tcc$(EXESUF): tcc.c c67-gen.c tccelf.c tccasm.c tcctok.h libtcc.h tcccoff.c Makefile
118 $(CC) $(CFLAGS) -DTCC_TARGET_C67 -o $@ $< $(LIBS)123 $(CC) $(CFLAGS) -DTCC_TARGET_C67 -o $@ $< $(LIBS)
119 124
120arm-tcc: tcc.c arm-gen.c tccelf.c tccasm.c tcctok.h libtcc.h Makefile125arm-tcc$(EXESUF): tcc.c arm-gen.c tccelf.c tccasm.c tcctok.h libtcc.h Makefile
121 $(CC) $(CFLAGS) -DTCC_TARGET_ARM -o $@ $< $(LIBS)126 $(CC) $(CFLAGS) -DTCC_TARGET_ARM -o $@ $< $(LIBS)
122 127
123# TinyCC runtime libraries128# TinyCC runtime libraries
124libtcc1.o: libtcc1.c129libtcc1.o: libtcc1.c
125 $(CC) -O2 -Wall -c -o $@ $<130 $(CC) -O2 -Wall -c -o $@ $<
126 131
127libtcc1.a: libtcc1.o132libtcc1$(LIBSUF): libtcc1.o
128 $(AR) rcs $@ $^133 $(AR) rcs $@ $^
129 134
130bcheck.o: bcheck.c135bcheck.o: bcheck.c
@@ -132,52 +137,49 @@ bcheck.o: bcheck.c · 1 unmodified line
132 137
133install: tcc_install libinstall138install: tcc_install libinstall
134 139
135tcc_install: tcc tcc.1 libtcc1.a bcheck.o140tcc_install: $(PROGS) tcc.1 libtcc1$(LIBSUF) $(BCHECK_O) tcc-doc.html tcc.1
136 mkdir -p $(bindir)141 mkdir -p "$(bindir)"
137 $(INSTALL) -m755 tcc $(bindir)142 $(INSTALL) -s -m755 $(PROGS) "$(bindir)"
138 mkdir -p $(mandir)/man1143ifndef CONFIG_WIN32
139 $(INSTALL) tcc.1 $(mandir)/man1144 mkdir -p "$(mandir)/man1"
140 mkdir -p $(libdir)/tcc145 $(INSTALL) tcc.1 "$(mandir)/man1"
141 mkdir -p $(libdir)/tcc/include146endif
142 $(INSTALL) -m644 libtcc1.a bcheck.o $(libdir)/tcc147 mkdir -p "$(libdir)/tcc"
148 mkdir -p "$(libdir)/tcc/include"
149 $(INSTALL) -m644 libtcc1$(LIBSUF) $(BCHECK_O) "$(libdir)/tcc"
143 $(INSTALL) -m644 stdarg.h stddef.h stdbool.h float.h varargs.h \150 $(INSTALL) -m644 stdarg.h stddef.h stdbool.h float.h varargs.h \
144 tcclib.h $(libdir)/tcc/include151 tcclib.h "$(libdir)/tcc/include"
152 mkdir -p "$(docdir)"
153 $(INSTALL) -m644 tcc-doc.html "$(docdir)"
145 154
146clean:155clean:
147 rm -f *~ *.o tcc tcc1 tcct tcc_g tcctest.ref *.bin *.i ex2 \156 rm -f *~ *.o tcc tcc1 tcct tcc_g tcctest.ref *.bin *.i ex2 \
148 core gmon.out test.out test.ref a.out tcc_p \157 core gmon.out test.out test.ref a.out tcc_p \
149 *.exe tcc-doc.html tcc.pod tcc.1 libtcc.a libtcc_test \158 *.exe tcc-doc.html tcc.pod tcc.1 libtcc$(LIBSUF) libtcc_test \
150 tcctest[1234] test[1234].out159 tcctest[1234] test[1234].out c67-tcc arm-tcc
151 160
152distclean: clean161distclean: clean
153 rm -f config.h config.mak config.texi162 rm -f config.h config.mak config.texi
154 163
155# win32 TCC
156tcc_g.exe: tcc.c i386-gen.c bcheck.c Makefile
157 i386-mingw32msvc-gcc $(CFLAGS) -DCONFIG_TCC_STATIC -o $@ $<
158
159tcc.exe: tcc_g.exe
160 i386-mingw32msvc-strip -o $@ $<
161
162# profiling version164# profiling version
163tcc_p: tcc.c Makefile165tcc_p: tcc.c Makefile
164 $(CC) $(CFLAGS_P) -o $@ $< $(LIBS_P)166 $(CC) $(CFLAGS_P) -o $@ $< $(LIBS_P)
165 167
166# libtcc generation and example168# libtcc generation and example
167libinstall: libtcc.a 169libinstall: libtcc$(LIBSUF)
168 mkdir -p $(libdir)170 mkdir -p "$(libdir)"
169 $(INSTALL) -m644 libtcc.a $(libdir)171 $(INSTALL) -m644 libtcc$(LIBSUF) "$(libdir)"
170 mkdir -p $(includedir)172 mkdir -p "$(includedir)"
171 $(INSTALL) -m644 libtcc.h $(includedir)173 $(INSTALL) -m644 libtcc.h "$(includedir)"
172 174
173libtcc.o: tcc.c i386-gen.c bcheck.c Makefile175libtcc.o: tcc.c i386-gen.c Makefile
174 $(CC) $(CFLAGS) -DLIBTCC -c -o $@ $<176 $(CC) $(CFLAGS) -DLIBTCC -c -o $@ $<
175 177
176libtcc.a: libtcc.o 178libtcc$(LIBSUF): libtcc.o
177 $(AR) rcs $@ $^179 $(AR) rcs $@ $^
178 180
179libtcc_test: libtcc_test.c libtcc.a 181libtcc_test$(EXESUF): libtcc_test.c libtcc$(LIBSUF)
180 $(CC) $(CFLAGS) -I. -o $@ $< -L. -ltcc -ldl182 $(CC) $(CFLAGS) -o $@ $< libtcc$(LIBSUF) $(LIBS)
181 183
182libtest: libtcc_test184libtest: libtcc_test
183 ./libtcc_test185 ./libtcc_test
@@ -226,7 +228,9 @@ FILES= Makefile Makefile.uClibc configure VERSION \ · 42 unmodified lines
226 README TODO COPYING \228 README TODO COPYING \
227 Changelog tcc-doc.texi tcc-doc.html \229 Changelog tcc-doc.texi tcc-doc.html \
228 tcc.1 \230 tcc.1 \
229 tcc.c i386-gen.c tccelf.c tcctok.h tccasm.c i386-asm.c i386-asm.h\231 tcc.c tccelf.c tcctok.h tccasm.c i386-asm.c i386-asm.h \
232 tcccoff.c coff.h \
233 i386-gen.c c67-gen.c arm-gen.c \
230 bcheck.c libtcc1.c \234 bcheck.c libtcc1.c \
231 elf.h stab.h stab.def \235 elf.h stab.h stab.def \
232 stddef.h stdarg.h stdbool.h float.h varargs.h \236 stddef.h stdarg.h stdbool.h float.h varargs.h \
VERSION+1−1
@@ -1 +1 @@
10.9.2010.9.21
configure+48−11
@@ -18,7 +18,7 @@ TMPS="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.S" · 17 unmodified lines
18TMPH="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.h"18TMPH="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.h"
19 19
20# default parameters20# default parameters
21prefix="/usr/local"21prefix=""
22execprefix=""22execprefix=""
23bindir=""23bindir=""
24libdir=""24libdir=""
@@ -56,10 +56,16 @@ case "$cpu" in · 31 unmodified lines
56esac56esac
57gprof="no"57gprof="no"
58bigendian="no"58bigendian="no"
59mingw32="no"
60LIBSUF=".a"
61EXESUF=""
59 62
60# OS specific63# OS specific
61targetos=`uname -s`64targetos=`uname -s`
62case $targetos in65case $targetos in
66MINGW32*)
67mingw32="yes"
68;;
63*) ;;69*) ;;
64esac70esac
65 71
@@ -106,6 +112,8 @@ for opt do · 40 unmodified lines
106 ;;112 ;;
107 --enable-gprof) gprof="yes"113 --enable-gprof) gprof="yes"
108 ;;114 ;;
115 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
116 ;;
109 esac117 esac
110done118done
111 119
@@ -118,6 +126,11 @@ cc="${cross_prefix}${cc}" · 6 unmodified lines
118ar="${cross_prefix}${ar}"126ar="${cross_prefix}${ar}"
119strip="${cross_prefix}${strip}"127strip="${cross_prefix}${strip}"
120 128
129if test "$mingw32" = "yes" ; then
130 LIBSUF=".lib"
131 EXESUF=".exe"
132fi
133
121if test -z "$cross_prefix" ; then134if test -z "$cross_prefix" ; then
122 135
123# ---136# ---
@@ -188,26 +201,43 @@ echo "" · 64 unmodified lines
188exit 1201exit 1
189fi202fi
190 203
191if test x"$execprefix" = x""; then204if test "$mingw32" = "yes" ; then
192execprefix="${prefix}"205 if test -z "$prefix" ; then
193fi206 prefix="/c/Program Files/tcc"
194if test x"$bindir" = x""; then207 fi
195bindir="${execprefix}/bin"208 execprefix="$prefix"
196fi209 bindir="$prefix"
210 docdir="$prefix/doc"
211else
212 if test -z "$prefix" ; then
213 prefix="/usr/local"
214 fi
215 if test x"$execprefix" = x""; then
216 execprefix="${prefix}"
217 fi
218 if test x"$bindir" = x""; then
219 bindir="${execprefix}/bin"
220 fi
221 if test x"$docdir" = x""; then
222 docdir="$prefix/share/doc/qemu"
223 fi
224fi # mingw32
225
197if test x"$libdir" = x""; then226if test x"$libdir" = x""; then
198libdir="${execprefix}/lib"227libdir="${execprefix}/lib"
199fi228fi
200if test x"$includedir" = x""; then
201includedir="${prefix}/include"
202fi
203if test x"$mandir" = x""; then229if test x"$mandir" = x""; then
204mandir="${prefix}/man"230mandir="${prefix}/man"
205fi231fi
232if test x"$includedir" = x""; then
233includedir="${prefix}/include"
234fi
206 235
207echo "Binary directory $bindir"236echo "Binary directory $bindir"
208echo "Library directory $libdir"237echo "Library directory $libdir"
209echo "Include directory $includedir"238echo "Include directory $includedir"
210echo "Manual directory $mandir"239echo "Manual directory $mandir"
240echo "Doc directory $docdir"
211echo "Source path $source_path"241echo "Source path $source_path"
212echo "C compiler $cc"242echo "C compiler $cc"
213echo "make $make"243echo "make $make"
@@ -225,6 +255,7 @@ echo "bindir=$bindir" >> config.mak · 11 unmodified lines
225echo "libdir=$libdir" >> config.mak255echo "libdir=$libdir" >> config.mak
226echo "includedir=$includedir" >> config.mak256echo "includedir=$includedir" >> config.mak
227echo "mandir=$mandir" >> config.mak257echo "mandir=$mandir" >> config.mak
258echo "docdir=$docdir" >> config.mak
228echo "#define CONFIG_TCC_LIBDIR \"$libdir\"" >> $TMPH259echo "#define CONFIG_TCC_LIBDIR \"$libdir\"" >> $TMPH
229echo "MAKE=$make" >> config.mak260echo "MAKE=$make" >> config.mak
230echo "CC=$cc" >> config.mak261echo "CC=$cc" >> config.mak
@@ -235,6 +266,8 @@ echo "AR=$ar" >> config.mak · 4 unmodified lines
235echo "STRIP=$strip -s -R .comment -R .note" >> config.mak266echo "STRIP=$strip -s -R .comment -R .note" >> config.mak
236echo "CFLAGS=$CFLAGS" >> config.mak267echo "CFLAGS=$CFLAGS" >> config.mak
237echo "LDFLAGS=$LDFLAGS" >> config.mak268echo "LDFLAGS=$LDFLAGS" >> config.mak
269echo "LIBSUF=$LIBSUF" >> config.mak
270echo "EXESUF=$EXESUF" >> config.mak
238if test "$cpu" = "x86" ; then271if test "$cpu" = "x86" ; then
239 echo "ARCH=i386" >> config.mak272 echo "ARCH=i386" >> config.mak
240 echo "#define HOST_I386 1" >> $TMPH273 echo "#define HOST_I386 1" >> $TMPH
@@ -257,6 +290,10 @@ else · 16 unmodified lines
257 echo "Unsupported CPU"290 echo "Unsupported CPU"
258 exit 1291 exit 1
259fi292fi
293if test "$mingw32" = "yes" ; then
294 echo "CONFIG_WIN32=yes" >> config.mak
295 echo "#define CONFIG_WIN32 1" >> $TMPH
296fi
260if test "$bigendian" = "yes" ; then297if test "$bigendian" = "yes" ; then
261 echo "WORDS_BIGENDIAN=yes" >> config.mak298 echo "WORDS_BIGENDIAN=yes" >> config.mak
262 echo "#define WORDS_BIGENDIAN 1" >> $TMPH299 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
libtcc_test.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
6#include <stdlib.h>6#include <stdlib.h>
7#include <stdio.h>7#include <stdio.h>
8 8
9#include <libtcc.h>9#include "libtcc.h"
10 10
11/* this function is called by the generated code */11/* this function is called by the generated code */
12int add(int a, int b)12int add(int a, int b)
tcc.c+1−2
@@ -34,6 +34,7 @@ · 33 unmodified lines
34#include <time.h>34#include <time.h>
35#ifdef WIN3235#ifdef WIN32
36#include <sys/timeb.h>36#include <sys/timeb.h>
37#define CONFIG_TCC_STATIC
37#endif38#endif
38#ifndef WIN3239#ifndef WIN32
39#include <sys/time.h>40#include <sys/time.h>
@@ -85,13 +86,11 @@ · 45 unmodified lines
85#define TCC_TARGET_COFF86#define TCC_TARGET_COFF
86#endif87#endif
87 88
88#if !defined(WIN32)
89#define FALSE 089#define FALSE 0
90#define false 090#define false 0
91#define TRUE 191#define TRUE 1
92#define true 192#define true 1
93typedef int BOOL;93typedef int BOOL;
94#endif
95 94
96/* path to find crt1.o, crti.o and crtn.o. Only needed when generating95/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
97 executables or dlls */96 executables or dlls */

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