[project @ 1997-06-03 22:20:32 by andre]
[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 #
11 # First off, what system are we running under?
12 #
13 AC_CANONICAL_SYSTEM
14
15 dnl ** canonicalize platform names
16 # Canonicali[sz]e the platform name
17 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
18
19 #
20 # The following will be more difficult when we *are* cross-compiling.
21 # Suitable names to slam in *_CPP are in platform.h.in.
22 # We also record the architecture, vendor, and operating system (OS)
23 # separately.
24 case $TargetPlatform in
25 alpha-dec-osf[[1234]]*)
26         TargetPlatform=alpha-dec-osf1;;
27 hppa1.1-hp-hpux*)
28         TargetPlatform=hppa1.1-hp-hpux;;
29 i[[3456]]86-*-linuxaout*)
30         TargetPlatform=i386-unknown-linuxaout;;
31 i[[3456]]86-*-linux*)
32         TargetPlatform=i386-unknown-linux;;
33 i[[3456]]86-*-freebsd*)
34         TargetPlatform=i386-unknown-freebsd;;
35 i[[3456]]86-*-netbsd*)
36         TargetPlatform=i386-unknown-netbsd;;
37 i[[3456]]86-*-solaris2*)
38         TargetPlatform=i386-unknown-solaris2;;
39 i[[3456]]86-*-cygwin32*)
40         TargetPlatform=i386-unknown-cygwin32;;
41 m68k-next-nextstep2)
42         TargetPlatform=m68k-next-nextstep2;;
43 m68k-next-nextstep3)
44         TargetPlatform=m68k-next-nextstep3;;
45 i[[3456]]86-next-nextstep3)
46         TargetPlatform=i386-next-nextstep3;;
47 m68k-sun-sunos4*)
48         TargetPlatform=m68k-sun-sunos4;;
49 mips-dec-ultrix*)
50         TargetPlaformP=mips-dec-ultrix;;
51 mips-sgi-irix*)
52         TargetPlatform=mips-sgi-irix;;
53 powerpc-ibm-aix*)
54         TargetPlatform=powerpc-ibm-aix;;
55 rs6000-ibm-aix*)
56         TargetPlatform=rs6000-ibm-aix;;
57 sparc-sun-sunos4*)
58         TargetPlatform=sparc-sun-sunos4;;
59 sparc-sun-solaris2*)
60         TargetPlatform=sparc-sun-solaris2;;
61 *)
62         echo "Unrecognised platform: $TargetPlatform"
63         exit 1
64         ;;
65 esac
66 echo "Which we'll further canonicalise into: $TargetPlatform"
67
68 AC_SUBST(TargetPlatform)
69
70 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
71 if test -z "$PerlCmd"; then
72     echo "You must install perl before you can continue"
73     echo "Perhaps it is already installed, but not in your PATH?"
74     echo ""
75     echo "Continuing, assuming perl will be available as: perl"
76 fi
77 #
78 dnl ** does #!.../perl work? (sometimes it's too long...)
79 echo "checking if \`#!$PerlCmd' works in shell scripts"
80 echo "#!$PerlCmd"'
81 exit $1;
82 ' > conftest
83 chmod u+x conftest
84 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
85 if test $? -ne 69; then
86    echo "It does!"
87 else
88    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
89    exit 1
90 fi
91 rm -f conftest
92 #
93 dnl ** check if perl library is properly installed
94 # (by seeing if a "do 'getopts.pl'" works...
95 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
96     :
97 else
98     echo "I think your perl library is misinstalled."
99     echo "The following script did not work:"
100     echo '      do "getopts.pl" || exit(1); exit(0);'
101     echo "But, nevermind, let us continue.."
102 fi
103
104 dnl ** figure out how to do a BSD-ish install
105 #
106 AC_PROG_INSTALL
107 AC_PROG_LN_S()
108 #
109
110
111 AC_OUTPUT(Makefile)
112