From: <edh...@us...> - 2008-10-06 00:35:23
|
Revision: 5407 http://gemrb.svn.sourceforge.net/gemrb/?rev=5407&view=rev Author: edheldil Date: 2008-10-06 00:35:14 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Removed version check from AM_PATH_OPENAL, check for alGetError() Modified Paths: -------------- gemrb/trunk/acinclude.m4 gemrb/trunk/configure.in Modified: gemrb/trunk/acinclude.m4 =================================================================== --- gemrb/trunk/acinclude.m4 2008-10-05 21:36:49 UTC (rev 5406) +++ gemrb/trunk/acinclude.m4 2008-10-06 00:35:14 UTC (rev 5407) @@ -200,7 +200,7 @@ ################################################### dnl Configure paths for OPENAL -dnl AM_PATH_OPENAL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for OPENAL, and define OPENAL_CFLAGS and OPENAL_LIBS dnl @@ -231,8 +231,7 @@ AC_REQUIRE([AC_CANONICAL_TARGET]) PATH="$prefix/bin:$prefix/usr/bin:$PATH" AC_PATH_PROG(OPENAL_CONFIG, openal-config, no, [$PATH]) - min_openal_version=ifelse([$1], ,0.11.0,$1) - AC_MSG_CHECKING(for OPENAL - version >= $min_openal_version) + AC_MSG_CHECKING(for OPENAL library) no_openal="" if test "$OPENAL_CONFIG" = "no" ; then no_openal=yes @@ -240,12 +239,6 @@ OPENAL_CFLAGS=`$OPENAL_CONFIG $openalconf_args --cflags` OPENAL_LIBS="`$OPENAL_CONFIG $openalconf_args --libs` $LIBPTHREAD" - openal_major_version=`$OPENAL_CONFIG $openal_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - openal_minor_version=`$OPENAL_CONFIG $openal_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - openal_micro_version=`$OPENAL_CONFIG $openal_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_openaltest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" @@ -253,118 +246,29 @@ CXXFLAGS="$CXXFLAGS $OPENAL_CFLAGS" LIBS="$LIBS $OPENAL_LIBS" dnl -dnl Now check if the installed OPENAL is sufficiently new. (Also sanity -dnl checks the results of openal-config to some extent +dnl Now check if the installed OPENAL is sufficiently new. dnl rm -f conf.openaltest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> + AC_TRY_LINK([ #include "AL/al.h" - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main (int argc, char *argv[]) -{ - int major, minor, micro; - char *tmp_version; - - /* This hangs on some systems (?) - system ("touch conf.openaltest"); - */ - { FILE *fp = fopen("conf.openaltest", "a"); if ( fp ) fclose(fp); } - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_openal_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_openal_version"); - exit(1); - } - - if (($openal_major_version > major) || - (($openal_major_version == major) && ($openal_minor_version > minor)) || - (($openal_major_version == major) && ($openal_minor_version == minor) && ($openal_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'openal-config --version' returned %d.%d.%d, but the minimum version\n", $openal_major_version, $openal_minor_version, $openal_micro_version); - printf("*** of OPENAL required is %d.%d.%d. If openal-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If openal-config was wrong, set the environment variable OPENAL_CONFIG\n"); - printf("*** to point to the correct copy of openal-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -],, no_openal=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) +],[ return alGetError(); ],no_openal="",no_openal=yes) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_openal" = x ; then AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) + ifelse([$1], , :, [$1]) else AC_MSG_RESULT(no) - if test "$OPENAL_CONFIG" = "no" ; then - echo "*** The openal-config script installed by OPENAL could not be found" - echo "*** If OPENAL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the OPENAL_CONFIG environment variable to the" - echo "*** full path to openal-config." - else - if test -f conf.openaltest ; then - : - else - echo "*** Could not run OPENAL test program, checking why..." - CFLAGS="$CFLAGS $OPENAL_CFLAGS" - LIBS="$LIBS $OPENAL_LIBS" - AC_TRY_LINK([ -#include <stdio.h> -#include "AL/al.h" - -int main(int argc, char *argv[]) -{ return 0; } -#undef main -#define main K_and_R_C_main -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding OPENAL or finding the wrong" - echo "*** version of OPENAL. If it is not finding OPENAL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - 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 "*** exact error that occured. This usually means OPENAL was incorrectly installed" - echo "*** or that you have moved OPENAL since it was installed. In the latter case, you" - echo "*** may want to edit the openal-config script: $OPENAL_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means OPENAL is not installed," + echo "*** that it's installed incorrectly or that it has been moved since" + echo "*** installation. In the latter case, you may want to edit the " + echo "*** openal-config script: $OPENAL_CONFIG" OPENAL_CFLAGS="" OPENAL_LIBS="" - ifelse([$3], , :, [$3]) + ifelse([$2], , :, [$2]) fi AC_SUBST(OPENAL_CFLAGS) AC_SUBST(OPENAL_LIBS) Modified: gemrb/trunk/configure.in =================================================================== --- gemrb/trunk/configure.in 2008-10-05 21:36:49 UTC (rev 5406) +++ gemrb/trunk/configure.in 2008-10-06 00:35:14 UTC (rev 5407) @@ -126,9 +126,9 @@ dnl Check for OpenAL, fail if not found. dnl Check for libSDL Version 1.2 or greater, fail if not found. -AM_PATH_OPENAL(0.0.7, [], [AC_MSG_ERROR([ +AM_PATH_OPENAL([], [AC_MSG_ERROR([ -*** You need OpenAL (www.openal.org) version 0.0.7 or greater to compile GemRB +*** You need OpenAL (www.openal.org) to compile GemRB ])]) #AC_CHECK_LIB([openal], [alGetError], [ $(which true) ], [AC_MSG_ERROR([ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |