From 1721251fcb0437b27574681c1ffb068862b9d296 Mon Sep 17 00:00:00 2001 From: riccardom Date: Wed, 3 Feb 2010 13:21:23 +0000 Subject: [PATCH] Avoid to link wxlibs with frontends that does not use them The only frontend that may use wxwidgets library is the gtk one so there is no need to link the others against a tons of wxwidgets libs when calling configure with --enable-wxwidgets. --- desmume/configure.ac | 8 +++----- desmume/src/Makefile.am | 6 +----- desmume/src/cli/Makefile.am | 2 +- desmume/src/gtk-glade/Makefile.am | 3 ++- desmume/src/gtk/Makefile.am | 6 ++++++ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/desmume/configure.ac b/desmume/configure.ac index 55ecbb62f..4014431b6 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -220,11 +220,9 @@ if test "x$wxwidget" = "xyes" ; then m4_include(wxwin.m4) AM_PATH_WXCONFIG([2.4.0], wxwin=1) if test "x$wxwin" = "x1"; then - CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" - CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" - CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" - LIBS="$LIBS $WX_LIBS" - AC_DEFINE([HAVE_WX]) + AC_SUBST(WX_CPPFLAGS) + AC_SUBST(WX_LIBS) + AC_DEFINE([WANT_WX]) fi fi diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 5f2d3e0a1..b5a955a39 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -18,7 +18,7 @@ libdesmume_a_SOURCES = \ bios.cpp bios.h bits.h cp15.cpp cp15.h \ commandline.h commandline.cpp \ common.cpp common.h \ - debug.cpp debug.h driver.cpp driver.h \ + debug.cpp debug.h \ Disassembler.cpp Disassembler.h \ emufile.h emufile.cpp fat.h FIFO.cpp FIFO.h \ firmware.cpp firmware.h GPU.cpp GPU.h \ @@ -55,10 +55,6 @@ libdesmume_a_SOURCES = \ version.cpp version.h \ desmume_config.cpp desmume_config.h -if HAVE_WX -libdesmume_a_SOURCES += wxdlg/wxdlg3dViewer.cpp -endif - if HAVE_OPENAL libdesmume_a_SOURCES += mic_openal.cpp else diff --git a/desmume/src/cli/Makefile.am b/desmume/src/cli/Makefile.am index 143783535..32ac74bc5 100644 --- a/desmume/src/cli/Makefile.am +++ b/desmume/src/cli/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/src/desmume.mk AM_CPPFLAGS += $(SDL_CFLAGS) $(ALSA_CFLAGS) $(LIBAGG_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) bin_PROGRAMS = desmume-cli -desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp +desmume_cli_SOURCES = main.cpp ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp ../driver.h ../driver.cpp desmume_cli_LDADD = ../libdesmume.a $(SDL_LIBS) $(ALSA_LIBS) $(LIBAGG_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) if HAVE_GDB_STUB desmume_cli_LDADD += ../gdbstub/libgdbstub.a diff --git a/desmume/src/gtk-glade/Makefile.am b/desmume/src/gtk-glade/Makefile.am index 89ea3b516..120254885 100644 --- a/desmume/src/gtk-glade/Makefile.am +++ b/desmume/src/gtk-glade/Makefile.am @@ -26,7 +26,8 @@ desmume_glade_SOURCES = \ dTools/callbacks_dtools.h \ dTools/dTools_display.h \ gdk_3Demu.cpp gdk_3Demu.h \ - ../sndsdl.h ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp + ../sndsdl.h ../sndsdl.cpp ../ctrlssdl.h ../ctrlssdl.cpp \ + ../driver.h ../driver.cpp desmume_glade_LDADD = ../libdesmume.a \ $(SDL_LIBS) $(GTKGLEXT_LIBS) $(LIBGLADE_LIBS) \ diff --git a/desmume/src/gtk/Makefile.am b/desmume/src/gtk/Makefile.am index fd5d005f6..220247a24 100644 --- a/desmume/src/gtk/Makefile.am +++ b/desmume/src/gtk/Makefile.am @@ -15,6 +15,7 @@ desmume_SOURCES = \ tools/ioregsView.cpp tools/ioregsView.h \ ../sndsdl.cpp \ ../ctrlssdl.h ../ctrlssdl.cpp \ + ../driver.h ../driver.cpp \ osmesa_3Demu.cpp osmesa_3Demu.h \ cheatsGTK.h cheatsGTK.cpp \ main.cpp main.h @@ -26,6 +27,11 @@ endif if HAVE_LIBOSMESA desmume_LDADD += $(OSMESA_LIBS) endif +if HAVE_WX +AM_CPPFLAGS += -DHAVE_WX=1 $(WX_CPPFLAGS) +desmume_LDADD += $(WX_LIBS) +desmume_SOURCES += ../wxdlg/wxdlg3dViewer.cpp +endif UPDATE_DESKTOP = \ appsdir=$(DESTDIR)$(datadir)/applications ; \