summaryrefslogtreecommitdiff
path: root/strata/build-essential/stage1-gcc.morph
blob: 0574749bbc48167d618498557015784efe14b517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: stage1-gcc
kind: chunk

configure-commands:
- mkdir o

# Configure flag notes:
#  1. See gcc.morph.
#  2. Disable searching /usr/local/include for headers
#  3. The pass 1 compiler needs to find the libraries we build in pass
#     2.  Include path must be set explicility, because it defaults to
#     $SYSROOT/usr/include rather than $SYSROOT/include.  FIXME: this
#     flag is not present until GCC 4.6.3!
#  4. Disable stuff that doesn't work when building a cross compiler
#     without an existing libc, and generally try to keep this build as
#     simple as possible.
- |
  cd o && ../configure                                        \
            $(../morph-arch-config)                           \
            --build=$(sh ../config.guess)                     \
            --host=$(sh ../config.guess)                      \
            --target=$TARGET_STAGE1                           \
            --prefix="$PREFIX"                                \
    `# [1]` --libdir="$PREFIX/lib"                            \
            --with-newlib                                     \
    `# [2]` --with-local-prefix="$PREFIX"                     \
    `# [3]` --with-native-system-header-dir="$PREFIX/include" \
            --with-mpfr-include="$(pwd)/../mpfr/src"          \
            --with-mpfr-lib="$(pwd)/mpfr/src/.libs"           \
            --with-system-zlib                                \
            --without-headers                                 \
            --without-cloog                                   \
            --without-ppl                                     \
            --disable-bootstrap                               \
            --disable-nls                                     \
            --disable-shared                                  \
            --disable-multilib                                \
    `# [4]` --disable-decimal-float                           \
    `# [4]` --disable-threads                                 \
    `# [4]` --disable-libgomp                                 \
    `# [4]` --disable-libmudflap                              \
    `# [4]` --disable-libquadmath                             \
    `# [4]` --disable-libssp                                  \
    `# [4]` --disable-target-libiberty                        \
    `# [4]` --disable-target-zlib                             \
            --enable-languages=c

build-commands:
- cd o && make

install-commands:
- cd o && make DESTDIR="$DESTDIR" install

# The file libgcc_eh is required during eglibc's build, but is not created
# because we built GCC with --disable-shared. This is a workaround for
# eglibc's build system being slightly broken.
- |
  libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name)
  ln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/')