Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,23 @@ endif

ifeq ($(COMP),mingw)
comp=mingw
CXX=g++
ifeq ($(UNAME),Linux)
ifeq ($(bits),64)
ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
CXX=x86_64-w64-mingw32-c++
else
CXX=x86_64-w64-mingw32-c++-posix
endif
else
ifeq ($(shell which i686-w64-mingw32-c++-posix),)
CXX=i686-w64-mingw32-c++
else
CXX=i686-w64-mingw32-c++-posix
endif
endif
else
CXX=g++
endif
CXXFLAGS += -Wextra -Wshadow
LDFLAGS += -static
endif
Expand Down Expand Up @@ -307,7 +323,7 @@ ifeq ($(pext),yes)
endif
endif

### 3.11 Link Time Optimization, it works since gcc 4.5 but not on mingw.
### 3.11 Link Time Optimization, it works since gcc 4.5 but not on mingw under Windows.
### This is a mix of compile and link time options because the lto link phase
### needs access to the optimization flags.
ifeq ($(comp),gcc)
Expand All @@ -319,6 +335,17 @@ ifeq ($(comp),gcc)
endif
endif

ifeq ($(comp),mingw)
ifeq ($(UNAME),Linux)
ifeq ($(optimize),yes)
ifeq ($(debug),no)
CXXFLAGS += -flto
LDFLAGS += $(CXXFLAGS)
endif
endif
endif
endif

### 3.12 Android 5 can only run position independent executables. Note that this
### breaks Android 4.0 and earlier.
ifeq ($(arch),armv7)
Expand Down