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