[project @ 1998-02-04 18:48:18 by sof]
[ghc-hetmet.git] / distrib / configure-bin.in
1 dnl
2 dnl Binary distribution configure script
3 dnl
4 #!/bin/sh
5 #
6
7 # Is it there?
8 AC_INIT(Makefile.in)
9
10 exeext=''
11
12 #
13 # First off, what system are we running under?
14 #
15 AC_CANONICAL_SYSTEM
16
17 dnl ** canonicalize platform names
18 # Canonicali[sz]e the platform name
19 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
20
21 #
22 # The following will be more difficult when we *are* cross-compiling.
23 # Suitable names to slam in *_CPP are in platform.h.in.
24 # We also record the architecture, vendor, and operating system (OS)
25 # separately.
26 case $TargetPlatform in
27 alpha-dec-osf[[1234]]*)
28         TargetPlatform=alpha-dec-osf1;;
29 hppa1.1-hp-hpux*)
30         TargetPlatform=hppa1.1-hp-hpux;;
31 i[[3456]]86-*-linuxaout*)
32         TargetPlatform=i386-unknown-linuxaout;;
33 i[[3456]]86-*-linux*)
34         TargetPlatform=i386-unknown-linux;;
35 i[[3456]]86-*-freebsd*)
36         TargetPlatform=i386-unknown-freebsd;;
37 i[[3456]]86-*-netbsd*)
38         TargetPlatform=i386-unknown-netbsd;;
39 i[[3456]]86-*-solaris2*)
40         TargetPlatform=i386-unknown-solaris2;;
41 i[[3456]]86-*-cygwin32*)
42         exeext='.exe'
43         TargetPlatform=i386-unknown-cygwin32;;
44 m68k-next-nextstep2)
45         TargetPlatform=m68k-next-nextstep2;;
46 m68k-next-nextstep3)
47         TargetPlatform=m68k-next-nextstep3;;
48 i[[3456]]86-next-nextstep3)
49         TargetPlatform=i386-next-nextstep3;;
50 m68k-sun-sunos4*)
51         TargetPlatform=m68k-sun-sunos4;;
52 mips-dec-ultrix*)
53         TargetPlaformP=mips-dec-ultrix;;
54 mips-sgi-irix*)
55         TargetPlatform=mips-sgi-irix;;
56 powerpc-ibm-aix*)
57         TargetPlatform=powerpc-ibm-aix;;
58 rs6000-ibm-aix*)
59         TargetPlatform=rs6000-ibm-aix;;
60 sparc-sun-sunos4*)
61         TargetPlatform=sparc-sun-sunos4;;
62 sparc-sun-solaris2*)
63         TargetPlatform=sparc-sun-solaris2;;
64 *)
65         echo "Unrecognised platform: $TargetPlatform"
66         exit 1
67         ;;
68 esac
69 echo "Which we'll further canonicalise into: $TargetPlatform"
70
71 AC_SUBST(TargetPlatform)
72 AC_SUBST(exeext)
73
74 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
75 if test -z "$PerlCmd"; then
76     echo "You must install perl before you can continue"
77     echo "Perhaps it is already installed, but not in your PATH?"
78     echo ""
79     echo "Continuing, assuming perl will be available as: perl"
80 fi
81 #
82 dnl ** does #!.../perl work? (sometimes it's too long...)
83 echo "checking if \`#!$PerlCmd' works in shell scripts"
84 echo "#!$PerlCmd"'
85 exit $1;
86 ' > conftest
87 chmod u+x conftest
88 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
89 if test $? -ne 69; then
90    echo "It does!"
91 else
92    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max).."
93 fi
94 rm -f conftest
95
96 #
97 dnl ** figure out how to do a BSD-ish install **
98 #
99 AC_PROG_INSTALL
100
101 #
102 dnl ** how to do symlinks **
103 #
104 AC_PROG_LN_S()
105
106 #
107 dnl ** Find the path to sed **
108 #
109 AC_PATH_PROG(SedCmd,sed)
110
111 #
112 dnl ** How to invoke cpp directly **
113 #
114 AC_PROG_CC
115 AC_HAVE_GCC
116 AC_PROG_CPP
117 AC_PROG_GNUCPP
118
119 #
120 AC_OUTPUT(Makefile)
121
122 echo "****************************************************"
123 echo "Configuration done, ready to either 'make install'"
124 echo "or 'make in-place', followed by 'make install-docs'."
125 echo "(see README and INSTALL files for more info.)"
126 echo "****************************************************"