summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am32
-rw-r--r--Makerules.mig.am118
-rw-r--r--configure.ac8
3 files changed, 155 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 91d3d9b3d..b32f5b85e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of nsmux.
#
@@ -17,6 +17,10 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+noinst_LIBRARIES =
+MOSTLYCLEANFILES =
+
+
AM_CPPFLAGS =
AM_CFLAGS =
@@ -30,6 +34,15 @@ AM_CFLAGS += \
-Wall
+# MIG Setup.
+
+# MIGCOM.
+MIGCOM = $(MIG) -n -cc cat - /dev/null
+
+# Makerules.mig: how to do some MIG-related things.
+include Makerules.mig.am
+
+
bin_PROGRAMS += \
nsmux
@@ -44,6 +57,23 @@ nsmux_SOURCES = \
magic.c \
trans.c
+
+# Helper, awaiting a proper solution.
+%.server.defs.c:
+ rm -f $@
+ echo \
+ > $@ \
+ '#include <$*.defs>'
+
+# Server stubs.
+nodist_lib_dep_tr_for_defs_a_SOURCES += \
+ mach/notify.server.defs.c
+nodist_nsmux_SOURCES = \
+ mach/notify.server.h \
+ mach/notify.server.c \
+ mach/notify.server.msgids
+
+
nsmux_CPPFLAGS = \
-DDEBUG \
$(AM_CPPFLAGS)
diff --git a/Makerules.mig.am b/Makerules.mig.am
new file mode 100644
index 000000000..b3f76da25
--- /dev/null
+++ b/Makerules.mig.am
@@ -0,0 +1,118 @@
+# Makerules.mig: how to do some MIG-related things.
+
+# 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 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Written by Thomas Schwinge.
+
+# serial 0
+
+# TODO. This file should probably be distributed with GNU MIG and then there
+# should be some mechanism so that every package using it is automagically
+# using the latest available (or best-matching) version of it. Which is not
+# trivial, as the file is already needed to build the build system. But then,
+# this file does not really depend on GNU Automake. Hmm...
+
+# USAGE.
+
+# Before `include'ing this file, `noinst_LIBRARIES' and `MOSTLYCLEANFILES' have
+# to be initialized.
+
+# For using these rules, `AM_CPPFLAGS', `MIGCOM', `MIGCOMFLAGS', `MIGCOMSFLAGS'
+# and `MIGCOMUFLAGS' have to be defined as desired.
+
+# Then you can (read: currently ``have to''; see below for comments) use
+# constructs like:
+#
+# # User stubs.
+# nodist_lib_dep_tr_for_defs_a_SOURCES += \
+# vm/memory_object_user.user.defs.c
+# nodist_libkernel_a_SOURCES += \
+# vm/memory_object_user.user.h \
+# vm/memory_object_user.user.c \
+# vm/memory_object_user.user.msgids
+#
+# # Server stubs.
+# nodist_lib_dep_tr_for_defs_a_SOURCES += \
+# device/device.server.defs.c
+# nodist_libkernel_a_SOURCES += \
+# device/device.server.h \
+# device/device.server.c \
+# device/device.server.msgids
+
+#
+# Building RPC stubs.
+#
+
+# TODO. Get rid of that stuff, lib_dep_tr_for_defs.a and the four following
+# rules. See the thread at
+# <http://lists.gnu.org/archive/html/automake/2006-10/msg00039.html> about what
+# we really want to do. This requires work on GNU Automake.
+
+noinst_LIBRARIES += \
+ lib_dep_tr_for_defs.a
+nodist_lib_dep_tr_for_defs_a_SOURCES =
+MOSTLYCLEANFILES += \
+ $(nodist_lib_dep_tr_for_defs_a_SOURCES)
+# Preprocess only.
+lib_dep_tr_for_defs_a_CPPFLAGS = $(AM_CPPFLAGS) \
+ -E
+
+%.server.defs.c: %.srv
+ rm -f $@
+ cp -p $< $@
+%.user.defs.c: %.cli
+ rm -f $@
+ cp -p $< $@
+%.server.h %.server.c %.server.msgids: lib_dep_tr_for_defs_a-%.server.defs.$(OBJEXT)
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
+ -sheader $*.server.h -server $*.server.c \
+ -list $*.server.msgids \
+ < $<
+%.user.h %.user.c %.user.msgids: lib_dep_tr_for_defs_a-%.user.defs.$(OBJEXT)
+ $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
+ -user $*.user.c -header $*.user.h \
+ -list $*.user.msgids \
+ < $<
+
+# This is how it should be done, but this is not integrated into GNU Automake
+# and is missing automatic inter-file dependency management because of that.
+
+# These chained rules could be (and used to be) single rules using pipes or
+# could even --- if you dare to --- use the `mig' shell script, but it's
+# convenient to be able to explicitly make the intermediate files when you want
+# to deal with a problem in the MIG stub generator.
+
+# TODO. Get rid of the .srv files and rather use .defs files and MIG*SFLAGS?
+#%.server.defs: %.srv
+# $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
+#%.server.defs: %.defs
+# $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGSFLAGS) -o $@ $<
+#%.server.h %.server.c %.server.msgids: %.server.defs
+# $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMSFLAGS) \
+# -sheader $*.server.h -server $*.server.c \
+# -list $*.server.msgids \
+# < $<
+# TODO. Get rid of the .cli files and rather use .defs files and MIG*UFLAGS?
+#%.user.defs: %.cli
+# $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $<
+#%.user.defs: %.defs
+# $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) $(MIGUFLAGS) -o $@ $<
+#%.user.h %.user.c %.user.msgids: %.user.defs
+# $(MIGCOM) $(MIGCOMFLAGS) $(MIGCOMUFLAGS) \
+# -user $*.user.c -header $*.user.h \
+# -list $*.user.msgids \
+# < $<
diff --git a/configure.ac b/configure.ac
index fdf17c864..15e5fe25c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of nsmux.
#
@@ -35,7 +35,11 @@ AM_INIT_AUTOMAKE(
AC_PROG_CC
-AC_PROG_CC_C_O
+AM_PROG_CC_C_O
+AC_PROG_RANLIB
+
+
+AC_CHECK_TOOL([MIG], [mig], [mig])
AC_CONFIG_HEADERS([config.h])