diff --git a/sys/devel/gcc/ympbuild b/sys/devel/gcc/ympbuild index 18ed1f42..0bafcaf9 100644 --- a/sys/devel/gcc/ympbuild +++ b/sys/devel/gcc/ympbuild @@ -32,7 +32,6 @@ prepare(){ setup(){ options=( --prefix=/usr - --libdir=/usr/lib64 --libexecdir=/usr/libexec --mandir=/usr/share/man --infodir=/usr/share/info @@ -44,24 +43,44 @@ setup(){ --enable-plugin --enable-lto --enable-languages=c,c++$(use_opt langs ",fortran,go,objc,obj-c++" "") - $(use_opt multilib "--enable-multilib" "") - $(use_opt multilib "--enable-multiarch" "") --enable-shared --without-zstd --with-system-zlib --disable-nls ) + if use multilib ; then + mkdir build-lib32 + cd build-lib32 + ../configure ${options[@]} \ + --libdir=/usr/lib32 \ + --target=i686-pc-linux-gnu + cd .. + fi mkdir build cd build - ../configure ${options[@]} + ../configure ${options[@]} \ + --libdir=/usr/lib64 \ + --target=x86_64-pc-linux-gnu \ + $(use_opt multilib "--enable-multilib" "") \ + $(use_opt multilib "--with-multilib-list=m32,m64" "") } build(){ + if use multilib ; then + cd build-lib32 + make -j`nproc` + cd .. + fi cd build make -j`nproc` } package(){ + if use multilib ; then + cd build-lib32 + make install -j`nproc` + cd .. + fi cd build make install -j`nproc` mkdir -p ${DESTDIR}/usr/lib64/ @@ -71,5 +90,8 @@ package(){ mv ${DESTDIR}/usr/{lib,lib32} fi fi + ln -s gcc ${DESTDIR}/usr/bin/cc + ln -s g++ ${DESTDIR}/usr/bin/cxx + ln -s ../usr/bin/cpp ${DESTDIR}/lib64/cpp }