Escape slashes in paths passed to mingw-gcc

Avoids Msys path mangling that turns *nix paths (such as /usr/include) into
DOS-style absolute paths (such as c:/mingw/msys/1.0/include).
Allows mingw-built pkg-config to pass check-cflags.
This commit is contained in:
Руслан Ижбулатов 2011-04-14 07:25:43 +04:00 committed by Tollef Fog Heen
parent 01005bbbd0
commit 7850aeb03a
2 changed files with 11 additions and 1 deletions

View file

@ -21,12 +21,21 @@ EXTRA_DIST = $(m4_DATA) $(man_MANS) README.win32
bin_PROGRAMS = pkg-config
AM_CFLAGS=@WARN_CFLAGS@
if NATIVE_WIN32
INCLUDES= \
-DPKG_CONFIG_PC_PATH="\"$(subst /,\/,$(pc_path))\"" \
-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(subst /,\/,$(system_include_path))\"" \
-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(subst /,\/,$(system_library_path))\"" \
@GLIB_CFLAGS@ \
$(popt_includes)
else
INCLUDES= \
-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" \
-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(system_include_path)\"" \
-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(system_library_path)\"" \
@GLIB_CFLAGS@ \
$(popt_includes)
endif
pkg_config_SOURCES= \
pkg.h \

View file

@ -107,7 +107,7 @@ AC_DEFINE_UNQUOTED(ENABLE_INDIRECT_DEPS, `test $use_indirect_deps = no; echo $?`
AC_SUBST(use_indirect_deps)
AC_MSG_CHECKING([for Win32])
case "$host" in
case "$build" in
*-*-mingw*)
native_win32=yes
;;
@ -116,6 +116,7 @@ case "$host" in
;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
if test "x$GLIB_CFLAGS" = "x" && test "x$GLIB_LIBS" = "x"; then
AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], [])