diff --git a/stepmania/autoconf/m4/alsa.m4 b/stepmania/autoconf/m4/alsa.m4 index cb12fd99a2..eda22ee693 100644 --- a/stepmania/autoconf/m4/alsa.m4 +++ b/stepmania/autoconf/m4/alsa.m4 @@ -61,11 +61,10 @@ no_alsa="" alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` -AC_LANG_SAVE -AC_LANG_C -AC_TRY_COMPILE([ +AC_LANG_PUSH([C]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -], [ +]], [[ /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR @@ -97,13 +96,11 @@ AC_TRY_COMPILE([ # endif # endif exit(0); -], - [AC_MSG_RESULT(found.)], - [AC_MSG_RESULT(not present.) +]])],[AC_MSG_RESULT(found.)],[AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) - alsa_found=no] -) -AC_LANG_RESTORE + alsa_found=no +]) +AC_LANG_POP([]) dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. AC_CHECK_LIB([asound], [snd_ctl_open],, diff --git a/stepmania/autoconf/m4/audio.m4 b/stepmania/autoconf/m4/audio.m4 index 4c26803c57..a66571b941 100644 --- a/stepmania/autoconf/m4/audio.m4 +++ b/stepmania/autoconf/m4/audio.m4 @@ -1,9 +1,9 @@ AC_DEFUN([SM_AUDIO], [ -AC_ARG_WITH(vorbis, AC_HELP_STRING([--without-vorbis], [Disable Vorbis support]), with_vorbis=$withval, with_vorbis=yes) +AC_ARG_WITH(vorbis, AS_HELP_STRING([--without-vorbis],[Disable Vorbis support]), with_vorbis=$withval, with_vorbis=yes) # This is used to force the integer decoder, on systems that prefer it. -AC_ARG_WITH(integer-vorbis, AC_HELP_STRING([--with-integer-vorbis], [Integer vorbis decoding only]), with_int_vorbis=$withval, with_int_vorbis=no) +AC_ARG_WITH(integer-vorbis, AS_HELP_STRING([--with-integer-vorbis],[Integer vorbis decoding only]), with_int_vorbis=$withval, with_int_vorbis=no) have_vorbis=no if test "$with_vorbis" = "yes" -a "$with_int_vorbis" = "no"; then @@ -44,7 +44,7 @@ fi AM_CONDITIONAL(HAVE_VORBIS, test "$have_vorbis" = "yes" ) -AC_ARG_WITH(mp3, AC_HELP_STRING([--without-mp3], [Disable MP3 support]), with_mp3=$withval, with_mp3=yes) +AC_ARG_WITH(mp3, AS_HELP_STRING([--without-mp3],[Disable MP3 support]), with_mp3=$withval, with_mp3=yes) if test "$with_mp3" = "yes"; then AC_CHECK_LIB(mad, mad_synth_init, have_mad=yes, have_mad=no) else diff --git a/stepmania/autoconf/m4/backtrace.m4 b/stepmania/autoconf/m4/backtrace.m4 index f1f13afc8a..a051589060 100644 --- a/stepmania/autoconf/m4/backtrace.m4 +++ b/stepmania/autoconf/m4/backtrace.m4 @@ -2,16 +2,15 @@ AC_DEFUN([SM_FUNC_BACKTRACE_SYMBOLS], [ AC_MSG_CHECKING(for working backtrace_symbols()) - AC_TRY_RUN( - [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { void *BacktracePointer=main; return backtrace_symbols (&BacktracePointer, 1) == 0? 1:0; } - ], have_backtrace_symbols=yes,have_backtrace_symbols=no,have_backtrace_symbols=no - ) + ]])],[have_backtrace_symbols=yes],[have_backtrace_symbols=no],[have_backtrace_symbols=no + ]) AC_MSG_RESULT($have_backtrace_symbols) ]) @@ -20,8 +19,7 @@ AC_DEFUN([SM_FUNC_CXA_DEMANGLE], # Check for abi::__cxa_demangle (gcc 3.1+) AC_MSG_CHECKING(for working cxa_demangle) AC_LANG_PUSH(C++) - AC_TRY_RUN( - [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -34,8 +32,8 @@ AC_DEFUN([SM_FUNC_CXA_DEMANGLE], free( realname ); return 0; } - ], have_cxa_demangle=yes,have_cxa_demangle=no,have_cxa_demangle=no - ) + ]])],[have_cxa_demangle=yes],[have_cxa_demangle=no],[have_cxa_demangle=no + ]) AC_LANG_POP(C++) AC_MSG_RESULT($have_cxa_demangle) if test "$have_cxa_demangle" = "yes"; then diff --git a/stepmania/autoconf/m4/gtk-2.0.m4 b/stepmania/autoconf/m4/gtk-2.0.m4 index 36a1f9f760..78050c26f7 100644 --- a/stepmania/autoconf/m4/gtk-2.0.m4 +++ b/stepmania/autoconf/m4/gtk-2.0.m4 @@ -74,7 +74,7 @@ dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -145,7 +145,7 @@ main () } return 1; } -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) +]])],[],[no_gtk=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -167,11 +167,10 @@ main () ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include -], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" +]], [[ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ]])],[ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" @@ -179,8 +178,7 @@ main () echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],[ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" diff --git a/stepmania/autoconf/m4/iconv.m4 b/stepmania/autoconf/m4/iconv.m4 index c5f3579827..26ef0b7ecd 100644 --- a/stepmania/autoconf/m4/iconv.m4 +++ b/stepmania/autoconf/m4/iconv.m4 @@ -31,29 +31,25 @@ AC_DEFUN([AM_ICONV_LINK], dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + dnl AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) will then fail, the second AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) + iconv_close(cd);]])],[am_cv_func_iconv=yes],[]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + iconv_close(cd);]])],[am_cv_lib_iconv=yes + am_cv_func_iconv=yes],[]) LIBS="$am_save_LIBS" fi ]) @@ -80,7 +76,7 @@ AC_DEFUN([AM_ICONV], if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include extern @@ -92,7 +88,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") +]], [[]])],[am_cv_proto_iconv_arg1=""],[am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- diff --git a/stepmania/autoconf/m4/opengl.m4 b/stepmania/autoconf/m4/opengl.m4 index b15e91eb15..169978c72f 100644 --- a/stepmania/autoconf/m4/opengl.m4 +++ b/stepmania/autoconf/m4/opengl.m4 @@ -17,10 +17,8 @@ AC_DEFUN([SM_X_WITH_OPENGL], if test -n "$x_includes"; then # See if we can compile X applications without using $XCFLAGS. AC_MSG_CHECKING(if $XCFLAGS is really necessary) - AC_TRY_COMPILE( [#include ], [], - [XCFLAGS= - AC_MSG_RESULT(no)], - [AC_MSG_RESULT(yes)]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])],[XCFLAGS= + AC_MSG_RESULT(no)],[AC_MSG_RESULT(yes)]) fi # Check for libXtst. diff --git a/stepmania/autoconf/m4/tls.m4 b/stepmania/autoconf/m4/tls.m4 index 7f6da091c8..58719ed3db 100644 --- a/stepmania/autoconf/m4/tls.m4 +++ b/stepmania/autoconf/m4/tls.m4 @@ -5,7 +5,7 @@ AC_DEFUN([SM_TLS], [ AC_MSG_CHECKING(for TLS) - AC_TRY_RUN( [ static __thread int val; int main() { return 0; } ], have_tls=yes,have_tls=no,have_tls=no ) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ]) AC_MSG_RESULT($have_tls) if test "$have_tls" = "yes"; then AC_DEFINE([HAVE_TLS],[1],[Define if the compiler supports __thread]) diff --git a/stepmania/autoconf/m4/video.m4 b/stepmania/autoconf/m4/video.m4 index b7a57b0efb..8f65661dd7 100644 --- a/stepmania/autoconf/m4/video.m4 +++ b/stepmania/autoconf/m4/video.m4 @@ -1,5 +1,5 @@ AC_DEFUN([SM_VIDEO], [ -AC_ARG_WITH(ffmpeg, AC_HELP_STRING([--without-ffmpeg], [Disable ffmpeg support]), with_ffmpeg=$withval, with_ffmpeg=yes) +AC_ARG_WITH(ffmpeg, AS_HELP_STRING([--without-ffmpeg],[Disable ffmpeg support]), with_ffmpeg=$withval, with_ffmpeg=yes) old_LIBS="$LIBS" old_CFLAGS="$CFLAGS" @@ -23,39 +23,39 @@ if test "$with_ffmpeg" != "no"; then if test "$have_libavcodec" = "yes"; then AC_MSG_CHECKING([for matching libavcodec headers and libs]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { return ( LIBAVCODEC_VERSION_INT == avcodec_version() && LIBAVCODEC_BUILD == avcodec_build() ) ? 0:1; } - ],,have_libavcodec=no,) + ]])],[],[have_libavcodec=no],[]) AC_MSG_RESULT($have_libavcodec) if test "$have_libavcodec" = "yes"; then AC_MSG_CHECKING([for libavcodec = 0.4.9-pre1]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { return ( LIBAVCODEC_VERSION_INT == 0x000409 && LIBAVCODEC_BUILD == 4718 ) ? 0:1; } - ],,have_libavcodec=no,) + ]])],[],[have_libavcodec=no],[]) AC_MSG_RESULT($have_libavcodec) fi fi if test "$have_libavformat" = "yes"; then AC_MSG_CHECKING([for libavformat = 0.4.9-pre1]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { return ( LIBAVFORMAT_VERSION_INT == 0x000409 && LIBAVFORMAT_BUILD == 4616 )? 0:1; } - ],,have_libavformat=no,) + ]])],[],[have_libavformat=no],[]) AC_MSG_RESULT($have_libavformat) fi fi @@ -73,7 +73,7 @@ AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" = "yes") -AC_ARG_WITH(theora, AC_HELP_STRING([--without-theora], [Disable Theora support]), with_theora=$withval, with_theora=yes) +AC_ARG_WITH(theora, AS_HELP_STRING([--without-theora],[Disable Theora support]), with_theora=$withval, with_theora=yes) have_vorbis=no if test "$with_theora" = "yes"; then diff --git a/stepmania/configure.ac b/stepmania/configure.ac index 711bc4fdeb..86fe0d7a7e 100644 --- a/stepmania/configure.ac +++ b/stepmania/configure.ac @@ -1,11 +1,12 @@ # only tested with autoconf 2.57 -AC_PREREQ(2.53) -AC_INIT(src/StepMania.cpp) +AC_PREREQ(2.60) +AC_INIT +AC_CONFIG_SRCDIR([src/StepMania.cpp]) AC_CONFIG_AUX_DIR(autoconf) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(StepMania, 3.001) -AM_CONFIG_HEADER(src/config.h) +AC_CONFIG_HEADERS([src/config.h]) AM_MAINTAINER_MODE # We don't want PROG_CC/CXX default settings, but don't ignore explicit settings. @@ -23,8 +24,8 @@ test "$DEFAULT_CXXFLAGS" = "yes" && CXXFLAGS="-Wall -W -Wno-unused -Wno-switch" test "$DEFAULT_LDFLAGS" = "yes" && LDFLAGS="" compile=release -AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug], [Enable debug mode]), with_debug=$withval, with_debug=no) -AC_ARG_WITH(fast-compile, AC_HELP_STRING([--with-fast-compile], [Enable fast compile]), with_fast_compile=$withval, with_fast_compile=no) +AC_ARG_WITH(debug, AS_HELP_STRING([--with-debug],[Enable debug mode]), with_debug=$withval, with_debug=no) +AC_ARG_WITH(fast-compile, AS_HELP_STRING([--with-fast-compile],[Enable fast compile]), with_fast_compile=$withval, with_fast_compile=no) if test "$with_debug" = "yes"; then compile=debug fi @@ -114,7 +115,7 @@ AC_C_BIGENDIAN( AC_DEFINE(ENDIAN_LITTLE, 1, [Little endian]), AC_MSG_ERROR([Can't determine endianness]) ) -AC_ARG_WITH(prof, AC_HELP_STRING([--with-prof], [Enable profiling]), with_prof=$withval, with_prof=no) +AC_ARG_WITH(prof, AS_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" @@ -134,7 +135,7 @@ if test "$have_libpng" = "no"; then fi LIBS="$LIBS -lpng -lz -lm" -AC_ARG_WITH(jpeg, AC_HELP_STRING([--without-jpeg], [Disable JPEG support]), with_jpeg=$withval, with_jpeg=yes) +AC_ARG_WITH(jpeg, AS_HELP_STRING([--without-jpeg],[Disable JPEG support]), with_jpeg=$withval, with_jpeg=yes) if test "$with_jpeg" = "yes"; then have_libjpeg=yes @@ -156,7 +157,7 @@ else AC_DEFINE(NO_JPEG_SUPPORT, 1, [JPEG support not available]) fi -AC_ARG_WITH(network, AC_HELP_STRING([--without-network], [Disable networking]), with_network=$withval, with_network=yes) +AC_ARG_WITH(network, AS_HELP_STRING([--without-network],[Disable networking]), with_network=$withval, with_network=yes) if test "$with_network" = "no"; then AC_DEFINE(WITHOUT_NETWORKING, 1, [Networking support not available]) fi @@ -173,7 +174,7 @@ AM_PATH_ALSA(0.9.0,AC_DEFINE([HAVE_ALSA],1,[Define presence of ALSA]),alsa=false AM_ICONV -AC_ARG_ENABLE(gtk2, AC_HELP_STRING([--disable-gtk2], [Disable GTK support]), enable_gtk2=$enableval, enable_gtk2=yes) +AC_ARG_ENABLE(gtk2, AS_HELP_STRING([--disable-gtk2],[Disable GTK support]), enable_gtk2=$enableval, enable_gtk2=yes) if test x$enable_gtk2 = xyes; then AM_PATH_GTK_2_0(2.0.0,AC_DEFINE([HAVE_GTK],1,[Define presence of GTK]),enable_gtk2=no) @@ -181,20 +182,17 @@ fi AC_CHECK_HEADER(sys/soundcard.h, [AC_DEFINE(HAVE_OSS, 1, [OSS support available])]) AC_CHECK_DECL(OSS_GETVERSION, AC_DEFINE([HAVE_OSS_GETVERSION],1,[OSS_GETVERSION is defined]), , [#include ]) -AC_ARG_ENABLE(force-oss, AC_HELP_STRING([--enable-force-oss], [Force OSS]), force_oss=$enableval, force_oss=no) +AC_ARG_ENABLE(force-oss, AS_HELP_STRING([--enable-force-oss],[Force OSS]), force_oss=$enableval, force_oss=no) AC_CHECK_HEADER(stdint.h, , [AC_DEFINE(MISSING_STDINT_H, 1, [stdint.h is missing])]) AC_CHECK_HEADERS([inttypes.h endian.h machine/endian.h]) AC_MSG_CHECKING(if cstdlib breaks llabs) AC_LANG_PUSH(C++) -AC_TRY_COMPILE( [#include +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include - using namespace std;], - [llabs(1)], - [AC_MSG_RESULT(no)], - [AC_MSG_RESULT(yes) - AC_DEFINE([NEED_CSTDLIB_WORKAROUND], 1, [cstdlib breaks llabs])] - ) + using namespace std;]], [[llabs(1)]])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(yes) + AC_DEFINE([NEED_CSTDLIB_WORKAROUND], 1, [cstdlib breaks llabs]) + ]) AC_LANG_POP(C++) AC_CHECK_LIB( pthread, pthread_create, AC_DEFINE([HAVE_LIBPTHREAD],1,[libpthread is available]) ) AC_CHECK_LIB( pthread, pthread_mutex_timedlock, AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK],1,[pthreads has pthread_mutex_timedlock()]) ) @@ -227,7 +225,7 @@ AC_CHECK_DECL(strtof, , AC_DEFINE([NEED_STRTOF],1,[Need strtof]), [#include ]) -AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Build test programs]), enable_tests=$enableval, enable_tests=no) +AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[Build test programs]), enable_tests=$enableval, enable_tests=no) AM_CONDITIONAL(BUILD_TESTS, test "$enable_tests" = "yes" ) AC_CONFIG_FILES(Makefile)