* 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.
Unified · Split
| @@ -5,7 +5,6 @@ · 4 unmodified lines | |||
| 5 | TOP ?= . | 5 | TOP ?= . |
| 6 | include $(TOP)/config.mak | 6 | include $(TOP)/config.mak |
| 7 | 7 | ||
| 8 | CFLAGS+=-g -Wall | ||
| 9 | CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC | 8 | CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC |
| 10 | LIBS_P= | 9 | LIBS_P= |
| 11 | 10 | ||
| @@ -217,12 +216,17 @@ libtcc1.a : FORCE · 205 unmodified lines | |||
| 217 | lib/%/libtcc1.a : FORCE $(PROGS_CROSS) | 216 | lib/%/libtcc1.a : FORCE $(PROGS_CROSS) |
| 218 | @$(MAKE) -C lib cross TARGET=$* | 217 | @$(MAKE) -C lib cross TARGET=$* |
| 219 | bcheck.o : lib/bcheck.c | 218 | bcheck.o : lib/bcheck.c |
| 220 | gcc -c $< -o $@ -O2 -Wall | 219 | gcc -c $< -o $@ $(CFLAGS) |
| 221 | FORCE: | 220 | FORCE: |
| 222 | 221 | ||
| 223 | # install | 222 | # install |
| 224 | TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h | 223 | TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h |
| 225 | INSTALL=install | 224 | INSTALL=install |
| 225 | ifdef STRIP_BINARIES | ||
| 226 | INSTALLBIN=$(INSTALL) -s | ||
| 227 | else | ||
| 228 | INSTALLBIN=$(INSTALL) | ||
| 229 | endif | ||
| 226 | 230 | ||
| 227 | ifndef CONFIG_WIN32 | 231 | ifndef CONFIG_WIN32 |
| 228 | install: $(PROGS) $(TCCLIBS) $(TCCDOCS) | 232 | install: $(PROGS) $(TCCLIBS) $(TCCDOCS) |
| @@ -230,7 +234,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 1 unmodified line | |||
| 230 | ifeq ($(CC),tcc) | 234 | ifeq ($(CC),tcc) |
| 231 | $(INSTALL) -m755 $(PROGS) "$(bindir)" | 235 | $(INSTALL) -m755 $(PROGS) "$(bindir)" |
| 232 | else | 236 | else |
| 233 | $(INSTALL) -s -m755 $(PROGS) "$(bindir)" | 237 | $(INSTALLBIN) -m755 $(PROGS) "$(bindir)" |
| 234 | endif | 238 | endif |
| 235 | mkdir -p "$(mandir)/man1" | 239 | mkdir -p "$(mandir)/man1" |
| 236 | -$(INSTALL) tcc.1 "$(mandir)/man1" | 240 | -$(INSTALL) tcc.1 "$(mandir)/man1" |
| @@ -291,7 +295,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 54 unmodified lines | |||
| 291 | mkdir -p "$(tccdir)/examples" | 295 | mkdir -p "$(tccdir)/examples" |
| 292 | mkdir -p "$(tccdir)/doc" | 296 | mkdir -p "$(tccdir)/doc" |
| 293 | mkdir -p "$(tccdir)/libtcc" | 297 | mkdir -p "$(tccdir)/libtcc" |
| 294 | $(INSTALL) -s -m755 $(PROGS) "$(tccdir)" | 298 | $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)" |
| 295 | $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib" | 299 | $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib" |
| 296 | cp -r win32/include/. "$(tccdir)/include" | 300 | cp -r win32/include/. "$(tccdir)/include" |
| 297 | cp -r win32/examples/. "$(tccdir)/examples" | 301 | cp -r win32/examples/. "$(tccdir)/examples" |
| @@ -146,6 +146,8 @@ for opt do · 145 unmodified lines | |||
| 146 | ;; | 146 | ;; |
| 147 | --disable-rpath) disable_rpath="yes" | 147 | --disable-rpath) disable_rpath="yes" |
| 148 | ;; | 148 | ;; |
| 149 | --strip-binaries) strip_binaries="yes" | ||
| 150 | ;; | ||
| 149 | --with-libgcc) use_libgcc="yes" | 151 | --with-libgcc) use_libgcc="yes" |
| 150 | ;; | 152 | ;; |
| 151 | --with-selinux) have_selinux="yes" | 153 | --with-selinux) have_selinux="yes" |
| @@ -157,7 +159,7 @@ done · 5 unmodified lines | |||
| 157 | 159 | ||
| 158 | # Checking for CFLAGS | 160 | # Checking for CFLAGS |
| 159 | if test -z "$CFLAGS"; then | 161 | if test -z "$CFLAGS"; then |
| 160 | CFLAGS="-O2" | 162 | CFLAGS="-Wall -g -O2" |
| 161 | fi | 163 | fi |
| 162 | 164 | ||
| 163 | cc="${cross_prefix}${cc}" | 165 | cc="${cross_prefix}${cc}" |
| @@ -253,6 +255,7 @@ echo " --sysroot=PREFIX prepend PREFIX to library/include paths []" · 89 unmodified lines | |||
| 253 | echo " --cc=CC use C compiler CC [$cc]" | 255 | echo " --cc=CC use C compiler CC [$cc]" |
| 254 | echo " --disable-static make libtcc.so instead of libtcc.a" | 256 | echo " --disable-static make libtcc.so instead of libtcc.a" |
| 255 | echo " --disable-rpath disable use of -rpath with the above" | 257 | echo " --disable-rpath disable use of -rpath with the above" |
| 258 | echo " --strip-binaries strip symbol tables from resulting binaries" | ||
| 256 | echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a" | 259 | echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a" |
| 257 | echo " --enable-mingw32 build windows version on linux with mingw32" | 260 | echo " --enable-mingw32 build windows version on linux with mingw32" |
| 258 | echo " --enable-cygwin build windows version on windows with cygwin" | 261 | echo " --enable-cygwin build windows version on windows with cygwin" |
| @@ -419,6 +422,9 @@ fi · 160 unmodified lines | |||
| 419 | if test "$disable_rpath" = "yes" ; then | 422 | if test "$disable_rpath" = "yes" ; then |
| 420 | echo "DISABLE_RPATH=yes" >> config.mak | 423 | echo "DISABLE_RPATH=yes" >> config.mak |
| 421 | fi | 424 | fi |
| 425 | if test "$strip_binaries" = "yes" ; then | ||
| 426 | echo "STRIP_BINARIES=yes" >> config.mak | ||
| 427 | fi | ||
| 422 | if test "$use_libgcc" = "yes" ; then | 428 | if test "$use_libgcc" = "yes" ; then |
| 423 | echo "#define CONFIG_USE_LIBGCC" >> $TMPH | 429 | echo "#define CONFIG_USE_LIBGCC" >> $TMPH |
| 424 | echo "CONFIG_USE_LIBGCC=yes" >> config.mak | 430 | echo "CONFIG_USE_LIBGCC=yes" >> config.mak |