Skip to content

Commit

Permalink
Add GameShell port to autotools build
Browse files Browse the repository at this point in the history
Restructure a bit
Notify the user before building, when a platform has special handling
  • Loading branch information
carstene1ns committed Jan 6, 2019
1 parent 01fee84 commit 04fccb2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 49 deletions.
24 changes: 17 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
AM_CPPFLAGS = ${HOST_CFLAGS} -DUSE_SOCKETS -DSCALE -I${top_srcdir}/src \
${SDL_CFLAGS} ${LIBMODPLUG_CFLAGS} ${LIBXMP_CFLAGS} ${ZLIB_CFLAGS}
AM_CFLAGS = -Wall
AM_CXXFLAGS = -Wall

dist_pkgdata_DATA = openjazz.000
EXTRA_DIST = gpl.txt licenses.txt README.md

Expand All @@ -14,6 +9,23 @@ appicon_fallbackdir = $(datadir)/icons/hicolor/48x48/apps
dist_appicon_fallback_DATA = unix/OpenJazz.png

bin_PROGRAMS = OpenJazz
OpenJazz_CPPFLAGS = \
-DUSE_SOCKETS \
-DSCALE \
-I${srcdir}/src
OpenJazz_CXXFLAGS = \
${HOST_CFLAGS} \
${SDL_CFLAGS} \
${LIBMODPLUG_CFLAGS} \
${LIBXMP_CFLAGS} \
${ZLIB_CFLAGS}
OpenJazz_LDADD = \
${SDL_LIBS} \
${LIBMODPLUG_LIBS} \
${LIBXMP_LIBS} \
${ZLIB_LIBS} \
${NET_LIBS} \
${HOST_LIBS}
OpenJazz_SOURCES = \
src/game/clientgame.cpp \
src/game/game.cpp \
Expand Down Expand Up @@ -113,5 +125,3 @@ OpenJazz_SOURCES = \
src/setup.h \
src/util.cpp \
src/util.h

OpenJazz_LDADD = ${SDL_LIBS} ${LIBMODPLUG_LIBS} ${LIBXMP_LIBS} ${ZLIB_LIBS} ${NET_LIBS} ${HOST_LIBS}
35 changes: 0 additions & 35 deletions Makefile.gameshell

This file was deleted.

27 changes: 20 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
AC_INIT([openjazz], [0], [https://github.com/AlisterT/openjazz/issues], [openjazz], [http://www.alister.eu/jazz/oj/])

AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax no-dist-gzip dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CANONICAL_HOST
AC_PROG_CXX
AC_PROG_CXXCPP
PKG_PROG_PKG_CONFIG

PKG_CHECK_MODULES([SDL], [sdl])
PKG_CHECK_MODULES([LIBXMP], [libxmp], [AC_DEFINE(USE_XMP, [1], [Enable XMP Music])], [
PKG_CHECK_MODULES([LIBMODPLUG], [libmodplug], [AC_DEFINE(USE_MODPLUG, [1], [Enable ModPlug Music])], [
AC_MSG_WARN([No music library found. OpenJazz will run, but music will be silent.])
])
])
PKG_CHECK_MODULES([ZLIB], [zlib])

AS_CASE([$host],
[*-*-mingw*], [NET_LIBS="-lws2_32"],
[*-haiku*], [HOST_CFLAGS="-D_BSD_SOURCE" HOST_LIBS="-lbe" NET_LIBS="-lnetwork"],
[arm-none-linux-gnueabi], [HOST_CFLAGS="-DPANDORA -fsigned-char" HOST_LIBS="-lts"],
[arm-gph-linux-gnueabi], [HOST_CFLAGS="-DCAANOO -fsigned-char"],
[arm-openwiz-linux-gnu], [HOST_CFLAGS="-DWIZ -fsigned-char"],
[arm-open2x-linux], [HOST_CFLAGS="-DGP2X -fsigned-char"],
[mipsel-linux*], [HOST_CFLAGS="-DDINGOO"])
[*-*-mingw*], [NET_LIBS="-lws2_32" OJ_HOST="MinGW (Windows)"],
[*-haiku*], [HOST_CFLAGS="-D_BSD_SOURCE" HOST_LIBS="-lbe" NET_LIBS="-lnetwork" OJ_HOST="Haiku"],
[arm-none-linux-gnueabi], [HOST_CFLAGS="-DPANDORA -fsigned-char" HOST_LIBS="-lts" OJ_HOST="Pandora"],
[arm-gph-linux-gnueabi], [HOST_CFLAGS="-DCAANOO -fsigned-char" OJ_HOST="GP2X Caanoo"],
[arm-openwiz-linux-gnu], [HOST_CFLAGS="-DWIZ -fsigned-char" OJ_HOST="GP2X Wiz"],
[arm-open2x-linux], [HOST_CFLAGS="-DGP2X -fsigned-char" OJ_HOST="GP2X"],
[mipsel-linux*], [HOST_CFLAGS="-DDINGOO" OJ_HOST="Dingoo"],
[armv7l-unknown-linux-gnueabihf], [HOST_CFLAGS="-DGAMESHELL" OJ_HOST="GameShell"])
AC_SUBST(HOST_CFLAGS)
AC_SUBST(HOST_LIBS)
AC_SUBST(NET_LIBS)

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

AS_IF([test "x$OJ_HOST" != "x"],[
echo ""
echo "Detected Platform: $OJ_HOST. If this is wrong, please open a bug report!"
echo ""
])

0 comments on commit 04fccb2

Please sign in to comment.