diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2007-02-19 20:09:16 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:04 +0200 |
commit | 45268d3812e359e15cb1b4dacbe86e985e5ba305 (patch) | |
tree | a03b6b89b51d6560dd02a23f43a14c757ea542aa | |
parent | 61721bfa3309f017155c3cfaab6f246afa3d6b18 (diff) |
2007-02-19 Thomas Schwinge <tschwinge@gnu.org>
Add a `--enable-platform' option for future use. Allow building
without any Linux code.
* Makefile.am: Don't include `linux/Makefrag.am' in there...
* Makefrag.am: ... but rather in here.
* configfrag.ac (MACH_MACHINE_ROUTINES): AC_DEFINE_UNQUOTED based on
then shell variable `mach_machine_routines'.
(--disable-default-device-drivers): Don't define in there...
* configure.ac: ... but rather in here.
(--enable-platform): New option.
(host_platform): New variable.
(HOST_i386): Don't define there...
* i386/configfrag.ac (HOST_ix86): ... but rather here, rename it and
adapt all users.
(PLATFORM_at): New conditional.
(MACH_MACHINE_ROUTINES): Don't AC_DEFINE, but rather set a shell
variable `mach_machine_routines'.
* linux/Makefrag.am (noinst_LIBRARIES, gnumach_o_LDADD): Only enhance
``if CODE_linux'' or ``if device_driver_group_pcmcia''.
* linux/configfrag.ac (AC_OPTION): Rename to `AC_OPTION_Linux_ix86_at'
and rework a bit. Adapt all users.
(AC_OPTION_nodef): Rename to `AC_OPTION_Linux_ix86_at_nodef' and rework
a bit. Adapt all users.
(CODE_linux): New conditional.
* i386/Makefrag.am (LINKFLAGS_gnumach): Don't evaluate $(systype).
* Makefile.am: Update the FSF's postal address.
* doc/Makefrag.am: Likewise.
* i386/linux/Makefrag.am: Likewise.
* linux/Makefrag.am: Likewise.
* tests/Makefrag.am: Likewise.
* tests/configfrag.ac: Move to GPL.
-rw-r--r-- | ChangeLog | 36 | ||||
-rw-r--r-- | Makefile.am | 29 | ||||
-rw-r--r-- | Makefrag.am | 16 | ||||
-rw-r--r-- | configfrag.ac | 20 | ||||
-rw-r--r-- | configure.ac | 78 | ||||
-rw-r--r-- | doc/Makefrag.am | 26 | ||||
-rw-r--r-- | i386/Makefrag.am | 6 | ||||
-rw-r--r-- | i386/configfrag.ac | 63 | ||||
-rw-r--r-- | i386/linux/Makefrag.am | 26 | ||||
-rw-r--r-- | linux/Makefrag.am | 38 | ||||
-rw-r--r-- | linux/configfrag.ac | 140 | ||||
-rw-r--r-- | tests/Makefrag.am | 26 | ||||
-rw-r--r-- | tests/configfrag.ac | 29 |
13 files changed, 326 insertions, 207 deletions
@@ -1,3 +1,37 @@ +2007-02-19 Thomas Schwinge <tschwinge@gnu.org> + + Add a `--enable-platform' option for future use. Allow building + without any Linux code. + * Makefile.am: Don't include `linux/Makefrag.am' in there... + * Makefrag.am: ... but rather in here. + * configfrag.ac (MACH_MACHINE_ROUTINES): AC_DEFINE_UNQUOTED based on + then shell variable `mach_machine_routines'. + (--disable-default-device-drivers): Don't define in there... + * configure.ac: ... but rather in here. + (--enable-platform): New option. + (host_platform): New variable. + (HOST_i386): Don't define there... + * i386/configfrag.ac (HOST_ix86): ... but rather here, rename it and + adapt all users. + (PLATFORM_at): New conditional. + (MACH_MACHINE_ROUTINES): Don't AC_DEFINE, but rather set a shell + variable `mach_machine_routines'. + * linux/Makefrag.am (noinst_LIBRARIES, gnumach_o_LDADD): Only enhance + ``if CODE_linux'' or ``if device_driver_group_pcmcia''. + * linux/configfrag.ac (AC_OPTION): Rename to `AC_OPTION_Linux_ix86_at' + and rework a bit. Adapt all users. + (AC_OPTION_nodef): Rename to `AC_OPTION_Linux_ix86_at_nodef' and rework + a bit. Adapt all users. + (CODE_linux): New conditional. + * i386/Makefrag.am (LINKFLAGS_gnumach): Don't evaluate $(systype). + + * Makefile.am: Update the FSF's postal address. + * doc/Makefrag.am: Likewise. + * i386/linux/Makefrag.am: Likewise. + * linux/Makefrag.am: Likewise. + * tests/Makefrag.am: Likewise. + * tests/configfrag.ac: Move to GPL. + 2007-02-05 Thomas Schwinge <tschwinge@gnu.org> * kern/mach_clock.c: Don't include <kern/time_out.h>. @@ -40,7 +74,7 @@ * doc/Makefrag.am ($(web)): Use ``mkdir -p''. * doc/mach.texi: Fix unusual hyphens. - + * i386/i386/hardclock.c: Don't check for the `SYMMETRY' platform. * kern/timer.h: Add some comments from... diff --git a/Makefile.am b/Makefile.am index b691d9d..baa5ecf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,20 +1,20 @@ # Makefile for GNU Mach. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, or (at -# your option) any later version. -# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# # This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Various definitions of the Automake environment. @@ -109,9 +109,6 @@ include tests/Makefrag.am # Documentation. include doc/Makefrag.am - -# Linux device drivers and the glue code. -include linux/Makefrag.am # # Kernel Image diff --git a/Makefrag.am b/Makefrag.am index 9a898a6..de37ab3 100644 --- a/Makefrag.am +++ b/Makefrag.am @@ -1,6 +1,6 @@ # Main Makefile fragment for GNU Mach. -# Copyright 1997, 1999, 2004, 2006 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999, 2004, 2006, 2007 Free Software Foundation, Inc. # Permission to use, copy, modify and distribute this software and its # documentation is hereby granted, provided that both the copyright @@ -503,9 +503,21 @@ exec_msgidsdir = $(datadir)/msgids exec_msgids_DATA = gnumach.msgids # +# Specific code. +# + +# Linux device drivers and the glue code. +include linux/Makefrag.am + +# +# Platform specific parts. +# + +# # Architecture specific parts. # -if HOST_i386 +# ix86. +if HOST_ix86 include i386/Makefrag.am endif diff --git a/configfrag.ac b/configfrag.ac index c6b0854..361bf38 100644 --- a/configfrag.ac +++ b/configfrag.ac @@ -1,6 +1,6 @@ dnl Configure fragment for general options. -dnl Copyright 2006, 2007 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2007 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 @@ -67,12 +67,9 @@ AC_DEFINE([MACH_LDEBUG], [0], [MACH_LDEBUG]) AC_DEFINE([MACH_LOCK_MON], [0], [MACH_LOCK_MON]) # Does the architecture provide machine-specific interfaces? -# 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]) +mach_machine_routines=${mach_machine_routines-0} +AC_DEFINE_UNQUOTED([MACH_MACHINE_ROUTINES], [$mach_machine_routines], + [MACH_MACHINE_ROUTINES]) # MP debugging. Use alternate locking routines to detect deadlocks. Used in # `kern/lock_mon.c'. @@ -127,15 +124,6 @@ AC_ARG_ENABLE([kmsg], [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] # # Set up `SYSTYPE/SYSTYPE' and `SYSTYPE/include/mach/SYSTYPE' links. diff --git a/configure.ac b/configure.ac index 86357b1..9aa6ba6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ dnl Configure script for GNU Mach. -dnl Copyright 1997, 1998, 1999, 2004, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 1997, 1998, 1999, 2004, 2006, 2007 +dnl 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 @@ -35,27 +36,35 @@ dnl We require GNU make. ) # -# Deduce the output variable `systype' from the configuration parameters. +# Deduce the architecture we're building for. # AC_CANONICAL_HOST -m4_define([set_HOST], [[ - case $host_cpu in - $2)] AM_CONDITIONAL([HOST_$1], [true]) [ - systype=$1;; - *)] AM_CONDITIONAL([HOST_$1], [false]) [;; - esac -]]) - -[systype=unsupported] -# Our supported architectures. -set_HOST([i386],[i?86]) - -[if test -f "$srcdir"/"$systype"/Makefrag.am; then :; else] - AC_MSG_ERROR([unsupported CPU type $host_cpu]) -[fi] +AC_ARG_ENABLE([platform], + AS_HELP_STRING([--enable-platform=PLATFORM], [specify the platform to build a + kernel for. Defaults to `at' for `i?86'. No other possibilities.]), + [host_platform=$enable_platform], + [host_platform=default]) +[# Supported configurations. +case $host_platform:$host_cpu in + default:i?86) + host_platform=at;; + at:i?86) + :;; + *)] + AC_MSG_ERROR([unsupported combination of cpu type `$host_cpu' and platform + `$host_platform'.])[;; +esac] +AC_SUBST([host_platform]) +[# This is used in a few places. +case $host_cpu in + i?86) + systype=i386;; + *) + systype=$host_cpu;; +esac] AC_SUBST([systype]) # @@ -91,29 +100,30 @@ AC_CHECK_PROG([PATCH], [patch], [patch], [patch-not-found]) # The test suite. m4_include([tests/configfrag.ac]) -# General options. -m4_include([configfrag.ac]) +# Default set of device drivers. +AC_ARG_ENABLE([default-device-drivers], + AS_HELP_STRING([--disable-default-device-drivers], [have the options marked + with ``enabled by default'' 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] + +# Platform-specific configuration. + +# PC AT. +# TODO. Currently handled in `i386/configfrag.ac'. # Machine-specific configuration. -# i386. -[if [ "$systype" = i386 ]; then] - m4_include([i386/configfrag.ac]) -[fi] +# ix86. +m4_include([i386/configfrag.ac]) + +# General options. +m4_include([configfrag.ac]) # 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] # # Compiler features. diff --git a/doc/Makefrag.am b/doc/Makefrag.am index 7848fb5..654611e 100644 --- a/doc/Makefrag.am +++ b/doc/Makefrag.am @@ -1,20 +1,20 @@ # Makefile fragment for the documentation. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, or (at -# your option) any later version. -# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# # This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The GNU Mach Reference Manual. diff --git a/i386/Makefrag.am b/i386/Makefrag.am index 50b7afd..f70e63c 100644 --- a/i386/Makefrag.am +++ b/i386/Makefrag.am @@ -1,6 +1,6 @@ -# Makefile fragment for i386 +# Makefile fragment for i386. -# Copyright 1997, 1999, 2006 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc. # Permission to use, copy, modify and distribute this software and its # documentation is hereby granted, provided that both the copyright @@ -195,7 +195,7 @@ nodist_libkernel_a_SOURCES += \ EXTRA_DIST += \ i386/ldscript LINKFLAGS_gnumach = \ - -T '$(srcdir)/$(systype)'/ldscript + -T '$(srcdir)'/i386/ldscript # # Installation. diff --git a/i386/configfrag.ac b/i386/configfrag.ac index a82ce5c..3603721 100644 --- a/i386/configfrag.ac +++ b/i386/configfrag.ac @@ -1,6 +1,6 @@ dnl Configure fragment for i386. -dnl Copyright 1999, 2004, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 1999, 2004, 2006, 2007 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 @@ -17,25 +17,49 @@ dnl USE OF THIS SOFTWARE. # Definitions. # -# Some of the i386-specific code checks for these. -AC_DEFINE([__ELF__], [1], [__ELF__]) -AC_DEFINE([i386], [1], [i386]) +[case $host_cpu in + i?86)] + AM_CONDITIONAL([HOST_ix86], [true]) + + # Some of the i386-specific code checks for these. + AC_DEFINE([__ELF__], [1], [__ELF__]) + AC_DEFINE([i386], [1], [i386]) + + [# Does the architecture provide machine-specific interfaces? + mach_machine_routines=1;; + *)] + AM_CONDITIONAL([HOST_ix86], [false])[;; +esac + +case $host_platform in + at)] + AM_CONDITIONAL([PLATFORM_at], [true])[;; + *)] + AM_CONDITIONAL([PLATFORM_at], [false])[;; +esac # # Formerly in `i386/bogus/'. # -# i386/bogus/com.h -AC_DEFINE([NCOM], [4], [NCOM]) +ncom=0 +nlpr=0 +case $host_platform:$host_cpu in + at:i?86) + ncom=4 + nlpr=1 -# i386/bogus/lpr.h -AC_DEFINE([NLPR], [1], [NLPR]) + # i386/bogus/platforms.h] + AC_DEFINE([AT386], [1], [AT386])[;; + *) + :;; +esac] -# i386/bogus/mach_machine_routines.h -AC_DEFINE([MACH_MACHINE_ROUTINES], [1], [MACH_MACHINE_ROUTINES]) +# i386/bogus/com.h +AC_DEFINE_UNQUOTED([NCOM], [$ncom], [NCOM]) -# i386/bogus/platforms.h -AC_DEFINE([AT386], [1], [AT386]) +# i386/bogus/lpr.h +AC_DEFINE_UNQUOTED([NLPR], [$nlpr], [NLPR]) # i386/bogus/rc.h # @@ -58,11 +82,22 @@ AC_DEFINE([RCADDR], [0x3f8], [where is the com port for the remote console]) # AC_ARG_ENABLE([lpr], - AS_HELP_STRING([--disable-lpr], [disable use of lpr device])) -[enable_lpr=${enable_lpr-$enable_default_device_drivers} + AS_HELP_STRING([--enable-lpr], [lpr device; enabled by default for ix86-at])) +[case $host_platform:$host_cpu in + at:i?86) + enable_lpr=${enable_lpr-$enable_default_device_drivers};; + *) + if [ x"$enable_lpr" = xyes ]; then] + AC_MSG_ERROR([cannot enable `lpr' in this configuration.]) + [fi;; +esac if [ x"$enable_lpr" = xyes ]; then] AC_DEFINE([MACH_LPR], [], [lpr device]) AM_CONDITIONAL([enable_lpr], [true]) [else] AM_CONDITIONAL([enable_lpr], [false]) [fi] + +dnl Local Variables: +dnl mode: autoconf +dnl End: diff --git a/i386/linux/Makefrag.am b/i386/linux/Makefrag.am index 41606c9..c280309 100644 --- a/i386/linux/Makefrag.am +++ b/i386/linux/Makefrag.am @@ -1,20 +1,20 @@ # Makefile fragment for i386-specific Linux code. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, or (at -# your option) any later version. -# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# # This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Files for device driver support. diff --git a/linux/Makefrag.am b/linux/Makefrag.am index 0fd21d0..8fd3cc0 100644 --- a/linux/Makefrag.am +++ b/linux/Makefrag.am @@ -1,29 +1,31 @@ # Makefile fragment for Linux device drivers and the glue code. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, or (at -# your option) any later version. -# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# # This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Files for device driver support. # +if CODE_linux noinst_LIBRARIES += \ liblinux.a gnumach_o_LDADD += \ liblinux.a +endif liblinux_a_CPPFLAGS = $(AM_CPPFLAGS) \ -I$(srcdir)/$(systype)/linux/dev/include \ @@ -608,12 +610,13 @@ liblinux_pcmcia_cs_modules_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \ liblinux_pcmcia_cs_modules_a_CFLAGS = $(liblinux_a_CFLAGS) \ -include $(srcdir)/linux/pcmcia-cs/glue/pcmcia_glue.h liblinux_pcmcia_cs_modules_a_SOURCES = +if device_driver_group_pcmcia noinst_LIBRARIES += \ liblinux_pcmcia_cs_modules.a gnumach_o_LDADD += \ liblinux_pcmcia_cs_modules.a +endif -if device_driver_group_pcmcia liblinux_pcmcia_cs_modules_a_SOURCES += \ linux/pcmcia-cs/glue/pcmcia.c \ linux/pcmcia-cs/glue/pcmcia_glue.h \ @@ -626,7 +629,6 @@ liblinux_pcmcia_cs_modules_a_SOURCES += \ linux/pcmcia-cs/modules/pci_fixup.c EXTRA_DIST += \ linux/pcmcia-cs/glue/ds.c -endif if device_driver_i82365 liblinux_pcmcia_cs_modules_a_SOURCES += \ @@ -648,10 +650,12 @@ liblinux_pcmcia_cs_clients_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \ liblinux_pcmcia_cs_clients_a_CFLAGS = $(liblinux_a_CFLAGS) \ -include $(srcdir)/linux/pcmcia-cs/glue/pcmcia_glue.h liblinux_pcmcia_cs_clients_a_SOURCES = +if device_driver_group_pcmcia noinst_LIBRARIES += \ liblinux_pcmcia_cs_clients.a gnumach_o_LDADD += \ liblinux_pcmcia_cs_clients.a +endif if device_driver_3c574_cs liblinux_pcmcia_cs_clients_a_SOURCES += \ @@ -701,10 +705,12 @@ liblinux_pcmcia_cs_wireless_a_CPPFLAGS = $(liblinux_a_CPPFLAGS) \ liblinux_pcmcia_cs_wireless_a_CFLAGS = $(liblinux_a_CFLAGS) \ -include $(srcdir)/linux/pcmcia-cs/glue/wireless_glue.h liblinux_pcmcia_cs_wireless_a_SOURCES = +if device_driver_group_pcmcia noinst_LIBRARIES += \ liblinux_pcmcia_cs_wireless.a gnumach_o_LDADD += \ liblinux_pcmcia_cs_wireless.a +endif if device_driver_orinoco_cs liblinux_pcmcia_cs_wireless_a_SOURCES += \ @@ -745,6 +751,6 @@ dist-hook-linux: # Architecture specific parts. # -if HOST_i386 +if HOST_ix86 include i386/linux/Makefrag.am endif diff --git a/linux/configfrag.ac b/linux/configfrag.ac index 648f109..5c0237e 100644 --- a/linux/configfrag.ac +++ b/linux/configfrag.ac @@ -1,6 +1,6 @@ dnl Configure fragment for Linux code snarfed into GNU Mach. -dnl Copyright 1997, 1999, 2004, 2006 Free Software Foundation, Inc. +dnl Copyright (C) 1997, 1999, 2004, 2006, 2007 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 @@ -14,32 +14,10 @@ dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE dnl USE OF THIS SOFTWARE. # -# Which host CPU? +# Internals. # -AC_DEFUN([hurd_host_CPU], [ - AC_DEFINE([CONFIG_M$1], [1], [$1]) - AC_DEFINE([CPU], [$1], [CPU]) -]) - -[if [ x"$systype" = xi386 ]; then - case "$host_cpu" in - i386)] hurd_host_CPU([386])[;; - i486)] hurd_host_CPU([486])[;; - i586)] hurd_host_CPU([586])[;; - i686)] hurd_host_CPU([686])[;; - *)] hurd_host_CPU([486])[;; - esac -fi] - -# -# Definitions. -# - -# The glue code dependend code checks for this. -AC_DEFINE([LINUX_DEV], [1], [Linux device drivers.]) -# Instead of Mach's KERNEL, Linux uses __KERNEL__. Whee. -AC_DEFINE([__KERNEL__], [1], [__KERNEL__]) +[have_linux_code=no] # # Helper functions. @@ -50,7 +28,7 @@ AC_DEFINE([__KERNEL__], [1], [__KERNEL__]) # for the group `group' will be set-up. # -device_driver_group() { +[device_driver_group() { case $1 in '') # No group. @@ -67,44 +45,63 @@ device_driver_group() { # Pull in group `pcmcia'. device_driver_group pcmcia device_driver_group_wireless=selected;; - *) - AC_MSG_ERROR([invalid device driver group `$1']);; + *)] + AC_MSG_ERROR([invalid device driver group `$1'])[;; esac -} +}] # -# AC_OPTION(name,description,option[,class]). Process configuration option -# --enable-`name' (with description `description'). If it's set, then `option' -# is defined with AC_DEFINE. The option optionally pulls in group `group'; see -# the comments on device_driver_group for more information. By default, the -# value from $enable_default_device_drivers is considered when deciding whether -# to activate the option by default or not. +# AC_OPTION_Linux_ix86_at(name,description,option[,class]). Process +# configuration option --enable-`name' (with description `description'). If +# it's set, then `option' is defined with AC_DEFINE. The option optionally +# pulls in group `group'; see the comments on device_driver_group for more +# information. For ix86-at, the value from $enable_default_device_drivers is +# considered when deciding whether to activate the option by default or not. # - -AC_DEFUN([AC_OPTION], [ +AC_DEFUN([AC_OPTION_Linux_ix86_at], [ [unset enableval] AC_ARG_ENABLE([$1], - AS_HELP_STRING([--disable-$1], [disable $2])) -[enableval=${enableval-$enable_default_device_drivers}] + AS_HELP_STRING([--enable-$1], [$2; enabled by default for ix86-at])) +[#TODO. +case $host_platform:$host_cpu in + at:i?86) + enableval=${enableval-$enable_default_device_drivers};; + *) + if [ x"$enableval" = xyes ]; then + # TODO. That might not always be true.] + AC_MSG_ERROR([cannot enable `$1' in this configuration.]) + [fi;; +esac] AM_CONDITIONAL([device_driver_]m4_bpatsubst([$1], [-], [_]), - [test x"$enableval" = xyes]) -[if test x"$enableval" = xyes; then] + [[[ x"$enableval" = xyes ]]]) +[if [ x"$enableval" = xyes ]; then + have_linux_code=yes] AC_DEFINE([$3], [1], [option $1: $2]) [device_driver_group $4 fi]]) # -# AC_OPTION_nodef() is like AC_OPTION(), but doesn't consider -# $enable_default_device_drivers. +# AC_OPTION_Linux_ix86_at_nodef() is like AC_OPTION_Linux_ix86_at(), but +# doesn't consider $enable_default_device_drivers. # - -AC_DEFUN([AC_OPTION_nodef], [ +AC_DEFUN([AC_OPTION_Linux_ix86_at_nodef], [ [unset enableval] AC_ARG_ENABLE([$1], - AS_HELP_STRING([--enable-$1], [enable $2])) + AS_HELP_STRING([--enable-$1], [$2])) +[#TODO. +case $host_platform:$host_cpu in + at:i?86) + :;; + *) + if [ x"$enableval" = xyes ]; then + # TODO. That might not always be true.] + AC_MSG_ERROR([cannot enable `$1' in this configuration.]) + [fi;; +esac] AM_CONDITIONAL([device_driver_]m4_bpatsubst([$1], [-], [_]), - [test x"$enableval" = xyes]) -[if test x"$enableval" = xyes; then] + [[[ x"$enableval" = xyes ]]]) +[if [ x"$enableval" = xyes ]; then + have_linux_code=yes] AC_DEFINE([$3], [1], [option $1: $2]) [device_driver_group $4 fi]]) @@ -114,10 +111,10 @@ fi]]) # AC_DEFUN([AC_Linux_DRIVER], [ - AC_OPTION([$1], [Linux device driver for $2], [$3], [$4]) + AC_OPTION_Linux_ix86_at([$1], [Linux device driver for $2], [$3], [$4]) ]) AC_DEFUN([AC_Linux_DRIVER_nodef], [ - AC_OPTION_nodef([$1], [Linux device driver for $2], [$3], [$4]) + AC_OPTION_Linux_ix86_at_nodef([$1], [Linux device driver for $2], [$3], [$4]) ]) # @@ -149,7 +146,7 @@ AC_Linux_DRIVER([BusLogic], # TODO. What's that? And what about FlashPoint.c? dnl Dirty implementation... AC_ARG_ENABLE([flashpoint], - AS_HELP_STRING([--enable-flashpoint], [enable SCSI flashpoint]), + AS_HELP_STRING([--enable-flashpoint], [SCSI flashpoint]), [test x"$enableval" = xno && AC_DEFINE([CONFIG_SCSI_OMIT_FLASHPOINT], [], [scsi omit flashpoint])]) # Disabled by default. @@ -484,7 +481,7 @@ AC_Linux_DRIVER([i82365], [CONFIG_I82365], [pcmcia]) -AC_OPTION([pcmcia-isa], +AC_OPTION_Linux_ix86_at([pcmcia-isa], [isa bus support in the pcmcia core], [CONFIG_ISA], [pcmcia]) @@ -559,8 +556,41 @@ if [ x"$device_driver_group_wireless" = xselected ]; then] [fi] # -# Set up `asm-SYSTYPE' links. +# Internals. # -AC_CONFIG_LINKS([linux/src/include/asm:linux/src/include/asm-$systype - linux/dev/include/asm:linux/dev/include/asm-$systype]) +AC_DEFUN([hurd_host_CPU], [ + AC_DEFINE([CONFIG_M$1], [1], [$1]) + AC_DEFINE([CPU], [$1], [CPU])]) + +[if [ "$have_linux_code" = yes ]; then] + AM_CONDITIONAL([CODE_linux], [true]) + + [case $host_cpu in + i386)] + hurd_host_CPU([386])[;; + i486)] + hurd_host_CPU([486])[;; + i586)] + hurd_host_CPU([586])[;; + i686)] + hurd_host_CPU([686])[;; + *) + # TODO. Warn here?] + hurd_host_CPU([486])[;; + esac] + + # The glue code dependend code checks for this. + AC_DEFINE([LINUX_DEV], [1], [Linux device drivers.]) + # Instead of Mach's KERNEL, Linux uses __KERNEL__. Whee. + AC_DEFINE([__KERNEL__], [1], [__KERNEL__]) + + # Set up `asm-SYSTYPE' links. + AC_CONFIG_LINKS([linux/src/include/asm:linux/src/include/asm-$systype + linux/dev/include/asm:linux/dev/include/asm-$systype]) +[else] AM_CONDITIONAL([CODE_linux], [false]) +[fi] + +dnl Local Variables: +dnl mode: autoconf +dnl End: diff --git a/tests/Makefrag.am b/tests/Makefrag.am index d42b0f8..16d9677 100644 --- a/tests/Makefrag.am +++ b/tests/Makefrag.am @@ -1,20 +1,20 @@ # Makefile fragment for the test suite. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, or (at -# your option) any later version. -# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# # This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Tests. diff --git a/tests/configfrag.ac b/tests/configfrag.ac index 432e710..bb0310c 100644 --- a/tests/configfrag.ac +++ b/tests/configfrag.ac @@ -1,17 +1,20 @@ dnl Configure fragment for the test suite. -dnl Copyright 2006 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2007 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. +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation; either version 2, or (at your option) any later +dnl version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +dnl for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Programs. @@ -24,3 +27,7 @@ AC_CHECK_PROG([MBCHK], [mbchk], [mbchk], [:]) # AC_CONFIG_FILES([tests/test-mbchk], [chmod +x tests/test-mbchk]) + +dnl Local Variables: +dnl mode: autoconf +dnl End: |