aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-07 19:59:24 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-07 19:59:24 +0000
commitf0b4ae82ddbd384c7dad594eb36d14e4946a5f62 (patch)
tree49862c74dfd3b46944eed223af3a01348accb154 /Game/Code
parentd4d3d8873fea024cd9e1f17b04416bebe627d1f0 (diff)
downloadusdx-f0b4ae82ddbd384c7dad594eb36d14e4946a5f62.tar.gz
usdx-f0b4ae82ddbd384c7dad594eb36d14e4946a5f62.tar.xz
usdx-f0b4ae82ddbd384c7dad594eb36d14e4946a5f62.zip
made some adaptions to be more portable.
you might have to call "autogen.sh" again because i added a new m4 script with one of the last commits. call "./configure --enable-dev-build" after this to install USDX into the local directory (the binary will simply be moved to ../.. at the moment). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@840 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Makefile.in82
-rw-r--r--Game/Code/configure.ac82
2 files changed, 112 insertions, 52 deletions
diff --git a/Game/Code/Makefile.in b/Game/Code/Makefile.in
index 5df6c737..b4eff25d 100644
--- a/Game/Code/Makefile.in
+++ b/Game/Code/Makefile.in
@@ -1,7 +1,6 @@
##
# Makefile for @PACKAGE_NAME@ @PACKAGE_VERSION@
-# @AUTOCONF_INFO@
-# @PACKAGE_BUGREPORT@
+# @configure_input@
##
# general definitions
@@ -23,19 +22,19 @@ LN_S = @LN_S@
USDX_PREFIX = UltraStar
USDX_TOOLS_DIR = ../../Tools
-
-
EXE_SUFFIX = @EXEEXT@
# Free Pascal compiler
PPC = @PPC@
PFLAGS = @PFLAGS@
+PLIBS = @PLIBS@
# FPC target platform and processor
PPLATFORM = @FPC_PLATFORM@
PPROCESSOR = @FPC_PROCESSOR@
# lazarus defines
LAZARUS_DIR = @LAZARUS_DIR@
+LCL_WIDGET_TYPE = @LCL_WIDGET_TYPE@
PROJ_SUFFIX = .lpr
# RC to LRS resource compiler
@@ -44,14 +43,14 @@ RESCOMPILER_BIN = $(USDX_TOOLS_DIR)/$(RESCOMPILER_NAME)$(EXE_SUFFIX)
RESCOMPILER_SRC = $(USDX_TOOLS_DIR)/$(RESCOMPILER_NAME)$(PROJ_SUFFIX)
RESCOMPILER_PFLAGS = -dRELEASE
-RES_SUFFIX = .lrs
-
# Directories added to the unit path
PUNIT_TOKEN = -Fu
-PUNIT_FLAGS = $(PUNIT_TOKEN)$(LAZARUS_DIR)/lcl/units/$(PPROCESSOR)-$(PPLATFORM) \
- $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/images/lib/$(PPROCESSOR)-$(PPLATFORM) \
- $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/jpeg \
- $(PUNIT_TOKEN).
+PUNIT_FLAGS = \
+ $(PUNIT_TOKEN)$(LAZARUS_DIR)/lcl/units/$(PPROCESSOR)-$(PPLATFORM) \
+ $(PUNIT_TOKEN)$(LAZARUS_DIR)/lcl/units/$(PPROCESSOR)-$(PPLATFORM)/$(LCL_WIDGET_TYPE) \
+ $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/images/lib/$(PPROCESSOR)-$(PPLATFORM) \
+ $(PUNIT_TOKEN)$(LAZARUS_DIR)/components/jpeg \
+ $(PUNIT_TOKEN).
# Directory where compiled units (.ppu and .o files) are stored
PCUNIT_TOKEN = -FU
@@ -60,10 +59,10 @@ PCUNIT_FLAGS = $(PCUNIT_TOKEN)$(PCUNIT_DIR)
# Directories added to the includes path
PINC_TOKEN = -Fi
-PINC_FLAGS = $(PINC_TOKEN)lib/JEDI-SDLv1.0/SDL/Pas
+PINC_FLAGS = $(PINC_TOKEN)lib/JEDI-SDL/SDL/Pas
# Defines
-PDEFINES = -dLCL
+PDEFINES = -dLCL -dLCL$(LCL_WIDGET_TYPE)
# Misc fpc options
PCOMPAT_FLAGS = -S2dgi
@@ -84,14 +83,12 @@ PFLAGS += $(PCOMPAT_FLAGS) \
USDX_SRC = $(USDX_PREFIX)$(PROJ_SUFFIX)
# name of executable
USDX_BIN = $(USDX_PREFIX)$(EXE_SUFFIX)
-# name of resource
-USDX_RES = $(USDX_PREFIX)$(RES_SUFFIX)
-.PHONY: all resources ultrastardx-app install uninstall clean distclean clean_obj clean_res
+.PHONY: all resources ultrastardx-app install install-dev install-release uninstall uninstall-dev uninstall-release clean distclean clean_obj clean_res
all: resources ultrastardx-app
-resources: $(USDX_RES)
+resources: $(USDX_PREFIX).lrs
ultrastardx-app: $(USDX_BIN)
@@ -99,44 +96,65 @@ ultrastardx-app: $(USDX_BIN)
# (it uses an .inc-files cache for example).
# As a result FPC misses some changes if it is called without cleaning
# up first (very annoying while debugging).
-$(USDX_BIN):
- $(MAKE) clean_obj
+$(USDX_BIN): clean_obj
+# $(MAKE) clean_obj
mkdir -p $(PCUNIT_DIR)
- $(PPC) $(PFLAGS) $(PINC_FLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$(USDX_BIN) $(USDX_SRC)
+ $(PPC) $(PFLAGS) $(PLIBS) $(PINC_FLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$@ $(USDX_SRC)
+
+install: install-@install_type@
+# all
+
+uninstall: uninstall-@install_type@
+
+
+# local development build
-install: all
+install-dev:
+ mv $(USDX_BIN) ../..
+
+uninstall-dev:
+ rm -f ../../$(USDX_BIN)
+
+# global release build
+
+install-release:
# TODO: copy files to the appropriate places
# $()/mkinstalldirs $(bindir)
# $()/mkinstalldirs $(libdir)
# $()/mkinstalldirs $(infodir)
- mv $(USDX_BIN) ../..
# $(INSTALL) $(USDX_BIN) $(bindir)/$(USDX_BIN)
+ @echo '"install-release" does not exist yet. Install USDX yourself or use "./configure --enable-dev-build" for a local installation.'
-uninstall:
+uninstall-release:
# TODO: remove installed files
-# rm -f ...
- echo "Comming soon!"
+# rm -f xyz
+ @echo '"install-release" does not exist yet.'
+
-clean: clean_obj clean_res
+clean: clean_obj
-distclean: clean
- find . -name "*.o" -o -name "*.ppu" -o -name "*.rst" | xargs rm -f
- find . -name "*.bak" -o -name "*.orig" -o -name "*.dcu" | xargs rm -f
+distclean: clean clean_res
+ find . -name "*.o" -o -name "*.ppu" -o -name "*.rst" -o -name "*.compiled" | xargs rm -f
+ find . -name "*~" -name "*.bak" -o -name "*.orig" -o -name "*.dcu" | xargs rm -f
find . -name "__history" | xargs rm -r -f
- rm -f $(OUTPUT).cfg $(OUTPUT).res $(OUTPUT).identcache
+ rm -f $(USDX_PREFIX).res $(USDX_PREFIX).identcache
rm -f config.inc config.log config.status configure
+ rm -f Makefile
+ rm -f aclocal.m4
+ rm -rf autom4te.cache
clean_obj:
find "$(PCUNIT_DIR)" -name "*.o" -o -name "*.ppu" -o -name "*.rst" -o -name "*.compiled" | xargs rm -f
- rm -f $(OUTPUT)
+ rm -f $(USDX_BIN)
clean_res:
- rm -f $(USDX_RES) link.res
+ rm -f $(USDX_PREFIX).lrs
-$(USDX_RES): $(RESCOMPILER_BIN) $(USDX_PREFIX).rc
+$(USDX_PREFIX).lrs: $(RESCOMPILER_BIN) $(USDX_PREFIX).rc
$(RESCOMPILER_BIN) $(USDX_PREFIX).rc
$(RESCOMPILER_BIN): $(RESCOMPILER_SRC)
+ mkdir -p $(PCUNIT_DIR)
$(PPC) $(RESCOMPILER_PFLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$@ $(RESCOMPILER_SRC)
configure: configure.ac config.inc.in aclocal.m4
diff --git a/Game/Code/configure.ac b/Game/Code/configure.ac
index 40e8a6d2..f0af3447 100644
--- a/Game/Code/configure.ac
+++ b/Game/Code/configure.ac
@@ -29,6 +29,18 @@ AC_CONFIG_MACRO_DIR(m4)
# show features and packages in one list
AC_PRESERVE_HELP_ORDER
+#echo $LIBS
+
+#define([maco], [])
+#echo maco
+#m4_foreach_w([arg], [-L/usr/local -l/bin/bash -L/usr/local],
+# [m4_append_uniq([maco], "arg", [ ])
+#])
+#echo maco
+
+#echo m4_split([hallo o])
+#AC_MSG_ERROR(oi)
+
# -----------------------------------------
# define switches
# -----------------------------------------
@@ -46,6 +58,15 @@ if [[ x$with_lazarus = xno ]] ; then
AC_MSG_ERROR([Lazarus is required. It is impossible to build without it.]);
fi
+# add lazarus widget-type option
+AC_ARG_WITH([lcl_widget_type],
+ [AS_HELP_STRING([--with-lcl-widget-type=TYPE],
+ [Lazarus LCL Widget Type @<:@default=gtk2@:>@])],
+ [with_lcl_widget_type=$withval], [with_lcl_widget_type="gtk2"])
+if [[ x$with_lcl_widget_type = xno -o x$with_lcl_widget_type = xyes ]] ; then
+ AC_MSG_ERROR([Invalid LCL Widget Type (try one of gtk2/gtk/qt)]);
+fi
+
# add portaudio option
AC_ARG_WITH([portaudio],
[AS_HELP_STRING([--with-portaudio=DIR],
@@ -88,12 +109,26 @@ AC_ARG_WITH([cfg-dummy3], [
Development options:])
# add dev_layout option
-# Note: now handled by the Makefile
-AC_ARG_ENABLE(dev_install,
- [AS_HELP_STRING([--enable-dev-install],
- [local installation for testing])],
- [enable_dev_install="yes"], [enable_dev_install="no"])
+AC_ARG_ENABLE(dev_build,
+ [AS_HELP_STRING([--enable-dev-build],
+ [local development build])],
+ [enable_dev_build="yes"], [enable_dev_build="no"])
+
+# -----------------------------------------
+# tools
+# -----------------------------------------
+# options for make command
+AC_PROG_MAKE_SET
+# find tool for ln -s
+AC_LN_S
+# find the best install tool
+AC_PROG_INSTALL
+# some other useful tools
+#AC_PROG_AWK
+AC_PROG_SED
+AC_PROG_GREP
+#AC_PROG_EGREP
# -----------------------------------------
# macro declarations
@@ -117,7 +152,7 @@ AC_DEFUN([AC_SPLIT_VERSION],
# Note: We use a here-document (<<< here-strings not POSIX compatible)
# Do NOT indent the eof-delimiter
read major minor release ignore <<eof
- `echo [$2] | tr '.-' ' ' | sed s/[^0-9\ ].*//`
+ `echo [$2] | tr '.-' ' ' | $SED 's/[[^0-9\ ]].*//'`
eof
# strip preceding 0s and set unset version-parts to 0
@@ -210,18 +245,6 @@ AC_LANG([C])
AC_PROG_CXX
AC_LANG([C++])
-# options for make command
-AC_PROG_MAKE_SET
-# find tool for ln -s
-AC_LN_S
-# find the best install tool
-AC_PROG_INSTALL
-# some other useful tools
-#AC_PROG_AWK
-#AC_PROG_SED
-#AC_PROG_GREP
-#AC_PROG_EGREP
-
# find pkg-config
PKG_PROG_PKG_CONFIG()
if [[ x$PKG_CONFIG = x ]]; then
@@ -254,7 +277,7 @@ AC_PATH_PROG(LAZARUS, lazarus, no, [$LAZARUS_CHECK_DIRS])
if [[ $LAZARUS = "no" ]] ; then
AC_MSG_ERROR([Could not find lazarus. Please install lazarus and try again.]);
fi
-LAZARUS_DIR=`dirname "$LAZARUS"`
+LAZARUS_DIR=`AS_DIRNAME(["$LAZARUS"])`
# get lazarus version
AC_MSG_CHECKING(for version of lazarus)
@@ -264,6 +287,18 @@ LAZARUS_VERSION=`(cd "$LAZARUS_DIR/tools/install"; ./get_lazarus_version.sh)`
AC_SPLIT_VERSION([LAZARUS], [$LAZARUS_VERSION])
AC_MSG_RESULT(@<:@$LAZARUS_VERSION@:>@)
+# check if LCL Widget type is valid
+LCL_WIDGET_TYPE=$with_lcl_widget_type
+LCL_UNIT_DIR="$LAZARUS_DIR/lcl/units/$FPC_PROCESSOR-$FPC_PLATFORM"
+LCL_WIDGET_DIR="$LCL_UNIT_DIR/$LCL_WIDGET_TYPE"
+AC_MSG_CHECKING([whether LCL Widget Type "$LCL_WIDGET_TYPE" is valid])
+if [[ -d "$LCL_WIDGET_DIR" ]]; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(LCL Widget Type not available: directory "$LCL_WIDGET_DIR" not found.)
+fi
+
# find sdl
AC_PKG_CHECK_VERSION(SDL, [sdl], yes)
@@ -328,12 +363,19 @@ AC_SUBST(PORTMIXER_LIB)
AC_SUBST_DEFINE(HAVE_PORTMIXER, $PORTMIXER_HAVE)
AC_SUBST(LAZARUS_DIR)
+AC_SUBST(LCL_WIDGET_TYPE)
-AC_SUBST_DEFINE(USE_LOCAL_DIRS, $enable_dev_install)
+AC_SUBST_DEFINE(USE_LOCAL_DIRS, $enable_dev_build)
+if [[ x$enable_dev_build = xyes ]]; then
+ AC_SUBST(install_type, ["dev"])
+else
+ AC_SUBST(install_type, ["release"])
+fi
AC_SUBST(suffix)
AC_SUBST(logrootdir, [$with_logrootdir])
AC_DEFINE_DIR(sharerootdir, datarootdir)
+AC_SUBST(PLIBS)
AC_SUBST(PACKAGE_WEBSITE)
# -----------------------------------------