Skip to content
This repository
Browse code

Fix #107 - Installing on Mono 3.0.4

@migueldeicaza says "The problem is that we installed a pkg-config
program in /usr/bin which only looked up at the Mono database of
packages, as it was a symlink to the one in
/Library/Frameworks/Mono.framework This caused problem for people that
either had their own, or were using popular Unix install systems like
Homebrew or MacPorts. The correct fix is to detect if
/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
exists, if it does, use that, instead use /usr/bin/pkg-config"
commit 19643d967ba814a1871694ede5f0696b928ac70d 1 parent e6351d4
Ben Winkel authored

Showing 1 changed file with 10 additions and 5 deletions. Show diff stats Hide diff stats

  1. 15  configure.ac
15  configure.ac
@@ -8,20 +8,25 @@ AC_INIT([fsharp], [0.1], [avidigal@novell.com])
8 8
 AC_PROG_MAKE_SET
9 9
 
10 10
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
11  
-if test "x$PKG_CONFIG" = "xno"; then
  11
+
  12
+# On OSX use Mono's private copy of pkg-config if it exists, see https://github.com/fsharp/fsharp/issues/107
  13
+osx_pkg_config=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
  14
+if test -e $osx_pkg_config; then
  15
+    PKG_CONFIG=$osx_pkg_config
  16
+elif test "x$PKG_CONFIG" = "xno"; then
12 17
         AC_MSG_ERROR([You need to install pkg-config])
13 18
 fi
14 19
 
15 20
 MONO_REQUIRED_VERSION=2.9
16 21
 MONO_RECOMMENDED_VERSION=3.0
17 22
 
18  
-if ! pkg-config --atleast-version=$MONO_REQUIRED_VERSION mono; then
  23
+if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then
19 24
 	AC_MSG_ERROR("You need mono $MONO_REQUIRED_VERSION")
20 25
 fi
21 26
 
22 27
 AC_PATH_PROG(MONO_SGEN, mono-sgen, no)
23 28
 
24  
-if ! pkg-config --atleast-version=$MONO_RECOMMENDED_VERSION mono; then
  29
+if ! $PKG_CONFIG --atleast-version=$MONO_RECOMMENDED_VERSION mono; then
25 30
 	AC_MSG_WARN([Mono $MONO_RECOMMENDED_VERSION or higher is recommended, for better MSBuild (xbuild) compatibility])
26 31
 
27 32
 	# stability of Mono's SGEN GC is not so good in older versions than Mono v3.0
@@ -49,9 +54,9 @@ AC_ARG_WITH([gacdir],
49 54
         )
50 55
 
51 56
 if test "x$with_gacdir" = "xno"; then
52  
-	MONODIR=`pkg-config --variable=libdir mono`/mono
  57
+	MONODIR=`$PKG_CONFIG --variable=libdir mono`/mono
53 58
 	if ! test -e $MONODIR/2.0/mscorlib.dll; then
54  
-		MONODIR=`pkg-config --variable=prefix mono`/lib/mono
  59
+		MONODIR=`$PKG_CONFIG --variable=prefix mono`/lib/mono
55 60
 	fi
56 61
 else
57 62
 	MONODIR=$(cd "$with_gacdir/.." && pwd)

0 notes on commit 19643d9

Please sign in to comment.
Something went wrong with that request. Please try again.