Mercurial > hg > aboriginal
annotate sources/sections/elf2flt.sh @ 1839:c8293b3ab81f draft default tip
Teach chroot-splice to accept one or two arguments. (Control image now optional.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 17 Jan 2016 21:18:52 -0600 |
parents | 8d8a961cfbca |
children |
rev | line source |
---|---|
1773
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
1 # This pile of crap cannot be built without zlib. Even if you're not using |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
2 # it, neither the autoconf nor the C has any concept of _not_ using zlib. |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
3 |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
4 setupfor zlib |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
5 CC=${HOST_ARCH:+${HOST_ARCH}-}$CC ./configure && |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
6 make -j $CPUS && |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
7 install -D z*.h "$STAGE_DIR/host/include" && |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
8 install -D libz.a "$STAGE_DIR/host/lib" && |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
9 cleanup |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
10 |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
11 setupfor elf2flt |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
12 CC=${HOST_ARCH:+${HOST_ARCH}-}$CC CFLAGS="$CFLAGS $STATIC_FLAGS" \ |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
13 ./configure --with-bfd-include-dir="$STAGE_DIR/host/include" \ |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
14 --with-binutils-include-dir="$STAGE_DIR/host/include" \ |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
15 --with-libiberty="$STAGE_DIR/host/lib/libiberty.a" --prefix="$STAGE_DIR" \ |
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
16 --with-libbfd="$STAGE_DIR/host/lib/libbfd.a" --target="$ELF2FLT" \ |
1801
8d8a961cfbca
Elf2flt doesn't handle pic relocations well. Add an option to make it less bad.
Rob Landley <rob@landley.net>
parents:
1793
diff
changeset
|
17 --with-zlib-prefix="$STAGE_DIR/host" --enable-always-reloc-text \ |
8d8a961cfbca
Elf2flt doesn't handle pic relocations well. Add an option to make it less bad.
Rob Landley <rob@landley.net>
parents:
1793
diff
changeset
|
18 ${HOST_ARCH:+--host=${KARCH}-unknown-linux} && |
1704
3675adfb4e36
Add basic elf2flt support to simple-cross-compiler.sh and sh2eb.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 make -j $CPUS && |
3675adfb4e36
Add basic elf2flt support to simple-cross-compiler.sh and sh2eb.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 make install TARGET="$CROSS_TARGET" PREFIX="$TOOLCHAIN_PREFIX" |
1789
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
21 |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
22 [ $? -ne 0 ] && dienow |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
23 |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
24 # elf2flt's wrapper sometimes calls the unprefixed version of this. :( |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
25 |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
26 if [ ! -e "$STAGE_DIR/bin/ld.real" ] |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
27 then |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
28 ln -s "${TOOLCHAIN_PREFIX}ld.real" "$STAGE_DIR/bin/ld.real" |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
29 fi |
17d2316a3c3a
The elf2flt wrapper sometimes calles the unprefixed ld.real. Humor it for now.
Rob Landley <rob@landley.net>
parents:
1773
diff
changeset
|
30 |
1773
eca87f8f58fb
Changes to build cross-compiler-sh2eb.
Rob Landley <rob@landley.net>
parents:
1759
diff
changeset
|
31 cleanup |