mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
configure: Try to detect MinGW zlib using pkg-config if --with-system-dllpath is specified.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
819d049f12
commit
9ac28955cf
3 changed files with 250 additions and 0 deletions
69
aclocal.m4
vendored
69
aclocal.m4
vendored
|
@ -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,28 @@ 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,[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`])])
|
||||
AS_VAR_IF([ac_libs],[],
|
||||
[AS_VAR_SET_IF([MINGW_PKG_CONFIG],
|
||||
[ac_libs=`$MINGW_PKG_CONFIG --libs [$2] 2>/dev/null`])])
|
||||
m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
|
||||
ac_save_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $ac_cflags"
|
||||
$4
|
||||
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 +220,44 @@ 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 header is available ****
|
||||
dnl
|
||||
dnl Usage: WINE_CHECK_MINGW_HEADER(header,[action-if-found],[action-if-not-found],[other-includes])
|
||||
dnl
|
||||
AC_DEFUN([WINE_CHECK_MINGW_HEADER],
|
||||
[AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_header_$1])dnl
|
||||
AC_CACHE_CHECK([for MinGW $1], ac_var,
|
||||
[ac_wine_check_headers_saved_cc=$CC
|
||||
ac_wine_check_headers_saved_exeext=$ac_exeext
|
||||
CC="$CROSSCC"
|
||||
ac_exeext=".exe"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$4
|
||||
#include <$1>]])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
|
||||
CC=$ac_wine_check_headers_saved_cc
|
||||
ac_exeext=$ac_wine_check_headers_saved_exeext])
|
||||
AS_VAR_IF([ac_var],[yes],[$2],[$3])dnl
|
||||
AS_VAR_POPDEF([ac_var])])
|
||||
|
||||
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],
|
||||
[AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_lib_$1])dnl
|
||||
AC_CACHE_CHECK([for $2 in MinGW -l$1], ac_var,
|
||||
[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="-l$1 $5 $LIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
|
||||
CC=$ac_wine_check_headers_saved_cc
|
||||
ac_exeext=$ac_wine_check_headers_saved_exeext
|
||||
LIBS=$ac_wine_check_headers_saved_libs])
|
||||
AS_VAR_IF([ac_var],[yes],[$3],[$4])dnl
|
||||
AS_VAR_POPDEF([ac_var])])
|
||||
|
||||
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]])
|
||||
|
|
169
configure
vendored
169
configure
vendored
|
@ -734,6 +734,7 @@ GSM_PE_LIBS
|
|||
GSM_PE_CFLAGS
|
||||
FAUDIO_PE_LIBS
|
||||
FAUDIO_PE_CFLAGS
|
||||
MINGW_PKG_CONFIG
|
||||
EXCESS_PRECISION_CFLAGS
|
||||
CROSSDEBUG
|
||||
DELAYLOADFLAG
|
||||
|
@ -12296,6 +12297,173 @@ esac
|
|||
fi
|
||||
|
||||
|
||||
if test "x$with_system_dllpath" != "x" -a "$CROSSCC" != "false"
|
||||
then
|
||||
case "$host_cpu" in
|
||||
i[3456789]86*)
|
||||
ac_prefix_list="i686-w64-mingw32-pkg-config i586-w64-mingw32-pkg-config i486-w64-mingw32-pkg-config i386-w64-mingw32-pkg-config " ;;
|
||||
*)
|
||||
ac_prefix_list="$host_cpu-w64-mingw32-pkg-config" ;;
|
||||
esac
|
||||
for ac_prog in $ac_prefix_list
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
printf %s "checking for $ac_word... " >&6; }
|
||||
if test ${ac_cv_prog_MINGW_PKG_CONFIG+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
if test -n "$MINGW_PKG_CONFIG"; then
|
||||
ac_cv_prog_MINGW_PKG_CONFIG="$MINGW_PKG_CONFIG" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
case $as_dir in #(((
|
||||
'') as_dir=./ ;;
|
||||
*/) ;;
|
||||
*) as_dir=$as_dir/ ;;
|
||||
esac
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_MINGW_PKG_CONFIG="$ac_prog"
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
fi
|
||||
fi
|
||||
MINGW_PKG_CONFIG=$ac_cv_prog_MINGW_PKG_CONFIG
|
||||
if test -n "$MINGW_PKG_CONFIG"; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MINGW_PKG_CONFIG" >&5
|
||||
printf "%s\n" "$MINGW_PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$MINGW_PKG_CONFIG" && break
|
||||
done
|
||||
test -n "$MINGW_PKG_CONFIG" || MINGW_PKG_CONFIG="false"
|
||||
|
||||
if ${ZLIB_PE_CFLAGS:+false} :
|
||||
then :
|
||||
if test ${MINGW_PKG_CONFIG+y}
|
||||
then :
|
||||
ZLIB_PE_CFLAGS=`$MINGW_PKG_CONFIG --cflags zlib 2>/dev/null`
|
||||
fi
|
||||
fi
|
||||
if ${ZLIB_PE_LIBS:+false} :
|
||||
then :
|
||||
if test ${MINGW_PKG_CONFIG+y}
|
||||
then :
|
||||
ZLIB_PE_LIBS=`$MINGW_PKG_CONFIG --libs zlib 2>/dev/null`
|
||||
fi
|
||||
fi
|
||||
ZLIB_PE_LIBS=${ZLIB_PE_LIBS:-"-lz"}
|
||||
ac_save_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $ZLIB_PE_CFLAGS"
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MinGW zlib.h" >&5
|
||||
printf %s "checking for MinGW zlib.h... " >&6; }
|
||||
if test ${ac_cv_mingw_header_zlib_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 <zlib.h>
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
ac_cv_mingw_header_zlib_h=yes
|
||||
else $as_nop
|
||||
ac_cv_mingw_header_zlib_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_zlib_h" >&5
|
||||
printf "%s\n" "$ac_cv_mingw_header_zlib_h" >&6; }
|
||||
if test "x$ac_cv_mingw_header_zlib_h" = xyes
|
||||
then :
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflate in MinGW -lz" >&5
|
||||
printf %s "checking for inflate in MinGW -lz... " >&6; }
|
||||
if test ${ac_cv_mingw_lib_z+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="-lz $ZLIB_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 inflate ();
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
return inflate ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
ac_cv_mingw_lib_z=yes
|
||||
else $as_nop
|
||||
ac_cv_mingw_lib_z=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_z" >&5
|
||||
printf "%s\n" "$ac_cv_mingw_lib_z" >&6; }
|
||||
if test "x$ac_cv_mingw_lib_z" = xyes
|
||||
then :
|
||||
:
|
||||
else $as_nop
|
||||
ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""
|
||||
fi
|
||||
else $as_nop
|
||||
ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""
|
||||
fi
|
||||
CPPFLAGS=$ac_save_CPPFLAGS
|
||||
|
||||
if test "x$ZLIB_PE_LIBS" = "x"
|
||||
then
|
||||
as_fn_append wine_notices "|zlib ${notice_platform}MinGW development files not found; using bundled version."
|
||||
fi
|
||||
fi
|
||||
|
||||
if ${FAUDIO_PE_LIBS:+false} :
|
||||
then :
|
||||
FAUDIO_PE_LIBS="faudio mfplat mfreadwrite mfuuid propsys"
|
||||
|
@ -22958,6 +23126,7 @@ CROSSLDFLAGS = $CROSSLDFLAGS
|
|||
DELAYLOADFLAG = $DELAYLOADFLAG
|
||||
CROSSDEBUG = $CROSSDEBUG
|
||||
EXCESS_PRECISION_CFLAGS = $EXCESS_PRECISION_CFLAGS
|
||||
MINGW_PKG_CONFIG = $MINGW_PKG_CONFIG
|
||||
FAUDIO_PE_CFLAGS = $FAUDIO_PE_CFLAGS
|
||||
FAUDIO_PE_LIBS = $FAUDIO_PE_LIBS
|
||||
GSM_PE_CFLAGS = $GSM_PE_CFLAGS
|
||||
|
|
12
configure.ac
12
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_HEADER(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")
|
||||
|
|
Loading…
Reference in a new issue