From b35a00ba936bc16180c2f18fb0089e80c05ee4a8 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 18 Jan 2008 17:59:54 +0000 Subject: Autoconf scripts for configure and make. Run "aclocal -I m4" and "autoconf" to create the configure script. I checked this in to test the configure script. Note: the generated Makefile is not supposed to work yet. Use the already checked in Makefile instead. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@796 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/m4/fpc.m4 | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 Game/Code/m4/fpc.m4 (limited to 'Game/Code/m4') diff --git a/Game/Code/m4/fpc.m4 b/Game/Code/m4/fpc.m4 new file mode 100644 index 00000000..44822b28 --- /dev/null +++ b/Game/Code/m4/fpc.m4 @@ -0,0 +1,148 @@ +dnl ** Version 1.1 of file is part of the LGPLed +dnl ** J Sound System (http://jss.sourceforge.net) +dnl ** +dnl ** Checks for Free Pascal Compiler by Matti "ccr/TNSP" Hamalainen +dnl ** (C) Copyright 2000-2001 Tecnic Software productions (TNSP) +dnl ** +dnl ** Versions +dnl ** -------- +dnl ** 1.0 - Created +dnl ** +dnl ** 1.1 - Added stuff to enable unix -> win32 +dnl ** cross compilation. +dnl ** +dnl ** 1.x - A few fixes (by the UltraStar Deluxe Team) +dnl ** + +AC_DEFUN([AC_PROG_FPC], [ + +AC_ARG_VAR(PFLAGS, [Free Pascal Compiler flags]) + +AC_ARG_ENABLE(dummy_fpc1,[ +Free Pascal Compiler specific options:]) + +AC_ARG_WITH(fpc, + [AS_HELP_STRING([--with-fpc], + [Directory of the FPC executable @<:@PATH@:>@])], + [PPC_PATH=$withval], []) + +FPC_DEBUG="no" + +AC_ARG_ENABLE(debug, + [AS_HELP_STRING([--enable-debug], + [Enable FPC debug options @<:@default=no@:>@])], + [FPC_DEBUG="yes"], []) + + +AC_ARG_ENABLE(release, + [AS_HELP_STRING([--enable-release], + [Enable FPC release options (same as --enable-debug=no)])], + [FPC_DEBUG="no"], []) + +dnl use -dDEBUG (instead of -g) so it uses the fpc.cfg defaults +AC_ARG_WITH(debug-flags, + [AS_HELP_STRING([--with-debug-flags], + [FPC debug flags @<:@-dDEBUG@:>@])], + [fpc_debugflags="$withval"], + [fpc_debugflags="-dDEBUG"]) + +dnl use -dDEBUG (instead of e.g. -O2) so it uses the fpc.cfg defaults +AC_ARG_WITH(release-flags, + [AS_HELP_STRING([--with-release-flags], + [FPC release flags @<:@-dRELEASE@:>@])], + [fpc_releaseflags="$withval"], + [fpc_releaseflags="-dRELEASE"]) + +if test x$FPC_DEBUG = xyes; then + PFLAGS="$PFLAGS $fpc_debugflags" +else + PFLAGS="$PFLAGS $fpc_releaseflags" +fi + +AC_ARG_ENABLE(profile, + [AS_HELP_STRING([--enable-profile], + [Enable FPC profiling options])], + [PFLAGS="$PFLAGS -pg"], []) + +PPC_CHECK_PROGS="fpc FPC ppc386 ppc PPC386 ppos2" + +if test -z "$PPC_PATH"; then + PPC_PATH=$PATH + AC_CHECK_PROGS(PPC, $PPC_CHECK_PROGS) +else + AC_PATH_PROGS(PPC, $PPC_CHECK_PROGS, [], $PPC_PATH) +fi +if test -z "$PPC"; then + AC_MSG_ERROR([no Free Pascal Compiler found in $PPC_PATH]) +fi + +AC_PROG_FPC_WORKS +AC_PROG_FPC_LINKS + +dnl *** Get the FPC version and some paths +FPC_VERSION=`${PPC} ${PFLAGS} -iV` +FPC_PLATFORM=`${PPC} ${PFLAGS} -iTO` +FPC_PROCESSOR=`${PPC} ${PFLAGS} -iTP` +if test "x$prefix" != xNONE; then + FPC_PREFIX=$prefix +else + FPC_PREFIX=$ac_default_prefix +fi +FPC_BASE_PATH="${FPC_PREFIX}/lib/fpc/${FPC_VERSION}" +FPC_UNIT_PATH="${FPC_BASE_PATH}/units/${FPC_PLATFORM}" +AC_SUBST(PFLAGS) +AC_SUBST(FPC_VERSION) +AC_SUBST(FPC_PLATFORM) +AC_SUBST(FPC_PROCESSOR) +AC_SUBST(FPC_PREFIX) +AC_SUBST(FPC_BASE_PATH) +AC_SUBST(FPC_UNIT_PATH) +]) + + +dnl *** +dnl *** Check if FPC works and can compile a program +dnl *** +AC_DEFUN([AC_PROG_FPC_WORKS], +[AC_CACHE_CHECK([whether the Free Pascal Compiler ($PPC $PFLAGS) works], ac_cv_prog_ppc_works, +[ +rm -f conftest* +echo "program foo; begin writeln; end." > conftest.pp +${PPC} ${PFLAGS} conftest.pp >> config.log + +if test -f conftest || test -f conftest.exe; then +dnl *** It works! + ac_cv_prog_ppc_works="yes" + +else + ac_cv_prog_ppc_works="no" +fi +rm -f conftest* +dnl AC_MSG_RESULT($ac_cv_prog_ppc_works) +if test x$ac_cv_prog_ppc_works = xno; then + AC_MSG_ERROR([installation or configuration problem: Cannot create executables.]) +fi +])]) + + +dnl *** +dnl *** Check if FPC can link with standard libraries +dnl *** +AC_DEFUN([AC_PROG_FPC_LINKS], +[AC_CACHE_CHECK([whether the Free Pascal Compiler ($PPC $PFLAGS) can link], ac_cv_prog_ppc_works, +[ +rm -f conftest* +echo "program foo; uses crt; begin writeln; end." > conftest.pp +${PPC} ${PFLAGS} conftest.pp >> config.log +if test -f conftest || test -f conftest.exe; then + ac_cv_prog_ppc_links="yes" +else + ac_cv_prog_ppc_links="no" +fi +rm -f conftest* +AC_MSG_RESULT($ac_cv_prog_ppc_links) +if test x$ac_cv_prog_ppc_links = xno; then + AC_MSG_ERROR([installation or configuration problem: Cannot link with some standard libraries.]) +fi +])]) + -- cgit v1.2.3 From c5b20922912a1f5449c4c3aecd96a1959d7d227a Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 7 Feb 2008 02:27:07 +0000 Subject: Sorry, forgot to check this in git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@836 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/m4/ac_define_dir.m4 | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 Game/Code/m4/ac_define_dir.m4 (limited to 'Game/Code/m4') diff --git a/Game/Code/m4/ac_define_dir.m4 b/Game/Code/m4/ac_define_dir.m4 new file mode 100755 index 00000000..f3d8734f --- /dev/null +++ b/Game/Code/m4/ac_define_dir.m4 @@ -0,0 +1,47 @@ +##### http://autoconf-archive.cryp.to/ac_define_dir.html +# +# SYNOPSIS +# +# AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +# +# DESCRIPTION +# +# This macro sets VARNAME to the expansion of the DIR variable, +# taking care of fixing up ${prefix} and such. +# +# VARNAME is then offered as both an output variable and a C +# preprocessor symbol. +# +# Example: +# +# AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +# +# LAST MODIFICATION +# +# 2006-10-13 +# +# COPYLEFT +# +# Copyright (c) 2006 Stepan Kasal +# Copyright (c) 2006 Andreas Schwab +# Copyright (c) 2006 Guido U. Draheim +# Copyright (c) 2006 Alexandre Oliva +# +# Copying and distribution of this file, with or without +# modification, are permitted in any medium without royalty provided +# the copyright notice and this notice are preserved. + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) -- cgit v1.2.3 From 64cc353a1bdcc0ef181dc8bd667ea30cd0cd191d Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 12 Feb 2008 10:35:06 +0000 Subject: Updated the autoconf/Makefile stuff - Use "./configue --enable-dev-build" to install locally - You can skip pkg-config errors with "--enable-skip-pkgconfig-errors" now git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@844 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/m4/fpc.m4 | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Game/Code/m4') diff --git a/Game/Code/m4/fpc.m4 b/Game/Code/m4/fpc.m4 index 44822b28..51ebfc63 100644 --- a/Game/Code/m4/fpc.m4 +++ b/Game/Code/m4/fpc.m4 @@ -39,30 +39,34 @@ AC_ARG_ENABLE(release, [Enable FPC release options (same as --enable-debug=no)])], [FPC_DEBUG="no"], []) -dnl use -dDEBUG (instead of -g) so it uses the fpc.cfg defaults +dnl do not use -dDEBUG because this will enable range-checks +dnl that will fail with USDX. +dnl we have to disable -Xs which is defined in fpc.cfg. AC_ARG_WITH(debug-flags, [AS_HELP_STRING([--with-debug-flags], - [FPC debug flags @<:@-dDEBUG@:>@])], - [fpc_debugflags="$withval"], - [fpc_debugflags="-dDEBUG"]) + [FPC debug flags @<:@-gl -Coi -Xs- -vew@:>@])], + [PFLAGS_DEBUG="$withval"], + [PFLAGS_DEBUG="-gl -Cit -Xs- -vew"]) -dnl use -dDEBUG (instead of e.g. -O2) so it uses the fpc.cfg defaults +dnl -dRELEASE works too but we define our own settings AC_ARG_WITH(release-flags, [AS_HELP_STRING([--with-release-flags], - [FPC release flags @<:@-dRELEASE@:>@])], - [fpc_releaseflags="$withval"], - [fpc_releaseflags="-dRELEASE"]) + [FPC release flags @<:@-O2 -Xs -vew@:>@])], + [PFLAGS_RELEASE="$withval"], + [PFLAGS_RELEASE="-O2 -Xs -vew"]) +dnl the user's PFLAGS must *follow* this script's flags +dnl to enable the user to overwrite the settings. if test x$FPC_DEBUG = xyes; then - PFLAGS="$PFLAGS $fpc_debugflags" + PFLAGS="$PFLAGS_DEBUG $PFLAGS" else - PFLAGS="$PFLAGS $fpc_releaseflags" + PFLAGS="$PFLAGS_RELEASE $PFLAGS" fi AC_ARG_ENABLE(profile, [AS_HELP_STRING([--enable-profile], [Enable FPC profiling options])], - [PFLAGS="$PFLAGS -pg"], []) + [PFLAGS="-pg $PFLAGS"], []) PPC_CHECK_PROGS="fpc FPC ppc386 ppc PPC386 ppos2" @@ -91,6 +95,8 @@ fi FPC_BASE_PATH="${FPC_PREFIX}/lib/fpc/${FPC_VERSION}" FPC_UNIT_PATH="${FPC_BASE_PATH}/units/${FPC_PLATFORM}" AC_SUBST(PFLAGS) +AC_SUBST(PFLAGS_DEBUG) +AC_SUBST(PFLAGS_RELEASE) AC_SUBST(FPC_VERSION) AC_SUBST(FPC_PLATFORM) AC_SUBST(FPC_PROCESSOR) -- cgit v1.2.3