wineesd: Make use of `esd-config --libs` for the configure check. Filter out /usr/lib and /usr/lib64. Also follow the naming convention for the 'xxx-config' variables.

Francois Gouget fgouget at codeweavers.com
Mon Jul 21 10:14:19 CDT 2008


---

I added code to filter out -L/usr/lib and -L/usr/lib64 because we're 
doing it for gphoto2 already, presumably to avoid trouble on 64bit Linux 
systems. I'm not sure if that was a gphoto2-specific issue or if it 
should be done more systematically. If the latter, then there are other 
places that don't do that filtering: libxml-2.0, libxslt, hal and 
freetype (but then maybe they don't report the -L settings). If the 
filtering is not desired, then I can resubmit.

 configure    |   25 ++++++++++++++++---------
 configure.ac |   22 +++++++++++++++-------
 2 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/configure b/configure
index 3096dc8..712ff6f 100755
--- a/configure
+++ b/configure
@@ -759,8 +759,8 @@ FREETYPELIBS
 FREETYPEINCL
 FONTSSUBDIRS
 ESDCONFIG
-ESDLIBS
 ESDINCL
+ESDLIBS
 ALSALIBS
 AUDIOIOLIBS
 FONTCONFIGINCL
@@ -14633,23 +14633,30 @@ fi
 
 if test "x$with_esd" != xno -a "x$ESDCONFIG" != x -a "x$ESDCONFIG" != x'"$ESDCONFIG"';
 then
-    ESD_CFLAGS=""
+    ac_esd_incl=""
     for i in `$ESDCONFIG --cflags`
     do
       case "$i" in
-        -I*) ESD_CFLAGS="$ESD_CFLAGS $i";;
+        -I*) ac_esd_incl="$ac_esd_incl $i";;
+      esac
+    done
+    ac_esd_libs=""
+    for i in `$ESDCONFIG --libs`
+    do
+      case "$i" in
+        -L/usr/lib|-L/usr/lib64) ;;
+        -L*|-l*) ac_esd_libs="$ac_esd_libs $i";;
       esac
     done
-    ESD_LIBS=`$ESDCONFIG --libs`
     save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $ESD_CFLAGS"
+    CFLAGS="$CFLAGS $ac_esd_incl"
     { echo "$as_me:$LINENO: checking for esd_open_sound in -lesd" >&5
 echo $ECHO_N "checking for esd_open_sound in -lesd... $ECHO_C" >&6; }
 if test "${ac_cv_lib_esd_esd_open_sound+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lesd  $LIBS"
+LIBS="-lesd $ac_esd_libs $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14705,9 +14712,9 @@ fi
 { echo "$as_me:$LINENO: result: $ac_cv_lib_esd_esd_open_sound" >&5
 echo "${ECHO_T}$ac_cv_lib_esd_esd_open_sound" >&6; }
 if test $ac_cv_lib_esd_esd_open_sound = yes; then
-  ESDLIBS=$ESD_LIBS
+  ESDINCL="$ac_esd_incl"
 
-         ESDINCL=$ESD_CFLAGS
+         ESDLIBS="$ac_esd_libs"
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -23841,8 +23848,8 @@ FREETYPELIBS!$FREETYPELIBS$ac_delim
 FREETYPEINCL!$FREETYPEINCL$ac_delim
 FONTSSUBDIRS!$FONTSSUBDIRS$ac_delim
 ESDCONFIG!$ESDCONFIG$ac_delim
-ESDLIBS!$ESDLIBS$ac_delim
 ESDINCL!$ESDINCL$ac_delim
+ESDLIBS!$ESDLIBS$ac_delim
 ALSALIBS!$ALSALIBS$ac_delim
 AUDIOIOLIBS!$AUDIOIOLIBS$ac_delim
 FONTCONFIGINCL!$FONTCONFIGINCL$ac_delim
diff --git a/configure.ac b/configure.ac
index 5b12d97..68f3914 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1070,20 +1070,28 @@ dnl **** Check for EsounD ****
 AC_PATH_PROG(ESDCONFIG, esd-config)
 if test "x$with_esd" != xno -a "x$ESDCONFIG" != x -a "x$ESDCONFIG" != x'"$ESDCONFIG"';
 then
-    ESD_CFLAGS=""
+    ac_esd_incl=""
     for i in `$ESDCONFIG --cflags`
     do
       case "$i" in
-        -I*) ESD_CFLAGS="$ESD_CFLAGS $i";;
+        -I*) ac_esd_incl="$ac_esd_incl $i";;
+      esac
+    done
+    ac_esd_libs=""
+    for i in `$ESDCONFIG --libs`
+    do
+      case "$i" in
+        -L/usr/lib|-L/usr/lib64) ;;
+        -L*|-l*) ac_esd_libs="$ac_esd_libs $i";;
       esac
     done
-    ESD_LIBS=`$ESDCONFIG --libs`
     save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $ESD_CFLAGS"
+    CFLAGS="$CFLAGS $ac_esd_incl"
     AC_CHECK_LIB(esd,esd_open_sound,
-        [AC_SUBST(ESDLIBS, $ESD_LIBS)
-         AC_SUBST(ESDINCL, $ESD_CFLAGS)
-         AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])])
+        [AC_SUBST(ESDINCL, "$ac_esd_incl")
+         AC_SUBST(ESDLIBS, "$ac_esd_libs")
+         AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])],,
+        [$ac_esd_libs])
     CFLAGS="$save_CFLAGS"
 fi
 
-- 
1.5.6.2



More information about the wine-patches mailing list