Contents of /trunk/mkinitrd-magellan/klibc/contrib/klibc.m4
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File size: 3711 byte(s)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File size: 3711 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | # klibc.m4 serial 99 |
2 | ## Copyright (C) 1995-2003 Free Software Foundation, Inc. |
3 | ## This file is free software, distributed under the terms of the GNU |
4 | ## General Public License. As a special exception to the GNU General |
5 | ## Public License, this file may be distributed as part of a program |
6 | ## that contains a configuration script generated by Autoconf, under |
7 | ## the same distribution terms as the rest of that program. |
8 | ## |
9 | ## This file can can be used in projects which are not available under |
10 | ## the GNU General Public License or the GNU Library General Public |
11 | ## License but which still want to provide support for the GNU gettext |
12 | ## functionality. |
13 | ## Please note that the actual code of the KLIBC Library is partly covered |
14 | ## by the GNU Library General Public License, and party copyrighted by the |
15 | ## Regents of The University of California, and the rest is covered by a |
16 | ## MIT style license. |
17 | |
18 | # Authors: |
19 | # Martin Schlemmer <azarah@nosferatu.za.org>, 2005. |
20 | |
21 | |
22 | # AC_CHECK_KLIBC |
23 | # -------------- |
24 | # Check if the user wants KLIBC support enabled. If so, set KLIBC=yes and |
25 | # fill in KLIBC_PREFIX, KLIBC_BINDIR, KLIBC_SBINDIR, KLIBC_LIBDIR and |
26 | # KLIBC_INCLUDEDIR. CC is also set to the proper klcc executable. |
27 | # NOTE: This should be called before AC_PROG_CC, and before header, function |
28 | # or type checks. |
29 | AC_DEFUN([AC_CHECK_KLIBC], |
30 | [AC_BEFORE([$0], [AC_PROG_CC]) |
31 | AC_REQUIRE([AC_CANONICAL_HOST]) |
32 | AC_ARG_ENABLE([klibc], |
33 | [AS_HELP_STRING([--enable-klibc], |
34 | [Enable linking to klibc [no]. You need at |
35 | least klibc-1.0 or later for this. Set KLCC |
36 | to the absolute file name of klcc if not in |
37 | the PATH])], |
38 | [KLIBC=$enableval], [KLIBC=no]) |
39 | AC_ARG_ENABLE([klibc-layout], |
40 | [AS_HELP_STRING([--enable-klibc-layout], |
41 | [Enable installing binaries, libraries and |
42 | headers into the klibc prefix [yes] ])], |
43 | [if test "X$KLIBC" != Xno; then |
44 | KLIBC_LAYOUT=$enableval |
45 | else |
46 | KLIBC_LAYOUT=no |
47 | fi], |
48 | [if test "X$KLIBC" != Xno; then |
49 | KLIBC_LAYOUT=yes |
50 | else |
51 | KLIBC_LAYOUT=no |
52 | fi]) |
53 | |
54 | if test "X$KLIBC" != Xno; then |
55 | # Basic cross compiling support. I do not think it is wise to use |
56 | # AC_CHECK_TOOL, because if we are cross compiling, we do not want |
57 | # just 'klcc' to be returned ... |
58 | if test "${host_alias}" != "${build_alias}"; then |
59 | AC_CHECK_PROGS([KLCC], [${host_alias}-klcc], [no]) |
60 | else |
61 | AC_CHECK_PROGS([KLCC], [klcc], [no]) |
62 | fi |
63 | if test "X$KLCC" = Xno; then |
64 | AC_MSG_ERROR([cannot find klibc frontend 'klcc'!]) |
65 | fi |
66 | |
67 | CC="$KLCC" |
68 | CFLAGS="-Os" |
69 | |
70 | KLIBC_KCROSS="$($KLCC -print-klibc-kcross 2>/dev/null)" |
71 | KLIBC_PREFIX="$($KLCC -print-klibc-prefix 2>/dev/null)" |
72 | KLIBC_BIN_DIR="$($KLCC -print-klibc-bindir 2>/dev/null)" |
73 | KLIBC_SBIN_DIR="${KLIBC_PREFIX}/${KLIBC_KCROSS}sbin" |
74 | KLIBC_LIB_DIR="$($KLCC -print-klibc-libdir 2>/dev/null)" |
75 | KLIBC_INCLUDE_DIR="$($KLCC -print-klibc-includedir 2>/dev/null)" |
76 | |
77 | if test "X$KLIBC_LAYOUT" != Xno; then |
78 | prefix="$KLIBC_PREFIX" |
79 | bindir="$KLIBC_BIN_DIR" |
80 | sbindir="$KLIBC_SBIN_DIR" |
81 | libdir="$KLIBC_LIB_DIR" |
82 | includedir="$KLIBC_INCLUDE_DIR" |
83 | fi |
84 | |
85 | # At least KLIBC_LIB_DIR should be valid, else klibc is too old or |
86 | # something went wrong |
87 | if test ! -d "$KLIBC_LIB_DIR"; then |
88 | AC_MSG_ERROR([your klibc installation is too old or not functional!]) |
89 | fi |
90 | fi |
91 | |
92 | AC_SUBST(KLIBC) |
93 | ])# AC_CHECK_KLIBC |