From b646c33080fd385fef34d758d40cd4c5ac3857b2 Mon Sep 17 00:00:00 2001 From: Ayla Date: Wed, 1 Jun 2011 01:07:00 +0200 Subject: [PATCH] The ./configure will now accept the --enable-platform switch. It takes as its parameter the name of the targeted platform. Currently, those are nanonote, dingux, pandora, gp2x and pc. The makefiles will install the data accordingly to the platform specs (e.g. install the 800x480 skins for the pandora platform). --- Makefile.am | 2 +- configure.in | 46 +++++++++++++++++++++++++++++++++++++++++++++- data/Makefile.am | 9 +++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 data/Makefile.am diff --git a/Makefile.am b/Makefile.am index 948a117..9768a98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = src +SUBDIRS = src data diff --git a/configure.in b/configure.in index 9849628..363af31 100644 --- a/configure.in +++ b/configure.in @@ -27,5 +27,49 @@ AC_ARG_WITH(sdl-gfx-prefix, AC_CHECK_LIB(SDL_gfx, rotozoomSurfaceXY,,check_sdl_gfx="no") +AC_ARG_ENABLE(platform, + [ --enable-platform=X specify the targeted platform], + [GMENU2X_PLATFORM="$enableval"], [GMENU2X_PLATFORM="default"]) -AC_OUTPUT(Makefile src/Makefile) +case "$GMENU2X_PLATFORM" in + gp2x) + AC_DEFINE(PLATFORM_GP2X) + PLATFORM="gp2x" + SCREEN_RES="320x240" + ;; + dingux) + AC_DEFINE(PLATFORM_DINGUX) + PLATFORM="dingux" + SCREEN_RES="320x240" + ;; + nanonote) + AC_DEFINE(PLATFORM_NANONOTE) + PLATFORM="nanonote" + SCREEN_RES="320x240" + ;; + pandora) + AC_DEFINE(PLATFORM_PANDORA) + PLATFORM="pandora" + SCREEN_RES="800x480" + ;; + default) + AC_MSG_WARN([*** No --enable-platform specified. Defaulting to "pc".]) + AC_DEFINE(PLATFORM_PC) + PLATFORM="pc" + SCREEN_RES="800x480" + ;; + pc) + AC_DEFINE(PLATFORM_PC) + PLATFORM="pc" + SCREEN_RES="800x480" + ;; + *) + AC_MSG_ERROR([*** Unknown platform.]) + ;; +esac + +AC_SUBST(PLATFORM) +AC_SUBST(SCREEN_RES) + + +AC_OUTPUT(Makefile src/Makefile data/Makefile) diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..9538540 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,9 @@ + +#pkgdata_DATA = platform/@PLATFORM@ translations skins/@SCREEN_RES@ + +install-data-local: + test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" + $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)/skins" + cp -r platform/@PLATFORM@/* "$(DESTDIR)$(pkgdatadir)" + cp -r translations "$(DESTDIR)$(pkgdatadir)" + cp -r skins/@SCREEN_RES@/* "$(DESTDIR)$(pkgdatadir)/skins"