History

gcc options and mingw: move a gcc options detection from a makefile to the configure + define XCC and XAR if mingw32 defined + use XCC and XAR in lib/Makefile if defined Try "./configure --enable-mingw32; make". This must work

seyko committed 11 years ago

Commit 48d12e41 parent 76af9483 files · +20 −18Browse files

Unified · Split

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

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