History

Default to create progs with symbols (incl. debug)

* Set CFLAGS entirely in configure if not already set. * Compile bcheck.c with the same flags as the other source files * Don't strip binaries by default (GB are cheap now) but provide a --strip-binaries option in configure script.

Thomas Preud'homme committed 15 years ago

Commit 3511e6e1 parent 330d2ee2 files · +15 −5Browse files

Unified · Split

2 files
  1. Makefile +8 −4
  2. configure +7 −1
Makefile+8−4
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 TOP ?= .
66 include $(TOP)/config.mak
77
8−CFLAGS+=-g -Wall
98 CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
109 LIBS_P=
1110
@@ -217,12 +216,17 @@ libtcc1.a : FORCE · 205 unmodified lines
217216 lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
218217 @$(MAKE) -C lib cross TARGET=$*
219218 bcheck.o : lib/bcheck.c
220− gcc -c $< -o $@ -O2 -Wall
219+ gcc -c $< -o $@ $(CFLAGS)
221220 FORCE:
222221
223222 # install
224223 TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h
225224 INSTALL=install
225+ifdef STRIP_BINARIES
226+INSTALLBIN=$(INSTALL) -s
227+else
228+INSTALLBIN=$(INSTALL)
229+endif
226230
227231 ifndef CONFIG_WIN32
228232 install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
@@ -230,7 +234,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 1 unmodified line
230234 ifeq ($(CC),tcc)
231235 $(INSTALL) -m755 $(PROGS) "$(bindir)"
232236 else
233− $(INSTALL) -s -m755 $(PROGS) "$(bindir)"
237+ $(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
234238 endif
235239 mkdir -p "$(mandir)/man1"
236240 -$(INSTALL) tcc.1 "$(mandir)/man1"
@@ -291,7 +295,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 54 unmodified lines
291295 mkdir -p "$(tccdir)/examples"
292296 mkdir -p "$(tccdir)/doc"
293297 mkdir -p "$(tccdir)/libtcc"
294− $(INSTALL) -s -m755 $(PROGS) "$(tccdir)"
298+ $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
295299 $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
296300 cp -r win32/include/. "$(tccdir)/include"
297301 cp -r win32/examples/. "$(tccdir)/examples"
configure+7−1
@@ -146,6 +146,8 @@ for opt do · 145 unmodified lines
146146 ;;
147147 --disable-rpath) disable_rpath="yes"
148148 ;;
149+ --strip-binaries) strip_binaries="yes"
150+ ;;
149151 --with-libgcc) use_libgcc="yes"
150152 ;;
151153 --with-selinux) have_selinux="yes"
@@ -157,7 +159,7 @@ done · 5 unmodified lines
157159
158160 # Checking for CFLAGS
159161 if test -z "$CFLAGS"; then
160− CFLAGS="-O2"
162+ CFLAGS="-Wall -g -O2"
161163 fi
162164
163165 cc="${cross_prefix}${cc}"
@@ -253,6 +255,7 @@ echo " --sysroot=PREFIX prepend PREFIX to library/include paths []" · 89 unmodified lines
253255 echo " --cc=CC use C compiler CC [$cc]"
254256 echo " --disable-static make libtcc.so instead of libtcc.a"
255257 echo " --disable-rpath disable use of -rpath with the above"
258+echo " --strip-binaries strip symbol tables from resulting binaries"
256259 echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
257260 echo " --enable-mingw32 build windows version on linux with mingw32"
258261 echo " --enable-cygwin build windows version on windows with cygwin"
@@ -419,6 +422,9 @@ fi · 160 unmodified lines
419422 if test "$disable_rpath" = "yes" ; then
420423 echo "DISABLE_RPATH=yes" >> config.mak
421424 fi
425+if test "$strip_binaries" = "yes" ; then
426+ echo "STRIP_BINARIES=yes" >> config.mak
427+fi
422428 if test "$use_libgcc" = "yes" ; then
423429 echo "#define CONFIG_USE_LIBGCC" >> $TMPH
424430 echo "CONFIG_USE_LIBGCC=yes" >> config.mak

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