From a6a280b5f0c6027cce0f55039e704ae5fd7b2d9e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 13 May 2019 23:47:43 -0400 Subject: build: Post-process directories --- diff --git a/build b/build index 3a51bbf..3a12bb3 100755 --- a/build +++ b/build @@ -16,6 +16,7 @@ install_targets = install-$(OPK_HOST_ARCH) installnative_targets = installnative-$(OPK_HOST_ARCH) installcross_targets = installcross-$(OPK_HOST_ARCH) +version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | sed 's/+sip.*//') base_version = $$(printf '%s\n' '$(OPK_SOURCE)' | sed 's/^gcc-//') target = $$(printf '%s' '$@' | sed 's/^[a-z]*-//') @@ -63,8 +64,12 @@ bootstrap1_opts = \ --disable-libgomp \ --disable-libssp +libdir = $(destdir)/usr/lib/$(OPK_HOST_ARCH) +gcclibdir = $(destdir)/usr/lib/$(OPK_HOST_ARCH)/gcc-$(base_version) +tgtlibdir = $(destdir)/usr/lib/$(OPK_HOST_ARCH)/$(target)/gcc-$(base_version) +libsuffix = $$(g++ -print-multi-os-directory) dir_macros = \ - user_tooldir_prefix="/usr/lib/$(target)/gcc-$(base_version)" \ + user_tooldir_prefix=$(tgtlibdir) \ gcc_gxx_tool_include_dir="/usr/include/$(target)/c++-$(base_version)" extra_opts = @@ -169,6 +174,11 @@ $(installnative_targets): mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\ ln -s $(target)-$${f} $(destdir)/usr/bin/$${f}; \ done + # Move files into ProteanOS-style directories. + mkdir -p $(tgtlibdir) + mv $(libdir)/gcc/$(target_gnu)/$(version)/* $(tgtlibdir) + mkdir -p $(gcclibdir) + mv $(libdir)/$(libsuffix)/* $(gcclibdir) # Move libstdc++.so link. rm -f $(destdir)/usr/lib/$(target)/libstdc++.so ln -sf /usr/lib/$(target)/libstdc++.so.6 \ @@ -265,6 +275,9 @@ $(installcross_targets): for f in $(destdir)/usr/bin/*; do f="$${f##*/}"; \ mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\ done + # Move files into ProteanOS-style directories. + mkdir -p $(tgtlibdir) + mv $(libdir)/gcc/$(target_gnu)/$(version)/* $(tgtlibdir) libdir=/usr/lib/$(target) && \ rm -Rf \ $(destdir)$${libdir}/gcc-$(base_version)/liblto_plugin.la \ -- cgit v0.9.1