Files
itgmania212121/stepmania/configure.ac
T

142 lines
4.8 KiB
Plaintext
Raw Normal View History

# only tested with autoconf 2.57
AC_PREREQ(2.53)
AC_INIT(src/StepMania.cpp)
AC_CONFIG_AUX_DIR(autoconf)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(StepMania, 3.001)
AM_CONFIG_HEADER(src/config.h)
2003-12-24 04:28:20 +00:00
AM_MAINTAINER_MODE
2003-05-05 06:27:53 +00:00
# We don't want PROG_CC/CXX default settings, but don't ignore explicit settings.
test -z "$CFLAGS" && DEFAULT_CFLAGS=yes
test -z "$CXXFLAGS" && DEFAULT_CXXFLAGS=yes
test -z "$LDFLAGS" && DEFAULT_LDFLAGS=yes
AC_PROG_CC
AC_PROG_CXX
test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="-Wall -W -Wno-unused -Wno-switch"
test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="-Wall -W -Wno-unused -Wno-switch"
2003-05-05 06:27:53 +00:00
test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS=""
2003-10-22 21:32:22 +00:00
compile=release
2003-10-06 05:02:59 +00:00
AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug], [Enable debug mode]), with_debug=$withval, with_debug=no)
2003-10-22 21:32:22 +00:00
AC_ARG_WITH(fast-compile, AC_HELP_STRING([--with-fast-compile], [Enable fast compile]), with_fast_compile=$withval, with_fast_compile=no)
2003-10-06 05:02:59 +00:00
if test "$with_debug" = "yes"; then
2003-10-22 21:32:22 +00:00
compile=debug
fi
if test "$with_fast_compile" = "yes"; then
compile=fast
fi
case $compile in
release)
2003-10-06 05:02:59 +00:00
test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -O3"
test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -O3"
2003-10-22 21:32:22 +00:00
;;
debug)
test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -g"
test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -g"
;;
fast)
test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -O2 -fno-inline"
test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -O2 -fno-inline"
;;
esac
AC_ARG_WITH(prof, AC_HELP_STRING([--with-prof], [Enable profiling]), with_prof=$withval, with_prof=no)
if test "$with_prof" = "yes"; then
test "$DEFAULT_CFLAGS" = "yes" && CFLAGS="$CFLAGS -pg"
test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="$CXXFLAGS -pg"
test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="$LDFLAGS -pg"
2003-10-06 05:02:59 +00:00
fi
2003-09-18 22:28:19 +00:00
SM_OPENGL
2003-09-16 19:24:17 +00:00
AM_PATH_SDL(1.2.6,enable_sdl=yes,enable_sdl=no)
AM_CONDITIONAL(NHAVE_SDL, test x$enable_sdl = xno )
# sdl-config puts -L/usr/lib in the library search path, which reorders things
# in a way that breaks some configurations.
2003-09-16 19:24:17 +00:00
# Does this still need to be in?
2003-09-16 22:26:17 +00:00
# not sure
# SDL_LIBS="`echo $SDL_LIBS | sed 's_-L/usr/lib/\?[[ $]]__'`"
2004-01-06 05:51:28 +00:00
AC_SEARCH_LIBS(IMG_Load, [SDL_image], have_SDL_image=yes, have_SDL_image=no)
if test "x$have_SDL_image" = "xno"; then
echo
echo "*** SDL_image is required to build StepMania; please"
echo "*** make sure that SDL_image is installed to continue"
echo "*** the installation process."
exit 0;
fi
2003-12-10 08:14:48 +00:00
SM_ZLIB
2003-09-20 20:03:44 +00:00
SM_AUDIO
2003-08-29 04:34:10 +00:00
AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)
AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)
2003-11-03 21:17:45 +00:00
if test "$have_libavcodec" = "yes"; then
AC_MSG_CHECKING([for libavcodec >= 0.4.8])
AC_TRY_RUN([
#include <ffmpeg/avcodec.h>
int main()
{
return ( FFMPEG_VERSION_INT < 0x000408 )? 1:0;
}
],,have_libavcodec=no,)
AC_MSG_RESULT($have_libavformat)
fi
2003-09-02 04:01:01 +00:00
have_ffmpeg=no
2003-08-29 04:34:10 +00:00
if test "$have_libavformat" = "yes" -a "$have_libavcodec" = "yes"; then
2003-09-02 04:01:01 +00:00
have_ffmpeg=yes
AC_DEFINE(HAVE_FFMPEG, 1, [FMPEG support available])
2003-08-29 04:34:10 +00:00
fi
2003-09-02 04:01:01 +00:00
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" == "yes" )
2003-08-29 04:34:10 +00:00
2003-07-27 07:42:40 +00:00
SM_CHECK_CRASH_HANDLER
AM_PATH_ALSA(0.9.0,AC_DEFINE([HAVE_ALSA],1,[Define presence of ALSA]),alsa=false)
2003-07-24 06:05:52 +00:00
AC_ARG_ENABLE(gtk2, AC_HELP_STRING([--disable-gtk2], [Disable GTK support]), enable_gtk2=$enableval, enable_gtk2=yes)
if test x$enable_gtk2 = xyes; then
2003-07-24 06:05:52 +00:00
AM_PATH_GTK_2_0(2.0.0,AC_DEFINE([HAVE_GTK],1,[Define presence of GTK]),enable_gtk2=no)
fi
AC_CHECK_HEADER(linux/soundcard.h, [AC_DEFINE(HAVE_OSS, 1, [OSS support available])])
2003-09-02 19:28:43 +00:00
AC_CHECK_HEADERS([inttypes.h])
AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse )
2003-07-24 06:05:52 +00:00
AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" )
AM_CONDITIONAL(HAVE_OSS, test x$ac_cv_header_linux_soundcard_h = xyes )
2003-07-27 07:42:40 +00:00
AM_CONDITIONAL(USE_CRASH_HANDLER, test "$use_crash_handler" = "yes" )
2003-11-03 21:40:07 +00:00
AC_CHECK_DECL(powf, , AC_DEFINE([NEED_POWF],1,[Need powf]), [#include <math.h>])
AC_CHECK_DECL(sqrtf, , AC_DEFINE([NEED_SQRTF],1,[Need sqrtf]), [#include <math.h>])
AC_CHECK_DECL(sinf, , AC_DEFINE([NEED_SINF],1,[Need sinf]), [#include <math.h>])
AC_CHECK_DECL(tanf, , AC_DEFINE([NEED_COSF],1,[Need tanf]), [#include <math.h>])
AC_CHECK_DECL(cosf, , AC_DEFINE([NEED_TANF],1,[Need cosf]), [#include <math.h>])
AC_CHECK_DECL(acosf, , AC_DEFINE([NEED_ACOSF],1,[Need acosf]), [#include <math.h>])
AC_CHECK_DECL(roundf, , AC_DEFINE([NEED_ROUNDF],1,[Need roundf]), [#include <math.h>])
AC_CHECK_DECL(truncf, , AC_DEFINE([NEED_TRUNCF],1,[Need truncf]), [#include <math.h>])
# This doesn't work on glibc math functions:
# AC_CHECK_FUNCS([sqrtf sinf tanf cosf acosf roundf truncf])
AC_CHECK_DECLS([SIGPWR],,,[#include <signal.h>])
case $host in
2003-09-19 02:18:43 +00:00
# This is just a general define for things we do in Linux that aren't
# yet fully generalized. It should probably be defined in other *nixes,
# too.
*)
AC_DEFINE(LINUX, 1, [Linux])
;;
esac
AC_OUTPUT([Makefile src/Makefile])