diff options
author | Roland McGrath <roland@gnu.org> | 1998-07-19 04:50:39 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1998-07-19 04:50:39 +0000 |
commit | 437ffbc127e85b2daefd96e655f3aef0b26846a2 (patch) | |
tree | 1ff0a73ea9b382a314c3c32123bd486f79f7f62b | |
parent | f71f362f7891bcc981dd6e48d7137c51119238bf (diff) | |
download | mig-437ffbc127e85b2daefd96e655f3aef0b26846a2.tar.gz mig-437ffbc127e85b2daefd96e655f3aef0b26846a2.tar.bz2 mig-437ffbc127e85b2daefd96e655f3aef0b26846a2.zip |
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
Moved mig out of gnumach into standalone distribution with
vanilla autoconf/automake build arrangement.
* configure.in, Makefile.am: New files.
* mig.in (prefix, exec_prefix, libexecdir): New vars set by configure.
(migcom): Find migcom in ${libexecdir}, and use @MIGCOM@ for its name.
(cpp): Use @TARGET_CC@ -E instead of @CPP@.
-rw-r--r-- | Makefile.am | 26 | ||||
-rw-r--r-- | configure.in | 61 | ||||
-rw-r--r-- | mig.in | 21 |
3 files changed, 99 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..b682e30 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = gnu +libexec_PROGRAMS = migcom +bin_SCRIPTS = mig +CLEANFILES = cpu.h *.sym[co] + +migcom_SOURCES = alloc.h boolean.h error.c error.h global.c global.h \ + header.c lexxer.h lexxer.l message.h mig_string.h \ + migcom.c parser.h parser.y routine.c routine.h \ + server.c statement.c statement.h string.c \ + type.c type.h user.c utils.c utils.h vprint.c write.h +migcom_LDADD = @ALLOCA@ @LEXLIB@ +EXTRADIST = gensym.awk + +SUFFIXES = .h .symo .symc .sym + +.sym.symc: + $(AWK) -f $(srcdir)/gensym.awk $< > $@ +.symc.symo: + $(TARGET_CC) -S $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -x c -o $@ $< +.symo.h: + sed -e '/^[^*].*$$/d' -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' \ + $< > $@ + +$(migcom_OBJECTS): cpu.h diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..427c47a --- /dev/null +++ b/configure.in @@ -0,0 +1,61 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(migcom.c) +AC_PREREQ(2.12) + +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM dnl needs SYSTEM, not just HOST and TARGET + +AM_INIT_AUTOMAKE(mig, 1.1.0) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_YACC +AM_PROG_LEX +AC_PROG_AWK +AC_PROG_INSTALL + +dnl Checks for header files. +AC_STDC_HEADERS + +dnl Checks for library functions. +AC_FUNC_ALLOCA +AC_HAVE_FUNCS(vprintf) + +AC_MSG_CHECKING(for target compiler) +if test "x$TARGET_CC" != x; then + # User set it. + AC_MSG_RESULT([$TARGET_CC]) +elif test "$target" = "$host"; then + TARGET_CC='${CC}' + AC_MSG_RESULT([native, using host compiler]) +else + [mig_target=`echo "$target" | sed 's/[^a-zA-Z0-9_]/_/g'`] + AC_CACHE_VAL(mig_cv_${mig_target}_CC, [ dnl + ac_word="${target_alias}-gcc" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + eval mig_cv_${mig_target}_CC='$ac_word' + break + fi + done + IFS="$ac_save_ifs"]) + eval TARGET_CC=\"\$mig_cv_${mig_target}_CC\" + if test "x$TARGET_CC" = x; then + AC_MSG_RESULT([${target_alias}-gcc not found]) + TARGET_CC='${CC}' + AC_MSG_WARN([using host compiler ($CC) for target $target]) + else + AC_MSG_RESULT([${TARGET_CC}]) + fi +fi +AC_SUBST(TARGET_CC) +dnl These two are just for the user's convenience. +AC_SUBST(TARGET_CPPFLAGS) +AC_SUBST(TARGET_CFLAGS) + +MIGCOM=`echo migcom | sed "$program_transform_name"` +AC_SUBST(MIGCOM) + +AC_OUTPUT([Makefile mig]) @@ -1,32 +1,35 @@ -#!/bin/sh +#!/bin/sh # # Mach Operating System # Copyright (c) 1991,1990 Carnegie Mellon University # All Rights Reserved. -# +# # 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. -# +# # CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" # CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR # ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. -# +# # Carnegie Mellon requests users of this software to return to -# +# # Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU # School of Computer Science # Carnegie Mellon University # Pittsburgh PA 15213-3890 -# +# # any improvements or extensions that they make and grant Carnegie Mellon # the rights to redistribute these changes. # -migcom=${MIGDIR-@MIGDIR@}/migcom -cpp="${CPP-@CPP@}" +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libexecdir=@libexecdir@ +migcom=${MIGDIR-@libexecdir@}/${MIGCOM-@MIGCOM@} +cpp="${CPP-@TARGET_CC@ -E}" cppflags= migflags= @@ -73,7 +76,7 @@ do ruser="${user-${base}User.c}" if [ "$ruser" != /dev/null ]; then if [ $sawI ]; then - for un in $ruser + for un in $ruser do deps="$deps $un" done |