source: rtems/tools/build/aclocal.m4 @ 9b8baa1

4.104.114.84.95
Last change on this file since 9b8baa1 was 9b8baa1, checked in by Joel Sherrill <joel.sherrill@…>, on 03/23/99 at 18:02:17

Automake II patch from Ralf Corsepius <corsepiu@…>. Email
description follows:

Description:

  • automake for *all* tool subdirectories (Makefile.am, configure.in etc.)
  • autogen now also considers CONFIG_HEADER (generates stamp-h.ins and config.h.ins)
  • c/src/tests/tools/generic/difftest and c/src/tests/tools/generic/sorttimes generated by configure scripts
  • c/update-tools/ampolish, beautifier for Makefile.ams, similar to acpolish
  • rtems-polish.sh added to c/update-tools/ + ampolish support
  • New subdirectory ./automake, contains automake -Makefile fragments to support RTEMS make "debug, debug_install, profile, profile_install" for native Makefile.ams (== ignore these make targets).
  • aclocal/rtems-top.m4's RTEMS_TOP now reads the automake makefile variable VERSION from RTEMS ./VERSION file.
  • ./configure.in uses the macros from aclocal + support for the tools' configure scripts

Remarks:

  • To run rtems-polish.sh, "cd <rtems-source-tree>; ./c/update-tools/rtems-polish.sh"
  • AFAIS, now all native subdirectories are converted to automake (Please drop me a note, if I forgot something).
  • Unless you notice something fatal, IMO the time has come for a public try (== snapshot). I do not intend to send more automake related patches within, say 2 weeks, to give these patches time to settle and to give me some time to think on how to continue.
  • The patch assumes installation to the new main installation directory [$(prefix)].
  • Property mode set to 100644
File size: 5.5 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl $Id$
14
15dnl
16dnl RTEMS_TOP($1)
17dnl
18dnl $1 .. relative path from this configure.in to the toplevel configure.in
19dnl
20AC_DEFUN(RTEMS_TOP,
21[dnl
22RTEMS_TOPdir="$1";
23AC_SUBST(RTEMS_TOPdir)
24
25PROJECT_ROOT=`pwd`/$RTEMS_TOPdir;
26AC_SUBST(PROJECT_ROOT)
27
28dnl Determine RTEMS Version string from the VERSION file
29dnl Hopefully, Joel never changes its format ;-
30AC_MSG_CHECKING([for RTEMS Version])
31if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
32changequote(,)dnl
33RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
34sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
35changequote([,])dnl
36else
37AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
38fi
39if test -z "$RTEMS_VERSION"; then
40AC_MSG_ERROR(Unable to determine version)
41fi
42AC_MSG_RESULT($RTEMS_VERSION)
43
44dnl FIXME: This once gets activated in future or will be removed
45dnl RTEMS_ROOT='$(top_srcdir)'/$RTEMS_TOPdir;
46dnl AC_SUBST(RTEMS_ROOT)
47])dnl
48
49# Do all the work for Automake.  This macro actually does too much --
50# some checks are only needed if your package does certain things.
51# But this isn't really a big deal.
52
53# serial 1
54
55dnl Usage:
56dnl AM_INIT_AUTOMAKE(package,version, [no-define])
57
58AC_DEFUN(AM_INIT_AUTOMAKE,
59[AC_REQUIRE([AC_PROG_INSTALL])
60PACKAGE=[$1]
61AC_SUBST(PACKAGE)
62VERSION=[$2]
63AC_SUBST(VERSION)
64dnl test to see if srcdir already configured
65if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
66  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
67fi
68ifelse([$3],,
69AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
70AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
71AC_REQUIRE([AM_SANITY_CHECK])
72AC_REQUIRE([AC_ARG_PROGRAM])
73dnl FIXME This is truly gross.
74missing_dir=`cd $ac_aux_dir && pwd`
75AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
76AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
77AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
78AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
79AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
80AC_REQUIRE([AC_PROG_MAKE_SET])])
81
82#
83# Check to make sure that the build environment is sane.
84#
85
86AC_DEFUN(AM_SANITY_CHECK,
87[AC_MSG_CHECKING([whether build environment is sane])
88# Just in case
89sleep 1
90echo timestamp > conftestfile
91# Do `set' in a subshell so we don't clobber the current shell's
92# arguments.  Must try -L first in case configure is actually a
93# symlink; some systems play weird games with the mod time of symlinks
94# (eg FreeBSD returns the mod time of the symlink's containing
95# directory).
96if (
97   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
98   if test "[$]*" = "X"; then
99      # -L didn't work.
100      set X `ls -t $srcdir/configure conftestfile`
101   fi
102   if test "[$]*" != "X $srcdir/configure conftestfile" \
103      && test "[$]*" != "X conftestfile $srcdir/configure"; then
104
105      # If neither matched, then we have a broken ls.  This can happen
106      # if, for instance, CONFIG_SHELL is bash and it inherits a
107      # broken ls alias from the environment.  This has actually
108      # happened.  Such a system could not be considered "sane".
109      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
110alias in your environment])
111   fi
112
113   test "[$]2" = conftestfile
114   )
115then
116   # Ok.
117   :
118else
119   AC_MSG_ERROR([newly created file is older than distributed files!
120Check your system clock])
121fi
122rm -f conftest*
123AC_MSG_RESULT(yes)])
124
125dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
126dnl The program must properly implement --version.
127AC_DEFUN(AM_MISSING_PROG,
128[AC_MSG_CHECKING(for working $2)
129# Run test in a subshell; some versions of sh will print an error if
130# an executable is not found, even if stderr is redirected.
131# Redirect stdin to placate older versions of autoconf.  Sigh.
132if ($2 --version) < /dev/null > /dev/null 2>&1; then
133   $1=$2
134   AC_MSG_RESULT(found)
135else
136   $1="$3/missing $2"
137   AC_MSG_RESULT(missing)
138fi
139AC_SUBST($1)])
140
141dnl $Id$
142
143AC_DEFUN(RTEMS_PATH_KSH,
144[
145dnl NOTE: prefer bash over ksh over sh
146AC_PATH_PROGS(KSH,bash ksh sh)
147if test -z "$KSH"; then
148dnl NOTE: This cannot happen -- /bin/sh must always exist
149AC_MSG_ERROR(
150[***]
151[    Cannot determine a usable shell bash/ksh/sh]
152[    Please contact your system administrator] );
153fi
154])
155
156# Like AC_CONFIG_HEADER, but automatically create stamp file.
157
158AC_DEFUN(AM_CONFIG_HEADER,
159[AC_PREREQ([2.12])
160AC_CONFIG_HEADER([$1])
161dnl When config.status generates a header, we must update the stamp-h file.
162dnl This file resides in the same directory as the config header
163dnl that is generated.  We must strip everything past the first ":",
164dnl and everything past the last "/".
165AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
166ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
167<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
168<<am_indx=1
169for am_file in <<$1>>; do
170  case " <<$>>CONFIG_HEADERS " in
171  *" <<$>>am_file "*<<)>>
172    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
173    ;;
174  esac
175  am_indx=`expr "<<$>>am_indx" + 1`
176done<<>>dnl>>)
177changequote([,]))])
178
Note: See TracBrowser for help on using the repository browser.