Skip to content

Commit

Permalink
build: GCC=1, win image-version=0,1, rm RDLLFLAGS
Browse files Browse the repository at this point in the history
more buildsystem fixes: on win32 set -Wl,--major-image-version,0,--minor-image-version,1
on darwin replace unused RDLLFLAGS with LDDLLFLAGS
set GCC and ICC config.inc values
  • Loading branch information
Reini Urban committed Oct 16, 2013
1 parent 32e0e7f commit 15d72c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -450,7 +450,7 @@ lib/potion/buffile${LOADEXT}: core/config.h core/potion.h \
lib/buffile.${OPIC} lib/buffile.c lib/libpotion${DLL}
@${ECHO} LD $@
@${LIBPNA_AWAY}
@${CC} $(DEBUGFLAGS) -o $@ ${LDDLLFLAGS} ${RPATH} \
@${CC} $(DEBUGFLAGS) -o $@ $(subst libpotion,buffile,${LDDLLFLAGS}) ${RPATH} \
lib/buffile.${OPIC} ${LIBPTH} -lpotion ${LIBS} > /dev/null
@${LIBPNA_BACK}

Expand Down
10 changes: 8 additions & 2 deletions config.mak
Expand Up @@ -18,6 +18,8 @@ DEBUG ?= 0
WIN32 = 0
CLANG = 0
JIT = 0
ICC = 0
GCC = 0
EXE =
APPLE = 0
CYGWIN = 0
Expand Down Expand Up @@ -147,6 +149,7 @@ ifneq ($(shell ./tools/config.sh "${CC}" icc),0)
endif
else
ifneq ($(shell ./tools/config.sh "${CC}" gcc),0)
GCC = 1
WARNINGS += -Wno-switch -Wno-unused-label
DEBUGFLAGS += --param ssp-buffer-size=1
ifeq (${DEBUG},0)
Expand Down Expand Up @@ -177,8 +180,10 @@ endif

CROSS = $(shell tools/config.sh "${CC}" cross)
# cygwin is not WIN32. detect mingw target on cross
# maybe parse versions from core/potion.h
ifeq ($(shell tools/config.sh "${CC}" mingw),1)
WIN32 = 1
LDFLAGS += -Wl,--major-image-version,0,--minor-image-version,1
LDDLLFLAGS = -shared
EXE = .exe
DLL = .dll
Expand Down Expand Up @@ -214,6 +219,7 @@ ifeq ($(shell tools/config.sh "${CC}" mingw),1)
else
ifeq ($(shell tools/config.sh "${CC}" cygwin),1)
CYGWIN = 1
LDFLAGS += -Wl,--major-image-version,0,--minor-image-version,1
LDDLLFLAGS = -shared
LOADEXT = .dll
EXE = .exe
Expand All @@ -224,7 +230,7 @@ ifeq ($(shell tools/config.sh "${CC}" apple),1)
DLL = .dylib
LOADEXT = .bundle
LDDLLFLAGS = -dynamiclib -undefined dynamic_lookup -fpic -Wl,-flat_namespace
RDLLFLAGS = -install_name "@executable_path/../lib/libpotion${DLL}"
LDDLLFLAGS += -install_name "@executable_path/../lib/libpotion${DLL}"
RPATH =
RPATH_INSTALL =
else
Expand Down Expand Up @@ -327,7 +333,7 @@ core/config.h: config.inc core/version.h tools/config.sh config.mak
@${CAT} core/version.h > core/config.h
@${MAKE} -s -f config.mak config.h.echo >> core/config.h

#TODO: fix when git is not available
# TODO: fix when git is not available
core/version.h: $(shell git show-ref HEAD | ${SED} "s,^.* ,.git/,g")
@${ECHO} MAKE $@
@${ECHO} "/* created by ${MAKE} -f config.mak */" > core/version.h
Expand Down

0 comments on commit 15d72c1

Please sign in to comment.