[project @ 1998-02-05 12:23:33 by simonm]
[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[[12]]*)
28         TargetPlatform=alpha-dec-osf1;;
29 alpha-dec-osf[[34]]*)
30         TargetPlatform=alpha-dec-osf3;;
31 hppa1.1-hp-hpux*)
32         TargetPlatform=hppa1.1-hp-hpux;;
33 i[[3456]]86-*-linuxaout*)
34         TargetPlatform=i386-unknown-linuxaout;;
35 i[[3456]]86-*-linux*)
36         TargetPlatform=i386-unknown-linux;;
37 i[[3456]]86-*-freebsd*)
38         TargetPlatform=i386-unknown-freebsd;;
39 i[[3456]]86-*-netbsd*)
40         TargetPlatform=i386-unknown-netbsd;;
41 i[[3456]]86-*-solaris2*)
42         TargetPlatform=i386-unknown-solaris2;;
43 i[[3456]]86-*-cygwin32*)
44         exeext='.exe'
45         TargetPlatform=i386-unknown-cygwin32;;
46 m68k-next-nextstep2)
47         TargetPlatform=m68k-next-nextstep2;;
48 m68k-next-nextstep3)
49         TargetPlatform=m68k-next-nextstep3;;
50 i[[3456]]86-next-nextstep3)
51         TargetPlatform=i386-next-nextstep3;;
52 m68k-sun-sunos4*)
53         TargetPlatform=m68k-sun-sunos4;;
54 mips-dec-ultrix*)
55         TargetPlaformP=mips-dec-ultrix;;
56 mips-sgi-irix*)
57         TargetPlatform=mips-sgi-irix;;
58 powerpc-ibm-aix*)
59         TargetPlatform=powerpc-ibm-aix;;
60 rs6000-ibm-aix*)
61         TargetPlatform=rs6000-ibm-aix;;
62 sparc-sun-sunos4*)
63         TargetPlatform=sparc-sun-sunos4;;
64 sparc-sun-solaris2*)
65         TargetPlatform=sparc-sun-solaris2;;
66 *)
67         echo "Unrecognised platform: $TargetPlatform"
68         exit 1
69         ;;
70 esac
71 echo "Which we'll further canonicalise into: $TargetPlatform"
72
73 AC_SUBST(TargetPlatform)
74 AC_SUBST(exeext)
75
76 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
77 if test -z "$PerlCmd"; then
78     echo "You must install perl before you can continue"
79     echo "Perhaps it is already installed, but not in your PATH?"
80     echo ""
81     echo "Continuing, assuming perl will be available as: perl"
82 fi
83 #
84 dnl ** does #!.../perl work? (sometimes it's too long...)
85 echo "checking if \`#!$PerlCmd' works in shell scripts"
86 echo "#!$PerlCmd"'
87 exit $1;
88 ' > conftest
89 chmod u+x conftest
90 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
91 if test $? -ne 69; then
92    echo "It does!"
93 else
94    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max).."
95 fi
96 rm -f conftest
97
98 #
99 dnl ** figure out how to do a BSD-ish install **
100 #
101 AC_PROG_INSTALL
102
103 #
104 dnl ** how to do symlinks **
105 #
106 AC_PROG_LN_S()
107
108 #
109 dnl ** Find the path to sed **
110 #
111 AC_PATH_PROG(SedCmd,sed)
112
113 #
114 dnl ** How to invoke cpp directly **
115 #
116 AC_PROG_CC
117 AC_HAVE_GCC
118 AC_PROG_CPP
119 AC_PROG_GNUCPP
120
121 #
122 AC_OUTPUT(Makefile)
123
124 echo "****************************************************"
125 echo "Configuration done, ready to either 'make install'"
126 echo "or 'make in-place', followed by 'make install-docs'."
127 echo "(see README and INSTALL files for more info.)"
128 echo "****************************************************"