head 1.105; access; symbols pkgsrc-2023Q4:1.105.0.14 pkgsrc-2023Q4-base:1.105 pkgsrc-2023Q3:1.105.0.12 pkgsrc-2023Q3-base:1.105 pkgsrc-2023Q2:1.105.0.10 pkgsrc-2023Q2-base:1.105 pkgsrc-2023Q1:1.105.0.8 pkgsrc-2023Q1-base:1.105 pkgsrc-2022Q4:1.105.0.6 pkgsrc-2022Q4-base:1.105 pkgsrc-2022Q3:1.105.0.4 pkgsrc-2022Q3-base:1.105 pkgsrc-2022Q2:1.105.0.2 pkgsrc-2022Q2-base:1.105 pkgsrc-2022Q1:1.104.0.2 pkgsrc-2022Q1-base:1.104 pkgsrc-2021Q4:1.102.0.14 pkgsrc-2021Q4-base:1.102 pkgsrc-2021Q3:1.102.0.12 pkgsrc-2021Q3-base:1.102 pkgsrc-2021Q2:1.102.0.10 pkgsrc-2021Q2-base:1.102 pkgsrc-2021Q1:1.102.0.8 pkgsrc-2021Q1-base:1.102 pkgsrc-2020Q4:1.102.0.6 pkgsrc-2020Q4-base:1.102 pkgsrc-2020Q3:1.102.0.4 pkgsrc-2020Q3-base:1.102 pkgsrc-2020Q2:1.102.0.2 pkgsrc-2020Q2-base:1.102 pkgsrc-2020Q1:1.101.0.6 pkgsrc-2020Q1-base:1.101 pkgsrc-2019Q4:1.101.0.8 pkgsrc-2019Q4-base:1.101 pkgsrc-2019Q3:1.101.0.4 pkgsrc-2019Q3-base:1.101 pkgsrc-2019Q2:1.101.0.2 pkgsrc-2019Q2-base:1.101 pkgsrc-2019Q1:1.100.0.6 pkgsrc-2019Q1-base:1.100 pkgsrc-2018Q4:1.100.0.4 pkgsrc-2018Q4-base:1.100 pkgsrc-2018Q3:1.100.0.2 pkgsrc-2018Q3-base:1.100 pkgsrc-2018Q2:1.99.0.6 pkgsrc-2018Q2-base:1.99 pkgsrc-2018Q1:1.99.0.4 pkgsrc-2018Q1-base:1.99 pkgsrc-2017Q4:1.99.0.2 pkgsrc-2017Q4-base:1.99 pkgsrc-2017Q3:1.97.0.16 pkgsrc-2017Q3-base:1.97 pkgsrc-2017Q2:1.97.0.12 pkgsrc-2017Q2-base:1.97 pkgsrc-2017Q1:1.97.0.10 pkgsrc-2017Q1-base:1.97 pkgsrc-2016Q4:1.97.0.8 pkgsrc-2016Q4-base:1.97 pkgsrc-2016Q3:1.97.0.6 pkgsrc-2016Q3-base:1.97 pkgsrc-2016Q2:1.97.0.4 pkgsrc-2016Q2-base:1.97 pkgsrc-2016Q1:1.97.0.2 pkgsrc-2016Q1-base:1.97 pkgsrc-2015Q4:1.93.0.6 pkgsrc-2015Q4-base:1.93 pkgsrc-2015Q3:1.93.0.4 pkgsrc-2015Q3-base:1.93 pkgsrc-2015Q2:1.93.0.2 pkgsrc-2015Q2-base:1.93 pkgsrc-2015Q1:1.91.0.4 pkgsrc-2015Q1-base:1.91 pkgsrc-2014Q4:1.91.0.2 pkgsrc-2014Q4-base:1.91 pkgsrc-2014Q3:1.89.0.6 pkgsrc-2014Q3-base:1.89 pkgsrc-2014Q2:1.89.0.4 pkgsrc-2014Q2-base:1.89 pkgsrc-2014Q1:1.89.0.2 pkgsrc-2014Q1-base:1.89 pkgsrc-2013Q4:1.88.0.8 pkgsrc-2013Q4-base:1.88 pkgsrc-2013Q3:1.88.0.6 pkgsrc-2013Q3-base:1.88 pkgsrc-2013Q2:1.88.0.4 pkgsrc-2013Q2-base:1.88 pkgsrc-2013Q1:1.88.0.2 pkgsrc-2013Q1-base:1.88 pkgsrc-2012Q4:1.87.0.4 pkgsrc-2012Q4-base:1.87 pkgsrc-2012Q3:1.87.0.2 pkgsrc-2012Q3-base:1.87 pkgsrc-2012Q2:1.86.0.8 pkgsrc-2012Q2-base:1.86 pkgsrc-2012Q1:1.86.0.6 pkgsrc-2012Q1-base:1.86 pkgsrc-2011Q4:1.86.0.4 pkgsrc-2011Q4-base:1.86 pkgsrc-2011Q3:1.86.0.2 pkgsrc-2011Q3-base:1.86 pkgsrc-2011Q2:1.85.0.8 pkgsrc-2011Q2-base:1.85 pkgsrc-2011Q1:1.85.0.6 pkgsrc-2011Q1-base:1.85 pkgsrc-2010Q4:1.85.0.4 pkgsrc-2010Q4-base:1.85 pkgsrc-2010Q3:1.85.0.2 pkgsrc-2010Q3-base:1.85 pkgsrc-2010Q2:1.84.0.6 pkgsrc-2010Q2-base:1.84 pkgsrc-2010Q1:1.84.0.4 pkgsrc-2010Q1-base:1.84 pkgsrc-2009Q4:1.84.0.2 pkgsrc-2009Q4-base:1.84 pkgsrc-2009Q3:1.83.0.4 pkgsrc-2009Q3-base:1.83 pkgsrc-2009Q2:1.83.0.2 pkgsrc-2009Q2-base:1.83 pkgsrc-2009Q1:1.82.0.4 pkgsrc-2009Q1-base:1.82 pkgsrc-2008Q4:1.82.0.2 pkgsrc-2008Q4-base:1.82 pkgsrc-2008Q3:1.76.0.10 pkgsrc-2008Q3-base:1.76 cube-native-xorg:1.76.0.8 cube-native-xorg-base:1.76 pkgsrc-2008Q2:1.76.0.6 pkgsrc-2008Q2-base:1.76 cwrapper:1.76.0.4 pkgsrc-2008Q1:1.76.0.2 pkgsrc-2008Q1-base:1.76 pkgsrc-2007Q4:1.75.0.2 pkgsrc-2007Q4-base:1.75 pkgsrc-2007Q3:1.72.0.2 pkgsrc-2007Q3-base:1.72 pkgsrc-2007Q2:1.70.0.2 pkgsrc-2007Q2-base:1.70 pkgsrc-2007Q1:1.65.0.4 pkgsrc-2007Q1-base:1.65 jlam-pkgviews:1.65.0.2 jlam-pkgviews-base:1.65 pkgsrc-2006Q4:1.60.0.2 pkgsrc-2006Q4-base:1.60 pkgsrc-2006Q3:1.53.0.2 pkgsrc-2006Q3-base:1.53 pkgsrc-2006Q2:1.40.0.4 pkgsrc-2006Q2-base:1.40 tv-derecurse-eol:1.12.2.12 pkgsrc-2006Q1:1.40.0.2 pkgsrc-2006Q1-base:1.40 pkgsrc-2005Q4:1.39.0.2 pkgsrc-2005Q4-base:1.39 pkgsrc-2005Q3:1.37.0.2 pkgsrc-2005Q3-base:1.37 pkgsrc-2005Q2:1.32.0.2 pkgsrc-2005Q2-base:1.32 tv-derecurse-merge:1.30 pkgsrc-2005Q1:1.26.0.2 pkgsrc-2005Q1-base:1.26 pkgsrc-2004Q4:1.15.0.2 pkgsrc-2004Q4-base:1.15 tv-derecurse:1.12.0.2 tv-derecurse-base:1.26; locks; strict; comment @# @; 1.105 date 2022.04.04.11.23.07; author riastradh; state Exp; branches; next 1.104; commitid jGk9U4TgudBQhSyD; 1.104 date 2022.03.13.06.26.57; author nia; state Exp; branches; next 1.103; commitid GfTNBnrOwYi3m1wD; 1.103 date 2022.01.18.01.41.09; author pho; state Exp; branches; next 1.102; commitid PnZacn3jIIBFv3pD; 1.102 date 2020.04.27.05.23.11; author rillig; state Exp; branches; next 1.101; commitid CdMpZwdAQc1T0Z5C; 1.101 date 2019.05.07.19.36.44; author rillig; state Exp; branches; next 1.100; commitid 7bls5X0eEMdtajmB; 1.100 date 2018.08.22.20.48.37; author maya; state Exp; branches; next 1.99; commitid FMEpDDTKwDQBR9PA; 1.99 date 2017.11.16.02.16.56; author khorben; state Exp; branches; next 1.98; commitid n5e7UYvSupqfGcfA; 1.98 date 2017.11.16.00.36.10; author khorben; state Exp; branches; next 1.97; commitid ptNH1QSIRwF18cfA; 1.97 date 2016.03.11.23.03.31; author khorben; state Exp; branches; next 1.96; commitid VaF6SORApwojmhYy; 1.96 date 2016.03.04.21.25.47; author tnn; state Exp; branches; next 1.95; commitid hG4O2EBUkDb51nXy; 1.95 date 2016.03.04.01.38.39; author tnn; state Exp; branches; next 1.94; commitid kxkn1QLBnQIgtgXy; 1.94 date 2016.01.31.17.27.41; author rillig; state Exp; branches; next 1.93; commitid mggE58b4FA3eM6Ty; 1.93 date 2015.04.27.19.59.07; author jperkin; state Exp; branches; next 1.92; commitid t6vBaXv7gspVygjy; 1.92 date 2015.04.27.19.38.03; author jperkin; state Exp; branches; next 1.91; commitid sC0f8piXjq9tsgjy; 1.91 date 2014.11.25.18.27.49; author joerg; state Exp; branches; next 1.90; commitid iWlvcYQue7or0BZx; 1.90 date 2014.11.24.00.32.31; author joerg; state Exp; branches; next 1.89; commitid T4azylosSGWk5nZx; 1.89 date 2014.03.06.10.15.54; author uebayasi; state Exp; branches; next 1.88; commitid BYUaXOjtrjBQLCrx; 1.88 date 2013.03.01.13.27.38; author jperkin; state Exp; branches; next 1.87; 1.87 date 2012.07.08.19.57.10; author marino; state Exp; branches; next 1.86; 1.86 date 2011.08.04.13.32.05; author obache; state Exp; branches; next 1.85; 1.85 date 2010.08.16.10.03.44; author obache; state Exp; branches; next 1.84; 1.84 date 2009.11.23.00.25.13; author tron; state Exp; branches; next 1.83; 1.83 date 2009.05.30.19.18.01; author joerg; state Exp; branches; next 1.82; 1.82 date 2008.12.29.20.47.17; author joerg; state Exp; branches; next 1.81; 1.81 date 2008.12.29.16.53.06; author joerg; state Exp; branches; next 1.80; 1.80 date 2008.11.27.18.00.06; author joerg; state Exp; branches; next 1.79; 1.79 date 2008.11.14.14.04.12; author joerg; state Exp; branches; next 1.78; 1.78 date 2008.11.06.21.34.16; author joerg; state Exp; branches; next 1.77; 1.77 date 2008.10.30.18.56.22; author joerg; state Exp; branches; next 1.76; 1.76 date 2008.02.19.17.36.51; author tnn; state Exp; branches; next 1.75; 1.75 date 2007.11.28.14.45.22; author rillig; state Exp; branches; next 1.74; 1.74 date 2007.11.28.13.18.50; author rillig; state Exp; branches; next 1.73; 1.73 date 2007.11.28.12.57.46; author rillig; state Exp; branches; next 1.72; 1.72 date 2007.09.20.18.17.18; author rillig; state Exp; branches; next 1.71; 1.71 date 2007.08.02.18.19.32; author joerg; state Exp; branches; next 1.70; 1.70 date 2007.06.18.07.33.34; author rillig; state Exp; branches; next 1.69; 1.69 date 2007.06.06.13.20.34; author rillig; state Exp; branches; next 1.68; 1.68 date 2007.04.21.14.53.19; author tnn; state Exp; branches; next 1.67; 1.67 date 2007.04.14.14.17.49; author tnn; state Exp; branches; next 1.66; 1.66 date 2007.04.12.14.51.10; author tnn; state Exp; branches; next 1.65; 1.65 date 2007.02.19.14.50.33; author rillig; state Exp; branches; next 1.64; 1.64 date 2007.02.18.23.49.44; author rillig; state Exp; branches; next 1.63; 1.63 date 2007.02.06.20.33.50; author rillig; state Exp; branches; next 1.62; 1.62 date 2007.01.17.13.20.56; author rillig; state Exp; branches; next 1.61; 1.61 date 2007.01.04.00.57.29; author rillig; state Exp; branches; next 1.60; 1.60 date 2006.11.26.14.42.17; author rillig; state Exp; branches; next 1.59; 1.59 date 2006.11.26.13.02.53; author rillig; state Exp; branches; next 1.58; 1.58 date 2006.11.26.09.56.46; author rillig; state Exp; branches; next 1.57; 1.57 date 2006.11.11.07.44.46; author rillig; state Exp; branches; next 1.56; 1.56 date 2006.11.02.23.25.00; author rillig; state Exp; branches; next 1.55; 1.55 date 2006.10.21.11.42.25; author rillig; state Exp; branches; next 1.54; 1.54 date 2006.10.21.10.01.23; author rillig; state Exp; branches; next 1.53; 1.53 date 2006.09.17.22.52.45; author rillig; state Exp; branches; next 1.52; 1.52 date 2006.07.31.14.53.45; author jlam; state Exp; branches; next 1.51; 1.51 date 2006.07.27.13.47.29; author jlam; state Exp; branches; next 1.50; 1.50 date 2006.07.22.16.31.35; author jlam; state Exp; branches; next 1.49; 1.49 date 2006.07.21.14.21.28; author jlam; state Exp; branches; next 1.48; 1.48 date 2006.07.07.21.24.29; author jlam; state Exp; branches; next 1.47; 1.47 date 2006.07.06.22.29.53; author jlam; state Exp; branches; next 1.46; 1.46 date 2006.07.06.18.19.45; author jlam; state Exp; branches; next 1.45; 1.45 date 2006.07.05.22.21.03; author jlam; state Exp; branches; next 1.44; 1.44 date 2006.07.05.09.08.35; author jlam; state Exp; branches; next 1.43; 1.43 date 2006.07.05.06.09.15; author jlam; state Exp; branches; next 1.42; 1.42 date 2006.07.05.04.32.10; author jlam; state Exp; branches; next 1.41; 1.41 date 2006.07.02.09.45.23; author rillig; state Exp; branches; next 1.40; 1.40 date 2006.01.16.23.35.29; author wiz; state Exp; branches; next 1.39; 1.39 date 2005.12.05.22.07.08; author rillig; state Exp; branches; next 1.38; 1.38 date 2005.10.16.19.44.44; author schwarz; state Exp; branches; next 1.37; 1.37 date 2005.08.20.14.37.53; author grant; state Exp; branches; next 1.36; 1.36 date 2005.07.26.07.36.54; author grant; state Exp; branches; next 1.35; 1.35 date 2005.07.23.04.45.30; author grant; state Exp; branches; next 1.34; 1.34 date 2005.07.06.03.35.28; author grant; state Exp; branches; next 1.33; 1.33 date 2005.07.06.03.31.24; author grant; state Exp; branches; next 1.32; 1.32 date 2005.05.20.22.40.36; author rillig; state Exp; branches 1.32.2.1; next 1.31; 1.31 date 2005.05.20.21.36.05; author jlam; state Exp; branches; next 1.30; 1.30 date 2005.05.11.22.08.19; author jlam; state Exp; branches; next 1.29; 1.29 date 2005.05.09.05.06.56; author jlam; state Exp; branches; next 1.28; 1.28 date 2005.04.07.16.56.00; author tv; state Exp; branches; next 1.27; 1.27 date 2005.03.24.17.46.01; author tv; state Exp; branches; next 1.26; 1.26 date 2005.03.08.00.52.31; author grant; state Exp; branches; next 1.25; 1.25 date 2005.03.06.22.27.12; author agc; state Exp; branches; next 1.24; 1.24 date 2005.02.19.04.19.59; author grant; state Exp; branches; next 1.23; 1.23 date 2005.02.16.10.59.03; author grant; state Exp; branches; next 1.22; 1.22 date 2005.02.15.07.43.43; author grant; state Exp; branches; next 1.21; 1.21 date 2005.02.15.03.18.50; author jlam; state Exp; branches; next 1.20; 1.20 date 2005.02.14.21.33.08; author jlam; state Exp; branches; next 1.19; 1.19 date 2005.01.18.17.25.13; author jlam; state Exp; branches; next 1.18; 1.18 date 2005.01.11.18.08.20; author jlam; state Exp; branches; next 1.17; 1.17 date 2005.01.10.17.16.35; author jlam; state Exp; branches; next 1.16; 1.16 date 2005.01.10.03.40.25; author jlam; state Exp; branches; next 1.15; 1.15 date 2004.12.05.09.29.26; author grant; state Exp; branches; next 1.14; 1.14 date 2004.11.30.15.07.26; author jlam; state Exp; branches; next 1.13; 1.13 date 2004.11.30.14.50.37; author jlam; state Exp; branches; next 1.12; 1.12 date 2004.11.20.04.37.08; author grant; state Exp; branches 1.12.2.1; next 1.11; 1.11 date 2004.11.12.16.27.57; author jlam; state Exp; branches; next 1.10; 1.10 date 2004.10.14.20.22.21; author tv; state Exp; branches; next 1.9; 1.9 date 2004.10.14.20.00.30; author tv; state Exp; branches; next 1.8; 1.8 date 2004.10.09.03.49.13; author tv; state Exp; branches; next 1.7; 1.7 date 2004.10.06.09.49.53; author grant; state Exp; branches; next 1.6; 1.6 date 2004.10.04.20.28.30; author jlam; state Exp; branches; next 1.5; 1.5 date 2004.09.27.12.05.53; author jlam; state Exp; branches; next 1.4; 1.4 date 2004.09.26.21.38.03; author jlam; state Exp; branches; next 1.3; 1.3 date 2004.09.25.20.38.21; author jlam; state Exp; branches; next 1.2; 1.2 date 2004.09.23.03.59.01; author jlam; state Exp; branches; next 1.1; 1.1 date 2004.09.21.15.01.41; author jlam; state Exp; branches; next ; 1.32.2.1 date 2005.07.29.07.38.30; author snj; state Exp; branches; next 1.32.2.2; 1.32.2.2 date 2005.08.24.09.01.19; author salo; state Exp; branches; next 1.32.2.3; 1.32.2.3 date 2005.08.24.09.11.11; author salo; state Exp; branches; next ; 1.12.2.1 date 2004.11.22.22.48.05; author tv; state Exp; branches; next 1.12.2.2; 1.12.2.2 date 2004.11.23.18.25.35; author tv; state Exp; branches; next 1.12.2.3; 1.12.2.3 date 2004.11.30.15.06.35; author tv; state Exp; branches; next 1.12.2.4; 1.12.2.4 date 2004.11.30.15.10.47; author tv; state Exp; branches; next 1.12.2.5; 1.12.2.5 date 2004.12.09.17.15.01; author tv; state Exp; branches; next 1.12.2.6; 1.12.2.6 date 2005.01.10.16.15.25; author tv; state Exp; branches; next 1.12.2.7; 1.12.2.7 date 2005.01.13.20.11.55; author tv; state Exp; branches; next 1.12.2.8; 1.12.2.8 date 2005.01.24.18.40.01; author tv; state Exp; branches; next 1.12.2.9; 1.12.2.9 date 2005.02.15.16.25.23; author tv; state Exp; branches; next 1.12.2.10; 1.12.2.10 date 2005.02.25.14.46.51; author tv; state Exp; branches; next 1.12.2.11; 1.12.2.11 date 2005.03.21.15.43.00; author tv; state Exp; branches; next 1.12.2.12; 1.12.2.12 date 2005.05.17.18.29.46; author tv; state Exp; branches; next 1.12.2.13; 1.12.2.13 date 2006.06.07.15.25.40; author tv; state dead; branches; next ; desc @@ 1.105 log @mk: Cross-eyed hacks to support cross-libtool. For a long time, when cross-building, say from native=amd64 to target=powerpc, it was necessary to: 1. cross-build a _powerpc_ package called cross-libtool-base-powerpc, and then 2. install the powerpc package _natively_ with `pkg_add -m x86_64' to override the architecture check that normally forbids this kind of shenanigans, in order to cross-build anything that uses libtool as a tool. This is partly because libtool doesn't follow the normal GNU convention of `./configure --build= --host= --target=' -- in this example, build=amd64, host=amd64, target=powerpc. Instead, libtool expects to be cross-built itself, even if it's going to run as a tool. It's not as bonkers as it sounds at first: libtool is just a shell script, and it caches various information about the (cross-building!) toolchain it is built with so it can use that information later when it is run as a tool itself to cross-compile other software. To make this work, we need to create the toolchain wrappers for libtool _as if_ we were cross-building even if we are building a native package. So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE instead of USE_CROSS_COMPILE, and libtool internally sets MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make it look like we're cross-building. The new TOOLS_CROSS_DESTDIR is an alias for the (defaulted) CROSS_DESTDIR, which must now be set unconditionally in mk.conf in order for libtool to know where the cross-destdir will be; _CROSS_DESTDIR remains empty when building any native packages (including the native cross-libtool package). Finally, we need to make the resulting package be a native package, with MACHINE_ARCH set to the one that it will be installed on (in the example above, amd64), so I added an indirection _BUILD_DEFS.${var} to replace var on its own in the build definitions that get baked into the package, shown by `pkg_info -B'. Setting _BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this mutant hybrid cross-built libtool still produces a native package. All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not building cross-libtool, everything is as before. @ text @# $NetBSD: bsd.wrapper.mk,v 1.104 2022/03/13 06:26:57 nia Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. # # This code is derived from software contributed to The NetBSD Foundation # by Johnny C. Lam. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # Package-settable variables: # # WRAPPER_REORDER_CMDS # A list of library reordering specifications to make sure that the # linker sees the libraries in the correct order. # # Each of the specifications has the form reorder:l:foo:bar, which # means that -lfoo will always come before -lbar in the linker # command line. # # Keywords: libs order reorder wrapper # .include "../../mk/wrapper/wrapper-defs.mk" .PHONY: generate-wrappers .include "../../mk/buildlink3/bsd.buildlink3.mk" # Prepend ${WRAPPER_BINDIR} to the PATH so that the wrappers are found # first when searching for executables. # PREPEND_PATH+= ${WRAPPER_BINDIR} ### ### BEGIN: after the barrier ### .if exists(${_COOKIE.barrier}) && !${_CLEANING} _WRAPPER_DEBUG?= no CONFIGURE_ENV+= WRAPPER_DEBUG=${_WRAPPER_DEBUG:Q} MAKE_ENV+= WRAPPER_DEBUG=${_WRAPPER_DEBUG:Q} SCRIPTS_ENV+= WRAPPER_DEBUG="${_WRAPPER_DEBUG}" # The caching code, which greatly speeds up the build process, doesn't # work correctly on certain platforms. # _WRAP_BROKEN_CACHE= Darwin-5.*-* .if !defined(WRAPPER_UPDATE_CACHE) WRAPPER_UPDATE_CACHE?= yes . for _pattern_ in ${_WRAP_BROKEN_CACHE} . if !empty(MACHINE_PLATFORM:M${_pattern_}) WRAPPER_UPDATE_CACHE= no . endif . endfor .endif CONFIGURE_ENV+= WRAPPER_UPDATE_CACHE=${WRAPPER_UPDATE_CACHE:Q} MAKE_ENV+= WRAPPER_UPDATE_CACHE=${WRAPPER_UPDATE_CACHE:Q} # Only do the (expensive) reordering step if we have reordering # transformations. WRAPPER_REORDER_CMDS?= # empty .if !empty(WRAPPER_REORDER_CMDS) MAKE_ENV+= WRAPPER_REORDER=yes .endif # Remove rpath options if _USE_RPATH is "no". .if defined(_USE_RPATH) && !empty(_USE_RPATH:M[nN][oO]) _WRAP_TRANSFORM_CMDS+= no-rpath .endif # Add any package-specified transformations. _WRAP_TRANSFORM_CMDS+= ${WRAPPER_TRANSFORM_CMDS} # _WRAP_PATH is the path we embed in the wrapper scripts for subsequent # calls to the toolchain. We don't need to wrap them again because they # are already being called with the correct arguments. # .if !defined(_WRAP_PATH) _WRAP_PATH= ${PATH:S/${WRAPPER_BINDIR}://:S/:${WRAPPER_BINDIR}//} .endif MAKEVARS+= _WRAP_PATH # Generate wrapper scripts for the compiler tools. These wrapper # scripts are to be used instead of the actual compiler tools when # building software. # # WRAPPER_CC, WRAPPER_LD, etc. are the full paths to the wrapper # scripts. # # _WRAP_ALIASES.CC, _WRAP_ALIASES.LD, etc. are the other names by # which each wrapper may be invoked. # WRAPPEES+= AS WRAPPEES+= CC WRAPPEES+= CPP WRAPPEES+= CXX WRAPPEES+= FC .if !empty(USE_TOOLS:C/:.*//:Mimake) IMAKE?= ${X11BASE}/bin/imake WRAPPEES+= IMAKE .endif WRAPPEES+= LD WRAPPEES+= AR WRAPPEES+= RANLIB .if !empty(PKGSRC_COMPILER:Mxlc) && ${OPSYS} == "AIX" CC_R?= ${_XLC_DIR}/bin/cc_r WRAPPEES+= CC_R CXX_R?= ${_XLC_DIR}/bin/c++_r WRAPPEES+= CXX_R .endif _WRAPPEE_UNIQUE_CMDS= # empty .for _wrappee_ in ${WRAPPEES} _WRAPPEES+= ${_wrappee_} _WRAPPEE_${_wrappee_}= ${${_wrappee_}:T:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} . if empty(_WRAPPEE_UNIQUE_CMDS:M${_WRAPPEE_${_wrappee_}}) _WRAPPEE_UNIQUE_CMDS+= ${_WRAPPEE_${_wrappee_}} _WRAPPEES_UNIQUE+= ${_wrappee_} . endif .endfor # WRAPPEES .for _wrappee_ in ${_WRAPPEES} # # Strip the leading paths from the toolchain variables since we manipulate # the PATH to use the correct executable. # . if empty(${_wrappee_}:C/^/_asdf_/1:N_asdf_*) ${_wrappee_}:= ${${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} . else ${_wrappee_}:= ${${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} ${${_wrappee_}:C/^/_asdf_/1:N_asdf_*} . endif # # WRAPPER_ is the full path to the wrapper script, plus any # trailing arguments to . # WRAPPER_${_wrappee_}= ${WRAPPER_BINDIR}/${${_wrappee_}} .endfor # _WRAPPEES _WRAP_ALIASES.AS= as _WRAP_ALIASES.CC= cc gcc ada _WRAP_ALIASES.CXX= c++ g++ CC cxx _WRAP_ALIASES.CPP= cpp _WRAP_ALIASES.FC= f77 g77 gfortran _WRAP_ALIASES.IMAKE= imake _WRAP_ALIASES.LD= ld _WRAP_ALIASES.AR= ar _WRAP_ALIASES.RANLIB= ranlib # _WRAP_*. variables represent "template methods" of the main # wrapper script. This allows individual wrappers to be customized to # some degree: # _WRAP_ENV?= PATH="${_WRAP_PATH}"; export PATH _WRAP_EMPTY_FILE?= ${WRAPPER_TMPDIR}/empty _WRAP_ARG_PP?= ${_WRAP_EMPTY_FILE} _WRAP_ARG_PP_MAIN?= ${WRAPPER_TMPDIR}/arg-pp-main _WRAP_ARG_SOURCE?= ${WRAPPER_TMPDIR}/arg-source _WRAP_BUILDCMD?= ${WRAPPER_TMPDIR}/buildcmd _WRAP_CACHE?= ${WRAPPER_TMPDIR}/cache _WRAP_CACHE_BODY?= ${WRAPPER_TMPDIR}/cache-body _WRAP_CLEANUP?= ${_WRAP_EMPTY_FILE} _WRAP_CMD_SINK?= ${WRAPPER_TMPDIR}/cmd-sink _WRAP_GEN_REORDER?= ${WRAPPER_TMPDIR}/gen-reorder _WRAP_GEN_TRANSFORM?= ${WRAPPER_TMPDIR}/gen-transform _WRAP_LOG?= ${WRKLOG} _WRAP_LOGIC?= ${WRAPPER_TMPDIR}/logic _WRAP_REORDERLIBS?= ${WRAPPER_TMPDIR}/reorderlibs _WRAP_SCAN?= ${WRAPPER_TMPDIR}/scan _WRAP_SHELL_LIB?= ${WRAPPER_TMPDIR}/shell-lib _WRAP_SUBR_SH?= ${WRAPPER_TMPDIR}/wrapper-subr.sh _WRAP_SKIP_TRANSFORM?= no _WRAP_TRANSFORM?= ${_WRAP_EMPTY_FILE} _WRAP_TRANSFORM_SED?= # empty _WRAP_TRANSFORM_SEDFILE?= ${WRAPPER_TMPDIR}/transform.sed _WRAP_UNTRANSFORM_SEDFILE?= ${WRAPPER_TMPDIR}/untransform.sed # Generate the transformation sedfiles if we need them. .if !empty(_WRAP_TRANSFORM_CMDS) generate-wrappers: ${_WRAP_TRANSFORM_SEDFILE} ${_WRAP_UNTRANSFORM_SEDFILE} _WRAP_TRANSFORM_SED+= -f ${_WRAP_TRANSFORM_SEDFILE} _UNWRAP_SED= -f ${_WRAP_UNTRANSFORM_SEDFILE} .endif .for _wrappee_ in ${_WRAPPEES} _WRAPPER_SH.${_wrappee_}= ${WRAPPER_SRCDIR}/wrapper.sh _WRAP_ENV.${_wrappee_}?= ${_WRAP_ENV} _WRAP_EXTRA_ARGS.${_wrappee_}?= # empty _WRAP_ARG_PP.${_wrappee_}?= ${_WRAP_ARG_PP} _WRAP_ARG_PP_MAIN.${_wrappee_}?= ${_WRAP_ARG_PP_MAIN} _WRAP_ARG_SOURCE.${_wrappee_}?= ${_WRAP_ARG_SOURCE} _WRAP_BUILDCMD.${_wrappee_}?= ${_WRAP_BUILDCMD} _WRAP_CACHE.${_wrappee_}?= ${_WRAP_CACHE} _WRAP_CACHE_BODY.${_wrappee_}?= ${_WRAP_CACHE_BODY} _WRAP_CLEANUP.${_wrappee_}?= ${_WRAP_CLEANUP} _WRAP_CMD_SINK.${_wrappee_}?= ${_WRAP_CMD_SINK} _WRAP_LOG.${_wrappee_}?= ${_WRAP_LOG} _WRAP_LOGIC.${_wrappee_}?= ${_WRAP_LOGIC} _WRAP_SCAN.${_wrappee_}?= ${_WRAP_SCAN} _WRAP_TRANSFORM.${_wrappee_}?= ${_WRAP_TRANSFORM} _WRAP_TRANSFORM_SED.${_wrappee_}?= ${_WRAP_TRANSFORM_SED} _WRAP_SKIP_TRANSFORM.${_wrappee_}?= ${_WRAP_SKIP_TRANSFORM} _WRAP_TYPE.${_wrappee_}?= ${_wrappee_} .endfor # _WRAPPEES .if !empty(PKGSRC_COMPILER:Micc) . if !empty(CC_VERSION:M8.1) || !empty(CC_VERSION:M9.0) _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-icc81-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} . else _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-icc-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} . endif _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-icc-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-icc-cc _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} .endif .if !empty(PKGSRC_COMPILER:Mmipspro) _WRAP_ARG_PP.CC= ${WRAPPER_TMPDIR}/arg-pp-mipspro-cc _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-mipspro-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-mipspro-cc _WRAP_ARG_PP.CXX= ${_WRAP_ARG_PP.CC} _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} .endif .if !empty(PKGSRC_COMPILER:Mmipspro-ucode) _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-mipspro-ucode-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-mipspro-ucode-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} .endif .if !empty(PKGSRC_COMPILER:Mido) _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-ido-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-ido-cc # enable C++ style (//) commments with the IDO cc # just in case increase the optimization threshold from the default 1000 _WRAP_EXTRA_ARGS.CC+= -Xcpluscomm -Olimit 6000 .endif .if !empty(PKGSRC_COMPILER:Msunpro) _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-sunpro-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-sunpro-cc _WRAP_ARG_PP.CXX= ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx _WRAP_CACHE.CXX= ${WRAPPER_TMPDIR}/cache-sunpro-cxx _WRAP_CACHE_BODY.CXX= ${WRAPPER_TMPDIR}/cache-body-sunpro-cxx _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} _WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx _WRAP_CACHE_BODY.CPP= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CPP= ${_WRAP_TRANSFORM.CC} .endif .if !empty(PKGSRC_COMPILER:Mxlc) . if ${OPSYS} == "AIX" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc _WRAP_CMD_SINK.CC_R= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.CPP= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.CXX_R= ${_WRAP_CMD_SINK.CC} . elif ${OPSYS} == "Darwin" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-xlc-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-xlc-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} . else PKG_FAIL_REASON+= "xlc unsupported on ${OPSYS}" . endif .endif .if !empty(PKGSRC_COMPILER:Mccc) _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-ccc-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-ccc-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} .endif .if !empty(PKGSRC_COMPILER:Mgcc) _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-gcc _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} . if ${_PKGSRC_MKPIE} != "no" && ${PKGSRC_OVERRIDE_MKPIE:tl} == "no" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-mkpie-gcc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-mkpie-ld MKPIE_CFLAGS= ${_MKPIE_CFLAGS.gcc} .export MKPIE_CFLAGS MKPIE_LDFLAGS= ${_MKPIE_LDFLAGS} .export MKPIE_LDFLAGS . endif .endif _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-ld _WRAP_SKIP_TRANSFORM.IMAKE= yes # XXX # XXX This section is ${OPSYS}-specific and shouldn't be here. # XXX .if ${OPSYS} == "Interix" _WRAP_EXTRA_ARGS.CC+= -D_ALL_SOURCE _WRAP_EXTRA_ARGS.CXX+= -D_ALL_SOURCE _WRAP_EXTRA_ARGS.CPP+= -D_ALL_SOURCE _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-interix-gcc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-interix-ld .elif ${OPSYS} == "Darwin" _WRAP_ARG_PP.CC= ${WRAPPER_TMPDIR}/arg-pp-darwin-gcc _WRAP_ARG_PP.CXX= ${_WRAP_ARG_PP.CC} _WRAP_ARG_PP.LD= ${_WRAP_ARG_PP.CC} .elif ${OPSYS} == "UnixWare" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-unixware-gcc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${_WRAP_CMD_SINK.CC} .elif ${OPSYS} == "OSF1" _WRAP_EXTRA_ARGS.CC+= -D_POSIX_PII_SOCKET _WRAP_EXTRA_ARGS.CXX+= -D_POSIX_PII_SOCKET -D__USE_STD_IOSTREAM _WRAP_EXTRA_ARGS.CPP+= -D_POSIX_PII_SOCKET _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-osf1-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-osf1-ld .elif ${OPSYS} == "HPUX" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-hpux-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-hpux-ld .elif ${OPSYS} == "AIX" _WRAP_CMD_SINK.CC?= ${WRAPPER_TMPDIR}/cmd-sink-aix-cc _WRAP_CMD_SINK.CXX?= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-aix-ld _WRAP_CACHE_BODY.CC?= ${WRAPPER_TMPDIR}/cache-body-aix-cc _WRAP_CACHE_BODY.CC_R?= ${WRAPPER_TMPDIR}/cache-body-aix-cc _WRAP_TRANSFORM.CC?= ${WRAPPER_TMPDIR}/transform-aix-cc _WRAP_TRANSFORM.CC_R?= ${WRAPPER_TMPDIR}/transform-aix-cc _WRAP_CACHE_BODY.CXX?= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX?= ${_WRAP_TRANSFORM.CC} .elif ${OPSYS} == "IRIX" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-irix-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-irix-ld .endif .if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-cross-gcc _WRAP_CMD_SINK.CPP= ${WRAPPER_TMPDIR}/cmd-sink-cross-cpp _WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-cross-gxx .endif .if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc) _WRAP_CMD_SINK.IMAKE= ${WRAPPER_TMPDIR}/cmd-sink-solaris-imake _WRAP_CACHE_BODY.IMAKE= ${WRAPPER_TMPDIR}/cache-body-solaris-imake .endif # Filter to scrunch shell scripts by removing comments and empty lines. _WRAP_SH_CRUNCH_FILTER= ${AWK} ' \ /^\#!/ { print } \ /^[[:space:]]*\#/ || NF == 0 { next } \ /.*/ { print } \ ' _WRAP_SUBST_SED= \ -e "s|@@ABI@@|${ABI:Q}|g" \ -e "s|@@CAT@@|${CAT:Q}|g" \ -e "s|@@ECHO@@|${ECHO:Q}|g" \ -e "s|@@EXPR@@|${EXPR:Q}|g" \ -e "s|@@MV@@|${MV}|g" \ -e "s|@@SED@@|${SED:Q}|g" \ -e "s|@@TEST@@|${TEST:Q}|g" \ -e "s|@@WRAPPER_SHELL@@|${WRAPPER_SHELL:Q}|g" \ -e "s|@@_WRAP_LOG@@|${_WRAP_LOG:Q}|g" \ -e "s|@@_WRAP_REORDERLIBS@@|${_WRAP_REORDERLIBS:Q}|g" \ -e "s|@@_WRAP_SHELL_LIB@@|${_WRAP_SHELL_LIB:Q}|g" \ -e "s|@@_WRAP_SUBR_SH@@|${_WRAP_SUBR_SH}|g" .for _wrappee_ in ${_WRAPPEES} _WRAP_SUBST_SED.${_wrappee_}= \ -e "s|@@_WRAP_EMPTY_FILE@@|${_WRAP_EMPTY_FILEQ}|g" \ -e "s|@@_WRAP_ENV@@|${_WRAP_ENV.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_EXTRA_ARGS@@|${_WRAP_EXTRA_ARGS.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_ARG_PP@@|${_WRAP_ARG_PP.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_ARG_PP_MAIN@@|${_WRAP_ARG_PP_MAIN.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_ARG_SOURCE@@|${_WRAP_ARG_SOURCE.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_BUILDCMD@@|${_WRAP_BUILDCMD.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_CACHE@@|${_WRAP_CACHE.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_CACHE_BODY@@|${_WRAP_CACHE_BODY.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_CLEANUP@@|${_WRAP_CLEANUP.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_CMD_SINK@@|${_WRAP_CMD_SINK.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_LOG@@|${_WRAP_LOG.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_LOGIC@@|${_WRAP_LOGIC.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_SCAN@@|${_WRAP_SCAN.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_SKIP_TRANSFORM@@|${_WRAP_SKIP_TRANSFORM.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_TRANSFORM@@|${_WRAP_TRANSFORM.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_TRANSFORM_SED@@|${_WRAP_TRANSFORM_SED.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_TYPE@@|${_WRAP_TYPE.${_wrappee_}}|g" \ -e "s|@@WRAPPER_DEBUG@@|${_WRAPPER_DEBUG}|g" \ -e "s|@@WRAPPER_UPDATE_CACHE@@|${WRAPPER_UPDATE_CACHE}|g" \ ${_WRAP_SUBST_SED} _WRAP_COOKIE.${_wrappee_}= ${WRAPPER_DIR}/.wrapper_${_wrappee_}_done .endfor # _WRAPPEES .for _wrappee_ in ${_WRAPPEES_UNIQUE} PKG_${_wrappee_}?= ${${_wrappee_}} generate-wrappers: ${_WRAP_COOKIE.${_wrappee_}} ${_WRAP_COOKIE.${_wrappee_}}: \ ${_WRAPPER_SH.${_wrappee_}} \ ${_WRAP_ARG_PP.${_wrappee_}} \ ${_WRAP_ARG_PP_MAIN.${_wrappee_}} \ ${_WRAP_ARG_SOURCE.${_wrappee_}} \ ${_WRAP_BUILDCMD.${_wrappee_}} \ ${_WRAP_CACHE.${_wrappee_}} \ ${_WRAP_CLEANUP.${_wrappee_}} \ ${_WRAP_CMD_SINK.${_wrappee_}} \ ${_WRAP_LOGIC.${_wrappee_}} \ ${_WRAP_REORDERLIBS} \ ${_WRAP_SCAN.${_wrappee_}} \ ${_WRAP_SHELL_LIB} \ ${_WRAP_SUBR_SH} \ ${_WRAP_TRANSFORM.${_wrappee_}} ${RUN} \ wrapper="${WRAPPER_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ if [ -x "$$wrapper" ]; then ${ECHO_BUILDLINK_MSG} "=> $$wrapper already exists. Skipping"; exit 0; fi; \ ${ECHO_BUILDLINK_MSG} "=> Creating ${_wrappee_} wrapper: $$wrapper"; \ gen_wrapper=yes; \ wrappee="${PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ case $$wrappee in \ /*) ;; \ *) save_IFS="$$IFS"; \ IFS=":"; \ for dir in $${PATH}; do \ IFS="$$save_IFS"; \ case $${dir} in \ *${WRAPPER_DIR}*) \ ;; \ *) \ if ${TEST} -f "$${dir}/$$wrappee" -o \ -h "$${dir}/$$wrappee"; then \ wrappee="$${dir}/$$wrappee"; \ break; \ fi; \ ;; \ esac; \ done; \ IFS="$$save_IFS"; \ if ${TEST} ! -x "$$wrappee"; then \ gen_wrapper=no; \ ${ECHO_BUILDLINK_MSG} "Warning: unable to generate ${_wrappee_} wrapper script: \`$$wrappee'"; \ fi; \ ;; \ esac; \ case $$gen_wrapper in \ yes) \ ${MKDIR} `${DIRNAME} $$wrapper`; \ ${CAT} ${_WRAPPER_SH.${_wrappee_}} | \ ${SED} ${_WRAP_SUBST_SED.${_wrappee_}} \ -e "s|@@WRAPPEE@@|$$wrappee|g" | \ ${_WRAP_SH_CRUNCH_FILTER} \ > $$wrapper; \ ${CHMOD} +x $$wrapper; \ ;; \ esac ${RUN} ${TOUCH} ${TOUCH_FLAGS} ${.TARGET} . for _alias_ in ${_WRAP_ALIASES.${_wrappee_}:S/^/${WRAPPER_BINDIR}\//} . if !target(${_alias_}) generate-wrappers: ${_alias_} ${_alias_}: ${_WRAP_COOKIE.${_wrappee_}} ${RUN} \ wrapper="${WRAPPER_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ if [ ! -x ${.TARGET} -a -x $$wrapper ]; then \ ${ECHO_BUILDLINK_MSG} "=> Linking ${_wrappee_} wrapper: ${.TARGET}"; \ ${LN} -f${WRAPPER_USE_SYMLINK:Ds} $$wrapper ${.TARGET}; \ fi . endif . endfor .endfor # _WRAPPEES_UNIQUE .for _target_ in ${WRAPPER_TARGETS} generate-wrappers: ${_target_} .endfor .for w in \ arg-pp-darwin-gcc \ arg-pp-mipspro-cc \ arg-pp-sunpro-cxx \ cmd-sink-aix-cc \ cmd-sink-aix-ld \ cmd-sink-aix-xlc \ cmd-sink-darwin-xlc \ cmd-sink-icc-cc \ cmd-sink-icc81-cc \ cmd-sink-irix-cc \ cmd-sink-irix-ld \ cmd-sink-interix-gcc \ cmd-sink-ld \ cmd-sink-mkpie-gcc \ cmd-sink-mkpie-ld \ cmd-sink-osf1-cc \ cmd-sink-osf1-ld \ cmd-sink-hpux-cc \ cmd-sink-hpux-ld \ cmd-sink-solaris-imake \ cmd-sink-sunpro-cxx \ cmd-sink-unixware-gcc \ transform-aix-cc \ transform-ccc-cc \ transform-gcc \ transform-icc-cc \ transform-ido-cc \ transform-mipspro-cc \ transform-mipspro-ucode-cc \ transform-sunpro-cc \ transform-xlc-cc \ wrapper-subr.sh ${WRAPPER_TMPDIR}/${w}: ${WRAPPER_SRCDIR}/${w} ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} .endfor .if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) _WRAP_CROSS_GCC_FILTER+= ${SED} \ -e "s|@@CROSS_DESTDIR@@|${TOOLS_CROSS_DESTDIR:Q}|g" \ -e "s|@@PREFIX@@|${PREFIX:Q}|g" ${WRAPPER_TMPDIR}/cmd-sink-cross-gcc: ${WRAPPER_SRCDIR}/cmd-sink-cross-gcc ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_CROSS_GCC_FILTER} | \ ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-cross-cpp: ${WRAPPER_SRCDIR}/cmd-sink-cross-cpp ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_CROSS_GCC_FILTER} | \ ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-cross-gxx: ${WRAPPER_SRCDIR}/cmd-sink-cross-gxx ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_CROSS_GCC_FILTER} | \ ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} .endif .if !target(${_WRAP_GEN_REORDER}) ${_WRAP_GEN_REORDER}: \ ${_WRAP_SHELL_LIB} \ ${WRAPPER_SRCDIR}/gen-reorder.sh ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} \ ${CAT} ${WRAPPER_SRCDIR}/gen-reorder.sh \ | ${SED} ${_WRAP_SUBST_SED} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${RUN} ${CHMOD} +x ${.TARGET} .endif .if !target(${_WRAP_GEN_TRANSFORM}) ${_WRAP_GEN_TRANSFORM}: \ ${_WRAP_SHELL_LIB} \ ${WRAPPER_SRCDIR}/gen-transform.sh ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} \ ${CAT} ${WRAPPER_SRCDIR}/gen-transform.sh \ | ${SED} ${_WRAP_SUBST_SED} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${RUN} ${CHMOD} +x ${.TARGET} .endif .if !target(${_WRAP_REORDERLIBS}) ${_WRAP_REORDERLIBS}: ${_WRAP_GEN_REORDER} ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${_WRAP_GEN_REORDER} ${WRAPPER_REORDER_CMDS} > ${.TARGET} .endif . if !target(${_WRAP_SHELL_LIB}) ${_WRAP_SHELL_LIB}: ${.CURDIR}/../../mk/scripts/shell-lib ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif .if !target(${_WRAP_TRANSFORM_SEDFILE}) ${_WRAP_TRANSFORM_SEDFILE}: ${_WRAP_GEN_TRANSFORM} ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${_WRAP_GEN_TRANSFORM} transform ${_WRAP_TRANSFORM_CMDS} \ > ${.TARGET} .endif .if !target(${_WRAP_UNTRANSFORM_SEDFILE}) ${_WRAP_UNTRANSFORM_SEDFILE}: ${_WRAP_GEN_TRANSFORM} ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} \ ${_WRAP_GEN_TRANSFORM} untransform ${_WRAP_TRANSFORM_CMDS} \ > ${.TARGET} .endif .for _wrappee_ in ${_WRAPPEES} . if !target(${_WRAP_EMPTY_FILE}) ${_WRAP_EMPTY_FILE}: ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${TOUCH} ${TOUCH_ARGS} ${.TARGET} . endif . if !target(${_WRAP_ARG_PP_MAIN.${_wrappee_}}) ${_WRAP_ARG_PP_MAIN.${_wrappee_}}: ${WRAPPER_SRCDIR}/arg-pp-main ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_ARG_SOURCE.${_wrappee_}}) ${_WRAP_ARG_SOURCE.${_wrappee_}}: ${WRAPPER_SRCDIR}/arg-source ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_BUILDCMD.${_wrappee_}}) ${_WRAP_BUILDCMD.${_wrappee_}}: ${WRAPPER_SRCDIR}/buildcmd ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_CACHE.${_wrappee_}}) ${_WRAP_CACHE.${_wrappee_}}: ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} echo "cache_lookup() { cachehit=no; }" > ${.TARGET} . endif . if !target(${_WRAP_CACHE_BODY.${_wrappee_}}) ${_WRAP_CACHE_BODY.${_wrappee_}}: ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${TOUCH} ${TOUCH_ARGS} ${.TARGET} . endif . if !target(${_WRAP_CMD_SINK.${_wrappee_}}) ${_WRAP_CMD_SINK.${_wrappee_}}: ${WRAPPER_SRCDIR}/cmd-sink ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_LOGIC.${_wrappee_}}) ${_WRAP_LOGIC.${_wrappee_}}: ${WRAPPER_SRCDIR}/logic ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_SCAN.${_wrappee_}}) ${_WRAP_SCAN.${_wrappee_}}: ${WRAPPER_SRCDIR}/scan ${RUN} ${MKDIR} ${.TARGET:H} ${RUN} ${CAT} ${.ALLSRC} | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif .endfor # _WRAPPEES # UNWRAP_PATTERNS and UNWRAP_FILES list shell globs and files relative to # ${WRKSRC} that need to be "unwrapped". # UNWRAP_PATTERNS?= # empty _UNWRAP_PATTERNS= ${UNWRAP_PATTERNS} _UNWRAP_PATTERNS+= *-config _UNWRAP_PATTERNS+= *Conf.sh _UNWRAP_PATTERNS+= *.pc _UNWRAP_PATTERNS_FIND_cmd= \ cd ${WRKSRC} && \ ${ECHO} "__dummy-entry__" && \ ${FIND} . -type f \( ${_UNWRAP_PATTERNS:C/.*/-o -name "&"/g:S/-o//1} \) -print \ | ${SED} -e 's|^\./||' \ | ${SORT} -u UNWRAP_FILES?= # empty _UNWRAP_FILES= ${UNWRAP_FILES} \ ${_UNWRAP_PATTERNS_FIND_cmd:sh:N__dummy-entry__} _UNWRAP_SED?= # empty SUBST_CLASSES+= unwrap SUBST_STAGE.unwrap= post-build SUBST_MESSAGE.unwrap= Unwrapping files-to-be-installed. SUBST_FILES.unwrap= ${_UNWRAP_FILES} SUBST_SED.unwrap= ${_UNWRAP_SED} .if defined(_WRAPPER_DEBUG) && !empty(_WRAPPER_DEBUG:M[yY][eE][sS]) _SUBST_KEEP.unwrap= ${CP} -f "$$file" "$$file.before-unwrap" .endif SUBST_NOOP_OK.unwrap= yes # SUBST_SED may be empty .endif ### ### END: after the barrier ### ###################################################################### ###################################################################### ###################################################################### _COOKIE.wrapper= ${WRKDIR}/.wrapper_done .PHONY: wrapper .if !target(wrapper) . if exists(${_COOKIE.wrapper}) && !${_CLEANING} wrapper: @@${DO_NADA} . elif defined(_PKGSRC_BARRIER) wrapper: check-vulnerable patch acquire-wrapper-lock ${_COOKIE.wrapper} release-wrapper-lock . else wrapper: barrier . endif .endif .PHONY: acquire-wrapper-lock release-wrapper-lock acquire-wrapper-lock: acquire-lock release-wrapper-lock: release-lock .if exists(${_COOKIE.wrapper}) && !${_CLEANING} ${_COOKIE.wrapper}: @@${DO_NADA} .else ${_COOKIE.wrapper}: real-wrapper .endif .PHONY: real-wrapper real-wrapper: wrapper-message wrapper-vars pre-wrapper do-wrapper post-wrapper wrapper-cookie error-check .PHONY: wrapper-message wrapper-message: @@${PHASE_MSG} "Creating toolchain wrappers for ${PKGNAME}" .PHONY: pre-wrapper do-wrapper post-wrapper do-wrapper: generate-wrappers .if !target(do-wrapper) do-wrapper: @@${DO_NADA} .endif .if !target(pre-wrapper) pre-wrapper: @@${DO_NADA} .endif .if !target(post-wrapper) post-wrapper: @@${DO_NADA} .endif .PHONY: wrapper-cookie wrapper-cookie: ${RUN} [ ! -f ${_COOKIE.wrapper} ] ${RUN} ${MKDIR} ${_COOKIE.wrapper:H} ${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.wrapper} @ 1.104 log @mk: MKPIE is not GCC-specific. Should help ObjC packages. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.103 2022/01/18 01:41:09 pho Exp $ d366 1 a366 1 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) d543 1 a543 1 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) d545 1 a545 1 -e "s|@@CROSS_DESTDIR@@|${_CROSS_DESTDIR:Q}|g" \ @ 1.103 log @Add a package-settable variable PKGSRC_OVERRIDE_MKPIE This is needed by packages that require hand-holding in building PIE. Also a post-build check for MKPIE is performed by default when PKG_DEVELOPER=YES. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.102 2020/04/27 05:23:11 rillig Exp $ d313 1 a313 1 MKPIE_LDFLAGS= ${_MKPIE_LDFLAGS.gcc} @ 1.102 log @mk/wrapper: allow "unwrap" to be a no-op SUBST block Discovered in pkgtools/pkg, where libpkg/pkg.pc was left unmodified. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.101 2019/05/07 19:36:44 rillig Exp $ d307 1 a307 1 . if ${_PKGSRC_MKPIE} != "no" @ 1.101 log @mk: allow "bmake clean depends" as shortcut When "bmake clean depends" was called for a package where the various cookie files already existed, these would enable different rules than a clean package directory. Since "bmake clean" deletes all the cookie files before "bmake depends" starts, in these combined command lines the cookie files must be treated as absent. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.100 2018/08/22 20:48:37 maya Exp $ d697 1 @ 1.100 log @Remove clauses 3,4 from TNF-only copyright blocks. This is based on the decision The NetBSD Foundation made in 2008 to do so, which was already applied to src. This change has been applied to code which is likely not in other repositories. ok board@@, reviewed by riastradh@@ @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.99 2017/11/16 02:16:56 khorben Exp $ d57 1 a57 1 .if exists(${_COOKIE.barrier}) d711 1 a711 1 . if exists(${_COOKIE.wrapper}) d725 1 a725 1 .if exists(${_COOKIE.wrapper}) @ 1.99 log @Introduce a command sink for ld(1) with MKPIE When not using cwrappers, so far PKGSRC_MKPIE was only automatically applied when linking using gcc(1) (when enabled). This is now also the case for packages using ld(1) to link executables. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.98 2017/11/16 00:36:10 khorben Exp $ a16 7 # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the NetBSD # Foundation, Inc. and its contributors. # 4. Neither the name of The NetBSD Foundation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. @ 1.98 log @Obtain the MKPIE flags from the environment This solves an issue with the command sink component of the MKPIE wrapper for GCC, where the contents of the _MKPIE_CFLAGS.gcc and _MKPIE_LDFLAGS.gcc variables was guessed. It is now communicated to cmd-sink-mkpie-gcc through the environment instead. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.97 2016/03/11 23:03:31 khorben Exp $ d317 1 d527 1 @ 1.97 log @Add support for a number of security features - Revisit (and rename) support for FORTIFY as PKGSRC_USE_FORTIFY (instead of PKGSRC_USE_FORT) for easier support outside NetBSD/gcc; - PKGSRC_USE_SSP is no longer enabled by default when PKGSRC_USE_FORTIFY is enabled; - PKGSRC_MKPIE builds executables as PIE (to leverage userland ASLR) - PKGSRC_USE_RELRO builds with a read-only GOT to prevent some exploits from functioning. Tested on NetBSD/amd64 by myself, in every combination, with and without pkgtools/cwrappers. MKPIE is not supported at the moment with cwrappers. Also, MKPIE is known to still break a number of packages when enabled (and actually supported). Tested on SunOS by jperkin@@, thank you! As discussed on tech-pkg@@, the default behavior is not changed, except where noted above. ok bsiegert@@ @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.96 2016/03/04 21:25:47 tnn Exp $ d316 5 @ 1.96 log @pass correct ABI via OBJECT_MODE environment variable on AIX It turns out a handful of AIX binutil-like utilities are particular about type of object files they should examine. Instead of piping through flags for each utility everywhere, it is easier to just export 'OBJECT_MODE=[32|64]' instead. From Eric N. Vander Weele. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.94 2016/01/31 17:27:41 rillig Exp $ d314 3 d520 1 @ 1.95 log @pass correct ABI flags to ar(1) on AIX AIX is particular about the type of object files `ar` should examine. This should be set explicitly to coincide with the user's defined $ABI. Contributed by Eric N. Vander Weele. @ text @a350 1 _WRAP_CMD_SINK.AR= ${WRAPPER_TMPDIR}/cmd-sink-aix-ar a506 1 cmd-sink-aix-ar \ @ 1.94 log @Fixed subst.mk not to corrupt files Up to now, using subst.mk may have led to file corruption during active package development. This happened when a sed(1) command had a syntax error, in which case the whole sed(1) command was terminated, leaving an empty original file behind. This commit changes that behavior by applying the sed(1) commands to the original file and saving the result in a temporary file. Only after that succeeded is the original file overwritten. During this rewrite, SUBST_POSTCMD has been removed, since it was only used in one place (mk/wrapper), and since it relied on the exact sequence of the internal commands. No package in either main pkgsrc or pkgsrc-wip uses this variable right now. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.93 2015/04/27 19:59:07 jperkin Exp $ d351 1 d508 1 @ 1.93 log @Split cwrappers from legacy wrappers. We no longer generate the legacy wrappers when USE_CWRAPPERS is enabled, saving a reasonable amount of I/O during builds, mostly due to avoiding the transform/untransform sed file generations. WRAPPER_DIR and WRAPPER_BINDIR are used by various packages to override or point to specific wrappers, and these now point to the cwrappers directory when enabled, removing the need for CWRAPPERS_BIN_DIR duplication and fixing packages which previously were using legacy wrappers by accident. A number of targets are now duplicated between bsd.wrapper.mk and cwrappers.mk, the intention being that the legacy wrappers will be deprecated once cwrappers is verified on all supported platforms. If that turns out to take longer than expected, we will probably want to introduce a wrapper.mk to abstract them away before loading the appropriate back-end. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.92 2015/04/27 19:38:03 jperkin Exp $ d691 1 a691 1 SUBST_POSTCMD.unwrap= ${DO_NADA} @ 1.92 log @Remove ECHO_WRAPPER_MSG and just use ECHO_BUILDLINK_MSG, which was set to the same value anyway. Also removes a comment from 2005 which was possibly wrong at the time it was committed, given the same construct has been used in bsd.buildlink3.mk unchanged since 2004. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.91 2014/11/25 18:27:49 joerg Exp $ a58 1 .if ${USE_CWRAPPERS:tl} == "no" a59 1 .endif @ 1.91 log @Separate dependency from nada-rule. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.90 2014/11/24 00:32:31 joerg Exp $ a51 9 # pkgsrc bmake does not (yet) correctly handle ${VAR} > 0 because # ${VAR} is treated as a string, so we must use a string comparison # operator. .if ${PKG_DEBUG_LEVEL} != "0" || defined(PKG_VERBOSE) ECHO_WRAPPER_MSG?= ${ECHO} .else ECHO_WRAPPER_MSG?= ${TRUE} .endif d445 2 a446 2 if [ -x "$$wrapper" ]; then ${ECHO_WRAPPER_MSG} "=> $$wrapper already exists. Skipping"; exit 0; fi; \ ${ECHO_WRAPPER_MSG} "=> Creating ${_wrappee_} wrapper: $$wrapper"; \ d470 1 a470 1 ${ECHO_WRAPPER_MSG} "Warning: unable to generate ${_wrappee_} wrapper script: \`$$wrappee'"; \ d494 1 a494 1 ${ECHO_WRAPPER_MSG} "=> Linking ${_wrappee_} wrapper: ${.TARGET}"; \ @ 1.90 log @Add cwrappers glue as developed during Google's Summer of Code 2007. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.89 2014/03/06 10:15:54 uebayasi Exp $ d748 2 d751 1 a751 1 do-wrapper: generate-wrappers @ 1.89 log @Wrap not only ld but also ar and ranlib. @ text @d1 1 a1 1 # $NetBSD$ d68 1 d70 1 @ 1.88 log @Create a wrapper for gfortran. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.87 2012/07/08 19:57:10 marino Exp $ d141 2 d185 2 @ 1.87 log @compiler.mk/gcc.mk: Add support for USE_LANGUAGES+= ada All recent packages featuring Ada code have a hard dependency on the lang/gnat-aux compiler package. The valid values for USE_LANGUAGES are c, c99, c++, fortran, fortran77, java, objc, so specifying a specific compiler was necessary up into now. One problem with lang/gnat-aux is that it is installed at ${LOCALBASE} where the lang/gccXX compilers are installed at ${LOCALBASE}/gccXX. The latter compilers have no possibility of sharing conflicting files unlike lang/gnat-aux. Rather than fundamentally update the GCC 4.6-based lang/gnat-aux to avoid these conflicts, a new Ada-capable compiler based on GCC 4.7 was created with the intent of being supported by mk/compiler.mk and mk/compiler/gcc.mk. The Ada packages will be effectively migrated from lang/gnat-aux to the new lang/gcc-aux compiler, but lang/gcc-aux will remain as a standalone package as it is the only GCC 4.6-based compiler that builds on DragonFly and serves it as a world and kernel compile option. In addition to the current language wrappers, lang/gcc-aux adds wrappers for "ada" (unique to gcc-aux, hardlinked to gcc driver), and the gnat, gnatmake, gnatbind, gnatlink, gnatchop, gnatprep, and gnatls programs. Supporting all of these allows the wrapper system to be used with Ada packages; currently wrappers are mostly disabled on them. The lang/gcc47 implicitly adds support for the "objc-c++" language by adding it to the USE_LANGUAGES list, but it wasn't really supported. An attempt was made to better support objc-c++, but this new enumeration probably still needs work or needs to be removed completely. Logic for Ada support: 1) All lang/gccXX compilers have version numbers ranging from 2.8.1 to 9. 2) lang/gcc-aux uses the release date as its version number in the form of YYYYMMDD with a minimum value of 20120614, so there is no version overlap. 3) When at least one element of USE_LANGUAGES is "ada", the value of 20120614 is added to the set of GCC_REQD which selects lang/gcc-aux. 4) The _NEED_NEWER_GCC check is disabled. It fails and isn't relevant; unless a package sets GCC_REQD over 20120614, the only way to select lang/gcc-aux is to specify the Ada language and only one compiler known to gcc.mk can support it. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.86 2011/08/04 13:32:05 obache Exp $ d180 1 a180 1 _WRAP_ALIASES.FC= f77 g77 @ 1.86 log @Add support of C++ crossbuild with g++, based on CC with gcc. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.84 2009/11/23 00:25:13 tron Exp $ d177 1 a177 1 _WRAP_ALIASES.CC= cc gcc @ 1.85 log @Force to use symbolic link for wrapper if WRAPPER_USE_SYMLINK is defined. Workaround for missing hard link support on Haiku, PR#43398. @ text @d372 1 a372 1 _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} d557 5 @ 1.84 log @Make wrapper generation code work properly if there is a directory with a whitespace in the command search path. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.83 2009/05/30 19:18:01 joerg Exp $ d498 1 a498 1 ${LN} -f $$wrapper ${.TARGET}; \ @ 1.83 log @Avoid one fork per wrapper call if no cleanup is necessary and debugging is disabled. In that case, the post processing is doing nothing anyway. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.82 2008/12/29 20:47:17 joerg Exp $ d462 3 a464 3 if ${TEST} -f $${dir}/$$wrappee -o \ -h $${dir}/$$wrappee; then \ wrappee=$${dir}/$$wrappee; \ @ 1.82 log @Also wrap the cpp command like cc for AIX/XLC. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.81 2008/12/29 16:53:06 joerg Exp $ d403 1 @ 1.81 log @Improve AIX/XLC support: - provide cpp wrapper using cc -E - provide c++_r wrapper working like c++ - provide -rpath handling for cc - fix some debug messages to provide the correct script name @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.80 2008/11/27 18:00:06 joerg Exp $ d294 1 @ 1.80 log @Don't use the CC wrapper for ld on AIX with XLC. From Jens Rehsack. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.79 2008/11/14 14:04:12 joerg Exp $ d145 2 d293 1 a293 1 _WRAP_CMD_SINK.CC_R= ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc d295 1 @ 1.79 log @Improve AIX/XLC support based on discussions with Jens Rehsack: - Add cc_r/xlc_r wrapper using the same rules as xlc itself. It is used for example by Perl. - Improve the RPATH emulation: - Always set -blibpath, use /usr/lib:/lib as default - If -blibpath is exlicitly given, add to the default - Additionally append any -Wl,-rpath given. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.78 2008/11/06 21:34:16 joerg Exp $ a292 1 _WRAP_CMD_SINK.LD= ${_WRAP_CMD_SINK.CC} d352 1 a352 1 _WRAP_CMD_SINK.LD?= ${WRAPPER_TMPDIR}/cmd-sink-aix-ld @ 1.78 log @Merge aix-xlc block into the xlc block and distinguish AIX and Darwin. The PKG_FAIL_REASON isn't executed by default, no idea why, but this makes it a bit cleaner why the compiler wrapper will fail and fixes the more important AIX case. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.77 2008/10/30 18:56:22 joerg Exp $ d142 5 d291 1 d355 1 d357 1 @ 1.77 log @On AIX don't overwrite the XLC definitions with the platform logic, the former are already more specific. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.76 2008/02/19 17:36:51 tnn Exp $ a232 6 .if !empty(PKGSRC_COMPILER:Maix-xlc) _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${_WRAP_CMD_SINK.CC} .endif d284 5 d295 3 @ 1.76 log @Add IRIX command sinks, needed to get rpath fixup when using GCC. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.75 2007/11/28 14:45:22 rillig Exp $ d343 7 a349 7 _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-aix-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-aix-ld _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-aix-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-aix-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} @ 1.75 log @Do not load the $cache file for every argument. Instead, load it once and then call it as a shell function. Note that the shell function is not called "cache", since some shells have problems when a function has the same name as a variable. This speeds up the wrapper by as little as 75 percent for the final link command of editors/abiword on SunOS-5.10-sparc (before: 20 seconds, after: 5 seconds). @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.74 2007/11/28 13:18:50 rillig Exp $ d350 4 d504 2 @ 1.74 log @Oops, don't overflow the terminal. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.73 2007/11/28 12:57:46 rillig Exp $ d618 1 a618 1 ${RUN} echo "cachehit=no" > ${.TARGET} @ 1.73 log @Using a single awk process instead of a pipe of four grep processes should be both faster and easier to read. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.72 2007/09/20 18:17:18 rillig Exp $ d368 1 a368 1 ' | tee /dev/tty @ 1.72 log @When CPP is defined as "cc -E", the wrapper framework created the wrapper for gcc and cc as type "CPP", although these aren't C preprocessors. By preventing the code from overwriting files, this works now. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.71 2007/08/02 18:19:32 joerg Exp $ d364 5 a368 3 _WRAP_SH_CRUNCH_FILTER= \ ${GREP} -v "^\#[^!]" | ${GREP} -v "^[ ][ ]*\#" | \ ${GREP} -v "^\#$$" | ${GREP} -v "^[ ]*$$" @ 1.71 log @Add core of the infrastructure support for cross-compilation. - USE_CROSS_COMPILATION activates it, CROSS_DESTDIR specifies root of the target filesystem - derive _CROSS_DESTDIR from CROSS_DESTDIR or MAKEOBJDIR - buildlink3.mk prefixes the files to symlink with _CROSS_DESTDIR - compiler/gcc.mk knows about the target prefix (e.g. i386--netbsdelf) - PKG_DBDIR is prefixed with _CROSS_DESTDIR - package-install and bin-install are not called with su - install and strip are redirected to the tool version - links for the target specific ar, as, ld, nm, objdump, ranlib and strip are added - compiler wrapper detect if linking is requested or not - special command sinks for CPP and CC/CXX add the cross-compile magic: - modify include dirs to get the target /usr/include - modify linker dirs and runpath to use target /usr/lib at link time, but keep correct rpath entries Supported-by: Google SoC 2007 Basic tests by he@@ on Sparc. Review from jlam@@. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.70 2007/06/18 07:33:34 rillig Exp $ d428 1 @ 1.70 log @Changed the plain "mkdir" into ${MKDIR}, like in all the other cases. Apparently, the tools directory isn't in the PATH at the point where this code is executed. Fixes PR 35487. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.69 2007/06/06 13:20:34 rillig Exp $ d352 6 d521 15 @ 1.69 log @Replaced ${_PKG_SILENT}${_PKG_DEBUG} with a simple ${RUN} to save some space. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.68 2007/04/21 14:53:19 tnn Exp $ d593 1 a593 1 ${RUN} mkdir ${.TARGET:H} @ 1.68 log @fix typo @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.67 2007/04/14 14:17:49 tnn Exp $ d420 1 a420 1 ${_PKG_SILENT}${_PKG_DEBUG} \ d461 1 a461 1 ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} d467 1 a467 1 ${_PKG_SILENT}${_PKG_DEBUG} \ d511 2 a512 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d519 2 a520 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ d524 1 a524 1 ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} d531 2 a532 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ d536 1 a536 1 ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} d541 2 a542 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ ${_WRAP_GEN_REORDER} ${WRAPPER_REORDER_CMDS} > ${.TARGET} d547 2 a548 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d553 2 a554 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ ${_WRAP_GEN_TRANSFORM} transform ${_WRAP_TRANSFORM_CMDS} \ d560 2 a561 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ d569 2 a570 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} d575 2 a576 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d581 2 a582 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d587 2 a588 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d599 2 a600 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET} d605 2 a606 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d611 2 a612 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d617 2 a618 3 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} d710 3 a712 3 ${_PKG_SILENT}${_PKG_DEBUG}${TEST} ! -f ${_COOKIE.wrapper} || ${FALSE} ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_COOKIE.wrapper:H} ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} > ${_COOKIE.wrapper} @ 1.67 log @Teach pkgsrc about HP-UX. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.66 2007/04/12 14:51:10 tnn Exp $ d496 1 a496 1 cmd-sink hpux-ld \ @ 1.66 log @Add OSF1 wrapper quirks to always enable posix sockets and iso C++ iostreams. Fixes PR 31444. Fixes PR 31447. Both problems reported by Rumi Szabolcs. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.65 2007/02/19 14:50:33 rillig Exp $ d338 4 d495 2 @ 1.65 log @The ABI for which the code should be generated can be queried from the wrapper_abi variable. This is used in the MIPSpro wrapper to reject any package that tries to compile a file for the wrong ABI. This is not just a warning because such a package most likely has more severe problems. The gcc -Wall option seems to be similar to the MIPSpro -fullwarn option, so map them. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.64 2007/02/18 23:49:44 rillig Exp $ d332 3 @ 1.64 log @Documented WRAPPER_REORDER_CMDS. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.63 2007/02/06 20:33:50 rillig Exp $ d356 1 @ 1.63 log @Added a new variable wrapper_type to the wrappers, so that the transformations can decide whether they happen in a C or a C++ compiler. Now the wrappers don't depend on the basename of the executed compiler wrapper anymore. Fixes PR 35555. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.62 2007/01/17 13:20:56 rillig Exp $ d37 13 d98 1 a98 1 # @ 1.62 log @The sunpro C++ compiler needs its own cache, since cc and CC transform -Wall to different arguments. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.61 2007/01/04 00:57:29 rillig Exp $ d217 1 d373 1 @ 1.61 log @Bugfix: Only regular files can be unwrapped. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.60 2006/11/26 14:42:17 rillig Exp $ d267 2 a268 1 _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} @ 1.60 log @Removed the separate files for the cache header and footer. This makes the code a lot more readable. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.59 2006/11/26 13:02:53 rillig Exp $ d617 1 a617 1 ${FIND} . \( ${_UNWRAP_PATTERNS:C/.*/-o -name "&"/g:S/-o//1} \) -print \ @ 1.59 log @Merged the transformations from the Solaris-specific gcc part into the generic one. That way, the unknown options are reported properly on all platforms. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.58 2006/11/26 09:56:46 rillig Exp $ a174 1 _WRAP_CACHE_HEADER?= ${WRAPPER_TMPDIR}/cache-header a175 1 _WRAP_CACHE_FOOTER?= ${WRAPPER_TMPDIR}/cache-footer a207 1 _WRAP_CACHE_HEADER.${_wrappee_}?= ${_WRAP_CACHE_HEADER} a208 1 _WRAP_CACHE_FOOTER.${_wrappee_}?= ${_WRAP_CACHE_FOOTER} a361 1 -e "s|@@_WRAP_CACHE_HEADER@@|${_WRAP_CACHE_HEADER.${_wrappee_}:Q}|g" \ a362 1 -e "s|@@_WRAP_CACHE_FOOTER@@|${_WRAP_CACHE_FOOTER.${_wrappee_}:Q}|g" \ d573 3 a575 14 ${_WRAP_CACHE.${_wrappee_}}: \ ${_WRAP_CACHE_HEADER.${_wrappee_}} \ ${_WRAP_CACHE_BODY.${_wrappee_}} \ ${_WRAP_CACHE_FOOTER.${_wrappee_}} ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif . if !target(${_WRAP_CACHE_HEADER.${_wrappee_}}) ${_WRAP_CACHE_HEADER.${_wrappee_}}: ${WRAPPER_SRCDIR}/cache-header ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} a583 7 . if !target(${_WRAP_CACHE_FOOTER.${_wrappee_}}) ${_WRAP_CACHE_FOOTER.${_wrappee_}}: ${WRAPPER_SRCDIR}/cache-footer ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif @ 1.58 log @Added a transformation file for gcc to check for unknown options. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.57 2006/11/11 07:44:46 rillig Exp $ a334 4 _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-solaris-gcc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-solaris-gcc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} a486 1 transform-solaris-gcc \ @ 1.57 log @Added wrapper-subr.sh, which provides shell functions that are useful to make the wrapper code less frightening. For example, instead of arg="${arg#-Wl,}" $debug_log $wrapperlog " (transform-sunpro-cc) to: $arg" addtocache=yes one can simply write transform_to "${arg-Wl,}" The functions that are currently implemented are: transform_to, transform_discard, transform_to_nocache, transform_discard, transform_pass and transform_pass_unknown. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.56 2006/11/02 23:25:00 rillig Exp $ d294 5 d486 1 @ 1.56 log @Removed some code duplication, which results in 120 lines less code. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.55 2006/10/21 11:42:25 rillig Exp $ d187 1 d353 2 a354 1 -e "s|@@_WRAP_SHELL_LIB@@|${_WRAP_SHELL_LIB:Q}|g" d399 1 d487 2 a488 1 transform-xlc-cc @ 1.55 log @Fixed the "inconsistent update" problem when using the pkgsrc wrapper cache together with MAKE_FLAGS=-j. The cache file is now regenerated into a temporary file and then renamed (atomically) to the "real" cache file. Fixed some code that would fail when run in "set -e" mode. If you want to test the "set -e" mode, just uncomment the line in wrapper.sh. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.54 2006/10/21 10:01:23 rillig Exp $ d459 27 a485 146 ${WRAPPER_TMPDIR}/transform-solaris-gcc: \ ${WRAPPER_SRCDIR}/transform-solaris-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-solaris-imake: \ ${WRAPPER_SRCDIR}/cmd-sink-solaris-imake ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/arg-pp-darwin-gcc: \ ${WRAPPER_SRCDIR}/arg-pp-darwin-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/arg-pp-mipspro-cc: \ ${WRAPPER_SRCDIR}/arg-pp-mipspro-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx: \ ${WRAPPER_SRCDIR}/arg-pp-sunpro-cxx ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc: \ ${WRAPPER_SRCDIR}/cmd-sink-aix-xlc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-aix-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-aix-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-aix-ld: \ ${WRAPPER_SRCDIR}/cmd-sink-aix-ld ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc: \ ${WRAPPER_SRCDIR}/cmd-sink-darwin-xlc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-interix-gcc: \ ${WRAPPER_SRCDIR}/cmd-sink-interix-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-ld: \ ${WRAPPER_SRCDIR}/cmd-sink-ld ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-unixware-gcc: \ ${WRAPPER_SRCDIR}/cmd-sink-unixware-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-osf1-ld: \ ${WRAPPER_SRCDIR}/cmd-sink-osf1-ld ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-osf1-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-osf1-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-ccc-cc: \ ${WRAPPER_SRCDIR}/transform-ccc-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-icc-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-icc-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-icc81-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-icc81-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-aix-cc: \ ${WRAPPER_SRCDIR}/transform-aix-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-icc-cc: \ ${WRAPPER_SRCDIR}/transform-icc-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-mipspro-cc: \ ${WRAPPER_SRCDIR}/transform-mipspro-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-mipspro-ucode-cc: \ ${WRAPPER_SRCDIR}/transform-mipspro-ucode-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx: \ ${WRAPPER_SRCDIR}/cmd-sink-sunpro-cxx ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-ido-cc: \ ${WRAPPER_SRCDIR}/transform-ido-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-sunpro-cc: \ ${WRAPPER_SRCDIR}/transform-sunpro-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-xlc-cc: \ ${WRAPPER_SRCDIR}/transform-xlc-cc d489 1 @ 1.54 log @When CPP is defined as "cc -E" on Solaris with sunpro, the cc wrapper had been overwritten with the cpp wrapper, and the latter didn't define the necessary transformation rules. Fixed that. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.53 2006/09/17 22:52:45 rillig Exp $ d346 1 @ 1.53 log @When $debug_log is set to ":" and at the same time $IFS is ":", the command line $debug_log $arguments tries to execute the empty command. This results in error messages of the form cc[50]: : cannot execute (IRIX) bash: : command not found (Bash) : permission denied (NetBSD /bin/sh) Setting IFS to the original value as soon as possible fixes these bugs. Fixes PR 34135. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.52 2006/07/31 14:53:45 jlam Exp $ a266 2 _WRAP_ARG_PP.CXX= ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx _WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx d269 1 d272 3 @ 1.52 log @From the second point in Krister's mail to tech-pkg: http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html 2. Too much is logged in the .wrapper.log The wrappers log quite a lot of detailed information by default, with the result that my .work.log file is 176236028 bytes {for ghc}. The wrapper functionality is mature, so this detailed information is seldom needed, and you can in general determine what happened by looking at the input/output-lines (i.e. those lines marked as "[*]" and "<.>" in the .work.log). I would therefore like to change the default behavior to only log the input/output-lines. Flip the switch for WRAPPER_DEBUG from "yes" to "no" by default so that the detailed and rather verbose "push", "pop", "transform", etc. messages are not printed. While here, also make WRAPPER_DEBUG a pkgsrc-private variable by prepending with an underscore. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.51 2006/07/27 13:47:29 jlam Exp $ d405 1 @ 1.51 log @After auditing all the packages the ensure that they never invoke the compiler toolchain until the configure stage, move the "wrapper" stage back to between "patch" and "configure". This makes "make extract NO_DEPENDS=" work again for all packages. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.50 2006/07/22 16:31:35 jlam Exp $ d62 4 a65 4 WRAPPER_DEBUG?= yes CONFIGURE_ENV+= WRAPPER_DEBUG=${WRAPPER_DEBUG:Q} MAKE_ENV+= WRAPPER_DEBUG=${WRAPPER_DEBUG:Q} SCRIPTS_ENV+= WRAPPER_DEBUG="${WRAPPER_DEBUG}" d371 1 a371 1 -e "s|@@WRAPPER_DEBUG@@|${WRAPPER_DEBUG}|g" \ d763 1 a763 1 .if defined(WRAPPER_DEBUG) && !empty(WRAPPER_DEBUG:M[yY][eE][sS]) @ 1.50 log @Modify the barrier so that we always invoke the recursive make process when passing through the barrier. This ensures the PATH (passed via PKGSRC_MAKE_ENV) is correctly set for all phases after the barrier. This fixes a bug in "interactive" pkgsrc use, where if you have no work directory and type "make build && make install", then the "install" step does not have a PATH set to include all the wrapper and tools directories. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.49 2006/07/21 14:21:28 jlam Exp $ d784 1 a784 1 wrapper: check-vulnerable tools acquire-wrapper-lock ${_COOKIE.wrapper} release-wrapper-lock @ 1.49 log @Rearrange sequence so that "wrapper" occurs between "tools" and "extract". This allows all user-definable targets (pre-*, do-*, post-*) to have access to the wrapper scripts. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.48 2006/07/07 21:24:29 jlam Exp $ d783 1 a783 1 . elif exists(${_COOKIE.barrier}) @ 1.48 log @Rename _COOKIE variables to _COOKIE.. These are private variables so there are no user-visible changes. This change just makes it a little easier to write for loops. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.47 2006/07/06 22:29:53 jlam Exp $ d784 1 a784 1 wrapper: check-vulnerable patch acquire-wrapper-lock ${_COOKIE.wrapper} release-wrapper-lock @ 1.47 log @The cookie files are indirectly made using *-cookie targets, so verify that they are never being created more than once by inserting a check into the *-cookie targets. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.46 2006/07/06 18:19:45 jlam Exp $ d60 1 a60 1 .if exists(${_BARRIER_COOKIE}) d776 1 a776 1 _WRAPPER_COOKIE= ${WRKDIR}/.wrapper_done d780 1 a780 1 . if exists(${_WRAPPER_COOKIE}) d783 2 a784 2 . elif exists(${_BARRIER_COOKIE}) wrapper: check-vulnerable patch acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock d794 2 a795 2 .if exists(${_WRAPPER_COOKIE}) ${_WRAPPER_COOKIE}: d798 1 a798 1 ${_WRAPPER_COOKIE}: real-wrapper d827 3 a829 3 ${_PKG_SILENT}${_PKG_DEBUG}${TEST} ! -f ${_WRAPPER_COOKIE} || ${FALSE} ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${_WRAPPER_COOKIE:H} ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} > ${_WRAPPER_COOKIE} @ 1.46 log @Never skip the wrapper step, even if NO_BUILD is set. There are packages that invoke the compiler in either the configure or install steps that we still need to guard against. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.45 2006/07/05 22:21:03 jlam Exp $ d827 1 @ 1.45 log @Flatten out recursive makes into a single re-invocation of make by introducing the concept of a "barrier". We separate the user-invokable targets into ones that must happen before the barrier, and ones that must happen after the barrier. The ones that happen after the barrier are run in a sub-make process. In this case, the targets that must be run after the barrier are from the "wrapper" step and beyond. We rewrite the various "flow" targets, e.g. wrapper, configure, build, etc., so that they of the right form to use the barrier target. This now completely removes the concept of PKG_PHASE from pkgsrc. It is replaced with the concept of "before" and "after" the barrier, and this state can be checked by testing for the existence of the barrier cookie file. Because we've removed most of the recursive makes, there is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove them for now. As part of this commit, put back the logic that conditionalized the sources for the various cookie files. Because the sources are all "phony" targets, they were always run, regardless of whether or not the cookie file already existed. Now, if a cookie file exists, then that entire phase associated with that cookie file is skipped. Lastly, fix a thinko in configure/bsd.configure.mk where setting NO_CONFIGURE in a package Makefile would manage to skip the "wrapper" step altogether. Fix this by correctly noting "wrapper" and not "patch" as the preceding step to "configure". @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.44 2006/07/05 09:08:35 jlam Exp $ a783 3 . if defined(NO_BUILD) wrapper: patch wrapper-cookie . else a784 1 . endif @ 1.44 log @Make the check-vulnerable target more self-sufficient, by moving some of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that check-vulnerable can be used as a source target. Make check-vulnerable a source target for every phase of the build workflow, which ensures that it is always run if the user starts a new phase from the command line. Fix the cookie-generation targets so that they don't append, only overwrite to the cookie file. This works around potential problems due to recursive makes. Move the cookie checks so that they surround the corresponding phase target. The presence of the cookie should now inform the make process to avoid doing any processing of phases that occur before the phase corresponding to the cookie. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.43 2006/07/05 06:09:15 jlam Exp $ d58 1 a58 1 ### BEGIN: after "wrapper" phase d60 1 a60 1 .if !empty(PHASES_AFTER_WRAPPER:M${PKG_PHASE}) d767 1 a767 1 .endif # PHASES_AFTER_WRAPPER d769 1 a769 1 ### END: after "wrapper" phase d780 5 a784 1 . if defined(NO_BUILD) d786 1 a786 1 . elif !exists(${_WRAPPER_COOKIE}) d788 1 d790 1 a790 2 wrapper: @@${DO_NADA} d798 1 d800 4 a803 1 ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${SETENV} ${BUILD_ENV} ${MAKE} ${MAKEFLAGS} real-wrapper PKG_PHASE=wrapper @ 1.43 log @Refactor configure, build, test and wrapper phases out of bsd.pkg.mk and into their own directories. Also do some cleanups with build/_build and pkginstall -- we get rid of _build and simply run pkginstall as part of the "build" target. Introduce a new mechanism to handle varying directory depths under ${WRKSRC} in which we find files to override, e.g. configure, config.*, libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that specifies how far under ${WRKSRC} the various targets should look, and it defaults to "2". We preserve the meaning of the various *_OVERRIDE variables, so if they are defined, then their values supersede the OVERRIDE_DIRDEPTH mechanism. devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.42 2006/07/05 04:32:10 jlam Exp $ d782 2 d785 2 a786 1 wrapper: patch acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock a793 1 .if !exists(${_WRAPPER_COOKIE}) a795 4 .else ${_WRAPPER_COOKIE}: @@${DO_NADA} .endif d824 1 a824 1 ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${_WRAPPER_COOKIE} @ 1.42 log @Teach the tools framework about the following new tools: itools, intltool, diff3, sdiff, msgmerge * Adding USE_TOOLS+=itools to a package Makefile will cause the tool-directory versions of imake, makedepend, mkdirhier and xmkmf to point to the ones from the devel/nbitools package. This change will remove the need for nbitools/buildlink3.mk, which currently does a bit of hackery to force the "right" imake tools to be used by packages that need it. * Adding USE_TOOLS+=intltool to a package Makefile will cause the local versions of intltool-* inside ${WRKSRC} to be replaced by copies from the textproc/intltool package. If "intltool" is not specified as a tool, then we create "broken" intltool-* tools in the tools directory to help highlight hidden dependencies on the intltool package. In addition, modify the tools framework so that if "perl" is not specified as a tool, then we create a "broken" perl tool in the tools directory for the same reason as for "intltool". These two changes together will remove the need for intltools/buildlink3.mk and should also catch all cases where the sources' intltools may have been silently used because perl was found on the system. * Adding USE_TOOLS+=diff3, USE_TOOLS+=sdiff, or USE_TOOLS+=msgmerge to a package Makefile will cause the corresponding tool to be pulled into the tools directory. These are convenience tools to help simplify dependencies for some packages. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.41 2006/07/02 09:45:23 rillig Exp $ d48 1 a48 1 .PHONY: do-wrapper d195 1 a195 1 do-wrapper: ${_WRAP_TRANSFORM_SEDFILE} ${_WRAP_UNTRANSFORM_SEDFILE} d380 1 a380 1 do-wrapper: ${_WRAP_COOKIE.${_wrappee_}} d420 1 a420 1 ${ECHO_WRAPPER_MSG} "Warning: unable to create ${_wrappee_} wrapper script: \`$$wrappee'"; \ d439 1 a439 1 do-wrapper: ${_alias_} d452 1 a452 1 do-wrapper: ${_target_} d772 36 d809 6 a814 1 do-wrapper: d817 10 @ 1.41 log @Fixed an obvious typo: .if !target$(${_WRAP_EMPTY_FILE}) contains a dollar character before the opening parenthesis. This should really have been detected by bmake, but somehow the parser seems to be tolerant with respect to syntax errors. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.40 2006/01/16 23:35:29 wiz Exp $ d123 1 a123 1 .if defined(USE_X11) @ 1.40 log @Remove superfluous quotes around SUBST_MESSAGE. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.39 2005/12/05 22:07:08 rillig Exp $ d660 1 a660 1 . if !target$(${_WRAP_EMPTY_FILE}) @ 1.39 log @Applied all quoting fixes found by "pkglint --autofix". @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.38 2005/10/16 19:44:44 schwarz Exp $ d760 1 a760 1 SUBST_MESSAGE.unwrap= "Unwrapping files-to-be-installed." @ 1.38 log @ added support for the SGI IDO (IRIX Development Option) cc used by IRIX 5.3. changes approved by jschauma and recht. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.37 2005/08/20 14:37:53 grant Exp $ d63 2 a64 2 CONFIGURE_ENV+= WRAPPER_DEBUG="${WRAPPER_DEBUG}" MAKE_ENV+= WRAPPER_DEBUG="${WRAPPER_DEBUG}" d80 2 a81 2 CONFIGURE_ENV+= WRAPPER_UPDATE_CACHE="${WRAPPER_UPDATE_CACHE}" MAKE_ENV+= WRAPPER_UPDATE_CACHE="${WRAPPER_UPDATE_CACHE}" @ 1.37 log @strip leading "-Qoption ld" from -R args for sunpro C++ compiler, to avoid duplicate "-Qoption ld" args when the -R args is later stripped. thanks to jlam@@ for the hint. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.36 2005/07/26 07:36:54 grant Exp $ d258 8 d587 6 @ 1.36 log @icc 9.0 wants the same options as 8.1. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.35 2005/07/23 04:45:30 grant Exp $ d259 1 d471 6 @ 1.35 log @ensure gcc options are always passed to imake when using gcc on Solaris. fixes PR pkg/29608. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.34 2005/07/06 03:35:28 grant Exp $ d229 1 a229 1 . if !empty(CC_VERSION:M8.1) @ 1.34 log @update copyright year @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.33 2005/07/06 03:31:24 grant Exp $ d317 9 d446 12 @ 1.33 log @add cmd-sink for sunpro C++ which links shared libraries with the standard C++ runtime libraries. we need to explicitly do this because ${CXX} only links against the C++ runtime libraries when building an executable, not a shared object. this results in executables linked against libraries linked by ${CXX} unable to resolve C++ symbols at runtime. fixes packages which link shared libraries using ${CXX}, including graphics/glu, databases/db4, and packages which use shared libraries provided by these packages. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.32 2005/05/20 22:40:36 rillig Exp $ d3 1 a3 1 # Copyright (c) 2004 The NetBSD Foundation, Inc. @ 1.32 log @Made sure the :sh operator does not result in an empty string. Rewrote the variable substitution for the find(1) command to be more readable. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.31 2005/05/20 21:36:05 jlam Exp $ d259 1 d545 6 @ 1.32.2.1 log @Pullup ticket 630 - requested by grant beattie infrastructure fixes for sunpro Revisions pulled up: - pkgsrc/mk/wrapper/bsd.wrapper.mk 1.33-1.34 - pkgsrc/mk/wrapper/cmd-sink-sunpro-cxx 1.1 Module Name: pkgsrc Committed By: grant Date: Wed Jul 6 03:31:24 UTC 2005 Modified Files: pkgsrc/mk/wrapper: bsd.wrapper.mk Added Files: pkgsrc/mk/wrapper: cmd-sink-sunpro-cxx Log Message: add cmd-sink for sunpro C++ which links shared libraries with the standard C++ runtime libraries. we need to explicitly do this because ${CXX} only links against the C++ runtime libraries when building an executable, not a shared object. this results in executables linked against libraries linked by ${CXX} unable to resolve C++ symbols at runtime. fixes packages which link shared libraries using ${CXX}, including graphics/glu, databases/db4, and packages which use shared libraries provided by these packages. ---- Module Name: pkgsrc Committed By: grant Date: Wed Jul 6 03:35:28 UTC 2005 Modified Files: pkgsrc/mk/wrapper: bsd.wrapper.mk Log Message: update copyright year @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.32 2005/05/20 22:40:36 rillig Exp $ d3 1 a3 1 # Copyright (c) 2005 The NetBSD Foundation, Inc. a258 1 _WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx a543 6 ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx: \ ${WRAPPER_SRCDIR}/cmd-sink-sunpro-cxx ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.32.2.2 log @Pullup ticket 708 - requested by Grant Beattie portability fix for compiler wrapper Revisions pulled up: - pkgsrc/mk/wrapper/bsd.wrapper.mk 1.35 - pkgsrc/mk/wrapper/cmd-sink-solaris-imake 1.1 - pkgsrc/mk/wrapper/transform-solaris-gcc 1.1 Module Name: pkgsrc Committed By: grant Date: Sat Jul 23 04:45:30 UTC 2005 Modified Files: pkgsrc/mk/wrapper: bsd.wrapper.mk Added Files: pkgsrc/mk/wrapper: cmd-sink-solaris-imake transform-solaris-gcc Log Message: ensure gcc options are always passed to imake when using gcc on Solaris. fixes PR pkg/29608. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.35 2005/07/23 04:45:30 grant Exp $ a316 9 .if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc) _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-solaris-gcc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-solaris-gcc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} _WRAP_CMD_SINK.IMAKE= ${WRAPPER_TMPDIR}/cmd-sink-solaris-imake _WRAP_CACHE_BODY.IMAKE= ${WRAPPER_TMPDIR}/cache-body-solaris-imake .endif a436 12 ${WRAPPER_TMPDIR}/transform-solaris-gcc: \ ${WRAPPER_SRCDIR}/transform-solaris-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-solaris-imake: \ ${WRAPPER_SRCDIR}/cmd-sink-solaris-imake ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.32.2.3 log @Pullup ticket 709 - requested by Grant Beattie portability fixes for compiler wrapper Revisions pulled up: - pkgsrc/mk/wrapper/arg-pp-sunpro-cxx 1.1, 1.2 - pkgsrc/mk/wrapper/bsd.wrapper.mk 1.36, 1.37 - pkgsrc/mk/wrapper/transform-sunpro-cc 1.9 Module Name: pkgsrc Committed By: grant Date: Tue Jul 26 07:36:54 UTC 2005 Modified Files: pkgsrc/mk/wrapper: bsd.wrapper.mk Log Message: icc 9.0 wants the same options as 8.1. --- Module Name: pkgsrc Committed By: grant Date: Sat Aug 20 02:11:15 UTC 2005 Modified Files: pkgsrc/mk/wrapper: transform-sunpro-cc Log Message: add -xnolibmopt after -fast to disable the use of libsunmath (until it can be sanely statically linked). -- Module Name: pkgsrc Committed By: grant Date: Sat Aug 20 14:37:53 UTC 2005 Modified Files: pkgsrc/mk/wrapper: bsd.wrapper.mk Added Files: pkgsrc/mk/wrapper: arg-pp-sunpro-cxx Log Message: strip leading "-Qoption ld" from -R args for sunpro C++ compiler, to avoid duplicate "-Qoption ld" args when the -R args is later stripped. thanks to jlam@@ for the hint. --- Module Name: pkgsrc Committed By: grant Date: Sun Aug 21 02:39:52 UTC 2005 Modified Files: pkgsrc/mk/wrapper: arg-pp-sunpro-cxx Log Message: preserve -Qoption arg if the 2nd next arg isn't -R. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.37 2005/08/20 14:37:53 grant Exp $ d229 1 a229 1 . if !empty(CC_VERSION:M8.1) || !empty(CC_VERSION:M9.0) a258 1 _WRAP_ARG_PP.CXX= ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx a469 6 ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx: \ ${WRAPPER_SRCDIR}/arg-pp-sunpro-cxx ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.31 log @Change instances where we stored `shell command` in a make variable into variables that use the :sh modifier. This still causes expansion to only happen when referenced, and has the advantage of being :Q-safe. Bring back the changes from revision 1.19 of mk/subst.mk now that the problem noted above has been fixed. This passes the buildlink-unwrap regression test. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.30 2005/05/11 22:08:19 jlam Exp $ d699 5 a703 1 cd ${WRKSRC} && ${FIND} . \( ${_UNWRAP_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1} \) -print | ${SED} -e 's|^\./||' | ${SORT} -u d706 1 a706 1 ${_UNWRAP_PATTERNS_FIND_cmd:sh} @ 1.30 log @Rename MAKE_VARS to MAKEVARS so that it more closely resembles "MAKEFLAGS". Both "MAKEVARS" and "MAKEFLAGS" affect the package-level make process, not the software's own make process. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.29 2005/05/09 05:06:56 jlam Exp $ d698 2 a699 2 _UNWRAP_PATTERNS_FIND= \ \( ${_UNWRAP_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1} \) d701 2 a702 3 _UNWRAP_FILES= \ ${UNWRAP_FILES} \ `${FIND} . ${_UNWRAP_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${SORT} -u` @ 1.29 log @Teach bsd.pkg.mk to create a phase-specific "makevars.mk" file that caches variable definitions that were computed by make. These variables are specified by listing them in MAKE_VARS, e.g., .if !defined(FOO) FOO!= very_time_consuming_command .endif MAKE_VARS+= FOO bsd.pkg.mk will include only the one generated during the most recent phase. A particular phase's makevars.mk file consists of variable definitions that are a superset of all of the ones produced in previous phases of the build. The caching is useful because bsd.pkg.mk invokes make recursively, which in the example above has the potential to run the very time-consuming command each time unless we cause FOO to be defined for the sub-make processes. We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't consistently applied to every invocation of make, and also because MAKE_FLAGS can overflow the maximum length of a make variable very quickly if we add many values to it. One important and desirable property of variables cached via MAKE_VARS is that they only apply to the current package, and not to any dependencies whose builds may have been triggered by the current package. The makevars.mk files are generated by new targets fetch-vars, extract-vars, patch-vars, etc., and these targets are built during the corresponding real-* target to ensure that they are being invoked with PKG_PHASE set to the proper value. Also, remove the variables cache file that bsd.wrapper.mk was generating since the new makevars.mk files provide the same functionality at a higher level. Change all WRAPPER_VARS definitions that were used by the old wrapper-phase cache file into MAKE_VARS definitions. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.28 2005/04/07 16:56:00 tv Exp $ d106 1 a106 1 MAKE_VARS+= _WRAP_PATH @ 1.28 log @In line with the unconditional inclusion in bsd.pkg.mk, bsd.buildlink3.mk must always bee included too. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.27 2005/03/24 17:46:01 tv Exp $ a46 5 _WRAP_VARS_MK= ${WRAPPER_DIR}/vars.mk .if exists(${_WRAP_VARS_MK}) . include "${_WRAP_VARS_MK}" .endif a51 5 # Create the saved variables Makefile fragment to pass variables # through to sub-make processes invoked on the same Makefile. # do-wrapper: ${_WRAP_VARS_MK} d104 1 a104 2 _WRAP_PATH= ${PATH:S/${WRAPPER_BINDIR}://:S/:${WRAPPER_BINDIR}//} WRAPPER_VARS+= _WRAP_PATH d106 1 a689 16 .if !target(${_WRAP_VARS_MK}) ${_WRAP_VARS_MK}: ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET}.tmp . for _var_ in ${WRAPPER_VARS} ${_PKG_SILENT}${_PKG_DEBUG} \ ${ECHO} "${_var_}= ${${_var_}}" >> ${.TARGET}.tmp . endfor ${_PKG_SILENT}${_PKG_DEBUG} \ if [ -f ${.TARGET}.tmp ]; then \ ${SORT} -u ${.TARGET}.tmp > ${.TARGET}; \ ${RM} -f ${.TARGET}.tmp; \ fi ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .endif @ 1.27 log @USE_BUILDLINK3 is no longer optional (and cannot be turned off). Per mail to tech-pkg: ===== * USE_BUILDLINK3=YES will be unconditional. (In fact, USE_BUILDLINK3 will be ignored altogether by mk/; but see below.) * NO_BUILDLINK and NO_WRAPPER will be ignored by mk/. If a build happens, these phases will happen. * The existing NO_BUILD will imply the previous NO_BUILDLINK and NO_WRAPPER. If no build happens, those phases are not needed. * NO_TOOLS will be ignored by mk/. The tools phase, which provides much more than just the C compiler, will always happen regardless of package. This will make metapackage builds only slightly slower, in trade for far less user error. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.26 2005/03/08 00:52:31 grant Exp $ d55 1 a55 3 .if !defined(NO_BUILD) . include "../../mk/buildlink3/bsd.buildlink3.mk" .endif @ 1.26 log @fix previous to work with pkgsrc bmake, and add a comment explaining why it must be done this way. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.25 2005/03/06 22:27:12 agc Exp $ d55 1 a55 5 # USE_BUILDLINK3 == "no" implies NO_BUILDLINK .if !empty(USE_BUILDLINK3:M[nN][oO]) NO_BUILDLINK= yes .endif .if !defined(NO_BUILDLINK) @ 1.25 log @Also echo the wrapper stages if PKG_VERBOSE is defined, not just when PKG_DEBUG_LEVEL > 1. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.24 2005/02/19 04:19:59 grant Exp $ d39 4 a42 1 .if ${PKG_DEBUG_LEVEL} > 0 || defined(PKG_VERBOSE) @ 1.24 log @add wrappers to transform arguments for AIX's ld(1), notably, if we are dynamically linking, the -brtl flag must be passed to the linker so that the runtime linker is used. tested on AIX 4.3 and 5.1 by garbled@@. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.23 2005/02/16 10:59:03 grant Exp $ d39 1 a39 1 .if ${PKG_DEBUG_LEVEL} > 0 @ 1.23 log @properly detect icc 8.1, which needs a different argument to statically link the Intel provided libraries. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.22 2005/02/15 07:43:43 grant Exp $ d319 8 d467 12 d533 6 @ 1.22 log @add support for icc, the Intel C++ Compiler (Linux). icc is a high performance compiler suite for Linux/i386 and ia64, and is free for non-commercial use. see: http://www.intel.com/software/products/compilers/clin/ for more information. tested with icc version 8.0 and 8.1 on Slackware 10/i386. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.21 2005/02/15 03:18:50 jlam Exp $ d242 4 d248 1 d507 6 @ 1.21 log @The libtool wrapper should always do the compiler wrapper transformations, so move the setting for _WRAP_ARG_PP.LIBTOOL out of conditional areas of bsd.wrapper.mk and set it globally in bsd.buildlink3.mk with the rest of the libtool wrapper variables. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.20 2005/02/14 21:33:08 jlam Exp $ d241 9 d496 12 @ 1.20 log @Teach the libtool wrapper about the same types of transformations that the compiler wrapper already knows to do. This should protect "-install_name ..." from wrapper transformations within the libtool wrapper on Darwin and fixes PR pkg/29215. Software that properly use libtool don't pass an explicit "-install_name ..." because libtool always generates its own such argument when building the (Darwin) shared library. However, not every piece of software, including the ones like lang/tcl that pkgsrc converted to use libtool, will use libtool in the documented fashion. Longer term, those packages should be fixed properly, but we will still need the libtool wrapper to avoid transforming arguments that the compiler wrapper itself doesn't transform, e.g. for MIPSpro and -LANG:*. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.19 2005/01/18 17:25:13 jlam Exp $ a247 1 _WRAP_ARG_PP.LIBTOOL= ${_WRAP_ARG_PP.CC} a296 1 _WRAP_ARG_PP.LIBTOOL= ${_WRAP_ARG_PP.CC} @ 1.19 log @Split out the argument pre-processing logic into its own script arg-pp-main, and allow for wrapper-specific hooks to extend the pre-processing through _WRAP_ARG_PP.. Move the Darwin GCC-related preprocessing into arg-pp-darwin-gcc, and create a arg-pp-mipspro-cc that understands -LANG: and -LIST: so that they're not confused with the usual -Ldir options. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.18 2005/01/11 18:08:20 jlam Exp $ d248 1 d298 1 @ 1.18 log @Really skip the transformations for imake. This shows the danger in having variables that take a "yes" value to turn off behavior. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.17 2005/01/10 17:16:35 jlam Exp $ d183 2 d217 2 d242 1 d245 1 d293 4 d302 2 a304 2 _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-osf1-cc _WRAP_CMD_SINK.CXX= ${WRAPPER_TMPDIR}/cmd-sink-osf1-cc d327 2 d355 2 d427 12 d572 7 @ 1.17 log @Fix error in previous that turned off all transformations in all wrappers. "Oops". We now do transformations by default, and turn them off explicitly for wrappers that don't want them, e.g. IMAKE. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.16 2005/01/10 03:40:25 jlam Exp $ d275 1 a275 1 _WRAP_SKIP_TRANSFORM.IMAKE= no @ 1.16 log @Avoid the silly optimization in the make logic and push it into the shell script instead. We can't avoid invoking sed at least once since we need to protect the arguments against shell expansion, but we avoid invoking sed for transformations unless there actually are transformations to perform. The code is simpler, more straightforward, and logically correct now. This fixes problems with using a non-GCC compiler with packages that haven't been converted to use buildlink3, noted in PR pkg/28896. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.15 2004/12/05 09:29:26 grant Exp $ d198 1 a198 1 _WRAP_SKIP_TRANSFORM?= yes d275 1 a275 1 _WRAP_TRANSFORM_SED.IMAKE= # empty @ 1.15 log @add handling for some required -Wl, transformations for packages that assume Apple gcc on Darwin. thanks, Johnny :) this allows perl to build with xlc. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.14 2004/11/30 15:07:26 jlam Exp $ a227 3 . if !empty(_WRAP_TRANSFORM_SED.${_wrappee_}) _WRAP_SKIP_TRANSFORM.${_wrappee_}?= no . else a228 1 . endif @ 1.14 log @Remove the trailing whitespace in the values of the toolchain variables (CC, LD, CXX, etc.) if the default values have no arguments. Now, CC == "cc" and not "cc ". @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.13 2004/11/30 14:50:37 jlam Exp $ d263 2 d423 6 @ 1.13 log @Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc., are handled. The idea now is to simply remove the paths in the values of these variables, leaving behind only the basename plus any arguments, e.g.: CC= /usr/local/bin/gcc becomes CC= gcc CPP= /usr/local/bin/gcc -E becomes CPP= gcc -E The wrapper scripts are generated for every unique executable mentioned by the toolchain variables, so for the example above, only a "gcc" wrapper script is generated for ${CC} and ${CPP}. PKG_{CC,CPP,CXX,etc.} are the paths to the executables wrapped by the wrapper scripts. Note that it's now possible to set "CC" to something more than just the path to the compiler, e.g. CC= cc -ffast-math -funroll-loops -fomit-frame-pointer and the full value of ${CC} will be passed through via CONFIGURE_ENV and MAKE_ENV. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12 2004/11/20 04:37:08 grant Exp $ d157 3 d161 1 @ 1.12 log @add framework support for Tru64 and the Compaq C compiler. patches provided by Tobias Nygren with minor changes by me. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.11 2004/11/12 16:27:57 jlam Exp $ a132 3 # XXX The following is a workaround until I can find time to fix this # XXX more completely (jlam). .if ${CPP:N-*} != ${CC} a133 1 .endif d142 1 d144 20 a163 2 _WRAPPEES+= ${_wrappee_} .endfor d229 1 a229 1 .endfor a311 10 . if defined(PKG_${_wrappee_}) _WRAP_PKG_${_wrappee_}= ${PKG_${_wrappee_}} . else _WRAP_PKG_${_wrappee_}= ${${_wrappee_}} . endif WRAPPER_${_wrappee_}= \ ${WRAPPER_BINDIR}/${_WRAP_PKG_${_wrappee_}:T:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} ${_wrappee_}:= ${WRAPPER_${_wrappee_}:T} d334 1 d336 2 a350 2 ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_WRAPPER_MSG} \ "=> Creating wrapper: ${WRAPPER_${_wrappee_}}" d352 2 a353 1 wrappee="${_WRAP_PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ d355 4 a358 6 case $${wrappee} in \ /*) \ absdir=; \ ;; \ *) \ save_IFS="$$IFS"; \ d362 1 a362 1 *${BUILDLINK_DIR}*) \ d365 3 a367 5 if [ -f $${dir}/$${wrappee} ] || \ [ -h $${dir}/$${wrappee} ] && \ [ -x $${dir}/$${wrappee} ]; then \ absdir=$${dir}/; \ wrappee=$${absdir}$${wrappee}; \ d374 1 a374 1 if [ ! -x "$${wrappee}" ]; then \ d376 1 a376 1 ${ECHO_WRAPPER_MSG} "Warning: unable to create \`$${wrappee}' wrapper script"; \ d382 1 a382 1 ${MKDIR} ${WRAPPER_${_wrappee_}:H}; \ d385 1 a385 1 -e "s|@@WRAPPEE@@|$${absdir}${_WRAP_PKG_${_wrappee_}:Q}|g" | \ d387 2 a388 2 > ${WRAPPER_${_wrappee_}}; \ ${CHMOD} +x ${WRAPPER_${_wrappee_}}; \ d398 4 a401 3 if [ ! -x ${_alias_} -a -x ${WRAPPER_${_wrappee_}} ]; then \ ${ECHO_WRAPPER_MSG} "=> Linking wrapper: ${_alias_}"; \ ${LN} -f ${WRAPPER_${_wrappee_}} ${_alias_}; \ d405 1 a405 1 .endfor # _WRAPPEES @ 1.12.2.1 log @So that I don't lose all this work, stash the work-in-progress derecursion cleanup onto the tv-derecurse branch (only branched in pkgsrc/mk). @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12 2004/11/20 04:37:08 grant Exp $ d73 1 a73 1 .if !empty(PKG_PHASES:Mwrapper) a295 5 BUILD_ENV?= # empty .if !empty(BUILD_ENV) _WRAP_SUBST_SED+= -e 's|@@BUILD_ENV@@|export '${BUILD_ENV:Q}'|' .endif d641 1 a641 1 .endif # !empty(PKG_PHASES:Mwrapper) d646 4 a649 1 do-wrapper: .OPTIONAL @ 1.12.2.2 log @Factor out package data export bits which are not used in the normal build process into a new fragment, bsd.pkg.data.mk. Fix some include ordering so that most of the dependency logic works correctly again (though fetch-list is still broken). @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.1 2004/11/22 22:48:05 tv Exp $ d52 8 @ 1.12.2.3 log @merge from HEAD @ text @d1 1 a1 1 # $NetBSD$ d125 3 d129 1 a137 1 _WRAPPEE_UNIQUE_CMDS= # empty d139 2 a140 20 _WRAPPEES+= ${_wrappee_} _WRAPPEE_${_wrappee_}= ${${_wrappee_}:T:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} . if empty(_WRAPPEE_UNIQUE_CMDS:M${_WRAPPEE_${_wrappee_}}) _WRAPPEE_UNIQUE_CMDS+= ${_WRAPPEE_${_wrappee_}} _WRAPPEES_UNIQUE+= ${_wrappee_} . endif .endfor # WRAPPEES .for _wrappee_ in ${_WRAPPEES} # # Strip the leading paths from the toolchain variables since we manipulate # the PATH to use the correct executable. # ${_wrappee_}:= ${${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} ${${_wrappee_}:C/^/_asdf_/1:N_asdf_*} # # WRAPPER_ is the full path to the wrapper script, plus any # trailing arguments to . # WRAPPER_${_wrappee_}= ${WRAPPER_BINDIR}/${${_wrappee_}} .endfor # _WRAPPEES d206 1 a206 1 .endfor # _WRAPPEES d294 10 a325 1 .endfor # _WRAPPEES a326 2 .for _wrappee_ in ${_WRAPPEES_UNIQUE} PKG_${_wrappee_}?= ${${_wrappee_}} d340 2 d343 1 a343 2 wrapper="${WRAPPER_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ ${ECHO_WRAPPER_MSG} "=> Creating ${_wrappee_} wrapper: $$wrapper"; \ d345 6 a350 4 wrappee="${PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ case $$wrappee in \ /*) ;; \ *) save_IFS="$$IFS"; \ d354 1 a354 1 *${WRAPPER_DIR}*) \ d357 5 a361 3 if ${TEST} -f $${dir}/$$wrappee -o \ -h $${dir}/$$wrappee; then \ wrappee=$${dir}/$$wrappee; \ d368 1 a368 1 if ${TEST} ! -x "$$wrappee"; then \ d370 1 a370 1 ${ECHO_WRAPPER_MSG} "Warning: unable to create ${_wrappee_} wrapper script: \`$$wrappee'"; \ d376 1 a376 1 ${MKDIR} `${DIRNAME} $$wrapper`; \ d379 1 a379 1 -e "s|@@WRAPPEE@@|$$wrappee|g" | \ d381 2 a382 2 > $$wrapper; \ ${CHMOD} +x $$wrapper; \ d392 3 a394 4 wrapper="${WRAPPER_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \ if [ ! -x ${.TARGET} -a -x $$wrapper ]; then \ ${ECHO_WRAPPER_MSG} "=> Linking ${_wrappee_} wrapper: ${.TARGET}"; \ ${LN} -f $$wrapper ${.TARGET}; \ d398 1 a398 1 .endfor # _WRAPPEES_UNIQUE @ 1.12.2.4 log @merge from HEAD @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.3 2004/11/30 15:06:35 tv Exp $ a148 3 . if empty(${_wrappee_}:C/^/_asdf_/1:N_asdf_*) ${_wrappee_}:= ${${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} . else a149 1 . endif @ 1.12.2.5 log @Merge from HEAD. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.4 2004/11/30 15:10:47 tv Exp $ a254 2 _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} a417 6 ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc: \ ${WRAPPER_SRCDIR}/cmd-sink-darwin-xlc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.12.2.6 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.5 2004/12/09 17:15:01 tv Exp $ d220 3 d224 1 @ 1.12.2.7 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.6 2005/01/10 16:15:25 tv Exp $ d190 1 a190 1 _WRAP_SKIP_TRANSFORM?= no d267 1 a267 1 _WRAP_SKIP_TRANSFORM.IMAKE= yes @ 1.12.2.8 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD$ a174 2 _WRAP_ARG_PP?= ${_WRAP_EMPTY_FILE} _WRAP_ARG_PP_MAIN?= ${WRAPPER_TMPDIR}/arg-pp-main a206 2 _WRAP_ARG_PP.${_wrappee_}?= ${_WRAP_ARG_PP} _WRAP_ARG_PP_MAIN.${_wrappee_}?= ${_WRAP_ARG_PP_MAIN} a229 1 _WRAP_ARG_PP.CC= ${WRAPPER_TMPDIR}/arg-pp-mipspro-cc a231 1 _WRAP_ARG_PP.CXX= ${_WRAP_ARG_PP.CC} a278 4 .elif ${OPSYS} == "Darwin" _WRAP_ARG_PP.CC= ${WRAPPER_TMPDIR}/arg-pp-darwin-gcc _WRAP_ARG_PP.CXX= ${_WRAP_ARG_PP.CC} _WRAP_ARG_PP.LD= ${_WRAP_ARG_PP.CC} d284 1 d286 1 a286 2 _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-osf1-ld a313 2 -e "s|@@_WRAP_ARG_PP@@|${_WRAP_ARG_PP.${_wrappee_}:Q}|g" \ -e "s|@@_WRAP_ARG_PP_MAIN@@|${_WRAP_ARG_PP_MAIN.${_wrappee_}:Q}|g" \ a339 2 ${_WRAP_ARG_PP.${_wrappee_}} \ ${_WRAP_ARG_PP_MAIN.${_wrappee_}} \ a409 12 ${WRAPPER_TMPDIR}/arg-pp-darwin-gcc: \ ${WRAPPER_SRCDIR}/arg-pp-darwin-gcc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/arg-pp-mipspro-cc: \ ${WRAPPER_SRCDIR}/arg-pp-mipspro-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} a542 7 . if !target(${_WRAP_ARG_PP_MAIN.${_wrappee_}}) ${_WRAP_ARG_PP_MAIN.${_wrappee_}}: ${WRAPPER_SRCDIR}/arg-pp-main ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} . endif @ 1.12.2.9 log @sync with HEAD @ text @a232 9 .if !empty(PKGSRC_COMPILER:Micc) _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-icc-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-icc-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-icc-cc _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} .endif a483 12 ${WRAPPER_TMPDIR}/cmd-sink-icc-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-icc-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-icc-cc: \ ${WRAPPER_SRCDIR}/transform-icc-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.12.2.10 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.9 2005/02/15 16:25:23 tv Exp $ a233 4 . if !empty(CC_VERSION:M8.1) _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-icc81-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} . else a235 1 . endif a305 8 .elif ${OPSYS} == "AIX" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-aix-cc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.LD= ${WRAPPER_TMPDIR}/cmd-sink-aix-ld _WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-aix-cc _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-aix-cc _WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC} _WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC} a450 12 ${WRAPPER_TMPDIR}/cmd-sink-aix-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-aix-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/cmd-sink-aix-ld: \ ${WRAPPER_SRCDIR}/cmd-sink-aix-ld ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} a498 12 ${WRAPPER_TMPDIR}/cmd-sink-icc81-cc: \ ${WRAPPER_SRCDIR}/cmd-sink-icc81-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} ${WRAPPER_TMPDIR}/transform-aix-cc: \ ${WRAPPER_SRCDIR}/transform-aix-cc ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET} @ 1.12.2.11 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.10 2005/02/25 14:46:51 tv Exp $ d39 1 a39 4 # pkgsrc bmake does not (yet) correctly handle ${VAR} > 0 because # ${VAR} is treated as a string, so we must use a string comparison # operator. .if ${PKG_DEBUG_LEVEL} != "0" || defined(PKG_VERBOSE) @ 1.12.2.12 log @sync [all but bsd.pkg.mk] with HEAD @ text @d1 1 a1 1 # $NetBSD$ d47 5 d55 5 d112 2 a113 1 _WRAP_PATH= ${PATH:S/${WRAPPER_BINDIR}://:S/:${WRAPPER_BINDIR}//} a114 1 MAKEVARS+= _WRAP_PATH d703 16 @ 1.12.2.13 log @EOL the tv-derecurse branch; it has become too outdated. The last live revision can be fetched at the tv-derecurse-eol tag. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.12.2.12 2005/05/17 18:29:46 tv Exp $ @ 1.11 log @Insert the default values for WRAPPER_DEBUG and WRAPPER_UPDATE_CACHE as defaults within the wrapper script. This avoids requiring those two variables to be defined in the shell environment for the correct defaults to take effect. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.10 2004/10/14 20:22:21 tv Exp $ d152 1 a152 1 _WRAP_ALIASES.CXX= c++ g++ CC d250 7 d274 4 d431 18 a472 1 @ 1.10 log @Oy. For some reason, when doing :O:u, -L and -R options are stripped completely (they say "cached" but never come out the other side). So revert previous, hopefully to find a resolution later.... @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.9 2004/10/14 20:00:30 tv Exp $ d313 2 @ 1.9 log @Big speedup hack: Sort and uniqify ${_WRAP_TRANSFORM_CMDS}. Eliminates many (hundreds, in some packages) multiple identical transformations. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.8 2004/10/09 03:49:13 tv Exp $ a186 1 _WRAP_TRANSFORM_CMDS:= ${_WRAP_TRANSFORM_CMDS:O:u} @ 1.8 log @Move -D_ALL_SOURCE for Interix, required for nearly every compilation, from the funky CPPFLAGS assignment into the new wrapper framework. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.7 2004/10/06 09:49:53 grant Exp $ d187 1 @ 1.7 log @add initial support for IBM's XL C/C++ compiler. tested with version 6.0 on Mac OS X 10.3.5. to use XL C, set PKGSRC_COMPILER=xlc in mk.conf. XLCBASE defaults to /opt/ibmcmp/vacpp/6.0 (the default installation location on OS X), this can be overridden in mk.conf too. this is a work in progress - some simple packages can be built, but there are still lots of issues that need to be worked through. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.6 2004/10/04 20:28:30 jlam Exp $ d257 3 @ 1.6 log @Add a scan script that checks for "-v" on the command-line, and prevents the wrappers from adding extra flags to the command-line if "-v" exists. This makes "g++ -v" return the same error code for both the wrapper and the real executable and fixes the problem with the libtool-base build not correctly detecting the C++ compiler and thus not adding the CXX configuration tag to the final libtool script. Downgrade LIBTOOL_REQD to 1.5.10 since the newest version isn't needed with this change. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.5 2004/09/27 12:05:53 jlam Exp $ d243 7 d433 7 @ 1.5 log @Move some wrapper definitions into a separate file wrapper-defs.mk that is included by bsd.prefs.mk. This allows the following variables to be used before bsd.wrapper.mk is included: WRAPPER_DIR WRAPPER_SRCDIR WRAPPER_BINDIR WRAPPER_SHELL WRAPPER_TMPDIR @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.4 2004/09/26 21:38:03 jlam Exp $ d177 1 a177 1 _WRAP_SCAN?= ${_WRAP_EMPTY_FILE} d544 7 @ 1.4 log @Make _WRAPPEES into a public variable so that we can more easily create wrapper scripts in package-land. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.3 2004/09/25 20:38:21 jlam Exp $ d37 2 a43 5 WRAPPER_DIR= ${WRKDIR}/.wrapper WRAPPER_BINDIR= ${WRAPPER_DIR}/bin WRAPPER_TMPDIR= ${WRAPPER_DIR}/tmp WRAPPER_SRCDIR= ${.CURDIR}/../../mk/wrapper WRAPPER_SHELL= ${SH} @ 1.3 log @Add Dan Winship's workaround to allow building on Darwin. This is only a temporary fix until I can find time to do this better. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.2 2004/09/23 03:59:01 jlam Exp $ d134 2 a135 2 _WRAPPEES+= AS _WRAPPEES+= CC d139 1 a139 1 _WRAPPEES+= CPP d141 2 a142 2 _WRAPPEES+= CXX _WRAPPEES+= FC d145 1 a145 1 _WRAPPEES+= IMAKE d147 5 a151 1 _WRAPPEES+= LD @ 1.2 log @Move @@_WRAP_TRANSFORM_SED@@ from the logic script into wrapper.sh so that it can be customized per wrappee. This fixes the imake wrapper script to not do any transformations to -I... options. @ text @d1 1 a1 1 # $NetBSD: bsd.wrapper.mk,v 1.1 2004/09/21 15:01:41 jlam Exp $ d136 3 d140 1 @ 1.1 log @Initial commit of a new wrapper script framework that encapsulates the non-buildlink-related code and moves it out of mk/buildlink3 into mk/wrapper. The buildlink3 code is modified to simply hook its transformations into the wrapper script framework. The wrapper script framework has some new features: * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by ). * Much improved debugging output. It's possible to output the wrapper work log in-line with normal output by setting WRAPPER_LOG to "stderr". Important differences in behaviour from the old buildlink3 code include: * Only move the -l options to the end of the command line, leaving the -L options in-place. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la The old --fix-la syntax no longer works. 20040818 ======== * Initial release of a new wrapper script framework that encapsulates the non-buildlink-related code and moves it out of mk/buildlink3. These features include: * making MIPSpro accept GCC options * making MIPSpro "ucode" accept GCC options * making SunPro accept GCC options * making "ld" accept -Wl,* options and silently removing the "-Wl," * (NEW) making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH One major benefit of this is that the buildlink3 code is now much tighter and easier to understand since it concerns itself solely with buildlink-related details. I haven't yet optimized the wrapper cache, so the new wrapper scripts may take slightly longer to execute than the old buildlink3 wrapper scripts, but I'll be improving this over time. 20040821 ======== * Move the inclusion of $cmd_sink outside of the main loop in wrapper.sh so that the $cmd_sink script can be used to globally scan and process the arguments. Move the LD_RUN_PATH code to a cmd-sink-unixware-gcc script. Garbage-collect the now unused export_vars-related code. * Add cmd-sink-aix-xlc for AIX xlc that munges -Wl,-R* into an appropriate -blibpath option. * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by ). * Move the code that converts full paths to shared libraries into the "-Ldir -llib" equivalents from the buildlink3 code into wrapper/logic. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Move the code that checks for absolute rpaths from the buildlink3 code into wrapper/arg-source. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Only move the -l options to the end of the command line, leaving the -L options in-place. * Add more debugging code. 20040824 ======== * Fix quoting problems after arguments are transformed. Remove the hack that was inserted that magically made almost everything work because we do it the right way now. * Move the inclusion of $logic outside of the main loop in wrapper.sh so that the $logic script doesn't have to worry about underflowing the argument buffer. * Encapsulate the loop in wrapper.sh that fills the argument buffer entirely within the arg-source script. * Move from the logic script into the arg-source script the transformations that merge or split arguments. * Fix bug where skipargs was effectively being ignored if it was more than 1. * Handle the whitespace in transformations in the logic script that turn one library option into multiple library options, e.g. "-lreadline" -> "-ledit -ltermcap". * Allow you to specify an environment variable WRAPPER_SKIP_TRANSFORM for whether you wish to skip the transformation step in the logic script. This is intended for testing purposes. * Added check_prog() and init_lib() functions to the shell code library to make it more reusable outside of the wrapper framework. * Allow the msg_log() function to output to "stdout" or "stderr". If you want to have all of the logging appear on the screen, then you can now set WRAPPER_LOG=stderr. * Make some of the script components not overridable on a per-wrapper basis. * Add a gen-transform.sh script that generates transformation sedfiles. The "transform" script is used to transform arguments, while the "untransform" script is used to unwrap files. Move the no-rpath logic from buildlink3/gen-transform.sh into wrapper/gen-transform.sh since it's not buildlink3-specific. * Check for a non-empty blibpath before adding the option in cmd-sink-aix-xlc. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Add a cmd-sink-libtool script that doesn't pass linker options to libtool unless we're in "link" mode. * Set _USE_RPATH to "yes" for UnixWare so that the wrappers will see the rpath options and convert them to a LD_RUN_PATH definition. * Add more debugging code. 20040826 ======== * Rewrite buildlink3/gen-transform.sh to produce more precise sed commands. Drop some unused commands from the mini-language, and add a few more that are more restrictive in their scope. * Fix problem where repeated options weren't properly handled by some of sed commands. It's not enough that they're "global replace", since some patterns match separator characters before and after each option. We must repeat those patterns twice to catch all instances correctly. * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * Add more debugging code. 20040828 ======== * Added a head_queue function to shell-lib that returns the head of the named queue without popping it off the front of the queue. * Strip consecutive, repeated library options from the command line when we read it in the logic script. * Be more careful about not underflowing the argument buffer. 20040906 ======== * shell-lib was moved into pkgsrc/mk/scripts; correct references to that file in the wrapper code. * Use opt-sub instead of sub-mangle when protecting -I/usr/include/* and -L/usr/lib/* from buildlink transformations. This avoids adding lines that look like "-I-I..." in the transformation sedfiles. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Fix bug in strip-slashdot where the "." wasn't backquoted and thus matched all characters instead of only the "." character. * Change the libtool wrapper to use a modified buildcmd script that doesn't rearrange any of the arguments. This should fix spurious problems where libtool doesn't understand how to parse the command line when the -l options are moved to the end of the argument list. * Fix bug in the logic script where the $cachearg and $cachedarg weren't being properly set at all times, which caused the cache to contain the wrong transformed argument. 20040907 ======== * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * Move back the code that splits absolute paths to shared libraries from arg-source back into logic. This allows us to correctly skip splitting those paths based on the previous option. Also add a sanity check that the library name in the split argument doesn't contain a "/" since shell globs are not as precise as REs. * Don't transform the path given after --dynamic-linker (used by GNU ld for ELF linkage). * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la 20040914 ======== * Add a loop in libtool-fix-la to ensure that all of the options listed in the dependency_libs lines of *.lai files are processed. This fixes a buildlink3 leakage bug. * Merge the gen-transform.sh scripts between buildlink3 and wrapper and place them all in wrapper. This makes sense since the commands simply allow for many types of transformations, which buildlink3 takes advantage of, but there is nothing inherently buildlink-ish about those commands. * Don't directly manipulate SUBST_SED.unwrap. Instead, create the value of SUBST_SED.unwrap by combining several other variables (currently just _UNWRAP_SED) to ensure that the correct ordering is preserved. * Correct some confusing debugging messages. @ text @d1 1 a1 1 # $NetBSD$ d81 1 d297 1 a536 1 | ${SED} -e "s|@@_WRAP_TRANSFORM_SED@@|${_WRAP_TRANSFORM_SED.${_wrappee_}:Q}|g" \ @