Skip to content

Commit

Permalink
Optimized compiler flags for wxWidgets
Browse files Browse the repository at this point in the history
svn-id: r46447
  • Loading branch information
sev- committed Dec 20, 2009
1 parent 680d7c2 commit a4f31fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,33 @@ tools_gui$(EXEEXT): gui/main.o gui/pages.o gui/gui_tools.o compress_agos.o compr
extract_agos.o extract_cine.o extract_gob_stk.o extract_kyra.o extract_loom_tg16.o extract_mm_apple.o \
extract_mm_c64.o extract_mm_nes.o extract_parallaction.o extract_scumm_mac.o extract_t7g_mac.o \
encode_dxa.o extract_zak_c64.o kyra_pak.o kyra_ins.o compress.o tool.o tools.o $(UTILS)
$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
$(CXX) $(LDFLAGS) -o $@ $+ $(WXLIBS) $(LIBS)

tools_cli$(EXEEXT): main_cli.o tools_cli.o compress_agos.o compress_gob.o compress_kyra.o \
compress_queen.o compress_saga.o compress_scumm_bun.o compress_scumm_san.o compress_scumm_sou.o \
compress_sword1.o compress_sword2.o compress_touche.o compress_tucker.o compress_tinsel.o \
extract_agos.o extract_cine.o extract_gob_stk.o extract_kyra.o extract_loom_tg16.o extract_mm_apple.o \
extract_mm_c64.o extract_mm_nes.o extract_parallaction.o extract_scumm_mac.o extract_t7g_mac.o \
encode_dxa.o extract_zak_c64.o kyra_pak.o kyra_ins.o compress.o tool.o tools.o $(UTILS)
$(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz -lvorbis -logg -lvorbisenc -lFLAC
$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS) -lpng

sword2_clue$(EXEEXT): sword2_clue.o
$(CXX) $(LDFLAGS) -o $@ $+ `pkg-config --libs gtk+-2.0`

gui/main.o: gui/main.cpp gui/main.h gui/configuration.h gui/pages.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c gui/main.cpp -o gui/main.o
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(WXINCLUDES) -c gui/main.cpp -o gui/main.o

gui/pages.o: gui/pages.cpp gui/pages.h gui/main.h gui/gui_tools.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c gui/pages.cpp -o gui/pages.o
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(WXINCLUDES) -c gui/pages.cpp -o gui/pages.o

create_sjisfnt.o: create_sjisfnt.cpp util.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) `freetype-config --cflags` -c create_sjisfnt.cpp -o create_sjisfnt.o

tools_gui.o: tools_gui.cpp tools_gui.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c tools_gui.cpp -o tools_gui.o
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(WXINCLUDES) -c tools_gui.cpp -o tools_gui.o

gui/gui_tools.o: gui/gui_tools.cpp gui/gui_tools.h
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c gui/gui_tools.cpp -o gui/gui_tools.o
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(WXINCLUDES) -c gui/gui_tools.cpp -o gui/gui_tools.o

sword2_clue.o: sword2_clue.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) `pkg-config --cflags gtk+-2.0` -c sword2_clue.cpp
Expand Down
12 changes: 10 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ _ar="ar cru"
_wxconfig=wx-config
_wxpath="$PATH"
_prefix=/usr/local
_wxincludes=""
_wxlibs=""

_srcdir=`dirname $0`

Expand Down Expand Up @@ -883,8 +885,11 @@ test -z "$_libdir" && _libdir="$_prefix/lib"


find_wxconfig
INCLUDES="$INCLUDES `$_wxconfig --prefix="$_wxpath" --cflags`"
LIBS="$LIBS `$_wxconfig --prefix="$_wxpath" --libs`"
if test -n "$_wxconfig"; then
_wxincludes="`$_wxconfig --prefix="$_wxpath" --cflags`"
_wxlibs="`$_wxconfig --prefix="$_wxpath" --libs`"
fi


#
# Do CXXFLAGS now we know the compiler version
Expand Down Expand Up @@ -984,6 +989,9 @@ OBJS += $OBJS
DEFINES += $DEFINES
LDFLAGS += $LDFLAGS
WXINCLUDES := $_wxincludes
WXLIBS:= $_wxlibs
SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
SAVED_LDFLAGS := $SAVED_LDFLAGS
SAVED_CXX := $SAVED_CXX
Expand Down

0 comments on commit a4f31fa

Please sign in to comment.