diff options
Diffstat (limited to 'Game')
-rw-r--r-- | Game/Code/Makefile.in | 29 | ||||
-rw-r--r-- | Game/Code/config.inc.in | 134 | ||||
-rw-r--r-- | Game/Code/configure.ac | 143 |
3 files changed, 191 insertions, 115 deletions
diff --git a/Game/Code/Makefile.in b/Game/Code/Makefile.in index b702f8d6..5df6c737 100644 --- a/Game/Code/Makefile.in +++ b/Game/Code/Makefile.in @@ -1,5 +1,6 @@ ##
# Makefile for @PACKAGE_NAME@ @PACKAGE_VERSION@
+# @AUTOCONF_INFO@
# @PACKAGE_BUGREPORT@
##
@@ -12,6 +13,7 @@ infodir = @infodir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
datarootdir = @datarootdir@
+VPATH = @srcdir@
# install tool
INSTALL = @INSTALL@
@@ -21,6 +23,8 @@ LN_S = @LN_S@ USDX_PREFIX = UltraStar
USDX_TOOLS_DIR = ../../Tools
+
+
EXE_SUFFIX = @EXEEXT@
# Free Pascal compiler
@@ -83,26 +87,33 @@ USDX_BIN = $(USDX_PREFIX)$(EXE_SUFFIX) # name of resource
USDX_RES = $(USDX_PREFIX)$(RES_SUFFIX)
-.PHONY: all resources ultrastar install uninstall clean distclean clean_obj clean_res
+.PHONY: all resources ultrastardx-app install uninstall clean distclean clean_obj clean_res
-all: resources ultrastar
+all: resources ultrastardx-app
resources: $(USDX_RES)
-# we need to rebuild everything, fpc does some sort of caching of old files,
-# so we have to delete all the old stuff first
-ultrastar: clean_obj
+ultrastardx-app: $(USDX_BIN)
+
+# Clean and rebuild everything because FPC caches some old files
+# (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
mkdir -p $(PCUNIT_DIR)
$(PPC) $(PFLAGS) $(PINC_FLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$(USDX_BIN) $(USDX_SRC)
install: all
+# TODO: copy files to the appropriate places
# $()/mkinstalldirs $(bindir)
# $()/mkinstalldirs $(libdir)
# $()/mkinstalldirs $(infodir)
- mv $(OUTPUT) ../..
+ mv $(USDX_BIN) ../..
# $(INSTALL) $(USDX_BIN) $(bindir)/$(USDX_BIN)
uninstall:
+# TODO: remove installed files
# rm -f ...
echo "Comming soon!"
@@ -116,7 +127,7 @@ distclean: clean rm -f config.inc config.log config.status configure
clean_obj:
- find "$(PCUNIT_DIR)" -name "*.o" -o -name "*.ppu" -o -name "*.rst" | xargs rm -f
+ find "$(PCUNIT_DIR)" -name "*.o" -o -name "*.ppu" -o -name "*.rst" -o -name "*.compiled" | xargs rm -f
rm -f $(OUTPUT)
clean_res:
@@ -128,7 +139,7 @@ $(USDX_RES): $(RESCOMPILER_BIN) $(USDX_PREFIX).rc $(RESCOMPILER_BIN): $(RESCOMPILER_SRC)
$(PPC) $(RESCOMPILER_PFLAGS) $(PUNIT_FLAGS) $(PCUNIT_FLAGS) -o$@ $(RESCOMPILER_SRC)
-configure: configure.ac aclocal.m4
+configure: configure.ac config.inc.in aclocal.m4
autoconf
aclocal.m4: m4/*
@@ -138,4 +149,4 @@ Makefile: Makefile.in config.status ./config.status
config.status: configure
- ./config.status --recheck
\ No newline at end of file + ./config.status --recheck
diff --git a/Game/Code/config.inc.in b/Game/Code/config.inc.in index eaa37de7..a0bece8a 100644 --- a/Game/Code/config.inc.in +++ b/Game/Code/config.inc.in @@ -1,127 +1,83 @@ -// Configuration include file for @PACKAGE_NAME@ @PACKAGE_VERSION@ -// @PACKAGE_BUGREPORT@ +{***************************************************************** + * Configuration file for @PACKAGE_NAME@ @PACKAGE_VERSION@ + *****************************************************************} + +{* Misc options *} -// Note on version comparison: -// ------------------------------------------------------------------- -// Delphi (in contrast to FPC) DOESN'T support MACROS. So we -// can't define a macro like VERSION_MAJOR(version) to extract -// parts of the version-number or to create version numbers for -// comparison purposes as with a MAKE_VERSION(maj, min, rev) macro. -// So we have to define constants for every part of the version here. -// -// In addition FPC (in contrast to delphi) DOESN'T support floating- -// point numbers in $IF compiler-directives (e.g. {$IF VERSION > 1.23}) -// It also DOESN'T support arithmetic operations so we aren't able to -// compare versions this way (brackets aren't supported too): -// {$IF VERSION > ((VER_MAJ*2)+(VER_MIN*23)+(VER_REL*1))} -// -// Hence we have to use fixed numbers in the directives. At least -// Pascal allows leading 0s so 0005 equals 5 (octals are -// preceded by & and not by 0 in FPC). -// We also fix the count of digits for each part of the version number -// to 3 (aaaiiirrr with aaa=major, iii=minor, rrr=release version) -// -// A check for a library with at least a version of 2.5.11 would look -// like this: -// {$IF LIB_VERSION >= 002005011} -// -// If you just need to check the major version to this: -// {$IF LIB_VERSION_MAJOR >= 23} -// -// PLEASE consider this if you use version numbers in $IF compiler- -// directives. Otherwise you might break portability. -// ------------------------------------------------------------------- - {$@DEFINE_DEBUG@ DEBUG} -const - VERSION_MAJOR = 1000000; - VERSION_MINOR = 1000; - VERSION_RELEASE = 1; +{* Paths *} + +PathSuffix : WideString = '@suffix@'; +LogPath : WideString = '@logrootdir@/'+USDXPathSuffix+'/'; +SharedPath : WideString = '@datarootdir@/'+USDXPathSuffix+'/'; - FPC_VERSION_MAJOR = @FPC_VERSION_MAJOR@; - FPC_VERSION_MINOR = @FPC_VERSION_MINOR@; - FPC_VERSION_RELEASE = @FPC_VERSION_RELEASE@; - FPC_VERSION = (FPC_VERSION_MAJOR * VERSION_MAJOR) + - (FPC_VERSION_MINOR * VERSION_MINOR) + - (FPC_VERSION_RELEASE * VERSION_RELEASE); +{* Libraries *} +{$IF Defined(LAZARUS) and Defined(IncludeConstants)} LAZARUS_VERSION_MAJOR = @LAZARUS_VERSION_MAJOR@; LAZARUS_VERSION_MINOR = @LAZARUS_VERSION_MINOR@; LAZARUS_VERSION_RELEASE = @LAZARUS_VERSION_RELEASE@; - LAZARUS_VERSION = (LAZARUS_VERSION_MAJOR * VERSION_MAJOR) + - (LAZARUS_VERSION_MINOR * VERSION_MINOR) + - (LAZARUS_VERSION_RELEASE * VERSION_RELEASE); - - {$@DEFINE_HAVE_FFMPEG@ HaveFFMpeg} - {$IFDEF HaveFFMpeg} +{$IFEND} - av__codec = '@AVCODEC_LIB@'; +{$@DEFINE_HAVE_FFMPEG@ HaveFFMpeg} +{$IF Defined(HaveFFMpeg) and Defined(IncludeConstants)} + av__codec = 'libavcodec'; + //av__codec = '@AVCODEC_LIB@'; LIBAVCODEC_VERSION_MAJOR = @AVCODEC_VERSION_MAJOR@; LIBAVCODEC_VERSION_MINOR = @AVCODEC_VERSION_MINOR@; LIBAVCODEC_VERSION_RELEASE = @AVCODEC_VERSION_RELEASE@; - LIBAVCODEC_VERSION = (LIBAVCODEC_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVCODEC_VERSION_MINOR * VERSION_MINOR) + - (LIBAVCODEC_VERSION_RELEASE * VERSION_RELEASE); - av__format = '@AVFORMAT_LIB@'; + av__format = 'libavformat'; + //av__format = '@AVFORMAT_LIB@'; LIBAVFORMAT_VERSION_MAJOR = @AVFORMAT_VERSION_MAJOR@; LIBAVFORMAT_VERSION_MINOR = @AVFORMAT_VERSION_MINOR@; LIBAVFORMAT_VERSION_RELEASE = @AVFORMAT_VERSION_RELEASE@; - LIBAVFORMAT_VERSION = (LIBAVFORMAT_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVFORMAT_VERSION_MINOR * VERSION_MINOR) + - (LIBAVFORMAT_VERSION_RELEASE * VERSION_RELEASE); - av__util = '@AVUTIL_LIB@'; + av__util = 'libavutil'; + //av__util = '@AVUTIL_LIB@'; LIBAVUTIL_VERSION_MAJOR = @AVUTIL_VERSION_MAJOR@; LIBAVUTIL_VERSION_MINOR = @AVUTIL_VERSION_MINOR@; LIBAVUTIL_VERSION_RELEASE = @AVUTIL_VERSION_RELEASE@; - LIBAVUTIL_VERSION = (LIBAVUTIL_VERSION_MAJOR * VERSION_MAJOR) + - (LIBAVUTIL_VERSION_MINOR * VERSION_MINOR) + - (LIBAVUTIL_VERSION_RELEASE * VERSION_RELEASE); +{$IFEND} - {$ENDIF} - - {$@DEFINE_HAVE_SWSCALE@ HaveSWScale} - {$IFDEF HaveSWScale} - sw__scale = '@SWSCALE_LIB@'; +{$@DEFINE_HAVE_SWSCALE@ HaveSWScale} +{$IF Defined(HaveSWScale) and Defined(IncludeConstants)} + sw__scale = 'libswscale'; + //sw__scale = '@SWSCALE_LIB@'; LIBSWSCALE_VERSION_MAJOR = @SWSCALE_VERSION_MAJOR@; LIBSWSCALE_VERSION_MINOR = @SWSCALE_VERSION_MINOR@; LIBSWSCALE_VERSION_RELEASE = @SWSCALE_VERSION_RELEASE@; - LIBSWSCALE_VERSION = (LIBSWSCALE_VERSION_MAJOR * VERSION_MAJOR) + - (LIBSWSCALE_VERSION_MINOR * VERSION_MINOR) + - (LIBSWSCALE_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} - - {$@DEFINE_HAVE_PROJECTM@ HaveProjectM} - {$IFDEF HaveProjectM} +{$IFEND} + +// define this for versions of ProjectM < 1.0 (use C-Interface) +{$@DEFINE_HAVE_PROJECTM_0_9@ HaveProjectM_0_9} +// define this for versions of ProjectM >= 1.0 (use C++-Interface) +{$@DEFINE_HAVE_PROJECTM_1_0_PLUS@ HaveProjectM_1_0_PLUS} +{$IF Defined(HaveProjectM_0_9) or Defined(HaveProjectM_1_0_PLUS)} + {$DEFINE HaveProjectM} +{$IFEND} +{$IF Defined(HaveProjectM) and Defined(IncludeConstants)} libprojectM = '@PROJECTM_LIB@'; + // Note: Un/Define HaveProjectM_0_9 or HaveProjectM_1_0_PLUS accordingly PROJECTM_VERSION_MAJOR = @PROJECTM_VERSION_MAJOR@; PROJECTM_VERSION_MINOR = @PROJECTM_VERSION_MINOR@; PROJECTM_VERSION_RELEASE = @PROJECTM_VERSION_RELEASE@; - PROJECTM_VERSION = (PROJECTM_VERSION_MAJOR * VERSION_MAJOR) + - (PROJECTM_VERSION_MINOR * VERSION_MINOR) + - (PROJECTM_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} +{$IFEND} - {$@DEFINE_HAVE_PORTAUDIO@ HavePortaudio} - {$IFDEF HavePortaudio} +{$@DEFINE_HAVE_PORTAUDIO@ HavePortaudio} +{$IF Defined(HavePortaudio) and Defined(IncludeConstants)} libportaudio = '@PORTAUDIO_LIB@'; PORTAUDIO_VERSION_MAJOR = @PORTAUDIO_VERSION_MAJOR@; PORTAUDIO_VERSION_MINOR = @PORTAUDIO_VERSION_MINOR@; PORTAUDIO_VERSION_RELEASE = @PORTAUDIO_VERSION_RELEASE@; - PORTAUDIO_VERSION = (PORTAUDIO_VERSION_MAJOR * VERSION_MAJOR) + - (PORTAUDIO_VERSION_MINOR * VERSION_MINOR) + - (PORTAUDIO_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} +{$IFEND} - {$@DEFINE_HAVE_PORTMIXER@ HavePortmixer} - {$IFDEF HavePortmixer} +{$@DEFINE_HAVE_PORTMIXER@ HavePortmixer} +{$IF Defined(HavePortmixer) and Defined(IncludeConstants)} libportmixer = '@PORTMIXER_LIB@'; PORTMIXER_VERSION_MAJOR = @PORTMIXER_VERSION_MAJOR@; PORTMIXER_VERSION_MINOR = @PORTMIXER_VERSION_MINOR@; PORTMIXER_VERSION_RELEASE = @PORTMIXER_VERSION_RELEASE@; - PORTMIXER_VERSION = (PORTMIXER_VERSION_MAJOR * VERSION_MAJOR) + - (PORTMIXER_VERSION_MINOR * VERSION_MINOR) + - (PORTMIXER_VERSION_RELEASE * VERSION_RELEASE); - {$ENDIF} +{$IFEND} + diff --git a/Game/Code/configure.ac b/Game/Code/configure.ac index 2c4e37f1..ef0516d5 100644 --- a/Game/Code/configure.ac +++ b/Game/Code/configure.ac @@ -11,8 +11,22 @@ AC_PREREQ(2.61) # Init autoconf -AC_INIT([UltraStar Deluxe], [1.1], [TODO: send bugreport BUG-REPORT-ADDRESS]) +AC_INIT([UltraStar Deluxe], + [1.1 alpha], + [http://sourceforge.net/tracker/?group_id=191560&atid=937872]) +# specify the website here +PACKAGE_WEBSITE="http://www.ultrastardeluxe.org/" +# specify the IRC-channel here +PACKAGE_IRC="#ultrastardx at quakenet.org" + +AUTOCONF_INFO=[generated automatically by -*- Autoconf -*- +Do NOT edit this file. Edit ... instead.] + +# Specify a source-file so autoconf can check if the source-dir exists AC_CONFIG_SRCDIR(UltraStar.lpr) + +# This one is not used by autoconf at the moment. +# When it is used maybe we don't need aclocal's -I parameter anymore. AC_CONFIG_MACRO_DIR(m4) # show features and packages in one list @@ -22,17 +36,26 @@ AC_PRESERVE_HELP_ORDER # define switches # ----------------------------------------- -# print library option header +# print library options header AC_ARG_WITH([cfg-dummy1], [ External Libraries:]) # add lazarus option AC_ARG_WITH([lazarus], [AS_HELP_STRING([--with-lazarus=DIR], - [Directory of lazarus directory @<:@LAZARUSDIR@:>@])], + [Directory of lazarus @<:@LAZARUSDIR@:>@])], [with_lazarus=$withval], [with_lazarus="yes"]) -if [[ $with_lazarus = "no" ]] ; then - AC_MSG_ERROR("Lazarus is required. It is impossible to build without it."); +if [[ x$with_lazarus = xno ]] ; then + AC_MSG_ERROR([Lazarus is required. It is impossible to build without it.]); +fi + +# add jedi-sdl option +AC_ARG_WITH([jedi-sdl], + [AS_HELP_STRING([--with-jedi-sdl=DIR], + [Directory of JEDI-SDL @<:@lib/JEDI-SDLv1.0@:>@])], + [with_jedi_sdl=$withval], [with_jedi_sdl="lib/JEDI-SDLv1.0"]) +if [[ x$with_jedi_sdl = xno -o x$with_jedi_sdl = xyes ]]; then + AC_MSG_ERROR([JEDI-SDL is required. Specify its directory.]); fi # add portaudio option @@ -53,9 +76,35 @@ AC_ARG_WITH([projectM], [Enable projectM visualization support @<:@default=check@:>@])], [with_projectM=$withval], [with_projectM="check"]) -# AC_ARG_ENABLE(foobar, -# [ --enable-foobar Dummy option], -# enable_foobar=$enableval, enable_foobar="no") +# print path options header +AC_ARG_WITH([cfg-dummy2], [ +Additional directories:]) + +# add suffix option +AC_ARG_WITH([suffix], + [AS_HELP_STRING([--with-suffix=SUFFIX], + [path suffix @<:@default=UltraStarDeluxe@:>@])], + [suffix=$withval], [suffix="UltraStarDeluxe"]) +if [[ x$suffix = xno -o x$suffix = xyes ]] ; then + AC_MSG_ERROR([Invalid suffix.]); +fi + +# add logdir option +AC_ARG_WITH([logrootdir], + [AS_HELP_STRING([--with-logrootdir=DIR], + [logging root directory @<:@default=/var/log@:>@])], + [with_logrootdir=$withval], [with_logrootdir="/var/log"]) + +# print misc options header +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"]) # ----------------------------------------- @@ -149,7 +198,7 @@ AC_DEFUN([AC_PKG_CHECK_VERSION], AC_SPLIT_VERSION([$1], [0.0.0]) AC_MSG_RESULT(no) if test x$3 = xyes -o x$4 = xyes; then - AC_MSG_ERROR(["Could not find required library $2. Please install $2 and try again."]); + AC_MSG_ERROR([Could not find required library $2. Please install $2 and try again.]); fi fi ]) @@ -161,7 +210,9 @@ AC_DEFUN([AC_PKG_CHECK_VERSION], # find and test the freepascal compiler # sets PFLAGS, FPC_VERSION, FPC_DEBUG, etc. AC_PROG_FPC -AC_SPLIT_VERSION(FPC, $FPC_VERSION) +# FPC_VERSION is already defined by FPC, use +# PPC as prefix instead. +AC_SPLIT_VERSION(PPC, $FPC_VERSION) # find and test the C compiler (for C-libs and wrappers) AC_PROG_CC @@ -206,14 +257,14 @@ else if [[ -d $with_lazarus ]] ; then LAZARUS_CHECK_DIRS=$with_lazarus else - AC_MSG_ERROR(["LAZARUSDIR is not a directory."]); + AC_MSG_ERROR([LAZARUSDIR is not a directory.]); fi fi # find lazarus 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."]); + AC_MSG_ERROR([Could not find lazarus. Please install lazarus and try again.]); fi LAZARUS_DIR=`dirname "$LAZARUS"` @@ -228,6 +279,27 @@ AC_MSG_RESULT(@<:@$LAZARUS_VERSION@:>@) # find sdl AC_PKG_CHECK_VERSION(SDL, [sdl], yes) +# check if JEDI-SDL pascal headers exist +AC_MSG_CHECKING(for JEDI-SDL pascal headers) + +JEDISDL_DIR="$with_jedi_sdl" +if [[ ! -d "$JEDISDL_DIR" ]]; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Path specified for JEDI-SDL is not a directory.]); +fi +#http://delphi-jedi.org +# -d "$JEDISDL_DIR/SDL_ttf" -a +# -d "$JEDISDL_DIR/SDL_Image" -a +# -d "$JEDISDL_DIR/OpenGL" -a +# TODO: add further tests and check the version +if [[ -d "$JEDISDL_DIR/sdl" ]]; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +# AC_MSG_ERROR([JEDI-SDL is not available. +#Download it and extract it to "$JEDISDL_DIR".]); +fi + # find sqlite3 AC_PKG_CHECK_VERSION(SQLITE3, [sqlite3], yes) @@ -254,7 +326,7 @@ AC_PKG_CHECK_VERSION(PORTAUDIO, [portaudio-2.0], yes, $with_portaudio) AC_PKG_CHECK_VERSION(PORTMIXER, [portmixer], no, $with_portmixer) # ----------------------------------------- -# defines for config.inc +# defines for config.inc/versions.pas # ----------------------------------------- # AC_SUBST_DEFINE(DEFINE_SUFFIX, IS_DEFINED) @@ -279,7 +351,8 @@ AC_SUBST(SWSCALE_LIB) AC_SUBST_DEFINE(HAVE_SWSCALE, $SWSCALE_HAVE) AC_SUBST(PROJECTM_LIB) -AC_SUBST_DEFINE(HAVE_PROJECTM, $PROJECTM_HAVE) +AC_SUBST_DEFINE(HAVE_PROJECTM_0_9, $PROJECTM_HAVE) +AC_SUBST_DEFINE(HAVE_PROJECTM_1_0_PLUS, $PROJECTM_HAVE) AC_SUBST(PORTAUDIO_LIB) AC_SUBST_DEFINE(HAVE_PORTAUDIO, $PORTAUDIO_HAVE) @@ -289,11 +362,17 @@ AC_SUBST_DEFINE(HAVE_PORTMIXER, $PORTMIXER_HAVE) AC_SUBST(LAZARUS_DIR) +logrootdir=$with_logrootdir +AC_SUBST(logrootdir) + +AC_SUBST(PACKAGE_WEBSITE) + # ----------------------------------------- # create output files # ----------------------------------------- -AC_CONFIG_FILES([config.inc Makefile]) +AC_CONFIG_FILES([config-linux.inc:config.inc.in]) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT # ----------------------------------------- @@ -302,6 +381,36 @@ AC_OUTPUT AC_MSG_NOTICE([ -!!! Configuration done! -!!! Type "make" to compile the program. +!!! +!!! Configuration of $PACKAGE_NAME $PACKAGE_VERSION done! +!!! +!!! Type "make" to compile and +!!! "make install" to install it afterwards. +!!! +!!! For further information on $PACKAGE_NAME visit: +!!! $PACKAGE_WEBSITE +!!! +!!! IMPORTANT: +!!! This is an UNSUPPORTED ALPHA release for developers only. +!!! +!!! DO NOT EXPECT THE MAKEFILE OR THE PROGRAM ITSELF TO WORK +!!! +!!! and do not waste your time with bugfixing this version. +!!! Bugs might already be fixed in the developers' working copies. +!!! If you want to contribute, visit the IRC-Channel instead: +!!! $PACKAGE_IRC +!!! +!!! Known issues: +!!! - "make" might not work correctly +!!! - Audio-output and -input are not working yet +!!! - The editor is broken +!!! +!!! PLEASE DO NOT SEND BUGREPORTS FOR THIS VERSION. +!!! ]) + +# TODO: insert this in the public beta release +#!!! In case you find a bug send a bugreport to: +#!!! $PACKAGE_BUGREPORT +#!!! You might as well ask for help at the IRC-Channel +#!!! $PACKAGE_IRC |