Zebediah Figura : configure: Try to detect MinGW libmpg123 using pkg-config if --with-system-dllpath is specified.

Alexandre Julliard julliard at winehq.org
Thu Dec 2 15:30:16 CST 2021


Module: wine
Branch: master
Commit: 3869f5e6b1a10694dc66f3e473cabd4288c2be08
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3869f5e6b1a10694dc66f3e473cabd4288c2be08

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Dec  1 15:03:42 2021 -0600

configure: Try to detect MinGW libmpg123 using pkg-config if --with-system-dllpath is specified.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure    | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac |   9 +++++
 2 files changed, 119 insertions(+)

diff --git a/configure b/configure
index 9a6a1aa868a..5948756e7ae 100755
--- a/configure
+++ b/configure
@@ -12684,6 +12684,116 @@ CPPFLAGS=$ac_save_CPPFLAGS
         as_fn_append wine_notices "|liblcms2 ${notice_platform}MinGW development files not found; using bundled version."
     fi
 
+    if ${MPG123_PE_CFLAGS:+false} :
+then :
+  if test ${MINGW_PKG_CONFIG+y}
+then :
+  MPG123_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags libmpg123 2>/dev/null`
+fi
+fi
+if ${MPG123_PE_LIBS:+false} :
+then :
+  if test ${MINGW_PKG_CONFIG+y}
+then :
+  MPG123_PE_LIBS=`$MINGW_PKG_CONFIG --libs libmpg123 2>/dev/null`
+fi
+fi
+MPG123_PE_LIBS=${MPG123_PE_LIBS:-"-lmpg123"}
+ac_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $MPG123_PE_CFLAGS"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW mpg123.h" >&5
+printf %s "checking for MinGW mpg123.h... " >&6; }
+if test ${ac_cv_mingw_header_mpg123_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+CC="$CROSSCC"
+ac_exeext=".exe"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <mpg123.h>
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_mingw_header_mpg123_h=yes
+else $as_nop
+  ac_cv_mingw_header_mpg123_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_header_mpg123_h" >&5
+printf "%s\n" "$ac_cv_mingw_header_mpg123_h" >&6; }
+if test "x$ac_cv_mingw_header_mpg123_h" = xyes
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mpg123_feed in MinGW -lmpg123" >&5
+printf %s "checking for mpg123_feed in MinGW -lmpg123... " >&6; }
+if test ${ac_cv_mingw_lib_mpg123+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_wine_check_headers_saved_cc=$CC
+ac_wine_check_headers_saved_exeext=$ac_exeext
+ac_wine_check_headers_saved_libs=$LIBS
+CC="$CROSSCC"
+ac_exeext=".exe"
+LIBS="-lmpg123 $MPG123_PE_LIBS $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char mpg123_feed ();
+int
+main (void)
+{
+return mpg123_feed ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_mingw_lib_mpg123=yes
+else $as_nop
+  ac_cv_mingw_lib_mpg123=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+CC=$ac_wine_check_headers_saved_cc
+ac_exeext=$ac_wine_check_headers_saved_exeext
+LIBS=$ac_wine_check_headers_saved_libs
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mingw_lib_mpg123" >&5
+printf "%s\n" "$ac_cv_mingw_lib_mpg123" >&6; }
+if test "x$ac_cv_mingw_lib_mpg123" = xyes
+then :
+  :
+else $as_nop
+  MPG123_PE_CFLAGS=""; MPG123_PE_LIBS=""
+fi
+else $as_nop
+  MPG123_PE_CFLAGS=""; MPG123_PE_LIBS=""
+fi
+CPPFLAGS=$ac_save_CPPFLAGS
+
+    if test "x$MPG123_PE_LIBS" = "x"
+    then
+        as_fn_append wine_notices "|libmpg123 ${notice_platform}MinGW development files not found (or too old); using bundled version."
+    fi
+
     if ${ZLIB_PE_CFLAGS:+false} :
 then :
   if test ${MINGW_PKG_CONFIG+y}
diff --git a/configure.ac b/configure.ac
index 2a9a397ec01..2fe4b186fd6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1064,6 +1064,15 @@ then
         WINE_NOTICE([liblcms2 ${notice_platform}MinGW development files not found; using bundled version.])
     fi
 
+    WINE_MINGW_PACKAGE_FLAGS(MPG123,[libmpg123],[-lmpg123],
+        [WINE_CHECK_MINGW_HEADER(mpg123.h,
+            [WINE_CHECK_MINGW_LIB(mpg123,mpg123_feed,[:],[MPG123_PE_CFLAGS=""; MPG123_PE_LIBS=""],[$MPG123_PE_LIBS])],
+            [MPG123_PE_CFLAGS=""; MPG123_PE_LIBS=""])])
+    if test "x$MPG123_PE_LIBS" = "x"
+    then
+        WINE_NOTICE([libmpg123 ${notice_platform}MinGW development files not found (or too old); using bundled version.])
+    fi
+
     WINE_MINGW_PACKAGE_FLAGS(ZLIB,[zlib],[-lz],
         [WINE_CHECK_MINGW_HEADER(zlib.h,
             [WINE_CHECK_MINGW_LIB(z,inflate,[:],[ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""],[$ZLIB_PE_LIBS])],




More information about the wine-cvs mailing list