summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-04-22 13:21:55 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-04-22 13:24:13 (EDT)
commit80c0b7026066d1eb468947151ca6c4ee43202166 (patch)
treef34ef3cfc9859617b8991bed3b311e35cfe5aee4
parent2ba7de9b903b4b0eb6ddffefa8a8865415cb5e42 (diff)
build: Add a new target macro.
-rwxr-xr-xbuild108
1 files changed, 54 insertions, 54 deletions
diff --git a/build b/build
index 1496629..a19260a 100755
--- a/build
+++ b/build
@@ -30,6 +30,7 @@ bootstrap1_opts = \
--disable-libmudflap \
--disable-libssp
+target = $(OPK_HOST_ARCH)
builddir = gcc-build
nop:
@@ -46,13 +47,13 @@ configure:
touch $@
build: configure
- libsubdir="/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)" && \
+ libsubdir="/usr/lib/$(target)/gcc-$(base_version)" && \
oh-autobuild -B "$(builddir)" -T bootstrap-lean -- -j $${JOBS:-1} \
libsubdir="$${libsubdir}" \
libexecsubdir="$${libsubdir}" \
libsubincludedir="$${libsubdir}" \
fincludedir="$${libsubdir}/finclude" \
- toolexeclibdir=/usr/lib/$(OPK_HOST_ARCH) \
+ toolexeclibdir="/usr/lib/$(target)" \
MULTIOSDIR=
touch $@
@@ -65,26 +66,25 @@ install: build
# * GNU Make executes any commands that contain "$(MAKE)", even if -n
# is specified.
# See also: <http://gcc.gnu.org/ml/gcc/2013-04/msg00171.html>.
- # TODO: Replace $(OPK_HOST_ARCH) with the target arch.
- libsubdir="/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)" && \
+ libsubdir="/usr/lib/$(target)/gcc-$(base_version)" && \
oh-autoinstall -B "$(builddir)" -T install -- \
gxx_include_dir=/usr/include/c++-4.7 \
- host_installdir=/usr/include/$(OPK_HOST_ARCH)/c++-4.7/bits \
+ host_installdir=/usr/include/$(target)/c++-4.7/bits \
libsubdir="$${libsubdir}" \
libexecsubdir="$${libsubdir}" \
libsubincludedir="$${libsubdir}" \
fincludedir="$${libsubdir}/finclude" \
- toolexeclibdir=/usr/lib/$(OPK_HOST_ARCH) \
+ toolexeclibdir="/usr/lib/$(target)" \
MULTIOSDIR=
# Change the target architecture prefix of files in /usr/bin.
rm -f dest/usr/bin/*-gcc-$(base_version).*
for f in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do \
rm -f dest/usr/bin/$${f}-$(base_version); \
mv dest/usr/bin/*-$${f}-$(base_version) \
- dest/usr/bin/$(OPK_HOST_ARCH)-$$(printf '%s' \
+ dest/usr/bin/$(target)-$$(printf '%s' \
dest/usr/bin/*-$${f}-$(base_version) | \
sed "s/^.*-\($${f}\)/\1/"); \
- ln -sf $(OPK_HOST_ARCH)-$$(printf '%s' \
+ ln -sf $(target)-$$(printf '%s' \
dest/usr/bin/*-$${f}-$(base_version) | \
sed "s/^.*-\($${f}\)/\1/") \
dest/usr/bin/$$(printf '%s' \
@@ -92,67 +92,67 @@ install: build
sed "s/^.*-\($${f}\)/\1/"); \
done
# Remove the internal libiberty.a.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libiberty.a
+ rm -f dest/usr/lib/$(target)/libiberty.a
# Move libstdc++.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libstdc++.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libstdc++.so.6 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libstdc++.so
+ rm -f dest/usr/lib/$(target)/libstdc++.so
+ ln -sf /usr/lib/$(target)/libstdc++.so.6 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libstdc++.so
# Move libstdc++.a and libsupc++.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libstdc++.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libsupc++.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libstdc++.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libsupc++.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Move libmudflap.so and libmudflapth.so links.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libmudflap.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libmudflap.so.0 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libmudflap.so
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libmudflapth.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libmudflapth.so.0 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libmudflapth.so
+ rm -f dest/usr/lib/$(target)/libmudflap.so
+ ln -sf /usr/lib/$(target)/libmudflap.so.0 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libmudflap.so
+ rm -f dest/usr/lib/$(target)/libmudflapth.so
+ ln -sf /usr/lib/$(target)/libmudflapth.so.0 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libmudflapth.so
# Move libmudflap.a and libmudflapth.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libmudflap.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libmudflapth.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libmudflap.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libmudflapth.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Move libssp.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libssp.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libssp.so.0 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libssp.so
+ rm -f dest/usr/lib/$(target)/libssp.so
+ ln -sf /usr/lib/$(target)/libssp.so.0 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libssp.so
# Move libssp.a and libssp_nonshared.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libssp.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libssp_nonshared.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libssp.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libssp_nonshared.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Move libgcc_s.so.1 under /lib.
- mkdir -p dest/lib/$(OPK_HOST_ARCH)
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libgcc_s.so.1 dest/lib/$(OPK_HOST_ARCH)
+ mkdir -p dest/lib/$(target)
+ mv dest/usr/lib/$(target)/libgcc_s.so.1 dest/lib/$(target)
# Move libgcc_s.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libgcc_s.so
- ln -sf /lib/$(OPK_HOST_ARCH)/libgcc_s.so.1 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libgcc_s.so
+ rm -f dest/usr/lib/$(target)/libgcc_s.so
+ ln -sf /lib/$(target)/libgcc_s.so.1 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libgcc_s.so
# Move libquadmath.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libquadmath.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libquadmath.so.0 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libquadmath.so
+ rm -f dest/usr/lib/$(target)/libquadmath.so
+ ln -sf /usr/lib/$(target)/libquadmath.so.0 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libquadmath.so
# Move libquadmath.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libquadmath.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libquadmath.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Move libgomp.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libgomp.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libgomp.so.1 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libgomp.so
+ rm -f dest/usr/lib/$(target)/libgomp.so
+ ln -sf /usr/lib/$(target)/libgomp.so.1 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libgomp.so
# Move libgomp.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libgomp.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libgomp.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Move libitm.so link.
- rm -f dest/usr/lib/$(OPK_HOST_ARCH)/libitm.so
- ln -sf /usr/lib/$(OPK_HOST_ARCH)/libitm.so.1 \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/libitm.so
+ rm -f dest/usr/lib/$(target)/libitm.so
+ ln -sf /usr/lib/$(target)/libitm.so.1 \
+ dest/usr/lib/$(target)/gcc-$(base_version)/libitm.so
# Move libitm.a.
- mv dest/usr/lib/$(OPK_HOST_ARCH)/libitm.a \
- dest/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version)/
+ mv dest/usr/lib/$(target)/libitm.a \
+ dest/usr/lib/$(target)/gcc-$(base_version)/
# Remove libtool archives.
- libdir=usr/lib/$(OPK_HOST_ARCH) && \
+ libdir=usr/lib/$(target) && \
rm -f \
dest/$(libdir)/libmudflap.la \
dest/$(libdir)/libmudflapth.la \