[PATCH 02/17] configure: Change openal detection
Maarten Lankhorst
m.b.lankhorst at gmail.com
Wed Dec 9 04:52:09 CST 2009
---
configure | 60 ++++++++++++++++++++++++++++++--------------
configure.ac | 13 ++++++---
dlls/openal32/Makefile.in | 2 +-
include/config.h.in | 6 ++++
4 files changed, 56 insertions(+), 25 deletions(-)
diff --git a/configure b/configure
index d5a86b1..b962e29 100755
--- a/configure
+++ b/configure
@@ -625,6 +625,7 @@ LDPATH
BUILTINFLAG
EXTRACFLAGS
LIBKSTAT
+LIBOPENAL
LIBMPG123
PNGINCL
FONTCONFIGINCL
@@ -662,7 +663,7 @@ CROSSTARGET
CROSSTEST
CROSSCC
CARBONLIB
-LIBOPENAL
+FRAMEWORK_OPENAL
COREAUDIO
DISKARBITRATIONLIB
LDEXECFLAGS
@@ -6436,9 +6437,14 @@ fi
fi
if test "$ac_cv_header_OpenAL_al_h" = "yes"
then
- LIBOPENAL="-framework OpenAL"
+ FRAMEWORK_OPENAL="-framework OpenAL"
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENAL 1
+_ACEOF
- ac_cv_lib_openal_alGetSource3i=yes
+ ac_cv_lib_openal=yes
fi
if test "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes"
then
@@ -11197,14 +11203,14 @@ test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes || enable_winemp3_acm=${enable_wine
if test "$ac_cv_header_AL_al_h" = "yes"
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alGetSource3i in -lopenal" >&5
-$as_echo_n "checking for alGetSource3i in -lopenal... " >&6; }
-if test "${ac_cv_lib_openal_alGetSource3i+set}" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lopenal" >&5
+$as_echo_n "checking for -lopenal... " >&6; }
+if test "${ac_cv_lib_soname_openal+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
+ ac_check_soname_save_LIBS=$LIBS
LIBS="-lopenal $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -11223,23 +11229,39 @@ return alGetSource3i ();
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_openal_alGetSource3i=yes
-else
- ac_cv_lib_openal_alGetSource3i=no
+ case "$LIBEXT" in
+ dll) ;;
+ dylib) ac_cv_lib_soname_openal=`otool -L conftest$ac_exeext | grep "libopenal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libopenal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
+ *) ac_cv_lib_soname_openal=`$ac_cv_path_LDD conftest$ac_exeext | grep "libopenal\\.$LIBEXT" | sed -e "s/^.*\(libopenal\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;;
+ esac
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ LIBS=$ac_check_soname_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openal_alGetSource3i" >&5
-$as_echo "$ac_cv_lib_openal_alGetSource3i" >&6; }
-if test "x$ac_cv_lib_openal_alGetSource3i" = x""yes; then :
- LIBOPENAL="-lopenal"
+if test "x$ac_cv_lib_soname_openal" = "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
-fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_openal" >&5
+$as_echo "$ac_cv_lib_soname_openal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define SONAME_LIBOPENAL "$ac_cv_lib_soname_openal"
+_ACEOF
+
+ LIBOPENAL="-lopenal"
+ ac_cv_lib_openal=yes
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENAL 1
+_ACEOF
+
+fi
fi
-if test "x$ac_cv_lib_openal_alGetSource3i" != xyes; then :
+if test "x$ac_cv_lib_openal" != xyes; then :
case "x$with_openal" in
x) as_fn_append wine_notices "|libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported." ;;
xno) ;;
@@ -11247,7 +11269,7 @@ if test "x$ac_cv_lib_openal_alGetSource3i" != xyes; then :
This is an error since --with-openal was requested." "$LINENO" 5 ;;
esac
fi
-test "x$ac_cv_lib_openal_alGetSource3i" = xyes || enable_openal32=${enable_openal32:-no}
+test "x$ac_cv_lib_openal" = xyes || enable_openal32=${enable_openal32:-no}
if test "$ac_cv_header_kstat_h" = "yes"
then
diff --git a/configure.ac b/configure.ac
index ba54bcd..1bcd93a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,8 +639,9 @@ case $host_os in
fi
if test "$ac_cv_header_OpenAL_al_h" = "yes"
then
- AC_SUBST(LIBOPENAL,"-framework OpenAL")
- ac_cv_lib_openal_alGetSource3i=yes
+ AC_SUBST(FRAMEWORK_OPENAL,"-framework OpenAL")
+ AC_DEFINE_UNQUOTED(HAVE_OPENAL,1,[Define to 1 if OpenAL is available])
+ ac_cv_lib_openal=yes
fi
if test "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes"
then
@@ -1444,11 +1445,13 @@ test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes || enable_winemp3_acm=${enable_wine
dnl **** Check for OpenAL 1.1 ****
if test "$ac_cv_header_AL_al_h" = "yes"
then
- AC_CHECK_LIB(openal,alGetSource3i,[AC_SUBST(LIBOPENAL,"-lopenal")])
+ WINE_CHECK_SONAME(openal,alGetSource3i,[AC_SUBST(LIBOPENAL,"-lopenal")
+ ac_cv_lib_openal=yes
+ AC_DEFINE_UNQUOTED(HAVE_OPENAL,1,[Define to 1 if OpenAL is available])],,)
fi
-WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal_alGetSource3i" != xyes],
+WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal" != xyes],
[libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.])
-test "x$ac_cv_lib_openal_alGetSource3i" = xyes || enable_openal32=${enable_openal32:-no}
+test "x$ac_cv_lib_openal" = xyes || enable_openal32=${enable_openal32:-no}
dnl **** Check for libkstat ****
if test "$ac_cv_header_kstat_h" = "yes"
diff --git a/dlls/openal32/Makefile.in b/dlls/openal32/Makefile.in
index b237706..9c2ac8f 100644
--- a/dlls/openal32/Makefile.in
+++ b/dlls/openal32/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = openal32.dll
IMPORTS = kernel32 ntdll
-EXTRALIBS = @LIBOPENAL@
+EXTRALIBS = @LIBOPENAL@ @FRAMEWORK_OPENAL@
C_SRCS = \
openal.c
diff --git a/include/config.h.in b/include/config.h.in
index 4e8fcd1..8e4c010 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -558,6 +558,9 @@
/* Define if mkdir takes only one argument */
#undef HAVE_ONE_ARG_MKDIR
+/* Define to 1 if OpenAL is available */
+#undef HAVE_OPENAL
+
/* Define to 1 if you have the <OpenAL/al.h> header file. */
#undef HAVE_OPENAL_AL_H
@@ -1185,6 +1188,9 @@
/* Define to the soname of the libodbc library. */
#undef SONAME_LIBODBC
+/* Define to the soname of the libopenal library. */
+#undef SONAME_LIBOPENAL
+
/* Define to the soname of the libpng library. */
#undef SONAME_LIBPNG
--
1.7.0
--------------080202090306020902090606--
More information about the wine-patches
mailing list