summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog96
-rw-r--r--Makefile.correct_output_files_for_.S_files.patch18
-rw-r--r--Makerules.am2
-rw-r--r--bogus/bootstrap_symbols.h1
-rw-r--r--bogus/cpus.h27
-rw-r--r--bogus/fast_tas.h1
-rw-r--r--bogus/hw_footprint.h1
-rw-r--r--bogus/mach_counters.h1
-rw-r--r--bogus/mach_debug.h1
-rw-r--r--bogus/mach_fixpri.h1
-rw-r--r--bogus/mach_host.h1
-rw-r--r--bogus/mach_ipc_compat.h1
-rw-r--r--bogus/mach_ipc_debug.h1
-rw-r--r--bogus/mach_ipc_test.h1
-rw-r--r--bogus/mach_kdb.h3
-rw-r--r--bogus/mach_ldebug.h1
-rw-r--r--bogus/mach_lock_mon.h1
-rw-r--r--bogus/mach_machine_routines.h1
-rw-r--r--bogus/mach_mp_debug.h1
-rw-r--r--bogus/mach_pagemap.h1
-rw-r--r--bogus/mach_pcsample.h1
-rw-r--r--bogus/mach_ttd.h1
-rw-r--r--bogus/mach_vm_debug.h1
-rw-r--r--bogus/power_save.h1
-rw-r--r--bogus/simple_clock.h1
-rw-r--r--bogus/stat_time.h1
-rw-r--r--bogus/xpr_debug.h1
-rw-r--r--config.status.dep.patch11
-rw-r--r--configfrag.ac137
-rw-r--r--configure.ac277
-rw-r--r--i386/Makerules.in46
-rw-r--r--i386/bogus/com.h2
-rw-r--r--i386/bogus/fpe.h2
-rw-r--r--i386/bogus/lpr.h1
-rw-r--r--i386/bogus/mach_machine_routines.h1
-rw-r--r--i386/bogus/platforms.h1
-rw-r--r--i386/bogus/rc.h16
-rw-r--r--i386/configfrag.ac71
-rw-r--r--tests/configfrag.ac26
39 files changed, 579 insertions, 180 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c08401..6407eab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,102 @@
[task #5956 --- ``Automake'ify GNU Mach's code base'']
+ * configfrag.ac: New file.
+ * tests/configfrag.ac: Likewise.
+ * Makerules.am (DEFINES): Convert those into...
+ * configfrag.ac: ... AC_DEFINE instantiations.
+ * i386/Makerules.in (DEFINES): Convert those into...
+ * i386/configfrag.ac: ... AC_DEFINE instantiations.
+ * i386/Makerules.in: Remove file.
+ * i386/configfrag.ac (AC_PREREQ, AC_INIT, AC_CONFIG_SRCDIR)
+ (AC_CONFIG_SUBDIRS, AC_CONFIG_FILES, AC_OUTPUT): Don't invoke.
+ (../version.m4): Don't include.
+ (--disable-lpr): Rework configuration option.
+ (--disable-default-device-drivers): Move configuration option to...
+ * configfrag.ac: ... here.
+ * configure.ac (AC_CONFIG_AUX_DIR, AM_INIT_AUTOMAKE): Instantiate.
+ (AC_PREFIX_DEFAULT, AC_CONFIG_SUBDIRS): Don't invoke.
+ <Output variable `systype'>: Rework the whole section.
+ <Options> (--enable-kdb, --disable-kmsg): Move into `configfrag.ac' and
+ adopt.
+ <Programs> (AM_PROG_AS, AM_PROG_CC_C_O): Instantiate.
+ (AC_CHECK_PROG): Move instantiation searching for a `mbchk' program
+ into `tests/configfrag.ac'.
+ (AC_CHECK_PROG): Instantiate to search for a `patch' program.
+ <configure fragments> (tests/configfrag.ac, configfrag.ac)
+ (linux/configfrag.ac): Include files.
+ (i386/configfrag.ac): Include file if appropriate.
+ (AC_CONFIG_HEADER): Instantiate for `config.h'.
+ (AC_CONFIG_FILES): Remove `Makerules' and `doc/Makefile'.
+ (AC_CONFIG_COMMANDS_POST): Instantiate for `config.status.dep.patch'.
+ (AC_CONFIG_COMMANDS): Instantiate for
+ `Makefile.correct_output_files_for_.S_files.patch' and (the
+ nonexistent) `Makefile.dependency_tracking_for_.S_files.patch'.
+ * Makefile.dependency_tracking_for_.S_files.patch: New file.
+ * config.status.dep.patch: Likewise.
+ * bogus/bootstrap_symbols.h: Remove file.
+ * configfrag.ac: AC_DEFINE `BOOTSTRAP_SYMBOLS' to `0'.
+ * bogus/cpus.h: Remove file.
+ * configfrag.ac: AC_DEFINE `NCPUS' to `1'. AH_TEMPLATE
+ `MULTIPROCESSOR'.
+ * bogus/fast_tas.h: Remove file.
+ * configfrag.ac: AC_DEFINE `FAST_TAS' to `0'.
+ * bogus/hw_footprint.h: Remove file.
+ * configfrag.ac: AC_DEFINE `HW_FOOTPRINT' to `0'.
+ * bogus/mach_counters.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_COUNTERS' to `0'.
+ * bogus/mach_debug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_DEBUG' to `1'.
+ * bogus/mach_fixpri.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_FIXPRI' to `1'.
+ * bogus/mach_host.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_HOST' to `0'.
+ * bogus/mach_ipc_compat.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_IPC_COMPAT' to `1'.
+ * bogus/mach_ipc_debug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_IPC_DEBUG' to `1'.
+ * bogus/mach_ipc_test.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_IPC_TEST' to `0'.
+ * bogus/mach_kdb.h: Remove file.
+ * configfrag.ac (--disable-kdb): AC_DEFINE `MACH_KDB' to `0'.
+ * bogus/mach_ldebug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_LDEBUG' to `0'.
+ * bogus/mach_lock_mon.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_LOCK_MON' to `0'.
+ * bogus/mach_machine_routines.h: Remove file.
+ * configfrag.ac: Add comment about not AC_DEFINEing
+ `MACH_MACHINE_ROUTINES' to `0'.
+ * bogus/mach_mp_debug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_MP_DEBUG' to `0'.
+ * bogus/mach_pagemap.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_PAGEMAP' to `1'.
+ * bogus/mach_pcsample.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_PCSAMPLE' to `1'.
+ * bogus/mach_ttd.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_TTD' to `0'.
+ * bogus/mach_vm_debug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `MACH_VM_DEBUG' to `1'.
+ * bogus/power_save.h: Remove file.
+ * configfrag.ac: AC_DEFINE `POWER_SAVE' to `1'.
+ * bogus/simple_clock.h: Remove file.
+ * configfrag.ac: AC_DEFINE `SIMPLE_CLOCK' to `0'.
+ * bogus/stat_time.h: Remove file.
+ * configfrag.ac: AC_DEFINE `STAT_TIME' to `1'.
+ * bogus/xpr_debug.h: Remove file.
+ * configfrag.ac: AC_DEFINE `XPR_DEBUG' to `1'.
+ * i386/bogus/com.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `NCOM' to `4'.
+ * i386/bogus/fpe.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `FPE' to `0'.
+ * i386/bogus/lpr.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `NLPR' to `1'.
+ * i386/bogus/mach_machine_routines.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `MACH_MACHINE_ROUTINES' to `1'.
+ * i386/bogus/platforms.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `AT386' to `1'.
+ * i386/bogus/rc.h: Remove file.
+ * i386/configfrag.ac: AC_DEFINE `RCLINE' to `-1' and `RCADDR' to `0x3f8'.
+
* Makerules.in: Move file...
* Makerules.am: ... here.
diff --git a/Makefile.correct_output_files_for_.S_files.patch b/Makefile.correct_output_files_for_.S_files.patch
new file mode 100644
index 0000000..eb0c365
--- /dev/null
+++ b/Makefile.correct_output_files_for_.S_files.patch
@@ -0,0 +1,18 @@
+--- Makefile.save 2006-10-09 23:43:54.000000000 +0200
++++ Makefile 2006-10-09 23:57:00.000000000 +0200
+@@ -1864,6 +1864,6 @@
+ $(SHELL) ./config.status;; \
+ *) \
+- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ frob_Makefile_for_correct_output_files_for_.S_files $(am__depfiles_maybe)'; \
++ cd $(top_builddir) && $(SHELL) ./config.status $@ frob_Makefile_for_correct_output_files_for_.S_files $(am__depfiles_maybe);; \
+ esac;
+
+@@ -3520,5 +3520,5 @@
+
+ .S.o:
+- $(CCASCOMPILE) -c $<
++ $(CCASCOMPILE) -c -o $@ $<
+
+ .S.obj:
diff --git a/Makerules.am b/Makerules.am
index ce15497..10f6c75 100644
--- a/Makerules.am
+++ b/Makerules.am
@@ -56,8 +56,6 @@ include $(abs_top_builddir)/$(systype)/Makerules
DEFS += $(DEFS-common)
-DEFINES += $(DEFS) -DMACH -DCMU -DMACH_KERNEL -DKERNEL
-
INCLUDES += -I$(abs_top_builddir) -I$(abs_top_srcdir) \
-I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/$(systype) \
-I$(abs_top_srcdir)/$(systype)/include/mach/sa \
diff --git a/bogus/bootstrap_symbols.h b/bogus/bootstrap_symbols.h
deleted file mode 100644
index 77dcfc2..0000000
--- a/bogus/bootstrap_symbols.h
+++ /dev/null
@@ -1 +0,0 @@
-#define BOOTSTRAP_SYMBOLS 0
diff --git a/bogus/cpus.h b/bogus/cpus.h
deleted file mode 100644
index 355ecdb..0000000
--- a/bogus/cpus.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 1995 The University of Utah and
- * the Computer Systems Laboratory at the University of Utah (CSL).
- * All rights reserved.
- *
- * Permission to use, copy, modify and distribute this software is hereby
- * granted provided that (1) source code retains these copyright, permission,
- * and disclaimer notices, and (2) redistributions including binaries
- * reproduce the notices in supporting documentation, and (3) all advertising
- * materials mentioning features or use of this software display the following
- * acknowledgement: ``This product includes software developed by the
- * Computer Systems Laboratory at the University of Utah.''
- *
- * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
- * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
- * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * CSL requests users of this software to return to csl-dist@cs.utah.edu any
- * improvements that they make and grant CSL redistribution rights.
- *
- * Author: Bryan Ford, University of Utah CSL
- */
-
-/* Default cpus.h sets things up for a uniprocessor. */
-#define NCPUS 1
-#undef MULTIPROCESSOR
-
diff --git a/bogus/fast_tas.h b/bogus/fast_tas.h
deleted file mode 100644
index 0fcb107..0000000
--- a/bogus/fast_tas.h
+++ /dev/null
@@ -1 +0,0 @@
-#define FAST_TAS 0
diff --git a/bogus/hw_footprint.h b/bogus/hw_footprint.h
deleted file mode 100644
index c3e8eb3..0000000
--- a/bogus/hw_footprint.h
+++ /dev/null
@@ -1 +0,0 @@
-#define HW_FOOTPRINT 0
diff --git a/bogus/mach_counters.h b/bogus/mach_counters.h
deleted file mode 100644
index d2ac85a..0000000
--- a/bogus/mach_counters.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_COUNTERS 0
diff --git a/bogus/mach_debug.h b/bogus/mach_debug.h
deleted file mode 100644
index cc309b1..0000000
--- a/bogus/mach_debug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_DEBUG 1
diff --git a/bogus/mach_fixpri.h b/bogus/mach_fixpri.h
deleted file mode 100644
index f3dc988..0000000
--- a/bogus/mach_fixpri.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_FIXPRI 1
diff --git a/bogus/mach_host.h b/bogus/mach_host.h
deleted file mode 100644
index 0fc2b44..0000000
--- a/bogus/mach_host.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_HOST 0
diff --git a/bogus/mach_ipc_compat.h b/bogus/mach_ipc_compat.h
deleted file mode 100644
index f6ce886..0000000
--- a/bogus/mach_ipc_compat.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_IPC_COMPAT 1
diff --git a/bogus/mach_ipc_debug.h b/bogus/mach_ipc_debug.h
deleted file mode 100644
index 035c596..0000000
--- a/bogus/mach_ipc_debug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_IPC_DEBUG 1
diff --git a/bogus/mach_ipc_test.h b/bogus/mach_ipc_test.h
deleted file mode 100644
index e089191..0000000
--- a/bogus/mach_ipc_test.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_IPC_TEST 0
diff --git a/bogus/mach_kdb.h b/bogus/mach_kdb.h
deleted file mode 100644
index 51d16aa..0000000
--- a/bogus/mach_kdb.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifndef MACH_KDB
-#define MACH_KDB 0
-#endif
diff --git a/bogus/mach_ldebug.h b/bogus/mach_ldebug.h
deleted file mode 100644
index e82f400..0000000
--- a/bogus/mach_ldebug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_LDEBUG 0
diff --git a/bogus/mach_lock_mon.h b/bogus/mach_lock_mon.h
deleted file mode 100644
index c218f14..0000000
--- a/bogus/mach_lock_mon.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_LOCK_MON 0
diff --git a/bogus/mach_machine_routines.h b/bogus/mach_machine_routines.h
deleted file mode 100644
index 1f510f9..0000000
--- a/bogus/mach_machine_routines.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_MACHINE_ROUTINES 0
diff --git a/bogus/mach_mp_debug.h b/bogus/mach_mp_debug.h
deleted file mode 100644
index b396db7..0000000
--- a/bogus/mach_mp_debug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_MP_DEBUG 0
diff --git a/bogus/mach_pagemap.h b/bogus/mach_pagemap.h
deleted file mode 100644
index debeed7..0000000
--- a/bogus/mach_pagemap.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_PAGEMAP 1
diff --git a/bogus/mach_pcsample.h b/bogus/mach_pcsample.h
deleted file mode 100644
index ba9db4d..0000000
--- a/bogus/mach_pcsample.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_PCSAMPLE 1
diff --git a/bogus/mach_ttd.h b/bogus/mach_ttd.h
deleted file mode 100644
index b57ea75..0000000
--- a/bogus/mach_ttd.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_TTD 0
diff --git a/bogus/mach_vm_debug.h b/bogus/mach_vm_debug.h
deleted file mode 100644
index b746dca..0000000
--- a/bogus/mach_vm_debug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_VM_DEBUG 1
diff --git a/bogus/power_save.h b/bogus/power_save.h
deleted file mode 100644
index ee9a520..0000000
--- a/bogus/power_save.h
+++ /dev/null
@@ -1 +0,0 @@
-#define POWER_SAVE 1
diff --git a/bogus/simple_clock.h b/bogus/simple_clock.h
deleted file mode 100644
index ccb3cbe..0000000
--- a/bogus/simple_clock.h
+++ /dev/null
@@ -1 +0,0 @@
-#define SIMPLE_CLOCK 0
diff --git a/bogus/stat_time.h b/bogus/stat_time.h
deleted file mode 100644
index abf9b3f..0000000
--- a/bogus/stat_time.h
+++ /dev/null
@@ -1 +0,0 @@
-#define STAT_TIME 1
diff --git a/bogus/xpr_debug.h b/bogus/xpr_debug.h
deleted file mode 100644
index f4d627a..0000000
--- a/bogus/xpr_debug.h
+++ /dev/null
@@ -1 +0,0 @@
-#define XPR_DEBUG 1
diff --git a/config.status.dep.patch b/config.status.dep.patch
new file mode 100644
index 0000000..c14b6ea
--- /dev/null
+++ b/config.status.dep.patch
@@ -0,0 +1,11 @@
+--- config.status.save 2006-10-09 22:28:47.000000000 +0200
++++ config.status 2006-10-09 22:29:34.000000000 +0200
+@@ -1610,7 +1610,7 @@
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+- echo '# dummy' > "$dirpart/$file"
++ echo 'Makefile: $(filter-out $(DIST_SOURCES),$(SOURCES))' > "$dirpart/$file"
+ done
+ done
+ ;;
diff --git a/configfrag.ac b/configfrag.ac
new file mode 100644
index 0000000..03ba7b3
--- /dev/null
+++ b/configfrag.ac
@@ -0,0 +1,137 @@
+dnl Configure fragment for general options.
+
+dnl Copyright 2006 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.
+
+#
+# Definitions.
+#
+
+AC_DEFINE([MACH], [1], [MACH])
+AC_DEFINE([CMU], [1], [CMU])
+AC_DEFINE([MACH_KERNEL], [1], [MACH_KERNEL])
+AC_DEFINE([KERNEL], [1], [KERNEL])
+
+#
+# Formerly in `bogus/'.
+#
+
+# bogus/bootstrap_symbols.h
+AC_DEFINE([BOOTSTRAP_SYMBOLS], [0], [BOOTSTRAP_SYMBOLS])
+
+# bogus/cpus.h
+AC_DEFINE([NCPUS], [1], [set things up for a uniprocessor])
+AH_TEMPLATE([MULTIPROCESSOR], [set things up for a uniprocessor])
+
+# bogus/fast_tas.h
+AC_DEFINE([FAST_TAS], [0], [FAST_TAS])
+
+# bogus/hw_footprint.h
+AC_DEFINE([HW_FOOTPRINT], [0], [HW_FOOTPRINT])
+
+# bogus/mach_counters.h
+AC_DEFINE([MACH_COUNTERS], [0], [MACH_COUNTERS])
+
+# bogus/mach_debug.h
+AC_DEFINE([MACH_DEBUG], [1], [MACH_DEBUG])
+
+# bogus/mach_fixpri.h
+AC_DEFINE([MACH_FIXPRI], [1], [MACH_FIXPRI])
+
+# bogus/mach_host.h
+AC_DEFINE([MACH_HOST], [0], [MACH_HOST])
+
+# bogus/mach_ipc_compat.h
+AC_DEFINE([MACH_IPC_COMPAT], [1], [MACH_IPC_COMPAT])
+
+# bogus/mach_ipc_debug.h
+AC_DEFINE([MACH_IPC_DEBUG], [1], [MACH_IPC_DEBUG])
+
+# bogus/mach_ipc_test.h
+AC_DEFINE([MACH_IPC_TEST], [0], [MACH_IPC_TEST])
+
+# bogus/mach_ldebug.h
+AC_DEFINE([MACH_LDEBUG], [0], [MACH_LDEBUG])
+
+# bogus/mach_lock_mon.h
+AC_DEFINE([MACH_LOCK_MON], [0], [MACH_LOCK_MON])
+
+# bogus/mach_machine_routines.h
+# TODO. Defining a default value here and potentially overriding it later
+# might or might not work. See
+# <http://lists.gnu.org/archive/html/autoconf/2006-10/msg00005.html>. So,
+# comment this out so that the i386-specific one will be used instead. Doesn't
+# do any harm as we're i386-only so far.
+#AC_DEFINE([MACH_MACHINE_ROUTINES], [0], [MACH_MACHINE_ROUTINES])
+
+# bogus/mach_mp_debug.h
+AC_DEFINE([MACH_MP_DEBUG], [0], [MACH_MP_DEBUG])
+
+# bogus/mach_pagemap.h
+AC_DEFINE([MACH_PAGEMAP], [1], [MACH_PAGEMAP])
+
+# bogus/mach_pcsample.h
+AC_DEFINE([MACH_PCSAMPLE], [1], [MACH_PCSAMPLE])
+
+# bogus/mach_ttd.h
+AC_DEFINE([MACH_TTD], [0], [MACH_TTD])
+
+# bogus/mach_vm_debug.h
+AC_DEFINE([MACH_VM_DEBUG], [1], [MACH_VM_DEBUG])
+
+# bogus/power_save.h
+AC_DEFINE([POWER_SAVE], [1], [POWER_SAVE])
+
+# bogus/simple_clock.h
+AC_DEFINE([SIMPLE_CLOCK], [0], [SIMPLE_CLOCK])
+
+# bogus/stat_time.h
+AC_DEFINE([STAT_TIME], [1], [STAT_TIME])
+
+# bogus/xpr_debug.h
+AC_DEFINE([XPR_DEBUG], [1], [XPR_DEBUG])
+
+#
+# Options.
+#
+
+AC_ARG_ENABLE([kdb],
+ AS_HELP_STRING([--enable-kdb], [enable use of in-kernel debugger]))
+[if [ x"$enable_kdb" = xyes ]; then]
+ AC_DEFINE([MACH_KDB], [1], [Use the in-kernel debugger?])
+ AM_CONDITIONAL([enable_kdb], [true])
+[else]
+ # We need to be long winded here: bogus/mach_kdb.h made it default to zero,
+ # unless overridden.
+ AC_DEFINE([MACH_KDB], [0], [Use the in-kernel debugger?])
+ AM_CONDITIONAL([enable_kdb], [false])
+[fi]
+
+
+AC_ARG_ENABLE([kmsg],
+ AS_HELP_STRING([--disable-kmsg], [disable use of kmsg device]))
+[if [ x"$enable_kmsg" != xno ]; then]
+ AC_DEFINE([MACH_KMSG], [], [enable use of kmsg device])
+ AM_CONDITIONAL([enable_kmsg], [true])
+[else]
+ AM_CONDITIONAL([enable_kmsg], [false])
+[fi]
+
+
+AC_ARG_ENABLE([default-device-drivers],
+ AS_HELP_STRING([--disable-default-device-drivers], [have all of the following
+ device drivers and switches disabled by default; then use the `--enable-*'
+ options to enable only those you actually want to have enabled]))
+[if [ x"$enable_default_device_drivers" != xno ]
+then enable_default_device_drivers=yes
+fi]
diff --git a/configure.ac b/configure.ac
index e51e497..f206924 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,5 @@
dnl Configure script for GNU Mach.
+
dnl Copyright 1997, 1998, 1999, 2004, 2006 Free Software Foundation, Inc.
dnl Permission to use, copy, modify and distribute this software and its
@@ -15,72 +16,276 @@ dnl USE OF THIS SOFTWARE.
AC_PREREQ([2.57])
m4_include([version.m4])
-AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT], [AC_PACKAGE_TARNAME])
+AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT],
+ [AC_PACKAGE_TARNAME])
AC_CONFIG_SRCDIR([kern/ipc_kobject.c])
+
+AC_CONFIG_AUX_DIR([build-aux])
+
+dnl Do not clutter the main build directory.
+AM_INIT_AUTOMAKE([subdir-objects])
#
-# Deduce output var `systype' from configuration parms.
+# Deduce the output variable `systype' from the configuration parameters.
#
-AC_CANONICAL_HOST
-
-case "$host_cpu" in
-i[[3456]]86) systype=i386 ;;
-*) AC_MSG_ERROR([unsupported CPU type]) ;;
-esac
-AC_SUBST([systype])
+AC_CANONICAL_HOST
-# Default prefix is / for the kernel.
-AC_PREFIX_DEFAULT([])
+m4_define([set_HOST], [[
+ case $host_cpu in
+ $2)] AM_CONDITIONAL([HOST_$1], [true]) [
+ systype=$1;;
+ *)] AM_CONDITIONAL([HOST_$1], [false]) [;;
+ esac
+]])
-#
-# Options
-#
-AC_ARG_ENABLE([kdb],
-AS_HELP_STRING([--enable-kdb], [enable use of in-kernel debugger]))
-[if test x"$enable_kdb" = xyes; then]
- AC_DEFINE([MACH_KDB], [1], [enable use of in-kernel debugger])
-[fi]
+[systype=unsupported]
+# Our supported architectures.
+set_HOST([i386],[i?86])
-AC_ARG_ENABLE([kmsg],
-AS_HELP_STRING([--disable-kmsg], [disable use of kmsg device]))
-[if test x"$enable_kmsg" != xno; then]
- AC_DEFINE([MACH_KMSG], [], [enable use of kmsg device])
+[if test -f "$srcdir"/"$systype"/Makefrag.am; then :; else]
+ AC_MSG_ERROR([unsupported CPU type $host_cpu])
[fi]
+AC_SUBST([systype])
+
#
-# Programs
+# Programs.
#
-AC_PROG_INSTALL
AC_PROG_AWK
+AM_PROG_AS
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_INSTALL
AC_PROG_RANLIB
-
AC_CHECK_TOOL([AR], [ar])
AC_CHECK_TOOL([LD], [ld])
AC_CHECK_TOOL([NM], [nm])
-AC_CHECK_TOOL([STRIP], [strip])
AC_CHECK_TOOL([MIG], [mig], [mig])
-AC_CHECK_PROG([GZIP], [gzip], [gzip], false)
-AC_CHECK_PROG([MBCHK], [mbchk], [mbchk], :)
+dnl Needed for the Automake option `subdir-objects'.
+AM_PROG_CC_C_O
+
+dnl Makerules can make use of these.
+AC_CHECK_PROG([GZIP], [gzip], [gzip], [gzip-not-found])
+AC_CHECK_TOOL([STRIP], [strip])
+
+dnl See below why we need to patch stuff during build...
+AC_CHECK_PROG([PATCH], [patch], [patch], [patch-not-found])
+
+#
+# configure fragments.
+#
+
+# The test suite.
+m4_include([tests/configfrag.ac])
+
+# General options.
+m4_include([configfrag.ac])
+
+# Machine-specific configuration.
+
+# i386.
+[if [ "$systype" = i386 ]; then]
+ m4_include([i386/configfrag.ac])
+[fi]
+
+# Linux code snarfed into GNU Mach.
+dnl Strictly speaking, we could have a `linux' option too, but it's currently
+dnl not possible to built a useful kernel without at least one Linux driver, so
+dnl that's not really necessary.
+dnl
+dnl The following doesn't work because of ``configure: error: conditional
+dnl "device_driver_floppy" was never defined.''.
+dnl AC_ARG_ENABLE([linux-device-drivers],
+dnl AS_HELP_STRING([--disable-linux-device-drivers],
+dnl [disable any use of Linux's device drivers]))
+dnl [if [ x"$enable_linux_device_drivers" != xno ]; then]
+m4_include([linux/configfrag.ac])
+dnl [fi]
+
+#
+# Output.
+#
# Set up `machine' and `mach/machine' links in the build directory for easier
# header file location.
AC_CONFIG_LINKS([machine:${systype}/${systype}
mach/machine:${systype}/include/mach/${systype}])
+AC_CONFIG_HEADER([config.h])
+
+AC_CONFIG_FILES([Makefile version.c])
+
+#
+# The remaining ugly, dark corners...
+#
+# Attention, parents: don't show this to your children...
+#
+
+#
+# config.status.dep.patch
+#
+# This is a (ugly --- I admit) bootstrap hack to get to-be-generated files
+# created before any other source files are compiled.
+#
+# See <http://lists.gnu.org/archive/html/automake/2006-05/msg00038.html>.
+#
+# We don't use `BUILT_SOURCES' (as it was suggested in the follow-up message),
+# as we also want things like `make SPECIFIC_TARGET' to work.
+#
+# This affair is especially ugly because internals are used (the `# dummy'
+# tag): internals that may be subject to changes. That's the reason why a
+# real patch is being used here and not some `sed' magic: to make it fail
+# loudly in case.
+#
+# For all source files create dependency files where it is stated that the
+# Makefile depends on all to-be-generated files. Later, when compiling the
+# source files, these dependency files will be rewritten to contain the files's
+# actual dependencies. From then on this hack will be forgotten. The choice
+# of the Makefile as the file to depends on is not be the best one, because
+# when running `make clean', the build system may decide to first build all the
+# to-be-genereated files and afterwards remove them again, but it works and I
+# don't want to spend more thoughts on this issue at the moment. Feel free to
+# suggest something better.
+#
+
+dnl AC_CONFIG_COMMANDS_POST([
+dnl sed -i -e \
+dnl 's%#\ dummy%Makefile: $(filter-out $(DIST_SOURCES),$(SOURCES))%' \
+dnl config.status
+dnl ])
+AC_CONFIG_COMMANDS_POST([
+ if "$PATCH" -f < "$srcdir"/config.status.dep.patch
+ then] AC_MSG_NOTICE([Applied a patch to work around a deficiency in]
+ [Automake. See `configure.ac' for details.])
+ [else] AC_MSG_ERROR([failed to patch using `config.status.dep.patch'.]
+ [You have a serious problem. Please contact <$PACKAGE_BUGREPORT>.])
+ [fi
+])
+
-AC_CONFIG_SUBDIRS([linux])
+#
+# Makefile.correct_output_files_for_.S_files.patch
+#
+# The used version of Automake might emit rules that don't put compiled (pre
+# processed) Assembler files where they belong. We're bitten by this bug
+# because we use the Automake option `subdir-objects', to not clutter the main
+# build directory with all the object files. The problem is that the emitted
+# rules will place those in the main build directory, but later, when creating
+# the libraries, look for them in the subdirectories.
+#
+# See <http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=automake&pr=492>.
+#
+# Another note: even with versions of Automake that don't have this issue
+# fixed, a correct rule is emitted for linux/src/arch/i386/lib/semaphore.S, see
+# the comment by Thomas Schwinge on 2006-10-10 on the above bug report.
+#
+# Again, a real patch is being used here and not some `sed' magic, so that
+# it'll fail loudly in case some internals we're relying on are changed.
+#
-# Do machine-specific configuration last so that it can override anything
-# set above if necessary.
-if test "$systype" = i386; then
- AC_CONFIG_SUBDIRS([i386])
-fi
+AC_CONFIG_COMMANDS([frob_Makefile_for_correct_output_files_for_.S_files],[
+ # Do we have a version of Automake that doesn't have this bug?
+ if grep -q CPPASCOMPILE.\*-c.\*-o < "$srcdir"/Makefile.in
+ then] AC_MSG_NOTICE([... not a problem with the used version of Automake.])
+ [# We don't.
+ elif "$PATCH" -f \
+ < "$srcdir"/Makefile.correct_output_files_for_.S_files.patch
+ then]
+ AC_MSG_NOTICE([Applied a patch to fix a bug in your version of Automake.]
+ [The applied fix should work in most cases. You could also consider]
+ [updating to Automake 1.10 (once it is released) or better.])
+ [else]
+ AC_MSG_ERROR([failed to patch using ]
+ [`Makefile.correct_output_files_for_.S_files.patch'.]
+ [You have a serious problem. Please contact <$PACKAGE_BUGREPORT>.])
+ [fi
+],[
+ PACKAGE_BUGREPORT=$PACKAGE_BUGREPORT
+ PATCH=$PATCH
+])
+
+
+#
+# Makefile.dependency_tracking_for_.S_files.patch
+#
+# The used version of Automake might not support automatic dependency tracking
+# for (preprocessed) Assembler source files. We might add such support here.
+# But since adding such support is nontrivial and the nonexistent dependency
+# tracking (missing only for .S files) is not considered a fundamental problem,
+# we save the costs of adding such support here. You should instead consider
+# updating to Automake 1.10 (once it is released) or better.
+#
+
+AC_CONFIG_COMMANDS([frob_Makefile_for_dependency_tracking_for_.S_files],[
+ # Do we have a version of Automake that doesn't have this bug?
+ if grep -q CPPASCOMPILE.\*depbase < "$srcdir"/Makefile.in
+ then] AC_MSG_NOTICE([... not a problem with the used version of Automake.])
+ [# We don't.
+ else]
+ AC_MSG_NOTICE([Your build of GNU Mach won't have dependency tracking for]
+ [(preprocessed) Assembler source files. Consider updating to Automake]
+ [1.10 (once it is released) or better if you need such support.])
+dnl In case someone feels like completing this instead of simply using a fixed
+dnl version of Automake...
+dnl if "$PATCH" -f; then :; else]
+dnl AC_MSG_ERROR([failed to patch using]
+dnl [`Makefile.dependency_tracking_for_.S_files.patch'.]
+dnl [You have a serious problem. Please contact <$PACKAGE_BUGREPORT>.])
+dnl [fi < "$srcdir"/Makefile.dependency_tracking_for_.S_files.patch
+dnl
+dnl # Change the Makefile to care for dependencies of .S files.
+dnl ( cd "$srcdir"/ &&
+dnl find ./ -name \*.S ) | \
+dnl sed -e 's%^\./%%' -e 's%\.S$%%' -e 's%^\(.*\)/%\1 %' | \
+dnl while read d f; do
+dnl echo &&
+dnl echo "$d"/"$f"'.$(OBJEXT): '"$d"'/$(am__dirstamp) ' \
+dnl "$d"'/$(DEPDIR)/$(am__dirstamp)' &&
+dnl echo 'include '"$d"'/$(DEPDIR)/'"$f"'.Po' &&
+dnl
+dnl # Create the dependency files if they don't exist so far.
+dnl if test -f "$d"/"$DEPDIR"/"$f"'.Po'; then :; else
+dnl echo '# dummy' > "$d"/"$DEPDIR"/"$f"'.Po'
+dnl fi
+dnl done >> Makefile
+dnl
+dnl TODO. linux/src/arch/i386/lib/.deps/liblinux_a-semaphore.Po vs.
+dnl linux/src/arch/i386/lib/.deps/semaphore.Po. Because of the above
+dnl mentioned special rule for `semaphore.S' the .S.o rule is not used.
+dnl
+dnl gcc -nostdinc -imacros config.h -Ii386 -I. -I../i386 -I../include -I../i386/include/mach/sa -DASSEMBLER -g -O2 -c ../i386/i386at/boothdr.S
+dnl
+dnl Makefile
+dnl
+dnl COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+dnl .c.o:
+dnl depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
+dnl if $(COMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
+dnl then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi
+dnl # source='$<' object='$@' libtool=no \
+dnl # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+dnl # $(COMPILE) -c -o $@ $<
+dnl
+dnl CCAS = gcc
+dnl CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+dnl .S.o:
+dnl $(CCASCOMPILE) -c $<
+dnl
+dnl source=../i386/i386at/boothdr.S object=i386/i386at/boothdr.o libtool=no DEPDIR=.deps depmode=gcc3 ../depcomp gcc -nostdinc -imacros config.h -Ii386 -I. -I../i386 -I../include -I../i386/include/mach/sa -DASSEMBLER -g -O2 -c -o i386/i386at/boothdr.o ../i386/i386at/boothdr.S
+dnl ... creates a correct i386/i386at/.deps/boothdr.Po.
+ [fi
+dnl ],[
+dnl DEPDIR=$DEPDIR
+dnl PACKAGE_BUGREPORT=$PACKAGE_BUGREPORT
+dnl PATCH=$PATCH
+])
+
+#
+# Fire.
+#
-AC_CONFIG_FILES([Makefile Makerules version.c doc/Makefile])
AC_OUTPUT
diff --git a/i386/Makerules.in b/i386/Makerules.in
deleted file mode 100644
index 9f09bcc..0000000
--- a/i386/Makerules.in
+++ /dev/null
@@ -1,46 +0,0 @@
-# i386/Makerules
-# Copyright 2006 Free Software Foundation, Inc.
-#
-# Permission to use, copy, modify and distribute this software and its
-# documentation is hereby granted, provided that both the copyright
-# notice and this permission notice appear in all copies of the
-# software, derivative works or modified versions, and any portions
-# thereof, and that both notices appear in supporting documentation.
-#
-# THE FREE SOFTWARE FOUNDATION ALLOWS FREE USE OF THIS SOFTWARE IN ITS
-# "AS IS" CONDITION. THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
-# LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
-# USE OF THIS SOFTWARE.
-
-
-#
-# configure's findings.
-#
-
-DEFS-$(systype) = @DEFS@
-
-
-#
-# Glue code dependent Makerules
-#
-
-include $(abs_top_builddir)/$(systype)/linux/Makerules
-
-
-# Some of the i386-specific code checks for these.
-DEFINES += -DCONTINUATIONS -D__ELF__ -Di386 $(DEFS-$(systype))
-
-# The system specific ones always override the generic ones.
-INCLUDES += -I$(abs_top_srcdir)/$(systype)/bogus
-
-# i386 specific linker script.
-LDFLAGS-kernel += -T $(abs_top_srcdir)/$(systype)/ldscript
-
-#
-# Autoconf support
-#
-
-$(abs_top_builddir)/$(systype)/Makerules: \
- $(abs_top_srcdir)/$(systype)/Makerules.in \
- $(abs_top_builddir)/$(systype)/config.status
- cd $(abs_top_builddir)/$(systype) && ./config.status $(@F)
diff --git a/i386/bogus/com.h b/i386/bogus/com.h
deleted file mode 100644
index ea7ad7a..0000000
--- a/i386/bogus/com.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define NCOM 4
-
diff --git a/i386/bogus/fpe.h b/i386/bogus/fpe.h
deleted file mode 100644
index 3850b40..0000000
--- a/i386/bogus/fpe.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* We do not have a floating point implementation. */
-#define FPE 0
diff --git a/i386/bogus/lpr.h b/i386/bogus/lpr.h
deleted file mode 100644
index 02a8ebf..0000000
--- a/i386/bogus/lpr.h
+++ /dev/null
@@ -1 +0,0 @@
-#define NLPR 1
diff --git a/i386/bogus/mach_machine_routines.h b/i386/bogus/mach_machine_routines.h
deleted file mode 100644
index bf7bab5..0000000
--- a/i386/bogus/mach_machine_routines.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MACH_MACHINE_ROUTINES 1
diff --git a/i386/bogus/platforms.h b/i386/bogus/platforms.h
deleted file mode 100644
index c4d0a24..0000000
--- a/i386/bogus/platforms.h
+++ /dev/null
@@ -1 +0,0 @@
-#define AT386 1
diff --git a/i386/bogus/rc.h b/i386/bogus/rc.h
deleted file mode 100644
index 7bbe598..0000000
--- a/i386/bogus/rc.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * This controls whether or not we use a serial line for the console
- * (ie, remote console).
- */
-
-/*
- * Values for RCLINE:
- * -1 = disable
- * 0 = port 0x3f8/irq 4 (DOS COM1)
- * 1 = port 0x2f8/irq 3 (DOS COM2)
- * 2 = port 0x3e8/irq 5 (DOS COM3)
- * 3 = port 0x2e8/irq 9 (DOS COM4)
- */
-
-#define RCLINE -1 /* com port for console */
-#define RCADDR 0x3f8 /* where it is */
diff --git a/i386/configfrag.ac b/i386/configfrag.ac
index 98fe2b1..a6c0d7a 100644
--- a/i386/configfrag.ac
+++ b/i386/configfrag.ac
@@ -1,4 +1,5 @@
-dnl Configure script for i386
+dnl Configure fragment for i386.
+
dnl Copyright 1999, 2004, 2006 Free Software Foundation, Inc.
dnl Permission to use, copy, modify and distribute this software and its
@@ -12,32 +13,60 @@ 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_PREREQ([2.57])
+#
+# Definitions.
+#
+
+# Some of the i386-specific code checks for these.
+AC_DEFINE([CONTINUATIONS], [1], [CONTINUATIONS])
+AC_DEFINE([__ELF__], [1], [__ELF__])
+AC_DEFINE([i386], [1], [i386])
+
+#
+# Formerly in `i386/bogus/'.
+#
+
+# i386/bogus/com.h
+AC_DEFINE([NCOM], [4], [NCOM])
+
+# i386/bogus/fpe.h
+AC_DEFINE([FPE], [0], [We do not have a floating point implementation.])
-m4_include([../version.m4])
-AC_INIT([AC_PACKAGE_NAME], [AC_PACKAGE_VERSION], [AC_PACKAGE_BUGREPORT], [AC_PACKAGE_TARNAME])
-AC_CONFIG_SRCDIR([i386/i386asm.sym])
+# i386/bogus/lpr.h
+AC_DEFINE([NLPR], [1], [NLPR])
+
+# i386/bogus/mach_machine_routines.h
+AC_DEFINE([MACH_MACHINE_ROUTINES], [1], [MACH_MACHINE_ROUTINES])
+
+# i386/bogus/platforms.h
+AC_DEFINE([AT386], [1], [AT386])
+
+# i386/bogus/rc.h
+#
+# This controls whether or not we use a serial line for the console
+# (ie, remote console).
+#
+#
+# Values for RCLINE:
+# -1 = disable
+# 0 = port 0x3f8/irq 4 (DOS COM1)
+# 1 = port 0x2f8/irq 3 (DOS COM2)
+# 2 = port 0x3e8/irq 5 (DOS COM3)
+# 3 = port 0x2e8/irq 9 (DOS COM4)
+#
+AC_DEFINE([RCLINE], [-1], [com port for the remote console])
+AC_DEFINE([RCADDR], [0x3f8], [where is the com port for the remote console])
#
-# Options
+# Options.
#
-AC_ARG_ENABLE([default-device-drivers],
-AS_HELP_STRING([--disable-default-device-drivers], [have all device drivers
-disabled that can be disabled and would otherwise have been enabled by default;
-then use the `--enable-*' options to enable only those you actually want to
-have enabled]))
-[if test x"$enable_default_device_drivers" != xno
-then enable_default_device_drivers=yes
-fi]
AC_ARG_ENABLE([lpr],
AS_HELP_STRING([--disable-lpr], [disable use of lpr device]))
[enable_lpr=${enable_lpr-$enable_default_device_drivers}
-if test x"$enable_lpr" = xyes
-then] AC_DEFINE([MACH_LPR], [], [enable mach lpr])
+if [ x"$enable_lpr" = xyes ]; then]
+ AC_DEFINE([MACH_LPR], [], [lpr device])
+ AM_CONDITIONAL([enable_lpr], [true])
+[else]
+ AM_CONDITIONAL([enable_lpr], [false])
[fi]
-
-AC_CONFIG_SUBDIRS([linux])
-
-AC_CONFIG_FILES([Makefile Makerules])
-AC_OUTPUT
diff --git a/tests/configfrag.ac b/tests/configfrag.ac
new file mode 100644
index 0000000..432e710
--- /dev/null
+++ b/tests/configfrag.ac
@@ -0,0 +1,26 @@
+dnl Configure fragment for the test suite.
+
+dnl Copyright 2006 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.
+
+#
+# Programs.
+#
+
+AC_CHECK_PROG([MBCHK], [mbchk], [mbchk], [:])
+
+#
+# Tests.
+#
+
+AC_CONFIG_FILES([tests/test-mbchk], [chmod +x tests/test-mbchk])