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.
This commit is contained in:
Thomas Preud'homme 2011-06-17 22:22:04 +02:00
parent 330d2ee0fa
commit 3511e6e2a8
2 changed files with 15 additions and 5 deletions

View File

@ -5,7 +5,6 @@
TOP ?= . TOP ?= .
include $(TOP)/config.mak include $(TOP)/config.mak
CFLAGS+=-g -Wall
CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
LIBS_P= LIBS_P=
@ -217,12 +216,17 @@ libtcc1.a : FORCE
lib/%/libtcc1.a : FORCE $(PROGS_CROSS) lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
@$(MAKE) -C lib cross TARGET=$* @$(MAKE) -C lib cross TARGET=$*
bcheck.o : lib/bcheck.c bcheck.o : lib/bcheck.c
gcc -c $< -o $@ -O2 -Wall gcc -c $< -o $@ $(CFLAGS)
FORCE: FORCE:
# install # install
TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h
INSTALL=install INSTALL=install
ifdef STRIP_BINARIES
INSTALLBIN=$(INSTALL) -s
else
INSTALLBIN=$(INSTALL)
endif
ifndef CONFIG_WIN32 ifndef CONFIG_WIN32
install: $(PROGS) $(TCCLIBS) $(TCCDOCS) install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
@ -230,7 +234,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
ifeq ($(CC),tcc) ifeq ($(CC),tcc)
$(INSTALL) -m755 $(PROGS) "$(bindir)" $(INSTALL) -m755 $(PROGS) "$(bindir)"
else else
$(INSTALL) -s -m755 $(PROGS) "$(bindir)" $(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
endif endif
mkdir -p "$(mandir)/man1" mkdir -p "$(mandir)/man1"
-$(INSTALL) tcc.1 "$(mandir)/man1" -$(INSTALL) tcc.1 "$(mandir)/man1"
@ -291,7 +295,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
mkdir -p "$(tccdir)/examples" mkdir -p "$(tccdir)/examples"
mkdir -p "$(tccdir)/doc" mkdir -p "$(tccdir)/doc"
mkdir -p "$(tccdir)/libtcc" mkdir -p "$(tccdir)/libtcc"
$(INSTALL) -s -m755 $(PROGS) "$(tccdir)" $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
$(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib" $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
cp -r win32/include/. "$(tccdir)/include" cp -r win32/include/. "$(tccdir)/include"
cp -r win32/examples/. "$(tccdir)/examples" cp -r win32/examples/. "$(tccdir)/examples"

8
configure vendored
View File

@ -146,6 +146,8 @@ for opt do
;; ;;
--disable-rpath) disable_rpath="yes" --disable-rpath) disable_rpath="yes"
;; ;;
--strip-binaries) strip_binaries="yes"
;;
--with-libgcc) use_libgcc="yes" --with-libgcc) use_libgcc="yes"
;; ;;
--with-selinux) have_selinux="yes" --with-selinux) have_selinux="yes"
@ -157,7 +159,7 @@ done
# Checking for CFLAGS # Checking for CFLAGS
if test -z "$CFLAGS"; then if test -z "$CFLAGS"; then
CFLAGS="-O2" CFLAGS="-Wall -g -O2"
fi fi
cc="${cross_prefix}${cc}" cc="${cross_prefix}${cc}"
@ -253,6 +255,7 @@ echo " --sysroot=PREFIX prepend PREFIX to library/include paths []"
echo " --cc=CC use C compiler CC [$cc]" echo " --cc=CC use C compiler CC [$cc]"
echo " --disable-static make libtcc.so instead of libtcc.a" echo " --disable-static make libtcc.so instead of libtcc.a"
echo " --disable-rpath disable use of -rpath with the above" echo " --disable-rpath disable use of -rpath with the above"
echo " --strip-binaries strip symbol tables from resulting binaries"
echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a" echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
echo " --enable-mingw32 build windows version on linux with mingw32" echo " --enable-mingw32 build windows version on linux with mingw32"
echo " --enable-cygwin build windows version on windows with cygwin" echo " --enable-cygwin build windows version on windows with cygwin"
@ -419,6 +422,9 @@ fi
if test "$disable_rpath" = "yes" ; then if test "$disable_rpath" = "yes" ; then
echo "DISABLE_RPATH=yes" >> config.mak echo "DISABLE_RPATH=yes" >> config.mak
fi fi
if test "$strip_binaries" = "yes" ; then
echo "STRIP_BINARIES=yes" >> config.mak
fi
if test "$use_libgcc" = "yes" ; then if test "$use_libgcc" = "yes" ; then
echo "#define CONFIG_USE_LIBGCC" >> $TMPH echo "#define CONFIG_USE_LIBGCC" >> $TMPH
echo "CONFIG_USE_LIBGCC=yes" >> config.mak echo "CONFIG_USE_LIBGCC=yes" >> config.mak