[244ecd9] | 1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
---|
| 2 | |
---|
| 3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. |
---|
| 4 | dnl This file is free software; the Free Software Foundation |
---|
| 5 | dnl gives unlimited permission to copy and/or distribute it, |
---|
| 6 | dnl with or without modifications, as long as this notice is preserved. |
---|
| 7 | |
---|
| 8 | dnl This program is distributed in the hope that it will be useful, |
---|
| 9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
---|
| 10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
| 11 | dnl PARTICULAR PURPOSE. |
---|
| 12 | |
---|
| 13 | dnl $Id$ |
---|
| 14 | |
---|
| 15 | dnl |
---|
| 16 | dnl RTEMS_TOP($1) |
---|
| 17 | dnl |
---|
| 18 | dnl $1 .. relative path from this configure.in to the toplevel configure.in |
---|
| 19 | dnl |
---|
| 20 | AC_DEFUN(RTEMS_TOP, |
---|
| 21 | [dnl |
---|
[8cdb582] | 22 | AC_ARG_WITH(target-subdir, |
---|
| 23 | [ --with-target-subdir=DIR], |
---|
| 24 | TARGET_SUBDIR="$withval", |
---|
| 25 | TARGET_SUBDIR=".") |
---|
| 26 | |
---|
[244ecd9] | 27 | RTEMS_TOPdir="$1"; |
---|
| 28 | AC_SUBST(RTEMS_TOPdir) |
---|
| 29 | |
---|
| 30 | dnl Determine RTEMS Version string from the VERSION file |
---|
| 31 | dnl Hopefully, Joel never changes its format ;- |
---|
| 32 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
| 33 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
| 34 | changequote(,)dnl |
---|
| 35 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
| 36 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
| 37 | changequote([,])dnl |
---|
| 38 | else |
---|
| 39 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
| 40 | fi |
---|
| 41 | if test -z "$RTEMS_VERSION"; then |
---|
| 42 | AC_MSG_ERROR(Unable to determine version) |
---|
| 43 | fi |
---|
| 44 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
| 45 | ])dnl |
---|
| 46 | |
---|
| 47 | dnl |
---|
| 48 | dnl $Id$ |
---|
| 49 | dnl |
---|
| 50 | |
---|
| 51 | dnl canonicalize target cpu |
---|
| 52 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
| 53 | dnl target naming conventions "processor-vendor-os" |
---|
| 54 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
| 55 | dnl and we have to fix it for rtems ourselves |
---|
| 56 | |
---|
| 57 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
| 58 | [ |
---|
[15aa5ffb] | 59 | AC_CANONICAL_SYSTEM |
---|
[244ecd9] | 60 | AC_MSG_CHECKING(rtems target cpu) |
---|
| 61 | changequote(,)dnl |
---|
[8c92fa3] | 62 | case "${target}" in |
---|
[244ecd9] | 63 | # hpux unix port should go here |
---|
| 64 | i[3456]86-go32-rtems*) |
---|
[15aa5ffb] | 65 | RTEMS_CPU=i386 |
---|
[244ecd9] | 66 | ;; |
---|
| 67 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
[15aa5ffb] | 68 | RTEMS_CPU=unix |
---|
[244ecd9] | 69 | ;; |
---|
| 70 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
[15aa5ffb] | 71 | RTEMS_CPU=unix |
---|
[244ecd9] | 72 | ;; |
---|
| 73 | no_cpu-*rtems*) |
---|
[15aa5ffb] | 74 | RTEMS_CPU=no_cpu |
---|
[244ecd9] | 75 | ;; |
---|
| 76 | sparc-sun-solaris*) # unix "simulator" port |
---|
[15aa5ffb] | 77 | RTEMS_CPU=unix |
---|
[244ecd9] | 78 | ;; |
---|
| 79 | *) |
---|
[8c92fa3] | 80 | RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
[244ecd9] | 81 | ;; |
---|
| 82 | esac |
---|
| 83 | changequote([,])dnl |
---|
[d2d22780] | 84 | AC_SUBST(RTEMS_CPU) |
---|
[15aa5ffb] | 85 | AC_MSG_RESULT($RTEMS_CPU) |
---|
[244ecd9] | 86 | ]) |
---|
| 87 | |
---|
| 88 | # Do all the work for Automake. This macro actually does too much -- |
---|
| 89 | # some checks are only needed if your package does certain things. |
---|
| 90 | # But this isn't really a big deal. |
---|
| 91 | |
---|
| 92 | # serial 1 |
---|
| 93 | |
---|
| 94 | dnl Usage: |
---|
| 95 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
| 96 | |
---|
| 97 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
| 98 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
| 99 | PACKAGE=[$1] |
---|
| 100 | AC_SUBST(PACKAGE) |
---|
| 101 | VERSION=[$2] |
---|
| 102 | AC_SUBST(VERSION) |
---|
| 103 | dnl test to see if srcdir already configured |
---|
| 104 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
| 105 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
| 106 | fi |
---|
| 107 | ifelse([$3],, |
---|
| 108 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
| 109 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
| 110 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
| 111 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
| 112 | dnl FIXME This is truly gross. |
---|
| 113 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
| 114 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
| 115 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
| 116 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
| 117 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
| 118 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
| 119 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
| 120 | |
---|
| 121 | # |
---|
| 122 | # Check to make sure that the build environment is sane. |
---|
| 123 | # |
---|
| 124 | |
---|
| 125 | AC_DEFUN(AM_SANITY_CHECK, |
---|
| 126 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
| 127 | # Just in case |
---|
| 128 | sleep 1 |
---|
| 129 | echo timestamp > conftestfile |
---|
| 130 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
| 131 | # arguments. Must try -L first in case configure is actually a |
---|
| 132 | # symlink; some systems play weird games with the mod time of symlinks |
---|
| 133 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
| 134 | # directory). |
---|
| 135 | if ( |
---|
| 136 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
| 137 | if test "[$]*" = "X"; then |
---|
| 138 | # -L didn't work. |
---|
| 139 | set X `ls -t $srcdir/configure conftestfile` |
---|
| 140 | fi |
---|
| 141 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
| 142 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
| 143 | |
---|
| 144 | # If neither matched, then we have a broken ls. This can happen |
---|
| 145 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
| 146 | # broken ls alias from the environment. This has actually |
---|
| 147 | # happened. Such a system could not be considered "sane". |
---|
| 148 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
| 149 | alias in your environment]) |
---|
| 150 | fi |
---|
| 151 | |
---|
| 152 | test "[$]2" = conftestfile |
---|
| 153 | ) |
---|
| 154 | then |
---|
| 155 | # Ok. |
---|
| 156 | : |
---|
| 157 | else |
---|
| 158 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
| 159 | Check your system clock]) |
---|
| 160 | fi |
---|
| 161 | rm -f conftest* |
---|
| 162 | AC_MSG_RESULT(yes)]) |
---|
| 163 | |
---|
| 164 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
| 165 | dnl The program must properly implement --version. |
---|
| 166 | AC_DEFUN(AM_MISSING_PROG, |
---|
| 167 | [AC_MSG_CHECKING(for working $2) |
---|
| 168 | # Run test in a subshell; some versions of sh will print an error if |
---|
| 169 | # an executable is not found, even if stderr is redirected. |
---|
| 170 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
| 171 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
| 172 | $1=$2 |
---|
| 173 | AC_MSG_RESULT(found) |
---|
| 174 | else |
---|
| 175 | $1="$3/missing $2" |
---|
| 176 | AC_MSG_RESULT(missing) |
---|
| 177 | fi |
---|
| 178 | AC_SUBST($1)]) |
---|
| 179 | |
---|
[6693a68] | 180 | # Add --enable-maintainer-mode option to configure. |
---|
| 181 | # From Jim Meyering |
---|
| 182 | |
---|
| 183 | # serial 1 |
---|
| 184 | |
---|
| 185 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
| 186 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
| 187 | dnl maintainer-mode is disabled by default |
---|
| 188 | AC_ARG_ENABLE(maintainer-mode, |
---|
| 189 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
| 190 | (and sometimes confusing) to the casual installer], |
---|
| 191 | USE_MAINTAINER_MODE=$enableval, |
---|
| 192 | USE_MAINTAINER_MODE=no) |
---|
| 193 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
| 194 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
| 195 | MAINT=$MAINTAINER_MODE_TRUE |
---|
| 196 | AC_SUBST(MAINT)dnl |
---|
| 197 | ] |
---|
| 198 | ) |
---|
| 199 | |
---|
| 200 | # Define a conditional. |
---|
| 201 | |
---|
| 202 | AC_DEFUN(AM_CONDITIONAL, |
---|
| 203 | [AC_SUBST($1_TRUE) |
---|
| 204 | AC_SUBST($1_FALSE) |
---|
| 205 | if $2; then |
---|
| 206 | $1_TRUE= |
---|
| 207 | $1_FALSE='#' |
---|
| 208 | else |
---|
| 209 | $1_TRUE='#' |
---|
| 210 | $1_FALSE= |
---|
| 211 | fi]) |
---|
| 212 | |
---|
| 213 | dnl |
---|
| 214 | dnl $Id$ |
---|
| 215 | dnl |
---|
| 216 | |
---|
| 217 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
| 218 | [dnl |
---|
| 219 | AC_REQUIRE([RTEMS_TOP]) |
---|
| 220 | if test "$TARGET_SUBDIR" = "." ; then |
---|
| 221 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
| 222 | else |
---|
| 223 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
| 224 | fi |
---|
| 225 | AC_SUBST(PROJECT_ROOT) |
---|
| 226 | |
---|
| 227 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
| 228 | AC_SUBST(RTEMS_ROOT) |
---|
| 229 | |
---|
| 230 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
| 231 | AC_SUBST(INSTALL_CHANGE) |
---|
| 232 | |
---|
| 233 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
| 234 | AC_SUBST(PACKHEX) |
---|
| 235 | ]) |
---|
| 236 | |
---|
| 237 | |
---|
| 238 | AC_DEFUN(RTEMS_TOOLPATHS, |
---|
| 239 | [ |
---|
| 240 | # tooldir='$(exec_prefix)/'$target_alias |
---|
| 241 | # Temporary work-around until building in source tree is supported |
---|
| 242 | AC_REQUIRE([RTEMS_PROJECT_ROOT]) |
---|
| 243 | |
---|
| 244 | tooldir='$(PROJECT_ROOT)' |
---|
| 245 | AC_SUBST(tooldir) |
---|
| 246 | |
---|
| 247 | project_includedir='$(tooldir)'/include |
---|
| 248 | AC_SUBST(project_includedir) |
---|
| 249 | |
---|
| 250 | project_libdir='$(tooldir)/lib$(MULTISUBDIR)' |
---|
| 251 | AC_SUBST(project_libdir) |
---|
| 252 | |
---|
| 253 | project_bindir='$(tooldir)/bin' |
---|
| 254 | AC_SUBST(project_bindir) |
---|
| 255 | |
---|
| 256 | rtems_bspdir='$(prefix)/${RTEMS_BSP}' |
---|
| 257 | AC_SUBST(rtems_bspdir) |
---|
| 258 | rtems_makedir='$(prefix)/make' |
---|
| 259 | AC_SUBST(rtems_makedir) |
---|
| 260 | ]) |
---|
| 261 | |
---|