[project @ 1997-03-23 22:28:03 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 #
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 sparc-sun-sunos4*)
56         TargetPlatform=sparc-sun-sunos4;;
57 sparc-sun-solaris2*)
58         TargetPlatform=sparc-sun-solaris2;;
59 *)
60         echo "Unrecognised platform: $TargetPlatform"
61         exit 1
62         ;;
63 esac
64 echo "Which we'll further canonicalise into: $TargetPlatform"
65
66 AC_SUBST(TargetPlatform)
67
68 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
69 if test -z "$PerlCmd"; then
70     echo "You must install perl before you can continue"
71     echo "Perhaps it is already installed, but not in your PATH?"
72     echo ""
73     echo "Continuing, assuming perl will be available as: perl"
74 fi
75 #
76 dnl ** does #!.../perl work? (sometimes it's too long...)
77 echo "checking if \`#!$PerlCmd' works in shell scripts"
78 echo "#!$PerlCmd"'
79 exit $1;
80 ' > conftest
81 chmod u+x conftest
82 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
83 if test $? -ne 69; then
84    echo "It does!"
85 else
86    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
87    exit 1
88 fi
89 rm -f conftest
90 #
91 dnl ** check if perl library is properly installed
92 # (by seeing if a "do 'getopts.pl'" works...
93 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
94     :
95 else
96     echo "I think your perl library is misinstalled."
97     echo "The following script did not work:"
98     echo '      do "getopts.pl" || exit(1); exit(0);'
99     echo "But, nevermind, let us continue.."
100 fi
101
102 dnl ** figure out how to do a BSD-ish install
103 #
104 AC_PROG_INSTALL
105 AC_PROG_LN_S()
106 #
107
108
109 AC_OUTPUT(Makefile)
110