annotate sources/sections/uClibc.build @ 1207:4021fb1183d7

Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
author Rob Landley <rob@landley.net>
date Mon, 16 Aug 2010 15:00:35 -0500
parents 2f39d1bfb2fd
children 5e22b534839a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 # Build and install uClibc
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 make_uClibc()
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
4 {
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
5 make -j $CPUS $VERBOSITY CROSS="${ARCH}-" \
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
6 UCLIBC_LDSO_NAME=ld-uClibc KERNEL_HEADERS="$STAGE_DIR/include" \
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
7 PREFIX="$STAGE_DIR/" RUNTIME_PREFIX=/ DEVEL_PREFIX=/ $1
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 }
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
9
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
10 # Configure
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
11
1152
2f39d1bfb2fd Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents: 1136
diff changeset
12 getconfig uClibc > "$WORK/mini.conf" || dienow
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
13
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
14 # Build and install
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
15
871
b274eb556b50 Merge common uclibc miniconfig stuff into baseconfig-uClibc, and add the few lines that vary per target to each target's settings file.
Rob Landley <rob@landley.net>
parents: 821
diff changeset
16 make KCONFIG_ALLCONFIG="$WORK/mini.conf" allnoconfig &&
1065
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
17 mkdir -p "$STAGE_DIR/src" &&
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
18 cp .config "$STAGE_DIR/src/config-uClibc" &&
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
19 make_uClibc install || dienow
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
20
1136
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
21 # Old versions of uClibc couldn't be told not to hardwire absolute paths
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
22 # into their linker scripts. This isn't needed for current versions, and
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
23 # is allowed to fail if HAVE_SHARED=n
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
24
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
25 sed -i 's@/lib/@@g' "$STAGE_DIR/lib/libc.so" 2>/dev/null
1130
c222ae88733a Add NO_CPLUSPLUS config option, to skip c++ support entirely.
Rob Landley <rob@landley.net>
parents: 1090
diff changeset
26
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
27 # Build ldd and friends
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
28
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
29 if [ ! -z "$HOST_ARCH" ]
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 then
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
31 # The uClibc utils/Makefile.in is crazy. There's no way to specify a prefix,
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
32 # or to pass in --static via CFLAGS. Just build 'em by hand.
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
33
1207
4021fb1183d7 Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
Rob Landley <rob@landley.net>
parents: 1152
diff changeset
34 "$ARCH-cc" utils/ldd.c -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}ldd" --static \
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
35 -I ldso/include -DBUILDING_LINKAGE &&
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
36 "$ARCH-cc" utils/ldconfig.c utils/chroot_realpath.c \
1207
4021fb1183d7 Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
Rob Landley <rob@landley.net>
parents: 1152
diff changeset
37 -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}ldconfig" --static -I ldso/include \
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
38 -DUCLIBC_RUNTIME_PREFIX='"/"' -DBUILDING_LINKAGE || dienow
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
39 fi