summaryrefslogtreecommitdiff
path: root/configure.in
blob: 1f1e20e80eb03870fe3459dff4e23aa6e57151f8 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
dnl Configure script for GNU Mach.
dnl Copyright 1997, 1998, 1999 Free Software Foundation, Inc.

dnl Permission to use, copy, modify and distribute this software and its
dnl documentation is hereby granted, provided that both the copyright
dnl notice and this permission notice appear in all copies of the
dnl software, derivative works or modified versions, and any portions
dnl thereof, and that both notices appear in supporting documentation.
dnl
dnl THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
dnl "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
dnl USE OF THIS SOFTWARE.

AC_INIT(kern/ipc_kobject.c)
AC_PREREQ(2.12)
AC_CONFIG_HEADER(config.h)

VERSION=1.90
AC_SUBST(VERSION)

#
# Deduce output var `systype' from configuration parms.
#
AC_CANONICAL_HOST

case "$host_cpu" in
alpha*) systype=alpha ;;
i[[3456]]86) systype=i386 ;;
*) AC_MSG_ERROR([unsupported CPU type]) ;;
esac

AC_SUBST(systype)
AC_SUBST(cross_compiling)

# Default prefix is / for the kernel.
AC_PREFIX_DEFAULT()

#
# Options
#
AC_ARG_ENABLE(force-install,
[  --enable-force-install  force installation of files from this package,
			   even if they are older than the installed files],
	      force_install=$enableval, force_install=no)
AC_SUBST(force_install)

AC_ARG_ENABLE(smp,
[  --enable-smp=MAXCPUS    enable SMP with up to MAXCPUS processors])
case "x${enable_smp-no}" in
xno) MAXCPUS=1 ;;
xyes) AC_MSG_WARN([defaulting to max 4 CPUs; use --enable-smp=MAXCPUS])
      MAXCPUS=4 ;;
x[[1-9]]*) MAXCPUS="${enable_smp}" ;;
*) AC_MSG_ERROR([must give a numeric argument to --enable-smp]) ;;
esac
AC_DEFINE_UNQUOTED(NCPUS, $MAXCPUS)

AC_ARG_ENABLE(fpe,
[  --enable-fpe		  enable FPU emulator for machines with no FPU],
[test "x$enableval" = xno || AC_DEFINE(FPE)])

#
# Programs
#

AC_PROG_INSTALL
AC_PROG_AWK

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

AC_CHECK_TOOL(LD, ld)AC_SUBST(LDFLAGS)
AC_CHECK_TOOL(NM, nm)

AC_CHECK_TOOL(MIG, mig, mig)

AC_CHECK_PROG(MBCHK, mbchk, mbchk, :)

# Check oskit version.
NEEDED_OSKIT_VERSION=19991121
AC_REQUIRE_CPP()
AC_MSG_CHECKING([for oskit version >= ${NEEDED_OSKIT_VERSION}])
AC_CACHE_VAL(gnumach_cv_oskit_version_${NEEDED_OSKIT_VERSION}, [
AC_TRY_CPP([#include <oskit/version.h>
#if _OSKIT_VERSION < ${NEEDED_OSKIT_VERSION}
 #error _OSKIT_VERSION < ${NEEDED_OSKIT_VERSION}
#endif], eval gnumach_cv_oskit_version_${NEEDED_OSKIT_VERSION}=yes,
eval gnumach_cv_oskit_version_${NEEDED_OSKIT_VERSION}=no)])
if eval test \$gnumach_cv_oskit_version_${NEEDED_OSKIT_VERSION} != yes; then
  AC_MSG_RESULT([no, too old!])
  AC_MSG_ERROR([version in <oskit/version.h> less than required ${NEEDED_OSKIT_VERSION}])
else
  AC_MSG_RESULT([yes, ok])
fi

AC_CHECK_HEADERS(oskit/dev/stream.h)

AC_CHECK_LIB(oskit_dev, oskit_dev_init_i8042, [AC_DEFINE(HAVE_I8042)], [],
	     [-loskit_lmm -loskit_clientos -loskit_c -loskit_kern -loskit_com])

AC_SUBST(SMP_LIBS)SMP_LIBS=
if test $MAXCPUS -gt 1; then
  AC_CHECK_LIB(oskit_smp, smp_init, [SMP_LIBS=-loskit_smp], [
    AC_MSG_ERROR([need -loskit_smp library to build multiprocessor kernel])
  ])
fi

# Set up `machine' link in build directory for easier header file location.
AC_LINK_FILES(${systype}/${systype},machine)

test "x${OSKIT_LIBDIR+set}" = xset ||
  OSKIT_LIBDIR=`${CC} -print-file-name=oskit`
AC_SUBST(OSKIT_LIBDIR)

AC_OUTPUT(Makefile version.c doc/Makefile)