Fix bindist creation
[ghc-hetmet.git] / distrib / configure-bin.ac
1 dnl
2 dnl Binary distribution configure script
3 dnl
4 #!/bin/sh
5 #
6
7 # Is it there?
8 AC_INIT(Makefile-vars.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[[345]]*)
30         TargetPlatform=alpha-dec-osf3;;
31 alpha*-unknown-linux)
32         TargetPlatform=alpha-unknown-linux;;
33 alpha*-unknown-freebsd*)
34         TargetPlatform=alpha-unknown-freebsd;;
35 hppa1.1-hp-hpux*)
36         TargetPlatform=hppa1.1-hp-hpux;;
37 i[[3456]]86-*-linuxaout*)
38         TargetPlatform=i386-unknown-linuxaout;;
39 i[[3456]]86-*-linux*)
40         TargetPlatform=i386-unknown-linux;;
41 i[[3456]]86-*-freebsd2*)
42         TargetPlatform=i386-unknown-freebsd2;;
43 i[[3456]]86-*-freebsd[[3-9]]*)
44         TargetPlatform=i386-unknown-freebsd;;
45 i[[3456]]86-*-netbsd*)
46         TargetPlatform=i386-unknown-netbsd;;
47 i[[3456]]86-*-openbsd*)
48         TargetPlatform=i386-unknown-openbsd;;
49 i[[3456]]86-*-solaris2*)
50         TargetPlatform=i386-unknown-solaris2;;
51 i[[3456]]86-*-cygwin*)
52         exeext='.exe'
53         TargetPlatform=i386-unknown-cygwin32;;
54 i[[3456]]86-*-mingw32*)
55         exeext='.exe'
56         # We assume you're using mingw32 via the gcc that comes
57         # with cygwin, and not the native port, so let's augment
58         # the gcc command-line used here with -mno-cygwin -mwin32
59         # to arrange for good things to happen.
60         CFLAGS="-mno-cygwin -mwin32 $CFLAGS"
61         TargetPlatform=i386-unknown-mingw32
62         ;;
63 i[[3456]]86-apple-darwin*)
64         TargetPlatform=i386-apple-darwin;;
65 m68k-next-nextstep2)
66         TargetPlatform=m68k-next-nextstep2;;
67 m68k-next-nextstep3)
68         TargetPlatform=m68k-next-nextstep3;;
69 i[[3456]]86-next-nextstep3)
70         TargetPlatform=i386-next-nextstep3;;
71 m68k-sun-sunos4*)
72         TargetPlatform=m68k-sun-sunos4;;
73 mips-dec-ultrix*)
74         TargetPlaformP=mips-dec-ultrix;;
75 mips-sgi-irix*)
76         TargetPlatform=mips-sgi-irix;;
77 powerpc-ibm-aix*)
78         TargetPlatform=powerpc-ibm-aix;;
79 rs6000-ibm-aix*)
80         TargetPlatform=rs6000-ibm-aix;;
81 powerpc-apple-darwin*)
82         TargetPlatform=powerpc-apple-darwin;;
83 powerpc-*-linux*)
84         TargetPlatform=powerpc-unknown-linux;;
85 powerpc64-*-linux*)
86         TargetPlatform=powerpc64-unknown-linux;;
87 sparc-sun-sunos4*)
88         TargetPlatform=sparc-sun-sunos4;;
89 sparc-sun-solaris2*)
90         TargetPlatform=sparc-sun-solaris2;;
91 x86_64-*-linux*)
92         TargetPlatform=x86_64-unknown-linux;;
93 x86_64-*-freebsd*)
94         TargetPlatform=x86_64-unknown-freebsd;;
95 x86_64-*-openbsd*)
96         TargetPlatform=x86_64-unknown-openbsd;;
97 x86_64-*-netbsd*)
98         TargetPlatform=x86_64-unknown-netbsd;;
99 x86_64-apple-darwin*)
100         TargetPlatform=x86_64-apple-darwin;;
101 *)
102         echo "Unrecognised platform: $TargetPlatform"
103         exit 1
104         ;;
105 esac
106 echo "Which we'll further canonicalise into: $TargetPlatform"
107
108 AC_SUBST(TargetPlatform)
109 AC_SUBST(exeext)
110
111 FP_FIND_ROOT
112
113 #
114 dnl ** Check Perl installation **
115 #
116 AC_PATH_PROG(PerlCmd,perl)
117 if test -z "$PerlCmd"; then
118    echo "You must install perl before you can continue"
119    echo "Perhaps it is already installed, but not in your PATH?"
120    exit 1
121 fi
122 FPTOOLS_SHEBANG_PERL
123
124 #
125 dnl ** figure out how to do a BSD-ish install **
126 #
127 AC_PROG_INSTALL
128
129 #
130 dnl ** how to do symlinks **
131 #
132 AC_PROG_LN_S()
133
134 #
135 dnl ** Find the path to sed **
136 #
137 AC_PATH_PROG(SedCmd,sed)
138
139 #
140 dnl ** How to invoke cpp directly **
141 #
142 FP_HAVE_GCC
143 AC_PROG_CPP
144
145 #
146 AC_OUTPUT(Makefile-vars)
147
148 echo "****************************************************"
149 echo "Configuration done, ready to either 'make install'"
150 echo "or 'make in-place'."
151 echo "(see README and INSTALL files for more info.)"
152 echo "****************************************************"