Unified · Split
| @@ -8,19 +8,7 @@ VPATH = $(top_srcdir) · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | CPPFLAGS += -I$(TOP) # for config.h |
| 10 | 10 | |
| 11 | −ifeq (-$(findstring gcc,$(CC))-,-gcc-) | |
| 12 | −ifeq (-$(findstring $(GCC_MAJOR),01)-,--) | |
| 13 | −CFLAGS+=-fno-strict-aliasing | |
| 14 | −ifeq (-$(findstring $(GCC_MAJOR),23)-,--) | |
| 15 | −CFLAGS+=-Wno-pointer-sign -Wno-sign-compare | |
| 16 | −ifeq (-$(GCC_MAJOR)-$(findstring $(GCC_MINOR),56789)-,-4--) | |
| 17 | −CFLAGS+=-D_FORTIFY_SOURCE=0 | |
| 18 | −else | |
| 19 | −CFLAGS+=-Wno-unused-result | |
| 20 | −endif | |
| 21 | −endif | |
| 22 | −endif | |
| 23 | −else # not GCC | |
| 11 | +ifneq (-$(findstring gcc,$(CC))-,-gcc-) | |
| 24 | 12 | ifeq (-$(findstring clang,$(CC))-,-clang-) |
| 25 | 13 | # make clang accept gnuisms in libtcc1.c |
| 26 | 14 | CFLAGS+=-fheinous-gnu-extensions |
| @@ -373,8 +373,16 @@ else · 372 unmodified lines | ||
| 373 | 373 | fi |
| 374 | 374 | |
| 375 | 375 | # a final configuration tuning |
| 376 | −W_PRESENT="$($cc -v --help 2>&1 | grep deprecated-declarations)" | |
| 377 | −if test -n "$W_PRESENT"; then cc="$cc -Wno-deprecated-declarations"; fi | |
| 376 | +W_OPTIONS="deprecated-declarations strict-aliasing pointer-sign sign-compare unused-result uninitialized" | |
| 377 | +for i in $W_OPTIONS; do | |
| 378 | + O_PRESENT="$($cc -v --help 2>&1 | grep -- -W$i)" | |
| 379 | + if test -n "$O_PRESENT"; then CFLAGS="$CFLAGS -Wno-$i"; fi | |
| 380 | +done | |
| 381 | +F_OPTIONS="strict-aliasing" | |
| 382 | +for i in $F_OPTIONS; do | |
| 383 | + O_PRESENT="$($cc -v --help 2>&1 | grep -- -f$i)" | |
| 384 | + if test -n "$O_PRESENT"; then CFLAGS="$CFLAGS -fno-$i"; fi | |
| 385 | +done | |
| 378 | 386 | if test -z "$tcc_lddir" -a "$cpu" = "x86-64"; then tcc_lddir="lib64"; fi |
| 379 | 387 | |
| 380 | 388 | echo "Binary directory $bindir" |
| @@ -420,6 +428,12 @@ LDFLAGS=$LDFLAGS · 39 unmodified lines | ||
| 420 | 428 | LIBSUF=$LIBSUF |
| 421 | 429 | EXESUF=$EXESUF |
| 422 | 430 | EOF |
| 431 | +if test "$mingw32" = "yes"; then | |
| 432 | +cat >>config.mak <<EOF | |
| 433 | +XCC=$cc | |
| 434 | +XAR=$ar | |
| 435 | +EOF | |
| 436 | +fi | |
| 423 | 437 | |
| 424 | 438 | print_inc() { |
| 425 | 439 | if test -n "$2"; then |
| @@ -60,15 +60,15 @@ CFLAGS := $(filter-out -fstack-protector-strong,$(CFLAGS)) · 59 unmodified lines | ||
| 60 | 60 | ifeq "$(TARGET)" "i386-win" |
| 61 | 61 | OBJ = $(addprefix $(DIR)/,$(WIN32_O)) |
| 62 | 62 | TGT = -DTCC_TARGET_I386 -DTCC_TARGET_PE |
| 63 | − XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include | |
| 64 | − XAR = $(DIR)/tiny_libmaker$(EXESUF) | |
| 63 | + XCC ?= $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include | |
| 64 | + XAR ?= $(DIR)/tiny_libmaker$(EXESUF) | |
| 65 | 65 | PICFLAGS = |
| 66 | 66 | else |
| 67 | 67 | ifeq "$(TARGET)" "x86_64-win" |
| 68 | 68 | OBJ = $(addprefix $(DIR)/,$(WIN64_O)) |
| 69 | 69 | TGT = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE |
| 70 | 70 | XCC = $(TCC) -B$(top_srcdir)/win32 -I$(top_srcdir)/include |
| 71 | − XAR = $(DIR)/tiny_libmaker$(EXESUF) | |
| 71 | + XAR ?= $(DIR)/tiny_libmaker$(EXESUF) | |
| 72 | 72 | PICFLAGS = |
| 73 | 73 | else |
| 74 | 74 | ifeq "$(TARGET)" "i386" |