From 8e5e44728ecac7ad09e084a2a9a829aa4fa200aa Mon Sep 17 00:00:00 2001 From: evilynux Date: Fri, 29 Jun 2007 09:01:46 +0000 Subject: [PATCH] Applied patch from Thomas Moulard: - Now possible to build in a separated directory; - Fixes some autotools warnings (AM_PROG_CC_C_O used to be required for some versions of automake); - desmume-cli now builds without having the gtkglext librairy installed (-lGL and -lglut were missing). --- desmume/src/Makefile.am | 2 ++ desmume/src/cli/Makefile.am | 6 +++++- desmume/src/desmume.mk | 3 +++ desmume/src/gdbstub/Makefile.am | 4 ++-- desmume/src/gtk-glade/Makefile.am | 25 ++++++++++++++++--------- desmume/src/gtk/Makefile.am | 6 ++++-- desmume/src/windows/Makefile.am | 2 ++ 7 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 desmume/src/desmume.mk diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 82b4530bb..92d26374a 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/src/desmume.mk + EXTRA_DIST = build.bat instruction_tabdef.inc thumb_tabdef.inc fs-linux.c fs-windows.c DIST_SUBDIRS = . gdbstub cli gtk gtk-glade windows SUBDIRS = . gdbstub $(UI_DIR) diff --git a/desmume/src/cli/Makefile.am b/desmume/src/cli/Makefile.am index 1141030fd..1d830ac87 100644 --- a/desmume/src/cli/Makefile.am +++ b/desmume/src/cli/Makefile.am @@ -1,4 +1,8 @@ +include $(top_srcdir)/src/desmume.mk + +AM_CFLAGS += $(SDL_CFLAGS) +AM_LDFLAGS += -lGL -lglut + bin_PROGRAMS = desmume-cli desmume_cli_SOURCES = main.c ../sndsdl.c ../ctrlssdl.h ../ctrlssdl.c desmume_cli_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a $(SDL_LIBS) -desmume_cli_CFLAGS = $(SDL_CFLAGS) diff --git a/desmume/src/desmume.mk b/desmume/src/desmume.mk new file mode 100644 index 000000000..cfdf61069 --- /dev/null +++ b/desmume/src/desmume.mk @@ -0,0 +1,3 @@ +AM_CFLAGS = +AM_CPPFLAGS = -I$(top_srcdir)/src +AM_LDFLAGS = \ No newline at end of file diff --git a/desmume/src/gdbstub/Makefile.am b/desmume/src/gdbstub/Makefile.am index 9694db57c..3777d67f0 100644 --- a/desmume/src/gdbstub/Makefile.am +++ b/desmume/src/gdbstub/Makefile.am @@ -1,4 +1,4 @@ +include $(top_srcdir)/src/desmume.mk + noinst_LIBRARIES = libgdbstub.a libgdbstub_a_SOURCES = gdbstub.c gdbstub_internal.h -libgdbstub_a_CPPFLAGS = -I.. - diff --git a/desmume/src/gtk-glade/Makefile.am b/desmume/src/gtk-glade/Makefile.am index c137d22e7..f06224d75 100644 --- a/desmume/src/gtk-glade/Makefile.am +++ b/desmume/src/gtk-glade/Makefile.am @@ -1,11 +1,23 @@ +include $(top_srcdir)/src/desmume.mk + +AM_CPPFLAGS += $(SDL_CFLAGS) $(GTKGLEXT_CFLAGS) $(LIBGLADE_CFLAGS) \ + $(GTHREAD_CFLAGS) -DDATADIR=\"$(gladedir)/\" +AM_LDFLAGS += -rdynamic + +EXTRA_DIST = DeSmuME.dev $(glade_DATA) + Applicationsdir = $(datadir)/applications Applications_DATA = desmume-glade.desktop pixmapdir = $(datadir)/pixmaps pixmap_DATA = glade/DeSmuME.xpm +gladedir = $(datadir)/desmume/glade +glade_DATA = glade/DeSmuMe_Dtools.glade glade/DeSmuMe.glade glade/DeSmuME.xpm + bin_PROGRAMS = desmume-glade desmume_glade_SOURCES = \ globals.h glade-xml.c \ - callbacks.c callbacks.h callbacks_IO.c callbacks_IO.h desmume.c desmume.h \ + callbacks.c callbacks.h callbacks_IO.c callbacks_IO.h \ + desmume.c desmume.h \ keyval_names.c main.c printscreen.c gdk_gl.c gdk_gl.h \ dTools/callbacks_1_ioregs.c dTools/callbacks_2_memview.c \ dTools/callbacks_3_palview.c dTools/callbacks_4_tileview.c \ @@ -14,11 +26,6 @@ desmume_glade_SOURCES = \ gdk_3Demu.c gdk_3Demu.h \ ../sndsdl.h ../sndsdl.c ../ctrlssdl.h ../ctrlssdl.c -gladedir = $(datadir)/desmume/glade -glade_DATA = glade/DeSmuMe_Dtools.glade glade/DeSmuMe.glade glade/DeSmuME.xpm - -desmume_glade_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a $(SDL_LIBS) $(GTKGLEXT_LIBS) $(LIBGLADE_LIBS) $(GTHREAD_LIBS) -desmume_glade_CFLAGS = $(SDL_CFLAGS) $(GTKGLEXT_CFLAGS) $(LIBGLADE_CFLAGS) $(GTHREAD_CFLAGS) -DDATADIR=\"$(gladedir)/\" -desmume_glade_LDFLAGS = -rdynamic - -EXTRA_DIST = DeSmuME.dev $(glade_DATA) +desmume_glade_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a \ + $(SDL_LIBS) $(GTKGLEXT_LIBS) $(LIBGLADE_LIBS) \ + $(GTHREAD_LIBS) diff --git a/desmume/src/gtk/Makefile.am b/desmume/src/gtk/Makefile.am index fc0fee42f..26608c722 100644 --- a/desmume/src/gtk/Makefile.am +++ b/desmume/src/gtk/Makefile.am @@ -1,3 +1,7 @@ +include $(top_srcdir)/src/desmume.mk + +AM_CPPFLAGS += $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTKGLEXT_CFLAGS) $(GTHREAD_CFLAGS) + Applicationsdir = $(datadir)/applications Applications_DATA = desmume.desktop pixmapdir = $(datadir)/pixmaps @@ -18,5 +22,3 @@ desmume_SOURCES = \ main.c desmume_LDADD = ../libdesmume.a ../gdbstub/libgdbstub.a \ $(SDL_LIBS) $(GTK_LIBS) $(GTKGLEXT_LIBS) $(GTHREAD_LIBS) -desmume_CFLAGS = $(SDL_CFLAGS) $(GTK_CFLAGS) $(GTKGLEXT_CFLAGS) $(GTHREAD_CFLAGS) -#desmume_LDFLAGS = -rdynamic diff --git a/desmume/src/windows/Makefile.am b/desmume/src/windows/Makefile.am index b46fdf9dc..f99699705 100644 --- a/desmume/src/windows/Makefile.am +++ b/desmume/src/windows/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/src/desmume.mk + EXTRA_DIST = DeSmuME.dev DeSmuME.exe.Manifest DeSmuME.ico \ DeSmuME.layout DeSmuME.vcproj Makefile.win \ resources.rc yopyop_private.rc