forked from fsharp/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
93 lines (73 loc) · 2.64 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([fsharp], [4.0], [https://github.com/fsharp/fsharp/issues])
# Checks for programs.
AC_PROG_MAKE_SET
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
# pkg-config precedence: 1) our prefix 2) the system Mono location 3) the PATH
prefix_pkg_config="$prefix"/bin/pkg-config
osx_pkg_config=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config
if test -e $prefix_pkg_config; then
PKG_CONFIG=$prefix_pkg_config
elif test -e $osx_pkg_config; then
PKG_CONFIG=$osx_pkg_config
elif test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
AC_MSG_NOTICE("pkg-config: $PKG_CONFIG")
AC_MSG_NOTICE("PKG_CONFIG_LIBDIR: $PKG_CONFIG_LIBDIR")
MONO_REQUIRED_VERSION=4.0
MONO_RECOMMENDED_VERSION=4.2
MONO_RECOMMENDED_REASON="as it is newer and already considered a stable version"
if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then
AC_MSG_ERROR("You need mono $MONO_REQUIRED_VERSION")
fi
if ! $PKG_CONFIG --atleast-version=$MONO_RECOMMENDED_VERSION mono; then
AC_MSG_WARN([Mono $MONO_RECOMMENDED_VERSION or higher is recommended, $MONO_RECOMMENDED_REASON])
fi
AC_ARG_WITH([gacdir],
[ --with-gacdir=/path/to/gac Specify the gac directory (ex: /usr/lib/mono/gac)],
[],
[with_gacdir=no]
)
MONOPREFIX=$(cd `$PKG_CONFIG --variable=prefix mono` && pwd)
MONOBINDIR="$MONOPREFIX"/bin
MONOLIBDIR="$MONOPREFIX"/lib
AC_PATH_PROG(MSBUILD, msbuild, no)
msbuild_from_pkg_config="$MONOBINDIR"/msbuild
if test -e $msbuild_from_pkg_config; then
MSBUILD=$msbuild_from_pkg_config
elif test "x$MSBUILD" == "xno"; then
AC_MSG_ERROR([Could not find msbuild])
fi
AC_MSG_NOTICE(msbuild: $MSBUILD)
MONOGACDIR="$MONOLIBDIR"/mono
if ! test "x$with_gacdir" = "xno"; then
MONOGACDIR=$(cd "$with_gacdir/.." && pwd)
fi
MONOGACDIR40="$MONOGACDIR"/4.0
MONOGACDIR45="$MONOGACDIR"/4.5
if ! test -e $MONOGACDIR45/mscorlib.dll; then
AC_ERROR(Couldn't find the mono gac directory or mscorlib.dll in the usual places. Set --with-gacdir=<path>)
fi
AC_SUBST(MONOBINDIR)
AC_SUBST(MONOLIBDIR)
AC_SUBST(MONOGACDIR)
AC_SUBST(MONOGACDIR20)
AC_SUBST(MONOGACDIR35)
AC_SUBST(MONOGACDIR40)
AC_CONFIG_FILES([
mono/launcher
mono/config.make
])
AC_OUTPUT
CONFIGURE_FILE=autogen.sh
if ! test -e $CONFIGURE_FILE; then
CONFIGURE_FILE=configure
fi
CONFIGURE_COMMAND="`dirname $0`/$CONFIGURE_FILE"
if ! test "x$MONOPREFIX" = "x$prefix"; then
AC_WARN([Prefix to use is not the same as mono's: $prefix
Consider using: $CONFIGURE_COMMAND --prefix=$MONOPREFIX])
fi