--- /dev/null
+#!/bin/sh
+# Run this to generate configure, the initial makefiles, etc.
+#
+# Source (non-CVS) distributions should come with a "configure" script
+# already generated--people simply compiling the program shouldn't
+# need autoconf and friends installed.
+#
+# CVS only contains the source files: Makefile.am, configure.ac, and
+# so on.
+
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="stepmania"
+
+AUTOHEADER=autoheader
+ACLOCAL_OPTIONS="-I autoconf/m4/"
+AUTOMAKE_OPTIONS=-a
+
+AUTOCONF=autoconf
+
+(test -f $srcdir/configure.ac \
+ && test -d $srcdir/src) || {
+ echo -n "**Error**: Directory \"$srcdir\" does not look like the"
+ echo " top-level $PKG_NAME directory"
+
+ exit 1
+}
+
+DIE=0
+
+($AUTOCONF --version) > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
+ DIE=1
+}
+
+# Try automake-1.9, 1.8, and 1.7.
+if automake-1.9 --version > /dev/null 2>&1; then
+ ACLOCAL=aclocal-1.9
+ AUTOMAKE=automake-1.9
+elif automake-1.8 --version > /dev/null 2>&1; then
+ ACLOCAL=aclocal-1.8
+ AUTOMAKE=automake-1.8
+elif automake-1.7 --version > /dev/null 2>&1; then
+ ACLOCAL=aclocal-1.7
+ AUTOMAKE=automake-1.7
+fi
+
+# If none of those were found, check if "automake" exists, and check the version.
+if test -z "$AUTOMAKE" && automake --version > /dev/null 2>&1; then
+ version=`automake --version 2>/dev/null|head -1|sed -e 's/.* \([0-9]\+\.[0-9]\+\).*$/\1/'`
+
+ IFS=.
+ set $version
+ if test -z "$version"; then
+ echo "\`automake' appears to be installed, but the version string could not"
+ echo "be parsed. Proceeding anyway ..."
+ elif test $1 -lt 1 -o $2 -lt 7; then
+ echo "\`automake' appears to be installed, but is not recent enough. Automake"
+ echo "1.7 or newer is required."
+ exit 1
+ fi
+ IFS=
+ ACLOCAL=aclocal
+ AUTOMAKE=automake
+fi
+
+if test -z "$AUTOMAKE"; then
+ echo
+ echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
+ DIE=1
+ NO_AUTOMAKE=yes
+fi
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || ($ACLOCAL --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+$ACLOCAL $ACLOCAL_OPTIONS
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE $AUTOMAKE_OPTIONS
--- /dev/null
+# only tested with autoconf 2.57\r
+AC_PREREQ(2.53)\r
+AC_INIT(src/StepMania.cpp)\r
+AC_CONFIG_AUX_DIR(autoconf)\r
+AC_CANONICAL_TARGET\r
+\r
+AM_INIT_AUTOMAKE(StepMania, 3.001)\r
+AM_CONFIG_HEADER(src/config.h)\r
+AM_MAINTAINER_MODE\r
+\r
+# We don't want PROG_CC/CXX default settings, but don't ignore explicit settings.\r
+test -z "$CFLAGS" && DEFAULT_CFLAGS=yes\r
+test -z "$CXXFLAGS" && DEFAULT_CXXFLAGS=yes\r
+test -z "$LDFLAGS" && DEFAULT_LDFLAGS=yes\r
+\r
+AC_PROG_CC\r
+AC_PROG_CXX\r
+AC_PROG_RANLIB\r
+\r
+test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="-Wall -W -Wno-unused -Wno-switch"\r
+test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="-Wall -W -Wno-unused -Wno-switch"\r
+test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS=""\r
+\r
+compile=release\r
+AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug], [Enable debug mode]), with_debug=$withval, with_debug=no)\r
+AC_ARG_WITH(fast-compile, AC_HELP_STRING([--with-fast-compile], [Enable fast compile]), with_fast_compile=$withval, with_fast_compile=no)\r
+if test "$with_debug" = "yes"; then\r
+ compile=debug\r
+fi\r
+if test "$with_fast_compile" = "yes"; then\r
+ compile=fast\r
+fi\r
+\r
+case $compile in\r
+ release)\r
+ test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -O3"\r
+ test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -O3"\r
+ ;;\r
+ debug)\r
+ test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -g"\r
+ test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -g"\r
+ ;;\r
+ fast)\r
+ test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -O2 -fno-inline"\r
+ test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -O2 -fno-inline"\r
+ ;;\r
+esac\r
+\r
+# Define UNIX for all Unix-like systems. Don't define it for cross-compiling to\r
+# non-Unix-like systems. (-DUNIX selects the archutils and ArchHooks to use; if\r
+# your platform doesn't use the Unix ones, you probably don't want to define UNIX.)\r
+case $host in\r
+*-linux-*)\r
+ AC_DEFINE(LINUX, 1, [Linux])\r
+ AC_DEFINE(UNIX, 1, [Unix])\r
+ linux=yes\r
+ unix=yes\r
+ ;;\r
+\r
+*)\r
+ AC_DEFINE(UNIX, 1, [Unix])\r
+ unix=yes\r
+ ;;\r
+esac\r
+AM_CONDITIONAL(UNIX, test "$unix" = "yes" )\r
+AM_CONDITIONAL(LINUX, test "$linux" = "yes" )\r
+\r
+# Define macros for individual CPU types, for a few bits of inline assembly.\r
+# This is for major, compatible CPU classes--"CPU_X86" includes P2, P3, P4,\r
+# AMD, etc. If you need CPU-specific assembly, check at runtime--don't create\r
+# separate binaries for each CPU if the binaries themselves are otherwise\r
+# compatible.\r
+case $host in\r
+i?86-*)\r
+ AC_DEFINE(CPU_X86, 1, [x86])\r
+ ;;\r
+x86_64-*)\r
+ AC_DEFINE(CPU_X86_64, 1, [x86-64])\r
+ ;;\r
+powerpc-*)\r
+ AC_DEFINE(CPU_PPC, 1, [PPC])\r
+ ;;\r
+esac\r
+\r
+\r
+AC_C_BIGENDIAN( \r
+ AC_DEFINE(ENDIAN_BIG, 1, [Big endian]),\r
+ AC_DEFINE(ENDIAN_LITTLE, 1, [Little endian]),\r
+ AC_MSG_ERROR([Can't determine endianness]) )\r
+\r
+AC_ARG_WITH(prof, AC_HELP_STRING([--with-prof], [Enable profiling]), with_prof=$withval, with_prof=no)\r
+if test "$with_prof" = "yes"; then\r
+ test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -pg"\r
+ test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -pg"\r
+ test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="$LDFLAGS -pg"\r
+fi\r
+\r
+SM_X_WITH_OPENGL\r
+\r
+AC_ARG_ENABLE(sdl, AC_HELP_STRING([--enable-sdl], [Enable SDL support]), enable_sdl=$enableval, enable_sdl=no)\r
+if test "$enable_sdl" = "yes"; then\r
+ AM_PATH_SDL(1.2.6,have_sdl=yes,have_sdl=no)\r
+fi\r
+AM_CONDITIONAL(HAVE_SDL, test "$have_sdl" = "yes")\r
+if test "$have_sdl" = "yes"; then\r
+ AC_DEFINE(HAVE_SDL, 1, [SDL is available])\r
+fi\r
+\r
+# sdl-config puts -L/usr/lib in the library search path, which reorders things\r
+# in a way that breaks some configurations.\r
+# Does this still need to be in?\r
+# not sure\r
+# SDL_LIBS="`echo $SDL_LIBS | sed 's_-L/usr/lib/\?[[ $]]__'`"\r
+\r
+have_libpng=yes\r
+AC_CHECK_LIB(png, png_create_read_struct, [x=y], have_libpng=no, [-lz -lm]) # x=y to stop autoconf from messing with LIBS\r
+AC_CHECK_HEADER(png.h, , have_libpng=no)\r
+if test "$have_libpng" = "no"; then\r
+ echo\r
+ echo "*** libpng is required to build StepMania; please make sure that"\r
+ echo "*** it is installed to continue the build process."\r
+ exit 1\r
+fi\r
+LIBS="$LIBS -lpng -lz -lm"\r
+\r
+AC_ARG_WITH(jpeg, AC_HELP_STRING([--without-jpeg], [Disable JPEG support]), with_jpeg=$withval, with_jpeg=yes)\r
+\r
+if test "$with_jpeg" = "yes"; then\r
+ have_libjpeg=yes\r
+ AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [x=y], have_libjpeg=no) # x=y to stop autoconf from messing with LIBS\r
+ AC_CHECK_HEADER(jpeglib.h, , have_libjpeg=no)\r
+\r
+ if test "$have_libjpeg" = "no"; then\r
+ # Require JPEG by default, so people don't compile without it\r
+ # by accident and then come asking us why files won't load.\r
+ AC_MSG_ERROR(\r
+[libjpeg is required to build StepMania; please make sure that it is installed\r
+to continue the build process. If you really want to compile without JPEG\r
+support, pass the "--without-jpeg" flag to configure.])\r
+ fi\r
+ have_libjpeg=\r
+\r
+ LIBS="$LIBS -ljpeg"\r
+else\r
+ AC_DEFINE(NO_JPEG_SUPPORT, 1, [JPEG support not available])\r
+fi\r
+\r
+AC_ARG_WITH(network, AC_HELP_STRING([--without-network], [Disable networking]), with_network=$withval, with_network=yes)\r
+if test "$with_network" = "no"; then\r
+ AC_DEFINE(WITHOUT_NETWORKING, 1, [Networking support not available])\r
+fi\r
+AM_CONDITIONAL(WITHOUT_NETWORKING, test "$with_network" = "no")\r
+\r
+SM_LUA\r
+SM_ZLIB\r
+SM_AUDIO\r
+SM_TLS\r
+SM_LIBUSB\r
+\r
+AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)\r
+AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)\r
+\r
+if test "$have_libavcodec" = "yes"; then\r
+ AC_MSG_CHECKING([for libavcodec >= 0.4.9])\r
+ AC_TRY_RUN([\r
+ #include <ffmpeg/avcodec.h>\r
+ int main()\r
+ {\r
+ return ( LIBAVCODEC_VERSION_INT < 0x000409 )? 1:0;\r
+ }\r
+ ],,have_libavcodec=no,)\r
+ AC_MSG_RESULT($have_libavcodec)\r
+fi\r
+\r
+if test "$have_libavformat" = "yes"; then\r
+ AC_MSG_CHECKING([for libavformat >= 0.4.9])\r
+ AC_TRY_RUN([\r
+ #include <ffmpeg/avformat.h>\r
+ int main()\r
+ {\r
+ return ( LIBAVFORMAT_VERSION_INT < 0x000409 )? 1:0;\r
+ }\r
+ ],,have_libavformat=no,)\r
+ AC_MSG_RESULT($have_libavformat)\r
+fi\r
+\r
+have_ffmpeg=no\r
+if test "$have_libavformat" = "yes" -a "$have_libavcodec" = "yes"; then\r
+ have_ffmpeg=yes\r
+ AC_DEFINE(HAVE_FFMPEG, 1, [FMPEG support available])\r
+fi\r
+AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" = "yes")\r
+\r
+SM_CHECK_CRASH_HANDLER\r
+\r
+AM_PATH_ALSA(0.9.0,AC_DEFINE([HAVE_ALSA],1,[Define presence of ALSA]),alsa=false)\r
+\r
+AM_ICONV\r
+\r
+AC_ARG_ENABLE(gtk2, AC_HELP_STRING([--disable-gtk2], [Disable GTK support]), enable_gtk2=$enableval, enable_gtk2=yes)\r
+\r
+if test x$enable_gtk2 = xyes; then\r
+ AM_PATH_GTK_2_0(2.0.0,AC_DEFINE([HAVE_GTK],1,[Define presence of GTK]),enable_gtk2=no)\r
+fi\r
+\r
+AC_CHECK_HEADER(sys/soundcard.h, [AC_DEFINE(HAVE_OSS, 1, [OSS support available])])\r
+AC_CHECK_DECL(OSS_GETVERSION, AC_DEFINE([HAVE_OSS_GETVERSION],1,[OSS_GETVERSION is defined]), , [#include <sys/soundcard.h>])\r
+AC_ARG_ENABLE(force-oss, AC_HELP_STRING([--enable-force-oss], [Force OSS]), force_oss=$enableval, force_oss=no)\r
+AC_CHECK_HEADER(stdint.h, , [AC_DEFINE(MISSING_STDINT_H, 1, [stdint.h is missing])])\r
+AC_CHECK_HEADERS([inttypes.h endian.h])\r
+\r
+AC_MSG_CHECKING(if cstdlib breaks llabs)\r
+AC_TRY_COMPILE( [#include <stdlib.h>\r
+ #include <cstdlib> ],\r
+ [int foo() { return llabs(1); }],\r
+ [AC_MSG_RESULT(no)],\r
+ [AC_MSG_RESULT(yes)\r
+ AC_DEFINE([NEED_CSTDLIB_WORKAROUND], 1, [cstdlib breaks llabs])]\r
+ )\r
+\r
+AC_CHECK_LIB( pthread, pthread_create, AC_DEFINE([HAVE_LIBPTHREAD],1,[libpthread is available]) )\r
+AC_CHECK_LIB( pthread, pthread_mutex_timedlock, AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK],1,[pthreads has pthread_mutex_timedlock()]) )\r
+AC_CHECK_LIB( pthread, pthread_cond_timedwait, AC_DEFINE([HAVE_PTHREAD_COND_TIMEDWAIT],1,[pthreads has pthread_cond_timedwait()]) )\r
+\r
+# Always:\r
+AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extensions])\r
+\r
+AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse )\r
+AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" )\r
+AM_CONDITIONAL(HAVE_OSS, test x$ac_cv_header_sys_soundcard_h = xyes )\r
+AM_CONDITIONAL(USE_CRASH_HANDLER, test "$use_crash_handler" = "yes" )\r
+\r
+if test x$force_oss = xyes && test x$ac_cv_header_sys_soundcard_h = xyes; then\r
+ AC_DEFINE([FORCE_OSS], 1, [Force OSS Usage])\r
+fi\r
+\r
+AC_CHECK_DECL(powf, , AC_DEFINE([NEED_POWF],1,[Need powf]), [#include <math.h>])\r
+AC_CHECK_DECL(sqrtf, , AC_DEFINE([NEED_SQRTF],1,[Need sqrtf]), [#include <math.h>])\r
+AC_CHECK_DECL(sinf, , AC_DEFINE([NEED_SINF],1,[Need sinf]), [#include <math.h>])\r
+AC_CHECK_DECL(tanf, , AC_DEFINE([NEED_COSF],1,[Need tanf]), [#include <math.h>])\r
+AC_CHECK_DECL(cosf, , AC_DEFINE([NEED_TANF],1,[Need cosf]), [#include <math.h>])\r
+AC_CHECK_DECL(acosf, , AC_DEFINE([NEED_ACOSF],1,[Need acosf]), [#include <math.h>])\r
+AC_CHECK_DECL(roundf, , AC_DEFINE([NEED_ROUNDF],1,[Need roundf]), [#include <math.h>])\r
+AC_CHECK_DECL(truncf, , AC_DEFINE([NEED_TRUNCF],1,[Need truncf]), [#include <math.h>])\r
+\r
+# This doesn't work on glibc math functions:\r
+# AC_CHECK_FUNCS([sqrtf sinf tanf cosf acosf roundf truncf])\r
+\r
+AC_CHECK_DECLS([SIGPWR],,,[#include <signal.h>])\r
+\r
+AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Build test programs]), enable_tests=$enableval, enable_tests=no)\r
+AM_CONDITIONAL(BUILD_TESTS, test "$enable_tests" = "yes" )\r
+\r
+AC_CONFIG_FILES(Makefile)\r
+AC_CONFIG_FILES(src/Makefile)\r
+AC_OUTPUT\r