[project @ 1999-09-16 10:25:31 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[[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-*-freebsd2*)
38         TargetPlatform=i386-unknown-freebsd2;;
39 i[[3456]]86-*-freebsd3*)
40         TargetPlatform=i386-unknown-freebsd3;;
41 i[[3456]]86-*-netbsd*)
42         TargetPlatform=i386-unknown-netbsd;;
43 i[[3456]]86-*-solaris2*)
44         TargetPlatform=i386-unknown-solaris2;;
45 i[[3456]]86-*-cygwin32*)
46         exeext='.exe'
47         TargetPlatform=i386-unknown-cygwin32;;
48 i[[3456]]86-*-mingw32*)
49         exeext='.exe'
50         # We assume you're using mingw32 via the gcc that comes
51         # with cygwin, and not the native port, so let's augment
52         # the gcc command-line used here with -mno-cygwin to
53         # arrange for good things to happen.
54         CFLAGS="-mno-cygwin $CFLAGS"
55         TargetPlatform=i386-unknown-mingw32
56         ;;
57 m68k-next-nextstep2)
58         TargetPlatform=m68k-next-nextstep2;;
59 m68k-next-nextstep3)
60         TargetPlatform=m68k-next-nextstep3;;
61 i[[3456]]86-next-nextstep3)
62         TargetPlatform=i386-next-nextstep3;;
63 m68k-sun-sunos4*)
64         TargetPlatform=m68k-sun-sunos4;;
65 mips-dec-ultrix*)
66         TargetPlaformP=mips-dec-ultrix;;
67 mips-sgi-irix*)
68         TargetPlatform=mips-sgi-irix;;
69 powerpc-ibm-aix*)
70         TargetPlatform=powerpc-ibm-aix;;
71 rs6000-ibm-aix*)
72         TargetPlatform=rs6000-ibm-aix;;
73 sparc-sun-sunos4*)
74         TargetPlatform=sparc-sun-sunos4;;
75 sparc-sun-solaris2*)
76         TargetPlatform=sparc-sun-solaris2;;
77 *)
78         echo "Unrecognised platform: $TargetPlatform"
79         exit 1
80         ;;
81 esac
82 echo "Which we'll further canonicalise into: $TargetPlatform"
83
84 AC_SUBST(TargetPlatform)
85 AC_SUBST(exeext)
86
87 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
88 if test -z "$PerlCmd"; then
89     echo "You must install perl before you can continue"
90     echo "Perhaps it is already installed, but not in your PATH?"
91     echo ""
92     echo "Continuing, assuming perl will be available as: perl"
93 fi
94 #
95 dnl ** does #!.../perl work? (sometimes it's too long...)
96 echo "checking if \`#!$PerlCmd' works in shell scripts"
97 echo "#!$PerlCmd"'
98 exit $1;
99 ' > conftest
100 chmod u+x conftest
101 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
102 if test $? -ne 69; then
103    echo "It does!"
104 else
105    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max).."
106 fi
107 rm -f conftest
108
109 #
110 dnl ** figure out how to do a BSD-ish install **
111 #
112 AC_PROG_INSTALL
113
114 #
115 dnl ** how to do symlinks **
116 #
117 AC_PROG_LN_S()
118
119 #
120 dnl ** Find the path to sed **
121 #
122 AC_PATH_PROG(SedCmd,sed)
123
124 #
125 dnl ** How to invoke cpp directly **
126 #
127 AC_PROG_CC
128 FPTOOLS_HAVE_GCC
129 AC_PROG_CPP
130
131 #
132 AC_OUTPUT(Makefile)
133
134 echo "****************************************************"
135 echo "Configuration done, ready to either 'make install'"
136 echo "or 'make in-place', followed by 'make install-docs'."
137 echo "(see README and INSTALL files for more info.)"
138 echo "****************************************************"