configure-bin.in 3.52 KB
Newer Older
1
2
3
4
5
6
dnl
dnl Binary distribution configure script
dnl
#!/bin/sh
#

sof's avatar
sof committed
7
# Is it there?
8
9
AC_INIT(Makefile.in)

sof's avatar
sof committed
10
11
exeext=''

12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# First off, what system are we running under?
#
AC_CANONICAL_SYSTEM

dnl ** canonicalize platform names
# Canonicali[sz]e the platform name
TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1

#
# The following will be more difficult when we *are* cross-compiling.
# Suitable names to slam in *_CPP are in platform.h.in.
# We also record the architecture, vendor, and operating system (OS)
# separately.
sof's avatar
sof committed
26
case $TargetPlatform in
27
alpha-dec-osf[[12]]*)
28
	TargetPlatform=alpha-dec-osf1;;
29
30
alpha-dec-osf[[34]]*)
	TargetPlatform=alpha-dec-osf3;;
31
32
33
34
alpha-unknown-linux)
	TargetPlatform=alpha-unknown-linux;;
alpha-unknown-freebsd*)
	TargetPlatform=alpha-unknown-freebsd;;
35
36
37
38
39
40
hppa1.1-hp-hpux*)
	TargetPlatform=hppa1.1-hp-hpux;;
i[[3456]]86-*-linuxaout*)
	TargetPlatform=i386-unknown-linuxaout;;
i[[3456]]86-*-linux*)
	TargetPlatform=i386-unknown-linux;;
41
42
i[[3456]]86-*-freebsd2*)
	TargetPlatform=i386-unknown-freebsd2;;
43
i[[3456]]86-*-freebsd[[3-9]]*)
44
	TargetPlatform=i386-unknown-freebsd;;
45
46
47
48
49
i[[3456]]86-*-netbsd*)
	TargetPlatform=i386-unknown-netbsd;;
i[[3456]]86-*-solaris2*)
	TargetPlatform=i386-unknown-solaris2;;
i[[3456]]86-*-cygwin32*)
sof's avatar
sof committed
50
	exeext='.exe'
51
	TargetPlatform=i386-unknown-cygwin32;;
sof's avatar
sof committed
52
53
54
55
56
57
58
59
60
i[[3456]]86-*-mingw32*)
	exeext='.exe'
	# We assume you're using mingw32 via the gcc that comes
	# with cygwin, and not the native port, so let's augment
	# the gcc command-line used here with -mno-cygwin to
	# arrange for good things to happen.
	CFLAGS="-mno-cygwin $CFLAGS"
	TargetPlatform=i386-unknown-mingw32
	;;
61
62
63
64
65
m68k-next-nextstep2)
	TargetPlatform=m68k-next-nextstep2;;
m68k-next-nextstep3)
	TargetPlatform=m68k-next-nextstep3;;
i[[3456]]86-next-nextstep3)
sof's avatar
sof committed
66
	TargetPlatform=i386-next-nextstep3;;
67
m68k-sun-sunos4*)
sof's avatar
sof committed
68
	TargetPlatform=m68k-sun-sunos4;;
69
70
71
72
73
74
mips-dec-ultrix*)
        TargetPlaformP=mips-dec-ultrix;;
mips-sgi-irix*)
	TargetPlatform=mips-sgi-irix;;
powerpc-ibm-aix*)
	TargetPlatform=powerpc-ibm-aix;;
75
76
rs6000-ibm-aix*)
	TargetPlatform=rs6000-ibm-aix;;
77
78
79
80
81
82
83
84
85
sparc-sun-sunos4*)
	TargetPlatform=sparc-sun-sunos4;;
sparc-sun-solaris2*)
	TargetPlatform=sparc-sun-solaris2;;
*)
        echo "Unrecognised platform: $TargetPlatform"
        exit 1
        ;;
esac
sof's avatar
sof committed
86
echo "Which we'll further canonicalise into: $TargetPlatform"
87

sof's avatar
sof committed
88
AC_SUBST(TargetPlatform)
sof's avatar
sof committed
89
AC_SUBST(exeext)
90
91
92
93
94

AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
if test -z "$PerlCmd"; then
    echo "You must install perl before you can continue"
    echo "Perhaps it is already installed, but not in your PATH?"
sof's avatar
sof committed
95
96
    echo ""
    echo "Continuing, assuming perl will be available as: perl"
97
98
99
100
101
102
103
104
105
106
107
108
fi
#
dnl ** does #!.../perl work? (sometimes it's too long...)
echo "checking if \`#!$PerlCmd' works in shell scripts"
echo "#!$PerlCmd"'
exit $1;
' > conftest
chmod u+x conftest
(SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
if test $? -ne 69; then
   echo "It does!"
else
sof's avatar
sof committed
109
   echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max).."
110
111
112
fi
rm -f conftest

sof's avatar
sof committed
113
114
#
dnl ** figure out how to do a BSD-ish install **
115
116
#
AC_PROG_INSTALL
sof's avatar
sof committed
117
118
119
120

#
dnl ** how to do symlinks **
#
sof's avatar
sof committed
121
AC_PROG_LN_S()
sof's avatar
sof committed
122
123
124

#
dnl ** Find the path to sed **
125
#
sof's avatar
sof committed
126
AC_PATH_PROG(SedCmd,sed)
127

sof's avatar
sof committed
128
129
130
#
dnl ** How to invoke cpp directly **
#
131
AC_PROG_CC
sof's avatar
sof committed
132
FPTOOLS_HAVE_GCC
133
AC_PROG_CPP
134

sof's avatar
sof committed
135
#
136
137
AC_OUTPUT(Makefile)

138
echo "****************************************************"
139
echo "Configuration done, ready to either 'make install'"
140
echo "or 'make in-place', followed by 'make install-docs'."
sof's avatar
sof committed
141
echo "(see README and INSTALL files for more info.)"
142
echo "****************************************************"