comparison root-filesystem.sh @ 1034:27c38c82401d

Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
author Rob Landley <rob@landley.net>
date Sun, 11 Apr 2010 15:21:00 -0500
parents 2d5e356580b9
children e021bba5e22e
comparison
equal deleted inserted replaced
1033:87b3a69ca71c 1034:27c38c82401d
44 # test purposes. 44 # test purposes.
45 45
46 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -o "$STAGE_DIR/bin/hello-dynamic" && 46 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -o "$STAGE_DIR/bin/hello-dynamic" &&
47 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -static -o "$STAGE_DIR/bin/hello-static" || dienow 47 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -static -o "$STAGE_DIR/bin/hello-static" || dienow
48 48
49 # If no native compiler exists for this target... 49 # If a native compiler exists for this target, grab it
50 50
51 if [ ! -d "$BUILD/native-compiler-$ARCH" ] 51 if [ -d "$BUILD/native-compiler-$ARCH" ]
52 then 52 then
53 # Copy native compiler
53 54
55 cp -a "$BUILD/native-compiler-$ARCH/." "$STAGE_DIR/" || dienow
56 else
54 # Do we need shared libraries? 57 # Do we need shared libraries?
55 58
56 if [ ! -z "$BUILD_STATIC" ] 59 if [ ! -z "$BUILD_STATIC" ] && [ "$BUILD_STATIC" != none ]
57 then 60 then
58 echo Copying compiler libraries... 61 echo Copying compiler libraries...
59 mkdir -p "$STAGE_DIR/lib" || dienow 62 mkdir -p "$STAGE_DIR/lib" || dienow
60 (path_search \ 63 (path_search \
61 "$("$ARCH-cc" --print-search-dirs | sed -n 's/^libraries: =*//p')" \ 64 "$("$ARCH-cc" --print-search-dirs | sed -n 's/^libraries: =*//p')" \
63 || dienow) | dotprogress 66 || dienow) | dotprogress
64 fi 67 fi
65 68
66 # Since we're not installing a compiler, delete the example source code. 69 # Since we're not installing a compiler, delete the example source code.
67 rm -rf "$STAGE_DIR/src/*.c*" || dienow 70 rm -rf "$STAGE_DIR/src/*.c*" || dienow
68 71 fi
69 # If a native compiler exists for this target, use it and add supplementary
70 # development tools
71
72 else
73
74 # Copy native compiler
75
76 cp -a "$BUILD/native-compiler-$ARCH/." "$STAGE_DIR/" || dienow
77
78 # Build and install make
79
80 setupfor make
81 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \
82 --prefix="$STAGE_DIR" --build="${CROSS_HOST}" --host="${CROSS_TARGET}" &&
83 make -j $CPUS &&
84 make -j $CPUS install
85
86 cleanup
87
88 # Build and install bash. (Yes, this is an old version. It's intentional.)
89
90 setupfor bash
91 # wire around some tests ./configure can't run when cross-compiling.
92 echo -e "ac_cv_func_setvbuf_reversed=no\nbash_cv_sys_named_pipes=yes\nbash_cv_have_mbstate_t=yes\nbash_cv_getenv_redef=no" > config.cache &&
93 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" RANLIB="${ARCH}-ranlib" \
94 ./configure --prefix="$STAGE_DIR" \
95 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \
96 --without-bash-malloc --disable-readline &&
97 # note: doesn't work with -j
98 make &&
99 make install &&
100 # Make bash the default shell.
101 ln -sf bash "$STAGE_DIR/bin/sh"
102
103 cleanup
104
105 # Build and install distcc
106
107 setupfor distcc
108 rsync_cv_HAVE_C99_VSNPRINTF=yes \
109 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \
110 --host="${CROSS_TARGET}" --prefix="$STAGE_DIR" \
111 --with-included-popt --disable-Werror &&
112 make -j $CPUS &&
113 make -j $CPUS install &&
114 mkdir -p "$STAGE_DIR/distcc" || dienow
115
116 for i in gcc cc g++ c++
117 do
118 ln -s ../bin/distcc "$STAGE_DIR/distcc/$i" || dienow
119 done
120
121 cleanup
122
123 # Delete some unneeded files
124
125 [ -z "$SKIP_STRIP" ] &&
126 rm -rf "$STAGE_DIR"/{info,man,libexec/gcc/*/*/install-tools}
127
128 fi # native compiler
129 72
130 # This is allowed to fail if there are no configs. 73 # This is allowed to fail if there are no configs.
131 74
132 mv "$STAGE_DIR/config-"* "$STAGE_DIR/src" 2>/dev/null 75 mv "$STAGE_DIR/config-"* "$STAGE_DIR/src" 2>/dev/null
133 76