Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- aclocal.m4 | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 12 +++++++++++ 2 files changed, 71 insertions(+)
diff --git a/aclocal.m4 b/aclocal.m4 index 07a0359a3f1..50c79006f9a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -64,6 +64,15 @@ AC_CHECK_TOOL(READELF,[readelf],true)]) AC_DEFUN([WINE_PATH_PKG_CONFIG], [WINE_CHECK_HOST_TOOL(PKG_CONFIG,[pkg-config])])
+AC_DEFUN([WINE_PATH_MINGW_PKG_CONFIG], +[case "$host_cpu" in + i[[3456789]]86*) + ac_prefix_list="m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-w64-mingw32-pkg-config ])" ;; + *) + ac_prefix_list="$host_cpu-w64-mingw32-pkg-config" ;; +esac +AC_CHECK_PROGS(MINGW_PKG_CONFIG,[$ac_prefix_list],false)]) + dnl **** Extract the soname of a library **** dnl dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]]) @@ -124,6 +133,30 @@ CPPFLAGS=$ac_save_CPPFLAGS AS_VAR_POPDEF([ac_libs])dnl AS_VAR_POPDEF([ac_cflags])])dnl
+dnl **** Get flags from MinGW pkg-config or alternate xxx-config program **** +dnl +dnl Usage: WINE_MINGW_PACKAGE_FLAGS(var,pkg-name,[default-lib,[cflags-alternate,libs-alternate,[checks]]]) +dnl +AC_DEFUN([WINE_MINGW_PACKAGE_FLAGS], +[AC_REQUIRE([WINE_PATH_MINGW_PKG_CONFIG])dnl +AS_VAR_PUSHDEF([ac_cflags],[[$1]_PE_CFLAGS])dnl +AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl +AS_VAR_IF([ac_cflags],[], + [AS_VAR_SET_IF([MINGW_PKG_CONFIG], + [ac_cflags=`$MINGW_PKG_CONFIG --cflags [$2] 2>/dev/null`])]) +m4_ifval([$4],[test "$cross_compiling" = yes || ac_cflags=[$]{ac_cflags:-[$4]}]) +AS_VAR_IF([ac_libs],[], + [AS_VAR_SET_IF([MINGW_PKG_CONFIG], + [ac_libs=`$MINGW_PKG_CONFIG --libs [$2] 2>/dev/null`])]) +m4_ifval([$5],[test "$cross_compiling" = yes || ac_libs=[$]{ac_libs:-[$5]}]) +m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}]) +ac_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $ac_cflags" +$6 +CPPFLAGS=$ac_save_CPPFLAGS +AS_VAR_POPDEF([ac_libs])dnl +AS_VAR_POPDEF([ac_cflags])])dnl + dnl **** Get flags for an external lib program **** dnl dnl Usage: WINE_EXTLIB_FLAGS(var,pkg-name,default-libs,default-cflags) @@ -189,6 +222,32 @@ ac_exeext=$ac_wine_try_cflags_saved_exeext]) AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS $1"])], [$3])dnl AS_VAR_POPDEF([ac_var])])
+dnl **** Check whether the given MinGW headers are available **** +dnl +dnl Usage: WINE_CHECK_MINGW_HEADERS(files,[action-if-found],[action-if-not-found],[other-includes]) +dnl +AC_DEFUN([WINE_CHECK_MINGW_HEADERS], +[ac_wine_check_headers_saved=$CC +ac_wine_check_headers_saved_exeext=$ac_exeext +CC="$CROSSCC" +ac_exeext=".exe" +AC_CHECK_HEADERS([$1],[$2],[$3],[$4]) +CC=$ac_wine_check_headers_saved +ac_exeext=$ac_wine_check_headers_saved_exeext]) + +dnl **** Check whether the given MinGW library is available **** +dnl +dnl Usage: WINE_CHECK_MINGW_LIB(library,function,[action-if-found],[action-if-not-found],[other-libraries]) +dnl +AC_DEFUN([WINE_CHECK_MINGW_LIB], +[ac_wine_check_lib_saved=$CC +ac_wine_check_lib_saved_exeext=$ac_exeext +CC="$CROSSCC" +ac_exeext=".exe" +AC_CHECK_LIB([$1],[$2],[$3],[$4],[$5]) +CC=$ac_wine_check_lib_saved +ac_exeext=$ac_wine_check_lib_saved_exeext]) + dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS **** dnl dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]]) diff --git a/configure.ac b/configure.ac index 163d06fc327..ee5b5dbdb23 100644 --- a/configure.ac +++ b/configure.ac @@ -1033,6 +1033,18 @@ WINE_NOTICE_WITH(mingw,[test "x$CROSSTARGET" = "x"],
dnl **** External libraries ****
+if test "x$with_system_dllpath" != "x" -a "$CROSSCC" != "false" +then + WINE_MINGW_PACKAGE_FLAGS(ZLIB,[zlib],[-lz],,, + [WINE_CHECK_MINGW_HEADERS(zlib.h, + [WINE_CHECK_MINGW_LIB(z,inflate,[:],[ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""],[$ZLIB_PE_LIBS])], + [ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""])]) + if test "x$ZLIB_PE_LIBS" = "x" + then + WINE_NOTICE([zlib ${notice_platform}MinGW development files not found; using bundled version.]) + fi +fi + WINE_EXTLIB_FLAGS(FAUDIO, faudio, "faudio mfplat mfreadwrite mfuuid propsys", "-I$(top_srcdir)/libs/faudio/include") WINE_EXTLIB_FLAGS(GSM, gsm, gsm, "-I$(top_srcdir)/libs/gsm/inc") WINE_EXTLIB_FLAGS(JPEG, jpeg, jpeg, "-I$(top_srcdir)/libs/jpeg")