Mercurial > hg > aboriginal
annotate sources/sections/binutils.build @ 1021:ae5861222322
Link to mirror sites from each other.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 29 Mar 2010 08:17:24 -0500 |
parents | c6b3d648ead6 |
children | 9a7b5e73e6ea |
rev | line source |
---|---|
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 # Build binutils, which provides the linker and assembler and such. |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 function configure_binutils() |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 { |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 "$CURSRC/configure" --prefix="$STAGE_DIR" \ |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 --build="$CROSS_HOST" --host="$FROM_HOST" --target="$CROSS_TARGET" \ |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 --disable-nls --disable-shared --disable-multilib --disable-werror \ |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 --with-lib-path=lib --program-prefix="$PROGRAM_PREFIX" $BINUTILS_FLAGS |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 [ $? -ne 0 ] && dienow |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 } |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 if [ -z "$FROM_ARCH" ] |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 then |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 # Create a simple cross compiler, from this host to target $ARCH. |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 # This has no prerequisites. |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 |
981 | 18 # Define lots of environment variables to make configure behave. |
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 AR=ar AS=as LD=ld NM=nm OBJDUMP=objdump OBJCOPY=objcopy configure_binutils |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 else |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 # Canadian cross for an arbitrary host/target. The new compiler will run |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 # on $FROM_ARCH as its host, and build executables for $ARCH as its target. |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 # (Use host==target to produce a native compiler.) Doing this requires |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 # existing host ($FROM_ARCH) _and_ target ($ARCH) cross compilers as |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 # prerequisites. |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 AR="${FROM_ARCH}-ar" CC="${FROM_ARCH}-cc" configure_binutils |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 fi |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 # Now that it's configured, build and install binutils |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 make -j $CPUS configure-host && |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 make -j $CPUS CFLAGS="-O2 $STATIC_FLAGS" && |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 make -j $CPUS install && |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 # Fix up install |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 mkdir -p "$STAGE_DIR/include" && |
981 | 40 cp "$CURSRC/include/libiberty.h" "$STAGE_DIR/include" |