summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gnu-config/gnu-config
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gnu-config/gnu-config')
-rw-r--r--meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch174
-rwxr-xr-xmeta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in267
-rw-r--r--meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch21
3 files changed, 462 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch b/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
new file mode 100644
index 0000000000..f820cef1c9
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
@@ -0,0 +1,174 @@
1Patch courtesy gentoo-portage/sys-devel/gnuconfig/files/automake-1.8.5-config-guess-uclibc.patch.
2
3updated to 20050516 by Marcin 'Hrw' Juszkiewicz (by hand)
4updated to 20080123 by Nitin A Kamble (by hand)
5
6Index: config/config.guess
7===================================================================
8--- config.orig/config.guess
9+++ config/config.guess
10@@ -139,6 +139,19 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
11 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
12 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
13
14+# Detect uclibc systems.
15+
16+LIBC="gnu"
17+if [ -f /usr/include/bits/uClibc_config.h ]
18+then
19+ LIBC=uclibc
20+ if [ -n `grep "#define __UCLIBC_CONFIG_VERSION__" /usr/include/bits/uClibc_config.h` ]
21+ then
22+ UCLIBC_SUBVER=`sed -n "/#define __UCLIBC_CONFIG_VERSION__ /s///p" /usr/include/bits/uClibc_config.h`
23+ LIBC=$LIBC$UCLIBC_SUBVER
24+ fi
25+fi
26+
27 # Note: order is significant - the case branches are not exclusive.
28
29 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
30@@ -840,13 +853,13 @@ EOF
31 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
32 | grep -q __ARM_EABI__
33 then
34- echo ${UNAME_MACHINE}-unknown-linux-gnu
35+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
36 else
37 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
38 fi
39 exit ;;
40 avr32*:Linux:*:*)
41- echo ${UNAME_MACHINE}-unknown-linux-gnu
42+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
43 exit ;;
44 cris:Linux:*:*)
45 echo cris-axis-linux-gnu
46@@ -855,16 +868,16 @@ EOF
47 echo crisv32-axis-linux-gnu
48 exit ;;
49 frv:Linux:*:*)
50- echo frv-unknown-linux-gnu
51+ echo frv-unknown-linux-${LIBC}
52 exit ;;
53 ia64:Linux:*:*)
54- echo ${UNAME_MACHINE}-unknown-linux-gnu
55+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
56 exit ;;
57 m32r*:Linux:*:*)
58- echo ${UNAME_MACHINE}-unknown-linux-gnu
59+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
60 exit ;;
61 m68*:Linux:*:*)
62- echo ${UNAME_MACHINE}-unknown-linux-gnu
63+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
64 exit ;;
65 mips:Linux:*:*)
66 eval $set_cc_for_build
67@@ -887,7 +900,7 @@ EOF
68 s: ::g
69 p
70 }'`"
71- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
72+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
73 ;;
74 mips64:Linux:*:*)
75 eval $set_cc_for_build
76@@ -910,16 +923,16 @@ EOF
77 s: ::g
78 p
79 }'`"
80- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
81+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
82 ;;
83 or32:Linux:*:*)
84- echo or32-unknown-linux-gnu
85+ echo or32-unknown-linux-${LIBC}
86 exit ;;
87 ppc:Linux:*:*)
88- echo powerpc-unknown-linux-gnu
89+ echo powerpc-unknown-linux-${LIBC}
90 exit ;;
91 ppc64:Linux:*:*)
92- echo powerpc64-unknown-linux-gnu
93+ echo powerpc64-unknown-linux-${LIBC}
94 exit ;;
95 alpha:Linux:*:*)
96 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
97@@ -932,40 +945,40 @@ EOF
98 EV68*) UNAME_MACHINE=alphaev68 ;;
99 esac
100 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
101- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
102- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
103+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
104+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
105 exit ;;
106 parisc:Linux:*:* | hppa:Linux:*:*)
107 # Look for CPU level
108 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
109- PA7*) echo hppa1.1-unknown-linux-gnu ;;
110- PA8*) echo hppa2.0-unknown-linux-gnu ;;
111- *) echo hppa-unknown-linux-gnu ;;
112+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
113+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
114+ *) echo hppa-unknown-linux-${LIBC} ;;
115 esac
116 exit ;;
117 parisc64:Linux:*:* | hppa64:Linux:*:*)
118- echo hppa64-unknown-linux-gnu
119+ echo hppa64-unknown-linux-${LIBC}
120 exit ;;
121 s390:Linux:*:* | s390x:Linux:*:*)
122 echo ${UNAME_MACHINE}-ibm-linux
123 exit ;;
124 sh64*:Linux:*:*)
125- echo ${UNAME_MACHINE}-unknown-linux-gnu
126+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
127 exit ;;
128 sh*:Linux:*:*)
129- echo ${UNAME_MACHINE}-unknown-linux-gnu
130+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
131 exit ;;
132 sparc:Linux:*:* | sparc64:Linux:*:*)
133- echo ${UNAME_MACHINE}-unknown-linux-gnu
134+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
135 exit ;;
136 vax:Linux:*:*)
137 echo ${UNAME_MACHINE}-dec-linux-gnu
138 exit ;;
139 x86_64:Linux:*:*)
140- echo x86_64-unknown-linux-gnu
141+ echo x86_64-unknown-linux-${LIBC}
142 exit ;;
143 xtensa*:Linux:*:*)
144- echo ${UNAME_MACHINE}-unknown-linux-gnu
145+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
146 exit ;;
147 i*86:Linux:*:*)
148 # The BFD linker knows what the default object file format is, so
149@@ -980,20 +993,21 @@ EOF
150 p'`
151 case "$ld_supported_targets" in
152 elf32-i386)
153- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
154+ TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
155 ;;
156 a.out-i386-linux)
157- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
158+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
159 exit ;;
160 coff-i386)
161- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
162+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
163 exit ;;
164 "")
165 # Either a pre-BFD a.out linker (linux-gnuoldld) or
166 # one that does not give us useful --help.
167- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
168+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
169 exit ;;
170 esac
171+ if [ $LIBC != "gnu" -o $LIBC != "gnulibc1" ];then echo "$TENTATIVE" && exit; fi
172 # Determine whether the default compiler is a.out or elf
173 eval $set_cc_for_build
174 sed 's/^ //' << EOF >$dummy.c
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
new file mode 100755
index 0000000000..be8580c8e6
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
@@ -0,0 +1,267 @@
1#! /usr/bin/perl -w
2# -*- perl -*-
3
4eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
5 if 0;
6
7# gnu-configize - install the GNU config.guess / config.sub in a directory tree
8# Based on autoreconf:
9# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
10# Free Software Foundation, Inc.
11
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2, or (at your option)
15# any later version.
16
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25# 02111-1307, USA.
26
27BEGIN
28{
29 my $datadir = $ENV{'autom4te_perllibdir'} || '@autom4te_perllibdir@';
30# '/home/kergoth/code/build-arm/tmp/staging/share/autoconf';
31 unshift @INC, $datadir;
32
33 # Override SHELL. On DJGPP SHELL may not be set to a shell
34 # that can handle redirection and quote arguments correctly,
35 # e.g.: COMMAND.COM. For DJGPP always use the shell that configure
36 # has detected.
37 $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
38}
39
40use Autom4te::ChannelDefs;
41use Autom4te::Channels;
42use Autom4te::Configure_ac;
43use Autom4te::FileUtils;
44use Autom4te::General;
45use Autom4te::XFile;
46# Do not use Cwd::chdir, since it might hang.
47use Cwd 'cwd';
48use strict;
49
50## ----------- ##
51## Variables. ##
52## ----------- ##
53
54# $HELP
55# -----
56$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ...
57
58Install the GNU config.sub and config.guess scripts in the
59DIRECTORIES or the directory trees driven by CONFIGURE-AC
60(defaulting to `.').
61
62Operation modes:
63 -h, --help print this help, then exit
64 -V, --version print version number, then exit
65 -v, --verbose verbosely report processing
66 -f, --force consider all files obsolete
67 -s, --symlink install symbolic links instead of copies
68 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
69
70" . Autom4te::ChannelDefs::usage . "
71
72The environment variable \`WARNINGS\' is honored. Some subtools might
73support other warning types, using \`all' is encouraged.
74";
75
76# $VERSION
77# --------
78$version = "gnu-configize 1.0
79
80Copyright (C) 2004 Chris Larson
81This is free software; see the source for copying conditions. There is NO
82warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
83";
84
85my $configdir = '@gnu-configdir@';
86#'/home/kergoth/code/build-arm/tmp/staging/i686-linux/share/gnu-config';
87my $autoconf = $ENV{'AUTOCONF'} || 'autoconf';
88
89# use symlinks instead.
90my $symlink = 0;
91
92my $configure_ac;
93
94my $rm = "rm -f";
95my $ln_s = "ln -sf";
96my $cp = "cp -f";
97my $mkdir = "mkdir";
98my $chmod = "chmod";
99
100## ---------- ##
101## Routines. ##
102## ---------- ##
103
104
105# parse_args ()
106# -------------
107# Process any command line arguments.
108sub parse_args ()
109{
110 my $srcdir;
111
112 getopt ('s|symlink' => \$symlink);
113
114 # Even if the user specified a configure.ac, trim to get the
115 # directory, and look for configure.ac again. Because (i) the code
116 # is simpler, and (ii) we are still able to diagnose simultaneous
117 # presence of configure.ac and configure.in.
118 @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
119 push @ARGV, '.' unless @ARGV;
120}
121
122
123# &gnu_configize_current_directory
124# -----------------------------
125sub gnu_configize_current_directory ()
126{
127 my $configure_ac = require_configure_ac;
128
129 # ---------------------- #
130 # Is it using Autoconf? #
131 # ---------------------- #
132
133 my $uses_autoconf;
134 my $uses_gettext;
135 my $configure_ac_file = new Autom4te::XFile $configure_ac;
136 while ($_ = $configure_ac_file->getline)
137 {
138 s/#.*//;
139 s/dnl.*//;
140 $uses_autoconf = 1 if /AC_INIT/;
141 }
142
143 if (!$uses_autoconf)
144 {
145 verb "$configure_ac: not using Autoconf";
146 return;
147 }
148
149 my $aux_dir;
150 my @subdir;
151 my $cmd;
152 my $dest;
153
154 verb "$configure_ac: tracing";
155 my $traces = new Autom4te::XFile
156 ("$autoconf"
157 . join (' --trace=', '',
158 # If you change this list, update the
159 # `Autoreconf-preselections' section of autom4te.in.
160 'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
161 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
162 'AC_INIT',
163 )
164 . ' |');
165 while ($_ = $traces->getline)
166 {
167 $aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/;
168 $uses_autoconf = 1 if /AC_INIT/;
169 push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
170 }
171
172 # The subdirs are *optional*, they may not exist.
173 foreach (@subdir)
174 {
175 if (-d)
176 {
177 verb "$configure_ac: subdirectory $_ to gnu-configize";
178 gnu_configize ($_);
179 }
180 else
181 {
182 verb "$configure_ac: subdirectory $_ not present";
183 }
184 }
185
186 $dest = ".";
187
188 if (defined $aux_dir)
189 {
190 $dest = $aux_dir;
191 if (! -d $aux_dir)
192 {
193 verb "$configure_ac: creating directory $aux_dir";
194 mkdir $aux_dir
195 or error "cannot create $aux_dir: $!";
196 }
197 }
198
199 if (!$symlink)
200 {
201 $cmd = $cp;
202 }
203 else
204 {
205 $cmd = $ln_s;
206 }
207
208 xsystem ("$cmd $configdir/config.guess $dest/");
209 xsystem ("$chmod u+x $dest/config.guess");
210 xsystem ("$cmd $configdir/config.sub $dest/");
211 xsystem ("$chmod u+x $dest/config.sub");
212}
213
214
215# &gnu_configize ($DIRECTORY)
216# ------------------------
217# Reconf the $DIRECTORY.
218sub gnu_configize ($)
219{
220 my ($directory) = @_;
221 my $cwd = cwd;
222
223 # The format for this message is not free: taken from Emacs, itself
224 # using GNU Make's format.
225 verb "Entering directory `$directory'";
226 chdir $directory
227 or error "cannot chdir to $directory: $!";
228
229 gnu_configize_current_directory;
230
231 # The format is not free: taken from Emacs, itself using GNU Make's
232 # format.
233 verb "Leaving directory `$directory'";
234 chdir $cwd
235 or error "cannot chdir to $cwd: $!";
236}
237
238
239## ------ ##
240## Main. ##
241## ------ ##
242
243parse_args;
244
245# Autoreconf all the given configure.ac. A while loop, not a for,
246# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
247for my $directory (@ARGV)
248 {
249 gnu_configize ($directory);
250 }
251
252### Setup "GNU" style for perl-mode and cperl-mode.
253## Local Variables:
254## perl-indent-level: 2
255## perl-continued-statement-offset: 2
256## perl-continued-brace-offset: 0
257## perl-brace-offset: 0
258## perl-brace-imaginary-offset: 0
259## perl-label-offset: -2
260## cperl-indent-level: 2
261## cperl-brace-offset: 0
262## cperl-continued-brace-offset: 0
263## cperl-label-offset: -2
264## cperl-extra-newline-before-brace: t
265## cperl-merge-trailing-else: nil
266## cperl-continued-statement-offset: 2
267## End:
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch b/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
new file mode 100644
index 0000000000..20a3b11f2f
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
@@ -0,0 +1,21 @@
1--- config.sub.orig 2004-05-14 19:38:36.000000000 -0500
2+++ config.sub 2004-05-14 19:39:17.000000000 -0500
3@@ -118,7 +118,7 @@
4 # Here we must recognize all the valid KERNEL-OS combinations.
5 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
6 case $maybe_os in
7- nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
8+ nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
9 os=-$maybe_os
10 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
11 ;;
12@@ -1135,7 +1135,8 @@
13 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
14 | -chorusos* | -chorusrdb* \
15 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
16- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
17+ | -mingw32* | -linux-gnu* | -linux-uclibc* \
18+ | -uxpv* | -beos* | -mpeix* | -udk* \
19 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
20 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
21 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \