Fixed linux compilation in regard to SQLite dependency on libdl
For some reason newer G++ linker requires libraries to come after object files, yuck! git-svn-id: http://mc-server.googlecode.com/svn/trunk@1371 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
f10386bad5
commit
ee1e0d0eff
14
GNUmakefile
14
GNUmakefile
@ -33,15 +33,19 @@ all: MCServer/MCServer
|
|||||||
# CC_OPTIONS ... options for the C code compiler
|
# CC_OPTIONS ... options for the C code compiler
|
||||||
# CXX_OPTIONS ... options for the C++ code compiler
|
# CXX_OPTIONS ... options for the C++ code compiler
|
||||||
# LNK_OPTIONS ... options for the linker
|
# LNK_OPTIONS ... options for the linker
|
||||||
|
# LNK_LIBS ... libraries to link in
|
||||||
|
# -- according to http://stackoverflow.com/questions/6183899/undefined-reference-to-dlopen, libs must come after all sources
|
||||||
# BUILDDIR ... folder where the intermediate object files are built
|
# BUILDDIR ... folder where the intermediate object files are built
|
||||||
|
|
||||||
|
LNK_LIBS = -lstdc++ -ldl
|
||||||
|
|
||||||
ifeq ($(release),1)
|
ifeq ($(release),1)
|
||||||
################
|
################
|
||||||
# release build - fastest run-time, no gdb support
|
# release build - fastest run-time, no gdb support
|
||||||
################
|
################
|
||||||
CC_OPTIONS = -s -g -O3 -DNDEBUG
|
CC_OPTIONS = -s -g -O3 -DNDEBUG
|
||||||
CXX_OPTIONS = -s -g -O3 -DNDEBUG
|
CXX_OPTIONS = -s -g -O3 -DNDEBUG
|
||||||
LNK_OPTIONS = -lstdc++ -ldl -pthread -O3
|
LNK_OPTIONS = -pthread -O3
|
||||||
BUILDDIR = build/release/
|
BUILDDIR = build/release/
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -51,7 +55,7 @@ ifeq ($(profile),1)
|
|||||||
################
|
################
|
||||||
CC_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
|
CC_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
|
||||||
CXX_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
|
CXX_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
|
||||||
LNK_OPTIONS = -lstdc++ -ldl -pthread -ggdb -O3 -pg
|
LNK_OPTIONS = -pthread -ggdb -O3 -pg
|
||||||
BUILDDIR = build/profile/
|
BUILDDIR = build/profile/
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -61,7 +65,7 @@ ifeq ($(pedantic),1)
|
|||||||
################
|
################
|
||||||
CC_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
|
CC_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
|
||||||
CXX_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
|
CXX_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
|
||||||
LNK_OPTIONS = -lstdc++ -ldl -pthread -ggdb
|
LNK_OPTIONS = -pthread -ggdb
|
||||||
BUILDDIR = build/pedantic/
|
BUILDDIR = build/pedantic/
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -71,7 +75,7 @@ else
|
|||||||
################
|
################
|
||||||
CC_OPTIONS = -s -ggdb -g -D_DEBUG -O3
|
CC_OPTIONS = -s -ggdb -g -D_DEBUG -O3
|
||||||
CXX_OPTIONS = -s -ggdb -g -D_DEBUG
|
CXX_OPTIONS = -s -ggdb -g -D_DEBUG
|
||||||
LNK_OPTIONS = -lstdc++ -ldl -pthread -g -ggdb
|
LNK_OPTIONS = -pthread -g -ggdb
|
||||||
BUILDDIR = build/debug/
|
BUILDDIR = build/debug/
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -123,7 +127,7 @@ OBJECTS := $(patsubst %.cpp,$(BUILDDIR)%.o,$(OBJECTS))
|
|||||||
-include $(patsubst %.o,%.d,$(OBJECTS))
|
-include $(patsubst %.o,%.d,$(OBJECTS))
|
||||||
|
|
||||||
MCServer/MCServer : $(OBJECTS)
|
MCServer/MCServer : $(OBJECTS)
|
||||||
$(CC) $(LNK_OPTIONS) $(OBJECTS) -o MCServer/MCServer
|
$(CC) $(LNK_OPTIONS) $(OBJECTS) $(LNK_LIBS) -o MCServer/MCServer
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -rf $(BUILDDIR) MCServer/MCServer
|
rm -rf $(BUILDDIR) MCServer/MCServer
|
||||||
|
Loading…
Reference in New Issue
Block a user