summaryrefslogtreecommitdiff
path: root/configure.in
blob: ff28fde5bdcf2d149fc57c897d8c689621251f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$Id: configure.in,v 1.12 1998/04/23 00:52:19 tb Exp $])
AC_PREREQ(2.4)			dnl Minimum Autoconf version required.
AC_INIT(hurd/hurd_types.h)	dnl A distinctive file to look for in srcdir.

AC_PREFIX_DEFAULT()		dnl Default to empty prefix, not /usr/local.

AC_CANONICAL_HOST
case "$host_os" in
gnu*) ;;
*) AC_MSG_ERROR([sorry, this is the gnu os, not $host_os]) ;;
esac

case "$host_cpu" in
i[[3456]]86)
	asm_syntax=i386
	;;
*) AC_MSG_ERROR([unspported CPU type]) ;;
esac
AC_SUBST(asm_syntax)

AC_PROG_INSTALL

AC_CHECK_TOOL(CC, gcc)
# That check handles cross-compilation well, but AC_PROG_CC tests for GCC
# and sets default CFLAGS nicely for us, so do that too.
AC_PROG_CC_LOCAL
# Require GCC.
if test x$GCC != xyes; then
  AC_MSG_ERROR([this code uses GNU C extensions, you must compile with GCC])
fi

AC_CHECK_TOOL(LD, ld)
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib)
AC_CHECK_TOOL(MIG, mig)

dnl Let these propagate from the environment.
AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS)

# See if there's a separate libcrypt (many systems put crypt there)
AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt)
AC_SUBST(LIBCRYPT)
# Look for the crypt function itself (in libcrypt if possible)
_SAVE_LIBS="$LIBS"
LIBS="$LIBCRYPT $LIBS"
AC_CHECK_FUNCS(crypt)
LIBS="$_SAVE_LIBS"

if test -f ./$ac_unique_file; then
  # Configuring in source directory; don't create any Makefiles.
  makefiles=
else
  # We are configuring in a separate build tree.
  # Create a Makefile in the top-level build directory and
  # one for each subdirectory Makefile in the source.
  makefiles="Makeconf:build.mkcf.in \
	     `cd $srcdir; for file in Makefile */Makefile; do \
			    echo ${file}:build.mk.in; done`"
fi

AC_OUTPUT(config.make ${makefiles})

dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "autoconf"
dnl End: