summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-04-22 13:25:29 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-04-22 13:25:29 (EDT)
commit1b80dbdf467dac5cdf61d8a76a6570a1c0616e4e (patch)
tree48881b54a1879bbde7c3404bdafb8357640a0aef /build
parent80c0b7026066d1eb468947151ca6c4ee43202166 (diff)
build: Add a new destdir macro.
Diffstat (limited to 'build')
-rwxr-xr-xbuild121
1 files changed, 62 insertions, 59 deletions
diff --git a/build b/build
index a19260a..4d44351 100755
--- a/build
+++ b/build
@@ -32,6 +32,7 @@ bootstrap1_opts = \
target = $(OPK_HOST_ARCH)
builddir = gcc-build
+destdir = dest
nop:
@:
@@ -67,7 +68,7 @@ install: build
# is specified.
# See also: <http://gcc.gnu.org/ml/gcc/2013-04/msg00171.html>.
libsubdir="/usr/lib/$(target)/gcc-$(base_version)" && \
- oh-autoinstall -B "$(builddir)" -T install -- \
+ oh-autoinstall -B "$(builddir)" -d "$(destdir)" -T install -- \
gxx_include_dir=/usr/include/c++-4.7 \
host_installdir=/usr/include/$(target)/c++-4.7/bits \
libsubdir="$${libsubdir}" \
@@ -77,98 +78,100 @@ install: build
toolexeclibdir="/usr/lib/$(target)" \
MULTIOSDIR=
# Change the target architecture prefix of files in /usr/bin.
- rm -f dest/usr/bin/*-gcc-$(base_version).*
+ rm -f $(destdir)/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/$(target)-$$(printf '%s' \
- dest/usr/bin/*-$${f}-$(base_version) | \
+ rm -f $(destdir)/usr/bin/$${f}-$(base_version); \
+ mv $(destdir)/usr/bin/*-$${f}-$(base_version) \
+ $(destdir)/usr/bin/$(target)-$$(printf '%s' \
+ $(destdir)/usr/bin/*-$${f}-$(base_version) | \
sed "s/^.*-\($${f}\)/\1/"); \
ln -sf $(target)-$$(printf '%s' \
- dest/usr/bin/*-$${f}-$(base_version) | \
+ $(destdir)/usr/bin/*-$${f}-$(base_version) | \
sed "s/^.*-\($${f}\)/\1/") \
- dest/usr/bin/$$(printf '%s' \
- dest/usr/bin/*-$${f}-$(base_version) | \
+ $(destdir)/usr/bin/$$(printf '%s' \
+ $(destdir)/usr/bin/*-$${f}-$(base_version) | \
sed "s/^.*-\($${f}\)/\1/"); \
done
# Remove the internal libiberty.a.
- rm -f dest/usr/lib/$(target)/libiberty.a
+ rm -f $(destdir)/usr/lib/$(target)/libiberty.a
# Move libstdc++.so link.
- rm -f dest/usr/lib/$(target)/libstdc++.so
+ rm -f $(destdir)/usr/lib/$(target)/libstdc++.so
ln -sf /usr/lib/$(target)/libstdc++.so.6 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libstdc++.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libstdc++.so
# Move libstdc++.a and libsupc++.a.
- 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)/
+ mv $(destdir)/usr/lib/$(target)/libstdc++.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libsupc++.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Move libmudflap.so and libmudflapth.so links.
- rm -f dest/usr/lib/$(target)/libmudflap.so
+ rm -f $(destdir)/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
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libmudflap.so
+ rm -f $(destdir)/usr/lib/$(target)/libmudflapth.so
ln -sf /usr/lib/$(target)/libmudflapth.so.0 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libmudflapth.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libmudflapth.so
# Move libmudflap.a and libmudflapth.a.
- 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)/
+ mv $(destdir)/usr/lib/$(target)/libmudflap.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libmudflapth.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Move libssp.so link.
- rm -f dest/usr/lib/$(target)/libssp.so
+ rm -f $(destdir)/usr/lib/$(target)/libssp.so
ln -sf /usr/lib/$(target)/libssp.so.0 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libssp.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libssp.so
# Move libssp.a and libssp_nonshared.a.
- 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)/
+ mv $(destdir)/usr/lib/$(target)/libssp.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libssp_nonshared.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Move libgcc_s.so.1 under /lib.
- mkdir -p dest/lib/$(target)
- mv dest/usr/lib/$(target)/libgcc_s.so.1 dest/lib/$(target)
+ mkdir -p $(destdir)/lib/$(target)
+ mv $(destdir)/usr/lib/$(target)/libgcc_s.so.1 $(destdir)/lib/$(target)
# Move libgcc_s.so link.
- rm -f dest/usr/lib/$(target)/libgcc_s.so
+ rm -f $(destdir)/usr/lib/$(target)/libgcc_s.so
ln -sf /lib/$(target)/libgcc_s.so.1 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libgcc_s.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libgcc_s.so
# Move libquadmath.so link.
- rm -f dest/usr/lib/$(target)/libquadmath.so
+ rm -f $(destdir)/usr/lib/$(target)/libquadmath.so
ln -sf /usr/lib/$(target)/libquadmath.so.0 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libquadmath.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libquadmath.so
# Move libquadmath.a.
- mv dest/usr/lib/$(target)/libquadmath.a \
- dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libquadmath.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Move libgomp.so link.
- rm -f dest/usr/lib/$(target)/libgomp.so
+ rm -f $(destdir)/usr/lib/$(target)/libgomp.so
ln -sf /usr/lib/$(target)/libgomp.so.1 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libgomp.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libgomp.so
# Move libgomp.a.
- mv dest/usr/lib/$(target)/libgomp.a \
- dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libgomp.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Move libitm.so link.
- rm -f dest/usr/lib/$(target)/libitm.so
+ rm -f $(destdir)/usr/lib/$(target)/libitm.so
ln -sf /usr/lib/$(target)/libitm.so.1 \
- dest/usr/lib/$(target)/gcc-$(base_version)/libitm.so
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/libitm.so
# Move libitm.a.
- mv dest/usr/lib/$(target)/libitm.a \
- dest/usr/lib/$(target)/gcc-$(base_version)/
+ mv $(destdir)/usr/lib/$(target)/libitm.a \
+ $(destdir)/usr/lib/$(target)/gcc-$(base_version)/
# Remove libtool archives.
libdir=usr/lib/$(target) && \
rm -f \
- dest/$(libdir)/libmudflap.la \
- dest/$(libdir)/libmudflapth.la \
- dest/$(libdir)/libssp.la \
- dest/$(libdir)/libssp_nonshared.la \
- dest/$(libdir)/gcc-$(base_version)/liblto_plugin.la \
- dest/$(libdir)/libquadmath.la \
- dest/$(libdir)/libgomp.la \
- dest/$(libdir)/libitm.la \
- dest/$(libdir)/libstdc++.la \
- dest/$(libdir)/libsupc++.la
+ $(destdir)/$(libdir)/libmudflap.la \
+ $(destdir)/$(libdir)/libmudflapth.la \
+ $(destdir)/$(libdir)/libssp.la \
+ $(destdir)/$(libdir)/libssp_nonshared.la \
+ $(destdir)/$(libdir)/gcc-$(base_version)/liblto_plugin.la \
+ $(destdir)/$(libdir)/libquadmath.la \
+ $(destdir)/$(libdir)/libgomp.la \
+ $(destdir)/$(libdir)/libitm.la \
+ $(destdir)/$(libdir)/libstdc++.la \
+ $(destdir)/$(libdir)/libsupc++.la
# Remove the info directory node.
- rm -f dest/usr/share/info/dir
+ rm -f $(destdir)/usr/share/info/dir
# Remove empty documentation files.
- find dest/usr/share/man -type f -a -size 0c -a -exec rm -f '{}' ';'
- find dest/usr/share/info -type f -a -size 0c -a -exec rm -f '{}' ';'
+ find $(destdir)/usr/share/man -type f -a -size 0c -a \
+ -exec rm -f '{}' ';'
+ find $(destdir)/usr/share/info -type f -a -size 0c -a \
+ -exec rm -f '{}' ';'
# POSIX.1-2008:
# If the pathname does not begin with a '/' it shall be treated as relative to