They were not correctly being disabled if an external library was specified, which was causing msxml3 to link to the bundled version.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac index 72f580cbf0f..163d06fc327 100644 --- a/configure.ac +++ b/configure.ac @@ -1041,8 +1041,8 @@ WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I$(top_srcdir)/libs/lcms2/include") WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I$(top_srcdir)/libs/mpg123/src/libmpg123") WINE_EXTLIB_FLAGS(PNG, png, "png $(ZLIB_PE_LIBS)", "-I$(top_srcdir)/libs/png") WINE_EXTLIB_FLAGS(TIFF, tiff, tiff, "-I$(top_srcdir)/libs/tiff/libtiff") -WINE_EXTLIB_FLAGS(XML2, libxml2, xml2, "-I$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC") -WINE_EXTLIB_FLAGS(XSLT, libxslt, xslt, "-I$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC") +WINE_EXTLIB_FLAGS(XML2, xml2, xml2, "-I$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC") +WINE_EXTLIB_FLAGS(XSLT, xslt, xslt, "-I$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC") WINE_EXTLIB_FLAGS(ZLIB, zlib, z, "-I$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO")
dnl **** Check for pthread ****
The include path may be empty, e.g. if the relevant headers are to be found directly in the MinGW sysroot.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tools/makedep.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tools/makedep.c b/tools/makedep.c index ac3e6d969e2..2301ecf191e 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -1286,6 +1286,22 @@ static struct makefile *find_importlib_module( const char *name ) }
+/******************************************************************* + * has_external_import + */ +static int has_external_import( const struct makefile *make ) +{ + unsigned int i; + + for (i = 0; i < make->imports.count; i++) + { + if (!strncmp( make->imports.str[i], "-l", 2 )) + return 1; + } + return 0; +} + + /******************************************************************* * open_include_file */ @@ -1404,7 +1420,7 @@ static struct file *open_include_file( const struct makefile *make, struct incl_ { if (!strcmp( pFile->name, "stdarg.h" )) return NULL; if (!strcmp( pFile->name, "x86intrin.h" )) return NULL; - if (make->include_paths.count) return NULL; + if (has_external_import( make )) return NULL; fprintf( stderr, "%s:%d: error: system header %s cannot be used with msvcrt\n", pFile->included_by->file->name, pFile->included_line, pFile->name ); exit(1);
The external include path might be empty e.g. if the relevant headers are to be found directly in the MinGW sysroot, but we still don't want to use the bundled library's include path in that case.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- aclocal.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4 index a261105d44d..07a0359a3f1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -133,8 +133,10 @@ AC_DEFUN([WINE_EXTLIB_FLAGS], AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl AC_ARG_VAR(ac_cflags, [C compiler flags for the PE $2, overriding the bundled version])dnl AC_ARG_VAR(ac_libs, [Linker flags for the PE $2, overriding the bundled version])dnl -AS_VAR_IF([ac_cflags],[],[ac_cflags=$4],[enable_$2=no]) -AS_VAR_IF([ac_libs],[],[ac_libs=$3],[enable_$2=no]) +AS_VAR_IF([ac_libs],[], + [ac_libs=$3 + AS_VAR_IF([ac_cflags],[],[ac_cflags=$4],[enable_$2=no])], + [enable_$2=no]) AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 libs: $ac_libs"]) >&AS_MESSAGE_LOG_FD AS_VAR_POPDEF([ac_libs])dnl
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")
Zebediah Figura zfigura@codeweavers.com writes:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
aclocal.m4 | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 12 +++++++++++ 2 files changed, 71 insertions(+)
This is causing defines like HAVE_ZLIB_H to end up in the main config.h, I don't think we want that.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/configure.ac b/configure.ac index ee5b5dbdb23..3003a92f0f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1035,6 +1035,15 @@ dnl **** External libraries ****
if test "x$with_system_dllpath" != "x" -a "$CROSSCC" != "false" then + WINE_MINGW_PACKAGE_FLAGS(FAUDIO,[FAudio],[-lFAudio],,, + [WINE_CHECK_MINGW_HEADERS([FAudio.h], + [WINE_CHECK_MINGW_LIB(FAudio,FAudio_CommitOperationSet,[:],[FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS=""],[$FAUDIO_PE_LIBS])], + [FAUDIO_PE_CFLAGS=""; FAUDIO_PE_LIBS=""])]) + if test "x$FAUDIO_PE_LIBS" = "x" + then + WINE_NOTICE([FAudio ${notice_platform}MinGW development files not found (or too old); using bundled version.]) + fi + 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])],