@@ -9,9 +9,13 @@ AC_PROG_MAKE_SET
99
1010AC_PATH_PROG ( PKG_CONFIG , pkg-config , no )
1111
12- # On OSX use Mono's private copy of pkg-config if it exists, see https://github.com/fsharp/fsharp/issues/107
12+ # pkg-config precedence: 1) our prefix 2) the system Mono location 3) the PATH
13+ prefix_pkg_config="$prefix"/bin/pkg-config
1314osx_pkg_config=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
14- if test -e $osx_pkg_config; then
15+
16+ if test -e $prefix_pkg_config; then
17+ PKG_CONFIG=$prefix_pkg_config
18+ elif test -e $osx_pkg_config; then
1519 PKG_CONFIG=$osx_pkg_config
1620elif test "x$PKG_CONFIG" = "xno"; then
1721 AC_MSG_ERROR ( [ You need to install pkg-config] )
2024AC_MSG_NOTICE ( "pkg-config: $PKG_CONFIG" )
2125AC_MSG_NOTICE ( "PKG_CONFIG_LIBDIR: $PKG_CONFIG_LIBDIR" )
2226
23- # On OSX El Capitan, xbuild is no longer in PATH, so we need to use the full path.
24- AC_PATH_PROG ( XBUILD , xbuild , no )
25- osx_xbuild=/Library/Frameworks/Mono.framework/Versions/Current/bin/xbuild
26- if test "x$XBUILD" == "xno"; then
27- if test -e $osx_xbuild; then
28- XBUILD=$osx_xbuild
29- else
30- AC_MSG_ERROR ( [ Could not find xbuild] )
31- fi
32- fi
33- AC_MSG_NOTICE ( xbuild: $XBUILD )
34-
3527MONO_REQUIRED_VERSION=3.0
3628MONO_RECOMMENDED_VERSION=3.2
3729
@@ -64,7 +56,18 @@ AC_ARG_WITH([gacdir],
6456 )
6557
6658MONOPREFIX=$(cd `$PKG_CONFIG --variable=prefix mono` && pwd)
59+ MONOBINDIR="$MONOPREFIX"/bin
6760MONOLIBDIR="$MONOPREFIX"/lib
61+
62+ AC_PATH_PROG ( XBUILD , xbuild , no )
63+ xbuild_from_pkg_config="$MONOBINDIR"/xbuild
64+ if test -e $xbuild_from_pkg_config; then
65+ XBUILD=$xbuild_from_pkg_config
66+ elif test "x$XBUILD" == "xno"; then
67+ AC_MSG_ERROR ( [ Could not find xbuild] )
68+ fi
69+ AC_MSG_NOTICE ( xbuild: $XBUILD )
70+
6871MONOGACDIR="$MONOLIBDIR"/mono
6972if ! test "x$with_gacdir" = "xno"; then
7073 MONOGACDIR=$(cd "$with_gacdir/.." && pwd)
@@ -138,6 +141,7 @@ AC_SUBST(MONOTOUCHENABLED)
138141AC_SUBST ( MONODROIDENABLED )
139142AC_SUBST ( XAMARINMACENABLED )
140143
144+ AC_SUBST ( MONOBINDIR )
141145AC_SUBST ( MONOLIBDIR )
142146AC_SUBST ( MONOGACDIR )
143147
0 commit comments