summaryrefslogtreecommitdiff
path: root/distrib/configure.ac.in
blob: 27109a2e1ceabe5db1121ea5d5a0cb8a49f0040e (plain)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
dnl
dnl Binary distribution configure script
dnl
#!/bin/sh
#

AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs@haskell.org], [ghc])

FP_FIND_ROOT

BootingFromHc=NO
AC_SUBST(BootingFromHc)

dnl--------------------------------------------------------------------
dnl * Deal with arguments telling us gmp is somewhere odd
dnl--------------------------------------------------------------------

FP_ARG_GMP

GMP_INCLUDE_DIRS=
GMP_LIB_DIRS=
if test "x$gmp_libraries" != "xNONE"; then
  LDFLAGS="-L$gmp_libraries $LDFLAGS"
  GMP_LIB_DIRS=$gmp_libraries
fi
if test "x$gmp_includes" != "xNONE"; then
  CPPFLAGS="-I$gmp_includes $CPPFLAGS"
  GMP_INCLUDE_DIRS=$gmp_includes
fi
AC_SUBST(GMP_INCLUDE_DIRS)
AC_SUBST(GMP_LIB_DIRS)

#
dnl ** Check Perl installation **
#
AC_PATH_PROG(PerlCmd,perl)
if test -z "$PerlCmd"; then
   echo "You must install perl before you can continue"
   echo "Perhaps it is already installed, but not in your PATH?"
   exit 1
fi
FPTOOLS_SHEBANG_PERL

#
dnl ** figure out how to do a BSD-ish install **
#
AC_PROG_INSTALL

#
dnl ** how to do symlinks **
#
AC_PROG_LN_S()

#
dnl ** how to invoke `ar' and `ranlib'
#
FP_PROG_AR_NEEDS_RANLIB

#
dnl ** Find the path to sed **
#
AC_PATH_PROG(SedCmd,sed)

#
dnl ** How to invoke gcc/cpp **
#
FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
export CC
WhatGccIsCalled="$CC"
AC_SUBST(WhatGccIsCalled)

FP_HAVE_GCC
AC_PROG_CPP

#
dnl ** Check gcc version and flags we need to pass it **
#
FP_GCC_EXTRA_FLAGS

CONF_CC_OPTS="@CONF_CC_OPTS@"
CONF_LD_OPTS="@CONF_LD_OPTS@"
AC_SUBST(CONF_CC_OPTS)
AC_SUBST(CONF_LD_OPTS)

#
AC_CONFIG_FILES(extra-gcc-opts mk/config.mk mk/install.mk)
AC_OUTPUT

# We get caught by
#     http://savannah.gnu.org/bugs/index.php?1516
#     $(eval ...) inside conditionals causes errors
# with make 3.80, so warn the user if it looks like they're about to
# try to use it.
# We would use "grep -q" here, but Solaris's grep doesn't support it.
checkMake380() {
    if $1 --version 2>&1 | head -1 | grep 'GNU Make 3\.80' > /dev/null
    then
        echo
        echo "WARNING: It looks like \"$1\" is GNU make 3.80."
        echo "This version cannot be used to build GHC."
        echo "Please use GNU make >= 3.81."
    fi
}

checkMake380 make
checkMake380 gmake

echo "****************************************************"
echo "Configuration done, ready to 'make install'"
echo "(see README and INSTALL files for more info.)"
echo "****************************************************"