head 1.111; access; symbols pkgsrc-2023Q4:1.108.0.2 pkgsrc-2023Q4-base:1.108 pkgsrc-2023Q3:1.107.0.2 pkgsrc-2023Q3-base:1.107 pkgsrc-2023Q2:1.99.0.6 pkgsrc-2023Q2-base:1.99 pkgsrc-2023Q1:1.99.0.4 pkgsrc-2023Q1-base:1.99 pkgsrc-2022Q4:1.99.0.2 pkgsrc-2022Q4-base:1.99 pkgsrc-2022Q3:1.98.0.2 pkgsrc-2022Q3-base:1.98 pkgsrc-2022Q2:1.97.0.2 pkgsrc-2022Q2-base:1.97 pkgsrc-2022Q1:1.96.0.4 pkgsrc-2022Q1-base:1.96 pkgsrc-2021Q4:1.96.0.2 pkgsrc-2021Q4-base:1.96 pkgsrc-2021Q3:1.95.0.12 pkgsrc-2021Q3-base:1.95 pkgsrc-2021Q2:1.95.0.10 pkgsrc-2021Q2-base:1.95 pkgsrc-2021Q1:1.95.0.8 pkgsrc-2021Q1-base:1.95 pkgsrc-2020Q4:1.95.0.6 pkgsrc-2020Q4-base:1.95 pkgsrc-2020Q3:1.95.0.4 pkgsrc-2020Q3-base:1.95 pkgsrc-2020Q2:1.95.0.2 pkgsrc-2020Q2-base:1.95 pkgsrc-2020Q1:1.94.0.4 pkgsrc-2020Q1-base:1.94 pkgsrc-2019Q4:1.94.0.6 pkgsrc-2019Q4-base:1.94 pkgsrc-2019Q3:1.94.0.2 pkgsrc-2019Q3-base:1.94 pkgsrc-2019Q2:1.92.0.2 pkgsrc-2019Q2-base:1.92 pkgsrc-2019Q1:1.91.0.2 pkgsrc-2019Q1-base:1.91 pkgsrc-2018Q4:1.90.0.2 pkgsrc-2018Q4-base:1.90 pkgsrc-2018Q3:1.89.0.2 pkgsrc-2018Q3-base:1.89 pkgsrc-2018Q2:1.88.0.4 pkgsrc-2018Q2-base:1.88 pkgsrc-2018Q1:1.88.0.2 pkgsrc-2018Q1-base:1.88 pkgsrc-2017Q4:1.87.0.6 pkgsrc-2017Q4-base:1.87 pkgsrc-2017Q3:1.87.0.4 pkgsrc-2017Q3-base:1.87 pkgsrc-2017Q2:1.86.0.2 pkgsrc-2017Q2-base:1.86 pkgsrc-2017Q1:1.83.0.4 pkgsrc-2017Q1-base:1.83 pkgsrc-2016Q4:1.83.0.2 pkgsrc-2016Q4-base:1.83 pkgsrc-2016Q3:1.82.0.16 pkgsrc-2016Q3-base:1.82 pkgsrc-2016Q2:1.82.0.14 pkgsrc-2016Q2-base:1.82 pkgsrc-2016Q1:1.82.0.12 pkgsrc-2016Q1-base:1.82 pkgsrc-2015Q4:1.82.0.10 pkgsrc-2015Q4-base:1.82 pkgsrc-2015Q3:1.82.0.8 pkgsrc-2015Q3-base:1.82 pkgsrc-2015Q2:1.82.0.6 pkgsrc-2015Q2-base:1.82 pkgsrc-2015Q1:1.82.0.4 pkgsrc-2015Q1-base:1.82 pkgsrc-2014Q4:1.82.0.2 pkgsrc-2014Q4-base:1.82 pkgsrc-2014Q3:1.81.0.10 pkgsrc-2014Q3-base:1.81 pkgsrc-2014Q2:1.81.0.8 pkgsrc-2014Q2-base:1.81 pkgsrc-2014Q1:1.81.0.6 pkgsrc-2014Q1-base:1.81 pkgsrc-2013Q4:1.81.0.4 pkgsrc-2013Q4-base:1.81 pkgsrc-2013Q3:1.81.0.2 pkgsrc-2013Q3-base:1.81 pkgsrc-2013Q2:1.80.0.6 pkgsrc-2013Q2-base:1.80 pkgsrc-2013Q1:1.80.0.4 pkgsrc-2013Q1-base:1.80 pkgsrc-2012Q4:1.80.0.2 pkgsrc-2012Q4-base:1.80 pkgsrc-2012Q3:1.79.0.2 pkgsrc-2012Q3-base:1.79 pkgsrc-2012Q2:1.76.0.2 pkgsrc-2012Q2-base:1.76 pkgsrc-2012Q1:1.74.0.12 pkgsrc-2012Q1-base:1.74 pkgsrc-2011Q4:1.74.0.10 pkgsrc-2011Q4-base:1.74 pkgsrc-2011Q3:1.74.0.8 pkgsrc-2011Q3-base:1.74 pkgsrc-2011Q2:1.74.0.6 pkgsrc-2011Q2-base:1.74 pkgsrc-2011Q1:1.74.0.4 pkgsrc-2011Q1-base:1.74 pkgsrc-2010Q4:1.74.0.2 pkgsrc-2010Q4-base:1.74 pkgsrc-2010Q3:1.72.0.2 pkgsrc-2010Q3-base:1.72 pkgsrc-2010Q2:1.70.0.8 pkgsrc-2010Q2-base:1.70 pkgsrc-2010Q1:1.70.0.6 pkgsrc-2010Q1-base:1.70 pkgsrc-2009Q4:1.70.0.4 pkgsrc-2009Q4-base:1.70 pkgsrc-2009Q3:1.70.0.2 pkgsrc-2009Q3-base:1.70 pkgsrc-2009Q2:1.69.0.2 pkgsrc-2009Q2-base:1.69 pkgsrc-2009Q1:1.68.0.4 pkgsrc-2009Q1-base:1.68 pkgsrc-2008Q4:1.68.0.2 pkgsrc-2008Q4-base:1.68 pkgsrc-2008Q3:1.66.0.10 pkgsrc-2008Q3-base:1.66 cube-native-xorg:1.66.0.8 cube-native-xorg-base:1.66 pkgsrc-2008Q2:1.66.0.6 pkgsrc-2008Q2-base:1.66 cwrapper:1.66.0.4 pkgsrc-2008Q1:1.66.0.2 pkgsrc-2008Q1-base:1.66 pkgsrc-2007Q4:1.64.0.2 pkgsrc-2007Q4-base:1.64 pkgsrc-2007Q3:1.63.0.2 pkgsrc-2007Q3-base:1.63 pkgsrc-2007Q2:1.61.0.2 pkgsrc-2007Q2-base:1.61 pkgsrc-2007Q1:1.58.0.6 pkgsrc-2007Q1-base:1.58 jlam-pkgviews:1.58.0.4 jlam-pkgviews-base:1.58 pkgsrc-2006Q4:1.58.0.2 pkgsrc-2006Q4-base:1.58 pkgsrc-2006Q3:1.55.0.2 pkgsrc-2006Q3-base:1.55 pkgsrc-2006Q2:1.51.0.2 pkgsrc-2006Q2-base:1.51 tv-derecurse-eol:1.38.2.7 pkgsrc-2006Q1:1.47.0.4 pkgsrc-2006Q1-base:1.47 pkgsrc-2005Q4:1.47.0.2 pkgsrc-2005Q4-base:1.47 pkgsrc-2005Q3:1.46.0.6 pkgsrc-2005Q3-base:1.46 pkgsrc-2005Q2:1.46.0.4 pkgsrc-2005Q2-base:1.46 tv-derecurse-merge:1.46 pkgsrc-2005Q1:1.46.0.2 pkgsrc-2005Q1-base:1.46 pkgsrc-2004Q4:1.41.0.2 pkgsrc-2004Q4-base:1.41 tv-derecurse:1.38.0.2 tv-derecurse-base:1.46 pkgsrc-2004Q3:1.34.0.2 pkgsrc-2004Q3-base:1.34 pkgsrc-2004Q2:1.32.0.2 pkgsrc-2004Q2-base:1.32 pkgsrc-2004Q1:1.26.0.2 pkgsrc-2004Q1-base:1.26 pkgsrc-2003Q4:1.23.0.2 pkgsrc-2003Q4-base:1.23; locks; strict; comment @# @; 1.111 date 2024.01.27.00.03.49; author wiz; state Exp; branches; next 1.110; commitid bq0mL80Yf8Fud1WE; 1.110 date 2024.01.03.12.20.21; author gdt; state Exp; branches; next 1.109; commitid oE5I0w0InPw240TE; 1.109 date 2024.01.03.08.11.51; author mef; state Exp; branches; next 1.108; commitid zh6vVU5PSx6QFYSE; 1.108 date 2023.12.12.16.28.45; author gdt; state Exp; branches; next 1.107; commitid rebG68rbngO59cQE; 1.107 date 2023.08.02.15.59.58; author nia; state Exp; branches; next 1.106; commitid 8PkfA6iq1DH6eezE; 1.106 date 2023.07.30.21.47.44; author ryoon; state Exp; branches; next 1.105; commitid gH27b0v4L6bxfSyE; 1.105 date 2023.07.30.15.09.25; author jperkin; state Exp; branches; next 1.104; commitid xKLUMx8rW2dw2QyE; 1.104 date 2023.07.29.18.09.39; author nia; state Exp; branches; next 1.103; commitid vYTTjzyiSuWl4JyE; 1.103 date 2023.07.29.17.55.47; author nia; state Exp; branches; next 1.102; commitid bYOhbbPBMMPPZIyE; 1.102 date 2023.07.22.12.20.37; author nia; state Exp; branches; next 1.101; commitid oNjPIZX6LlSBmNxE; 1.101 date 2023.07.21.08.29.56; author nia; state Exp; branches; next 1.100; commitid akBpjjHywbBJ7ExE; 1.100 date 2023.07.18.12.49.46; author nia; state Exp; branches; next 1.99; commitid HhuC1JgcaBmOEhxE; 1.99 date 2022.11.23.13.30.38; author jperkin; state Exp; branches; next 1.98; commitid IPeynSrDlM7yuP2E; 1.98 date 2022.07.05.17.32.24; author jperkin; state Exp; branches; next 1.97; commitid byyzMra37bnSlJKD; 1.97 date 2022.04.10.19.54.02; author riastradh; state Exp; branches; next 1.96; commitid eCnqwu33hrWaVGzD; 1.96 date 2021.12.03.07.40.26; author wiz; state Exp; branches; next 1.95; commitid FgtMfZrYJKjAYajD; 1.95 date 2020.06.02.06.58.13; author rillig; state Exp; branches; next 1.94; commitid g9XIPwxEZTisnCaC; 1.94 date 2019.07.23.13.57.04; author gdt; state Exp; branches; next 1.93; commitid ffelOJ21nciGPawB; 1.93 date 2019.07.15.16.06.19; author ryoon; state Exp; branches; next 1.92; commitid Pxolurm8KLiUN9vB; 1.92 date 2019.06.26.00.22.56; author ryoon; state Exp; branches; next 1.91; commitid IHo0Ng5bpGH5cDsB; 1.91 date 2019.02.22.00.06.46; author rillig; state Exp; branches; next 1.90; commitid iRWArlaK99jw5HcB; 1.90 date 2018.11.12.14.22.58; author jperkin; state Exp; branches; next 1.89; commitid gHxFSFEcfM6Q5FZA; 1.89 date 2018.08.12.19.36.40; author rillig; state Exp; branches; next 1.88; commitid WuTdMu0DnbrANRNA; 1.88 date 2018.01.26.13.14.35; author jperkin; state Exp; branches; next 1.87; commitid K0wxHLTdO7MC2ooA; 1.87 date 2017.07.04.14.35.55; author gdt; state Exp; branches; next 1.86; commitid HlRZMhF4r91H7VXz; 1.86 date 2017.06.10.11.32.32; author kamil; state Exp; branches; next 1.85; commitid 4UpabrHDlHdvROUz; 1.85 date 2017.05.18.08.14.08; author jperkin; state Exp; branches; next 1.84; commitid SgyEQG3swFv9wQRz; 1.84 date 2017.05.03.08.34.23; author jperkin; state Exp; branches; next 1.83; commitid eYvPSZTI6y1u3VPz; 1.83 date 2016.11.10.20.59.43; author joerg; state Exp; branches; next 1.82; commitid l7OL4cSvxeToPCtz; 1.82 date 2014.12.09.23.43.29; author joerg; state Exp; branches; next 1.81; commitid 9SsPHExfCCRPiq1y; 1.81 date 2013.07.07.09.06.23; author marino; state Exp; branches; next 1.80; commitid Z2auptps37DgawWw; 1.80 date 2012.12.12.20.49.01; author marino; state Exp; branches; next 1.79; 1.79 date 2012.08.09.12.32.41; author jperkin; state Exp; branches; next 1.78; 1.78 date 2012.08.09.12.16.24; author jperkin; state Exp; branches; next 1.77; 1.77 date 2012.07.08.19.57.10; author marino; state Exp; branches; next 1.76; 1.76 date 2012.06.27.13.36.08; author jperkin; state Exp; branches; next 1.75; 1.75 date 2012.04.13.03.03.36; author sbd; state Exp; branches; next 1.74; 1.74 date 2010.11.17.08.40.22; author obache; state Exp; branches; next 1.73; 1.73 date 2010.11.17.08.38.15; author obache; state Exp; branches; next 1.72; 1.72 date 2010.09.23.22.26.06; author ahoka; state Exp; branches; next 1.71; 1.71 date 2010.07.30.07.58.58; author asau; state Exp; branches; next 1.70; 1.70 date 2009.07.08.21.17.16; author markd; state Exp; branches; next 1.69; 1.69 date 2009.05.30.18.16.26; author joerg; state Exp; branches; next 1.68; 1.68 date 2008.10.20.20.44.49; author wiz; state Exp; branches; next 1.67; 1.67 date 2008.10.20.18.33.50; author ahoka; state Exp; branches; next 1.66; 1.66 date 2008.02.13.09.00.52; author rillig; state Exp; branches; next 1.65; 1.65 date 2008.02.07.21.36.13; author rillig; state Exp; branches; next 1.64; 1.64 date 2007.10.17.10.43.37; author rillig; state Exp; branches; next 1.63; 1.63 date 2007.09.20.17.28.48; author rillig; state Exp; branches; next 1.62; 1.62 date 2007.09.18.01.51.10; author reed; state Exp; branches; next 1.61; 1.61 date 2007.06.09.18.44.37; author rillig; state Exp; branches; next 1.60; 1.60 date 2007.06.08.20.48.16; author rillig; state Exp; branches; next 1.59; 1.59 date 2007.04.17.11.05.33; author tnn; state Exp; branches; next 1.58; 1.58 date 2006.12.03.08.34.45; author seb; state Exp; branches; next 1.57; 1.57 date 2006.12.02.22.32.59; author jschauma; state Exp; branches; next 1.56; 1.56 date 2006.11.16.02.42.13; author markd; state Exp; branches; next 1.55; 1.55 date 2006.07.27.20.07.06; author joerg; state Exp; branches; next 1.54; 1.54 date 2006.07.22.05.01.17; author rillig; state Exp; branches; next 1.53; 1.53 date 2006.07.20.16.44.01; author rillig; state Exp; branches; next 1.52; 1.52 date 2006.07.02.23.09.19; author rillig; state Exp; branches; next 1.51; 1.51 date 2006.06.09.13.59.08; author jlam; state Exp; branches; next 1.50; 1.50 date 2006.05.12.21.37.08; author jlam; state Exp; branches; next 1.49; 1.49 date 2006.05.11.22.13.19; author jlam; state Exp; branches; next 1.48; 1.48 date 2006.05.06.15.20.05; author tv; state Exp; branches; next 1.47; 1.47 date 2005.10.16.19.44.44; author schwarz; state Exp; branches; next 1.46; 1.46 date 2005.02.16.08.41.20; author grant; state Exp; branches; next 1.45; 1.45 date 2005.02.15.07.43.43; author grant; state Exp; branches; next 1.44; 1.44 date 2005.01.24.18.07.56; author tv; state Exp; branches; next 1.43; 1.43 date 2005.01.12.15.32.01; author jlam; state Exp; branches; next 1.42; 1.42 date 2005.01.10.09.05.01; author jlam; state Exp; branches; next 1.41; 1.41 date 2004.11.30.15.07.26; author jlam; state Exp; branches; next 1.40; 1.40 date 2004.11.30.14.50.37; author jlam; state Exp; branches; next 1.39; 1.39 date 2004.11.28.21.32.47; author jlam; state Exp; branches; next 1.38; 1.38 date 2004.11.22.22.24.47; author wiz; state Exp; branches 1.38.2.1; next 1.37; 1.37 date 2004.11.20.04.37.08; author grant; state Exp; branches; next 1.36; 1.36 date 2004.10.06.09.49.53; author grant; state Exp; branches; next 1.35; 1.35 date 2004.09.21.15.01.39; author jlam; state Exp; branches; next 1.34; 1.34 date 2004.07.04.00.38.15; author wiz; state Exp; branches; next 1.33; 1.33 date 2004.07.04.00.28.30; author wiz; state Exp; branches; next 1.32; 1.32 date 2004.05.12.21.49.39; author reed; state Exp; branches; next 1.31; 1.31 date 2004.05.09.00.04.14; author grant; state Exp; branches; next 1.30; 1.30 date 2004.05.08.16.36.55; author grant; state Exp; branches; next 1.29; 1.29 date 2004.05.08.15.09.31; author grant; state Exp; branches; next 1.28; 1.28 date 2004.05.08.06.03.26; author grant; state Exp; branches; next 1.27; 1.27 date 2004.03.31.09.38.36; author sketch; state Exp; branches; next 1.26; 1.26 date 2004.02.18.13.32.38; author jlam; state Exp; branches; next 1.25; 1.25 date 2004.02.01.01.57.39; author jlam; state dead; branches; next 1.24; 1.24 date 2003.12.10.09.08.24; author sketch; state Exp; branches; next 1.23; 1.23 date 2003.11.12.13.13.43; author grant; state Exp; branches; next 1.22; 1.22 date 2003.10.24.12.07.14; author cube; state Exp; branches; next 1.21; 1.21 date 2003.10.18.09.14.47; author grant; state Exp; branches; next 1.20; 1.20 date 2003.10.12.03.05.37; author grant; state Exp; branches; next 1.19; 1.19 date 2003.10.11.03.43.14; author grant; state Exp; branches; next 1.18; 1.18 date 2003.10.11.02.44.18; author grant; state Exp; branches; next 1.17; 1.17 date 2003.10.06.11.14.22; author grant; state Exp; branches; next 1.16; 1.16 date 2003.10.06.07.11.19; author grant; state Exp; branches; next 1.15; 1.15 date 2003.09.28.09.53.56; author grant; state Exp; branches; next 1.14; 1.14 date 2003.09.28.09.48.00; author grant; state Exp; branches; next 1.13; 1.13 date 2003.09.27.17.20.38; author grant; state Exp; branches; next 1.12; 1.12 date 2003.09.24.12.22.04; author grant; state Exp; branches; next 1.11; 1.11 date 2003.09.24.03.01.02; author grant; state Exp; branches; next 1.10; 1.10 date 2003.09.23.19.19.33; author gavan; state Exp; branches; next 1.9; 1.9 date 2003.09.21.16.43.47; author wiz; state Exp; branches; next 1.8; 1.8 date 2003.09.17.19.58.08; author grant; state Exp; branches; next 1.7; 1.7 date 2003.09.17.14.37.32; author grant; state Exp; branches; next 1.6; 1.6 date 2003.09.12.22.53.18; author salo; state Exp; branches; next 1.5; 1.5 date 2003.09.12.20.10.17; author grant; state Exp; branches; next 1.4; 1.4 date 2003.09.12.16.07.09; author grant; state Exp; branches; next 1.3; 1.3 date 2003.09.12.15.54.40; author grant; state Exp; branches; next 1.2; 1.2 date 2003.09.12.13.35.29; author salo; state Exp; branches; next 1.1; 1.1 date 2003.09.12.13.03.38; author grant; state Exp; branches; next ; 1.38.2.1 date 2004.11.22.22.48.05; author tv; state Exp; branches; next 1.38.2.2; 1.38.2.2 date 2004.11.30.15.06.34; author tv; state Exp; branches; next 1.38.2.3; 1.38.2.3 date 2004.11.30.15.10.47; author tv; state Exp; branches; next 1.38.2.4; 1.38.2.4 date 2005.01.10.16.15.25; author tv; state Exp; branches; next 1.38.2.5; 1.38.2.5 date 2005.01.13.20.11.55; author tv; state Exp; branches; next 1.38.2.6; 1.38.2.6 date 2005.02.15.16.25.22; author tv; state Exp; branches; next 1.38.2.7; 1.38.2.7 date 2005.02.25.14.46.51; author tv; state Exp; branches; next 1.38.2.8; 1.38.2.8 date 2006.06.07.15.25.38; author tv; state dead; branches; next ; desc @@ 1.111 log @mk: add support for c++23/gnu++23 @ text @# $NetBSD: compiler.mk,v 1.110 2024/01/03 12:20:21 gdt Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. # # The following variables may be set by the pkgsrc user in mk.conf: # # PKGSRC_COMPILER # A list of values specifying the chain of compilers to be used by # pkgsrc to build packages. # # Valid values are: # ccc Compaq C Compilers (Tru64) # ccache compiler cache (chainable) # clang Clang C and Objective-C compiler # distcc distributed C/C++ (chainable) # f2c Fortran 77 to C compiler (chainable) # icc Intel C++ Compiler (Linux) # ido SGI IRIS Development Option cc (IRIX 5) # gcc GNU # hp HP-UX C/aC++ compilers # mipspro Silicon Graphics, Inc. MIPSpro (n32/n64) # mipspro-ucode Silicon Graphics, Inc. MIPSpro (o32) # pcc Portable C Compiler # sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun # ONE Studio # xlc IBM's XL C/C++ compiler suite (Darwin/MacOSX) # # The default is "gcc". You can use ccache and/or distcc with # an appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc # gcc". You can also use "f2c" to overlay the lang/f2c package # over the C compiler instead of using the system Fortran # compiler. The chain should always end in a real compiler. # This should only be set in /etc/mk.conf. # # COMPILER_USE_SYMLINKS # If set to yes, use symlinks for the compiler drivers, otherwise # shell scripts are created. The default is yes. # # CHECK_COMPILER # If set to yes, fail early if the compiler.mk variables are not # set correctly. # # ALLOW_NEWER_COMPILER # If set to no, fail early if a package requires newer compiler # features than supported by the system's compiler. If set to # yes (the default), pkgsrc may attempt to build a newer compiler # to use instead. # # The following variables may be set by a package: # # USE_LANGUAGES # Declares the languages that should be made available # via pkgsrc's compiler wrappers. # # Valid values are: c, c++, fortran, fortran77, java, objc, # obj-c++, ada. # # There is deprecated support for expressing a specific language # dialect (e.g. c++17) in USE_LANGUAGES. This both requires a # compiler that supports that dialect, and adds -std= flags via # the wrappers. (Instead, following the documentation below, # the language dialect should be added to USE_C_FEATURES or # USE_CXX_FEATURES to require a compiler with support, and if # the package does not add -std flags itself, then FORCE_C_STD # or FORCE_CXX_STD should be set.) # # Deprecated values are: c99, gnu99, c11, gnu11, c17, gnu17, # c++03, gnu++03, c++0x, gnu++0x, c++11, gnu++11, c++14, # gnu++14, c++17, gnu++17, c++20, gnu++20, c++23, gnu++23. # # The default is "c". # # USE_CC_FEATURES # # Declares the C compiler features required by the package. # # This is used to (optionally) install a newer compiler # than provided by the system, or to skip building the package. # # Valid values are: c99, c11, c17, has_include. # # USE_CXX_FEATURES # # Declares the C++ compiler features required by the package. # # This is used to (optionally) install a newer compiler # than provided by the system, to or skip building the package. # # Valid values are: c++11, c++14, c++17, c++20, c++23, has_include, # regex, filesystem, unique_ptr, charconv, parallelism_ts, # put_time, is_trivially_copy_constructible. # # FORCE_C_STD # # Overrides the compiler's default C dialect to ensure that a # specific language variant is used. This is useful if a package # uses features from a later or earlier C standard but doesn't set # -std=cXX, since the default dialect choice of different compiler # versions is not consistent. It is also useful if a package # wants to use GNU language extensions without setting -std=gnuXX. # # Valid values are: c90, c99, c11, gnu90, gnu99, gnu11 # # FORCE_CXX_STD # # Overrides the compiler's default C++ dialect to ensure that a # specific language variant is used. This is useful if a package # uses features from a later or earlier C++ standard but doesn't set # -std=c++XX, since the default dialect choice of different compiler # versions is not consistent. It is also useful if a package # uses GNU language extensions without setting -std=gnu++XX. # # Valid values are: c++03, c++11, c++14, c++17, c++20, c++23, # gnu++03, gnu++11, gnu++17, gnu++20, gnu++23 # # The following variables are defined, and available for testing in # package Makefiles: # # CC_VERSION # The compiler and version being used, e.g., # # .include "../../mk/compiler.mk" # # .if !empty(CC_VERSION:Mgcc-3*) # ... # .endif # # Keywords: compiler .if !defined(BSD_COMPILER_MK) BSD_COMPILER_MK= defined _VARGROUPS+= compiler _USER_VARS.compiler= PKGSRC_COMPILER USE_PKGSRC_GCC ABI COMPILER_USE_SYMLINKS _PKG_VARS.compiler= USE_LANGUAGES GCC_REQD NOT_FOR_COMPILER ONLY_FOR_COMPILER _SYS_VARS.compiler= CC_VERSION .include "bsd.fast.prefs.mk" # Since most packages need a C compiler, this is the default value. USE_LANGUAGES?= c _C_STD_VERSIONS= c99 gnu99 c11 gnu11 c17 gnu17 .for _version_ in ${_C_STD_VERSIONS} . if !empty(USE_LANGUAGES:M${_version_}) USE_LANGUAGES+= c . endif .endfor _CXX_STD_VERSIONS= gnu++23 c++23 gnu++20 c++20 gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 .for _version_ in ${_CXX_STD_VERSIONS} . if !empty(USE_LANGUAGES:M${_version_}) USE_LANGUAGES+= c++ . endif .endfor #.READONLY: USE_LANGUAGES _USE_LANGUAGES_EFFECTIVE:= ${USE_LANGUAGES} COMPILER_USE_SYMLINKS?= yes _COMPILERS= ccc clang gcc hp icc ido \ mipspro mipspro-ucode pcc sunpro xlc _PSEUDO_COMPILERS= ccache distcc f2c g95 .if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER) . for _compiler_ in ${_COMPILERS} . if ${NOT_FOR_COMPILER:M${_compiler_}} == "" _ACCEPTABLE_COMPILERS+= ${_compiler_} . endif . endfor .elif defined(ONLY_FOR_COMPILER) && !empty(ONLY_FOR_COMPILER) . for _compiler_ in ${_COMPILERS} . if ${ONLY_FOR_COMPILER:M${_compiler_}} != "" _ACCEPTABLE_COMPILERS+= ${_compiler_} . endif . endfor .else _ACCEPTABLE_COMPILERS+= ${_COMPILERS} .endif # Currently only gcc-based compilers support Ada # Override PKGSRC_COMPILER if Ada language specified .if !empty(USE_LANGUAGES:Mada) PKGSRC_COMPILER= gcc .endif .if defined(_ACCEPTABLE_COMPILERS) . for _acceptable_ in ${_ACCEPTABLE_COMPILERS} . for _compiler_ in ${PKGSRC_COMPILER} . if !empty(_ACCEPTABLE_COMPILERS:M${_compiler_}) && !defined(_COMPILER) _COMPILER= ${_compiler_} . endif . endfor . endfor .endif .if !defined(_COMPILER) PKG_FAIL_REASON+= "No acceptable compiler found for ${PKGNAME}." .endif .for _compiler_ in ${PKGSRC_COMPILER} . if !empty(_PSEUDO_COMPILERS:M${_compiler_}) _PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER} . endif .endfor _PKGSRC_COMPILER:= ${_COMPILER} ${_PKGSRC_COMPILER} _COMPILER_STRIP_VARS= # empty .for _compiler_ in ${_PKGSRC_COMPILER} . include "compiler/${_compiler_}.mk" .endfor .undef _compiler_ .if !defined(PKG_CPP) PKG_CPP:=${CPP} .endif # Ensure the Solaris linker is used by default. .if ${OPSYS} == "SunOS" . if exists(/usr/ccs/bin/ld) PKG_LD?= /usr/ccs/bin/ld . elif exists(/usr/bin/ld) PKG_LD?= /usr/bin/ld . endif .endif # Strip the leading paths from the toolchain variables since we manipulate # the PATH to use the correct executable. # .for _var_ in ${_COMPILER_STRIP_VARS} . if empty(${_var_}:C/^/_asdf_/1:N_asdf_*) ${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} . else ${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} ${${_var_}:C/^/_asdf_/1:N_asdf_*} . endif .endfor # Pass the compiler flag based on the most recent version of the C or C++ # standard required. We currently assume that each standard is a superset of # all that come after it. # _C_VERSION_REQD= .for _version_ in ${_C_STD_VERSIONS} . if empty(_C_VERSION_REQD) && !empty(USE_LANGUAGES:M${_version_}) _C_VERSION_REQD= ${_version_} _WRAP_EXTRA_ARGS.CC+= ${_C_STD_FLAG.${_C_VERSION_REQD}} CWRAPPERS_PREPEND.cc+= ${_C_STD_FLAG.${_C_VERSION_REQD}} . endif .endfor _CXX_VERSION_REQD= .for _version_ in ${_CXX_STD_VERSIONS} . if empty(_CXX_VERSION_REQD) && !empty(USE_LANGUAGES:M${_version_}) _CXX_VERSION_REQD= ${_version_} _WRAP_EXTRA_ARGS.CXX+= ${_CXX_STD_FLAG.${_CXX_VERSION_REQD}} CWRAPPERS_PREPEND.cxx+= ${_CXX_STD_FLAG.${_CXX_VERSION_REQD}} . endif .endfor .if defined(ABI) && !empty(ABI) _WRAP_EXTRA_ARGS.CC+= ${_COMPILER_ABI_FLAG.${ABI}} _WRAP_EXTRA_ARGS.CXX+= ${_COMPILER_ABI_FLAG.${ABI}} _WRAP_EXTRA_ARGS.FC+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_PREPEND.cc+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_PREPEND.cxx+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_PREPEND.f77+= ${_COMPILER_ABI_FLAG.${ABI}} .endif # Enable SSP if the user has chosen to and the compiler supports it. # .if ${_PKGSRC_USE_SSP} == "yes" && defined(_SSP_CFLAGS) _WRAP_EXTRA_ARGS.CC+= ${_SSP_CFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_SSP_CFLAGS} CWRAPPERS_PREPEND.cc+= ${_SSP_CFLAGS} CWRAPPERS_PREPEND.cxx+= ${_SSP_CFLAGS} CWRAPPERS_PREPEND.f77+= ${_SSP_CFLAGS} .endif # Enable FORTIFY_SOURCE if the user has chosen to and the compiler # supports it. # .if ${_PKGSRC_USE_FORTIFY} != "no" && defined(_FORTIFY_CFLAGS) _WRAP_EXTRA_ARGS.CC+= ${_FORTIFY_CFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_FORTIFY_CFLAGS} CWRAPPERS_PREPEND.cc+= ${_FORTIFY_CFLAGS} CWRAPPERS_PREPEND.cxx+= ${_FORTIFY_CFLAGS} .endif # Enable reproducible executables if the user has chosen to and the # compiler supports it. # .if ${_PKGSRC_MKREPRO} != "no" && defined(_MKREPRO_CFLAGS) _WRAP_EXTRA_ARGS.CC+= ${_MKREPRO_CFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_MKREPRO_CFLAGS} CWRAPPERS_PREPEND.cc+= ${_MKREPRO_CFLAGS} CWRAPPERS_PREPEND.cxx+= ${_MKREPRO_CFLAGS} .endif # Enable relocation read-only if the user has chosen to and the compiler # supports it. # .if (${_PKGSRC_USE_RELRO} == "partial" || ${_PKGSRC_USE_RELRO} == "full") \ && defined(_RELRO_LDFLAGS) LDFLAGS+= ${_RELRO_LDFLAGS} _WRAP_EXTRA_ARGS.CC+= ${_RELRO_LDFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_RELRO_LDFLAGS} CWRAPPERS_PREPEND.cc+= ${_RELRO_LDFLAGS} CWRAPPERS_PREPEND.cxx+= ${_RELRO_LDFLAGS} .endif # Enable position-independent executables if the user has chosen to and # the compiler supports it. # .if ${_PKGSRC_MKPIE} == "yes" && ${PKGSRC_OVERRIDE_MKPIE:tl} == "no" _WRAP_EXTRA_ARGS.CC+= ${_MKPIE_CFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_MKPIE_CFLAGS} CWRAPPERS_PREPEND.cc+= ${_MKPIE_CFLAGS} CWRAPPERS_PREPEND.cxx+= ${_MKPIE_CFLAGS} CWRAPPERS_PREPEND.f77+= ${_MKPIE_FCFLAGS} .endif # Add debug flags if the user has requested CTF and the compiler supports it. # .if ${_PKGSRC_USE_CTF} == "yes" && defined(_CTF_CFLAGS) _WRAP_EXTRA_ARGS.CC+= ${_CTF_CFLAGS} CWRAPPERS_APPEND.cc+= ${_CTF_CFLAGS} .endif # Add sysroot if using cross-compilation tools. # .if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) CWRAPPERS_PREPEND.cc+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} CWRAPPERS_PREPEND.cxx+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} CWRAPPERS_PREPEND.ld+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} # XXX cross fortran .endif # If the languages are not requested, force them not to be available # in the generated wrappers. # _FAIL_WRAPPER.CC= ${WRKDIR}/.compiler/bin/c-fail-wrapper _FAIL_WRAPPER.CXX= ${WRKDIR}/.compiler/bin/c++-fail-wrapper _FAIL_WRAPPER.FC= ${WRKDIR}/.compiler/bin/fortran-fail-wrapper _FAIL_WRAPPER.ADA= ${WRKDIR}/.compiler/bin/ada-fail-wrapper ${_FAIL_WRAPPER.CC}: fail-wrapper ${_FAIL_WRAPPER.CXX}: fail-wrapper ${_FAIL_WRAPPER.FC}: fail-wrapper ${_FAIL_WRAPPER.ADA}: fail-wrapper .PHONY: fail-wrapper fail-wrapper: .USE ${RUN} \ ${TEST} -d ${.TARGET:H} || ${MKDIR} ${.TARGET:H}; \ exec 1>${.TARGET}; \ ${ECHO} '#!'${TOOLS_SHELL:Q}; \ ${ECHO} 'wrapperlog="$${TOOLS_WRAPPER_LOG-'${_TOOLS_WRAP_LOG:Q}'}"'; \ ${ECHO} 'lang="${.TARGET:T:S/-fail-wrapper//}"'; \ ${ECHO} 'msg="*** Please consider adding $$lang to USE_LANGUAGES in the package Makefile."'; \ ${ECHO} '${ECHO} "$$msg" >> $$wrapperlog'; \ ${ECHO} '${ECHO} "$$msg" > ${WARNING_DIR}/${.TARGET:T}'; \ ${ECHO} '${ECHO} "PKGSRC-WARNING: Something is trying to run the $$lang compiler," 1>&2'; \ ${ECHO} '${ECHO} "PKGSRC-WARNING: but it is not added to USE_LANGUAGES in the package Makefile." 1>&2'; \ ${ECHO} 'exit 1'; \ ${CHMOD} +x ${.TARGET} .if empty(USE_LANGUAGES:Mc) && empty(USE_LANGUAGES:Mobjc) && empty(USE_LANGUAGES:Mobjc-c++) PKG_CC:= ${_FAIL_WRAPPER.CC} ALL_ENV+= CPP=${CPP:Q} override-tools: ${_FAIL_WRAPPER.CC} .endif .if empty(USE_LANGUAGES:Mc++) PKG_CXX:= ${_FAIL_WRAPPER.CXX} ALL_ENV+= CXXCPP=${CPP:Q} # to make some Autoconf scripts happy override-tools: ${_FAIL_WRAPPER.CXX} .endif .if empty(USE_LANGUAGES:Mfortran) && empty(USE_LANGUAGES:Mfortran77) PKG_FC:= ${_FAIL_WRAPPER.FC} override-tools: ${_FAIL_WRAPPER.FC} .endif .if empty(USE_LANGUAGES:Mada) PKG_ADA:= ${_FAIL_WRAPPER.ADA} override-tools: ${_FAIL_WRAPPER.ADA} .endif .if !empty(DRAGONFLY_CCVER) && ${OPSYS} == "DragonFly" ALL_ENV+= CCVER=${DRAGONFLY_CCVER} .endif .endif # BSD_COMPILER_MK .if ${CHECK_COMPILER:Uno:tl} == yes . if ${USE_LANGUAGES:O:u} != ${_USE_LANGUAGES_EFFECTIVE:O:u} .warning For ${PKGPATH}, only languages "${_USE_LANGUAGES_EFFECTIVE}" are used, the others in "${USE_LANGUAGES}" were defined too late. . endif . if ${GCC_REQD:U:O:u} != ${_GCC_REQD_EFFECTIVE:U:O:u} .warning For ${PKGPATH}, only GCC_REQD "${_GCC_REQD_EFFECTIVE}" are used, the others in "${GCC_REQD}" were defined too late. . endif .endif @ 1.110 log @mk/compiler.mk: Sort CXX_FEATURES values in comment c99 sorts before c11 and c17, once the implicit digits are considered. (Defer worrying about the pending Y2100 C/C++ standards naming problem.) This is a comment-only change. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.109 2024/01/03 08:11:51 mef Exp $ d70 1 a70 1 # gnu++14, c++17, gnu++17, c++20, gnu++20. d90 1 a90 1 # Valid values are: c++11, c++14, c++17, c++20, has_include, d114 2 a115 2 # Valid values are: c++03, c++11, c++14, c++17, c++20, gnu++03, # gnu++11, gnu++17, gnu++20 d151 1 a151 1 _CXX_STD_VERSIONS= gnu++20 c++20 gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 @ 1.109 log @(mk/compiler.mk, mk/compiler/gcc.mk) Add c17 on USE_CC_FEATURES (Re: gcc-10.x @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.108 2023/12/12 16:28:45 gdt Exp $ d81 1 a81 1 # Valid values are: c11, c17, c99, has_include. @ 1.108 log @mk/compiler.mk: Adjust USE_LANGUAGES documentation to recent changes Setting dialects in USE_LANGUAGES has been deprecated in favor of USE_CXX_FEATURES and FORCE_CXX_STD (which is a major improvement in cleanliness of expression). Actually say this, rather than documenting that it is expected to use USE_LANGUAGES for the FORCE case. This is a comment-only change. Proposed in concept on tech-pkg with no objections. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.107 2023/08/02 15:59:58 nia Exp $ d81 1 a81 1 # Valid values are: c11, c99, has_include. @ 1.107 log @mk: Add support for FORCE_C_STD and FORCE_CXX_STD as discussed on tech-pkg.k @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.106 2023/07/30 21:47:44 ryoon Exp $ d53 2 a54 2 # Declares the languages that should be made available via # pkgsrc's compiler wrappers. d56 15 a70 8 # If the package assumes the compiler defaults to a specific # language version, the USE_LANGUAGES variable can also be used # to force the inclusion of flags such as -std=c++11. In this case, # USE_CC_FEATURES/USE_CXX_FEATURES should also be set. # # Valid values are: c, c99, gnu99, c11, gnu11, c17, gnu17, c++, c++03, # gnu++03, c++0x, gnu++0x, c++11, gnu++11, c++14, gnu++14, c++17, # gnu++17, c++20, gnu++20, fortran, fortran77, java, objc, obj-c++, ada. d112 1 a112 1 # wants to use GNU language extensions without setting -std=gnu++XX. @ 1.106 log @mk: Pass RELRO check @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.105 2023/07/30 15:09:25 jperkin Exp $ d87 23 @ 1.105 log @mk: Fix relro enablement. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.104 2023/07/29 18:09:39 nia Exp $ d275 2 a276 1 .if ${_PKGSRC_USE_RELRO} == "yes" && defined(_RELRO_LDFLAGS) @ 1.104 log @mk: Use CWRAPPERS_PREPEND instead of APPEND to force the use of SSP For the sake of consistency, and to allow packages to override the choice of the infrastructure if necessary. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.103 2023/07/29 17:55:47 nia Exp $ d275 1 a275 1 .if defined(_RELRO_LDFLAGS) @ 1.103 log @mk: Begin to refactor common support for GCC/Clang into a single file. They share lots of command line argument features and it doesn't make sense to duplicate our work. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.102 2023/07/22 12:20:37 nia Exp $ d247 3 a249 3 CWRAPPERS_APPEND.cc+= ${_SSP_CFLAGS} CWRAPPERS_APPEND.cxx+= ${_SSP_CFLAGS} CWRAPPERS_APPEND.f77+= ${_SSP_CFLAGS} @ 1.102 log @mk: Add support for is_trivially_copy_constructible in USE_CXX_FEATURES. While a mouthful, this is the name the GCC commit message used for the features. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.101 2023/07/21 08:29:56 nia Exp $ d252 42 @ 1.101 log @mk: Add put_time to USE_CXX_FEATURES. C++11 feature, but appeared in GCC 5. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.100 2023/07/18 12:49:46 nia Exp $ d85 1 a85 1 # put_time. @ 1.100 log @mk: Add support for USE_CC_FEATURES and USE_CXX_FEATURES to the pkgsrc infrastructure, as discussed on tech-pkg@@. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.99 2022/11/23 13:30:38 jperkin Exp $ d84 2 a85 1 # regex, filesystem, unique_ptr, charconv, parallelism_ts. @ 1.99 log @mk: Miscellaneous performance improvements. Inline ${RUN} calls where appropriate. Call mkdir directly rather than via a shell when invoked as a single command. Avoid unnecessary mkdir calls. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.98 2022/07/05 17:32:24 jperkin Exp $ d44 6 d53 8 a60 4 # Declares the languages used in the source code of the package. # This is used to determine the correct compilers to make # visible to the build environment, installing them if # necessary. Flags such as -std=c++99 are also added. d64 1 d67 18 a84 2 # The above is partly aspirational. As an example c++11 does # not force a new enough version of gcc. @ 1.98 log @mk: Add support for newer C standards. For now the GCC "c99 == gnu99" override is kept, but gnu99 is now supported as a specific value for USE_LANGUAGES, so we may want to be specific where required. c11 and c17 (and the corresponding gnu11/gnu17 versions) are newly supported. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.97 2022/04/10 19:54:02 riastradh Exp $ d255 2 a256 2 ${RUN}${MKDIR} ${.TARGET:H} ${RUN} \ d266 2 a267 2 ${ECHO} 'exit 1' ${RUN}${CHMOD} +x ${.TARGET} @ 1.97 log @mk: Use CWRAPPERS_PREPEND for --sysroot. Looks like maybe the -Wl,-rpath-link business isn't necessary after all -- will leave this as is until I find evidence otherwise. (joerg says it was a workaround for NetBSD toolchain parts that weren't properly adapted to use sysroot.) With this, revert cwrappers version dependency to what it was before. But keep it as TOOL_DEPENDS, not BUILD_DEPENDS. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.96 2021/12/03 07:40:26 wiz Exp $ d51 3 a53 3 # Valid values are: c, c99, c++, c++03, gnu++03, c++0x, gnu++0x, # c++11, gnu++11, c++14, gnu++14, c++17, gnu++17, c++20, gnu++20, # fortran, fortran77, java, objc, obj-c++, and ada. d86 6 a91 4 # Add c support if c99 is set .if !empty(USE_LANGUAGES:Mc99) USE_LANGUAGES+= c .endif d183 13 a195 7 # Pass the compiler flag based on the most recent version of the C++ standard # required. We currently assume that each standard is a superset of all that # come after it. # # If and when the flags differ between compilers we can push this down into # the respective mk/compiler/*.mk files. # @ 1.96 log @mk: add c++20 and gnu++20 @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.95 2020/06/02 06:58:13 rillig Exp $ d223 9 @ 1.95 log @mk/compiler.mk: check for too late GCC_REQD and USE_LANGUAGES For USE_LANGUAGES there is already a pkglint warning, but for GCC_REQD it is missing. It's better to have this check directly in the infrastructure since it is more reliable. This check is disabled by default, to not cause any new breakage. It should be enabled in bulk builds. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.94 2019/07/23 13:57:04 gdt Exp $ d52 3 a54 2 # c++11, gnu++11, c++14, gnu++14, c++17, gnu++17, fortran, # fortran77, java, objc, obj-c++, and ada. The default is "c". d91 1 a91 1 _CXX_STD_VERSIONS= gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 @ 1.94 log @mk/compiler.mk: Add c++17 We have a new language making its way into pkgsrc: C++17! Add gnu++17 and c++17 to the list of _CXX_STD_VERSIONS. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.93 2019/07/15 16:06:19 ryoon Exp $ d40 4 d97 3 d275 9 @ 1.93 log @Do not pass -std=c++03 to GCC 4.4 No objection on tech-pkg@@. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.92 2019/06/26 00:22:56 ryoon Exp $ d48 2 a49 2 # c++11, gnu++11, c++14, gnu++14, fortran, fortran77, java, objc, # obj-c++, and ada. The default is "c". d86 1 a86 1 _CXX_STD_VERSIONS= gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 @ 1.92 log @Fix a typo in flag in comment @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.91 2019/02/22 00:06:46 rillig Exp $ d86 2 a87 1 .for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 d181 1 a181 1 .for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 d184 2 a185 2 _WRAP_EXTRA_ARGS.CXX+= -std=${_CXX_VERSION_REQD} CWRAPPERS_PREPEND.cxx+= -std=${_CXX_VERSION_REQD} @ 1.91 log @mk/compiler.mk: replace empty lines with empty comments This is necessary for "bmake help" to interpret the whole comment as a single block. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.90 2018/11/12 14:22:58 jperkin Exp $ d46 1 a46 1 # necessary. Flags such as --std=c++99 are also added. @ 1.90 log @mk: Add CTF infrastructure support. Platform support is determined by _OPSYS_SUPPORTS_CTF from mk/platform, the user enables support by setting PKGSRC_USE_CTF=yes, and packages can explicitly disable support with CTF_SUPPORTED=no or skip certain files with CTF_FILES_SKIP. The path to ctfconvert is configured via TOOLS_PLATFORM.ctfconvert. If all of the requisite variables are enabled, a compiler-specific debug flag is passed via the wrappers to ensure we have DWARF information to convert, _INSTALL_UNSTRIPPED is explicitly defined to avoid binaries being stripped prior to conversion, and the conversion is performed during the install stage. It is recommended that users who enable the feature also set STRIP_DEBUG=yes to reduce the final binary size once the conversion has been performed. This has been used for the past year in Joyent SmartOS builds. FreeBSD is marked as supported but is untested. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.89 2018/08/12 19:36:40 rillig Exp $ a42 1 d53 1 a53 1 @ 1.89 log @mk/compiler.mk: sort supported compilers alphabetically @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.88 2018/01/26 13:14:35 jperkin Exp $ d208 7 @ 1.88 log @mk/compiler.mk: Support gnu++03 and c++03 in USE_LANGUAGES. These can be used by packages when building with a compiler which defaults to a newer standard than the source supports (e.g. namespace issues). @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.87 2017/07/04 14:35:55 gdt Exp $ d95 2 a96 2 _COMPILERS= ccc gcc icc ido mipspro mipspro-ucode \ sunpro xlc hp pcc clang @ 1.87 log @Improve USE_LANGUAGES explanation Reference the notion of making compilers visible to the build environment. Mention setting --std flags. Note that the text is currently aspirtational relative to gcc and C++. (Comment change only.) @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.86 2017/06/10 11:32:32 kamil Exp $ d48 3 a50 3 # Valid values are: c, c99, c++, c++0x, gnu++0x, c++11, gnu++11, # c++14, gnu++14, fortran, fortran77, java, objc, obj-c++, and # ada. The default is "c". d87 1 a87 1 .for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x d181 1 a181 1 .for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x @ 1.86 log @Restore c++ support in ccache.mk The ccache.mk file was checking for languages "c" and "c++". New framework for C++ dialects (or revisions) was setting implicitly c++, translating e.g. c++11 to c++. compiler.mk set this c++ after including ccache.mk, so c++ was undefined and ccache was ignored. This helps to build large projects like LLVM+Clang+LLDB with ccache. Sponsored by @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.85 2017/05/18 08:14:08 jperkin Exp $ d43 5 a47 2 # Lists the languages used in the source code of the package, # and is used to determine the correct compilers to install. d52 3 @ 1.85 log @Consolidate setting of SSP flags now that multiple compilers support it. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.84 2017/05/03 08:34:23 jperkin Exp $ d81 6 a176 1 USE_LANGUAGES+= c++ @ 1.84 log @Add support to USE_LANGUAGES for C++ standards from c++0x to gnu++14. This allows packages to specify the version of the standard that they require, and the infrastructure then distils that down in a similar way to GCC_REQD to the newest standard, avoiding clashes with different -std requirements based on CXXFLAGS. Broad concensus on tech-pkg and tested in bulk builds. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.83 2016/11/10 20:59:43 joerg Exp $ d187 10 @ 1.83 log @Prepend the ABI flags to allow interested programs like qemu to overwrite them on demand. This allows building ROM images and the like with a special target ABI. Discussed a while ago with jperkin. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.82 2014/12/09 23:43:29 joerg Exp $ d45 3 a47 2 # Valid values are: c, c99, c++, fortran, fortran77, java, objc, # obj-c++, and ada. The default is "c". d161 17 @ 1.82 log @Pass down ABI flags for cwrappers too. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.81 2013/07/07 09:06:23 marino Exp $ d164 3 a166 3 CWRAPPERS_APPEND.cc+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_APPEND.cxx+= ${_COMPILER_ABI_FLAG.${ABI}} CWRAPPERS_APPEND.f77+= ${_COMPILER_ABI_FLAG.${ABI}} @ 1.81 log @compiler.mk: Fix Ada packages when PKGSRC_COMPILER=clang Only one compiler is used when "ada" is listed in LANGUAGES, and that is the one built by the lang/gcc-aux source package. When PKGSRC_COMPILER is defined as anything else other than "gcc", the Ada packages fail to build. This can be seen when clang is used with CLANGBASE=${LOCALBASE}. This straight-forward fix is to override the user specification of PKGSRC_COMPILER when Ada is specified and define it as "gcc" in all cases. Tested on NetBSD 6.1 amd64 with CLANGBASE=${LOCALBASE} @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.80 2012/12/12 20:49:01 marino Exp $ d164 3 @ 1.80 log @compiler.mk, gcc.mk: Implement DRAGONFLY_CCVER DragonFly has two compilers in base, GCC 4.4.7 and GCC 4.7.2. The way one switches between them for userland programs is to set CCVER in the environment. However, to set this via make.conf is tricky. I've been using the low level "ALL_ENV+= CCVER=gcc47", but this trick fails to properly identify the compiler which results in _GCC_VERSION being incorrectly defined. Additionally, there are some prominent packages that do not build on gcc 4.7 and the fix is either not fully understood or would require a large amount of work to implement. In these cases, it is desireable to specify the package be built on gcc 4.4 regardless of CCVER setting. To address these issues, a new directive is added: DRAGONFLY_CCVER. It is only effective if OPSYS equals "DragonFly", and it will properly set CCVER and properly define _GCC_VERSION. It will also allow a per package specification of a particular compiler in the pkg makefile. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.79 2012/08/09 12:32:41 jperkin Exp $ d102 6 @ 1.79 log @_LINKER_ABI_FLAG.* is not set anywhere in pkgsrc, remove to avoid confusion. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.78 2012/08/09 12:16:24 jperkin Exp $ d208 4 @ 1.78 log @Ensure the Fortran wrappers specify the correct ABI if necessary. Fixes a bunch of packages on Solaris when ABI=32 with 64-bit compilers. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.77 2012/07/08 19:57:10 marino Exp $ a157 1 _WRAP_EXTRA_ARGS.LD+= ${_LINKER_ABI_FLAG.${ABI}} @ 1.77 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: compiler.mk,v 1.76 2012/06/27 13:36:08 jperkin Exp $ d157 1 @ 1.76 log @Ensure the Solaris native linker is used by default, avoids conflicts where GNU ld is picked up first via $PATH. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.75 2012/04/13 03:03:36 sbd Exp $ d45 2 a46 2 # Valid values are: c, c99, c++, fortran, fortran77, java, objc. # The default is "c". d166 1 d171 1 d189 1 a189 1 .if empty(USE_LANGUAGES:Mc) && empty(USE_LANGUAGES:Mobjc) d203 4 @ 1.75 log @Move USE_PKGSRC_GCC from compler.mk to compler/gcc.mk and make it a yes/no check. At the same time cleanup GCC_REQD. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.74 2010/11/17 08:40:22 obache Exp $ d134 9 @ 1.74 log @Revert unwanted part (uncompleted msc support) from last commit. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.73 2010/11/17 08:38:15 obache Exp $ a35 6 # USE_PKGSRC_GCC # Force using the appropriate version of GCC from pkgsrc based on # GCC_REQD instead of the native compiler. # # This should be disabled only for debugging. # a41 10 # GCC_REQD # A list of version numbers used to determine the minimum # version of GCC required by a package. This value should only # be appended to by a package Makefile. # # NOTE: Be conservative when setting GCC_REQD, as lang/gcc3 is # known not to build on some platforms, e.g. Darwin. If gcc3 is # required, set GCC_REQD=3.0 so that we do not try to pull in # lang/gcc3 unnecessarily and have it fail. # a81 7 # For environments where there is an external gcc too, but pkgsrc # should use the pkgsrc one for consistency. # .if defined(USE_PKGSRC_GCC) _USE_PKGSRC_GCC= yes .endif @ 1.73 log @Replaced with ASCII char `-'. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.72 2010/09/23 22:26:06 ahoka Exp $ a23 1 # msc Microsoft Visual C++ wrapper cc (Interix) a105 1 msc \ @ 1.72 log @Add support for clang. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.71 2010/07/30 07:58:58 asau Exp $ d15 1 a15 1 # clang Clang C and Objective−C compiler d24 1 d107 1 @ 1.71 log @Implement "fortran77" as alias for "fortran". @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.70 2009/07/08 21:17:16 markd Exp $ d15 1 d105 2 a106 1 _COMPILERS= ccc gcc icc ido mipspro mipspro-ucode sunpro xlc hp pcc @ 1.70 log @Add g95 support to the compiler framework, based on the existing f2c support. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.69 2009/05/30 18:16:26 joerg Exp $ d60 2 a61 2 # Valid values are: c, c99, c++, fortran, java, objc. The # default is "c". d209 1 a209 1 .if empty(USE_LANGUAGES:Mfortran) @ 1.69 log @Rename GCC_USE_SYMLINKS to COMPILER_USE_SYMLINKS, implement it for the other compiler drivers and enable it by default. Saves at least a percent of build time even for trivial packages like lang/lua. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.68 2008/10/20 20:44:49 wiz Exp $ d105 1 a105 1 _PSEUDO_COMPILERS= ccache distcc f2c @ 1.68 log @Grammar fix in error message. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.67 2008/10/20 18:33:50 ahoka Exp $ d39 6 d81 1 a81 1 _USER_VARS.compiler= PKGSRC_COMPILER USE_PKGSRC_GCC ABI d95 2 @ 1.67 log @Sanitise the error message of the fail-wrapper: - Use PGKSRC-WARNING to note it's coming from pkgsrc and not always fatal. - Describe more precisely what's happening when you get this warning. Hopefuly this will stop the misundersanding of the error message I could see quite often amongst users. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.66 2008/02/13 09:00:52 rillig Exp $ d187 1 a187 1 ${ECHO} '${ECHO} "PKGSRC-WARNING: but its not added to USE_LANGUAGES in the package Makefile." 1>&2'; \ @ 1.66 log @Added a keyword for "bmake help". @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.65 2008/02/07 21:36:13 rillig Exp $ d186 2 a187 2 ${ECHO} '${ECHO} "ERROR: To use this compiler, you have to add $$lang to" 1>&2'; \ ${ECHO} '${ECHO} "ERROR: USE_LANGUAGES in the package Makefile." 1>&2'; \ @ 1.65 log @Replaced _PKG_SILENT and _PKG_DEBUG with RUN. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.64 2007/10/17 10:43:37 rillig Exp $ d69 1 @ 1.64 log @Made the .include lines simpler. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.63 2007/09/20 17:28:48 rillig Exp $ d176 2 a177 2 ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} ${_PKG_SILENT}${_PKG_DEBUG} \ d188 1 a188 1 ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} @ 1.63 log @Added variable descriptions. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.62 2007/09/18 01:51:10 reed Exp $ d78 1 a78 1 .include "../../mk/bsd.prefs.mk" d138 1 a138 1 . include "../../mk/compiler/${_compiler_}.mk" @ 1.62 log @For Portable C Compiler. Add beginning of PKGSRC_COMPILER=pcc support. Based on "sunpro". Please help improve this. I have not tested with C++ or fortan. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.61 2007/06/09 18:44:37 rillig Exp $ d73 5 @ 1.61 log @There was one ">" too much, so the fail-wrapper warning was printed multiple times. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.60 2007/06/08 20:48:16 rillig Exp $ d23 1 d90 1 a90 1 _COMPILERS= ccc gcc icc ido mipspro mipspro-ucode sunpro xlc hp @ 1.60 log @Changed the wording of the warning messages when a compiler-fail-wrapper is run. As a new feature, an error message is printed when the wrapper is called, so that there is a better trace to it than a completely empty output. See also: http://mail-index.netbsd.org/tech-pkg/2007/06/08/0017.html @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.59 2007/04/17 11:05:33 tnn Exp $ d178 1 a178 1 ${ECHO} '${ECHO} "$$msg" >> ${WARNING_DIR}/${.TARGET:T}'; \ @ 1.59 log @add support for the HP-UX C/aC++ compilers @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.58 2006/12/03 08:34:45 seb Exp $ d175 6 a180 2 ${ECHO} ${ECHO:Q} '"*** Please consider adding USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." >> $$wrapperlog'; \ ${ECHO} ${ECHO:Q} '"*** Please consider adding USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." > ${WARNING_DIR}/${.TARGET:T}'; \ @ 1.58 log @If 'c99' is in USE_LANGUAGES also add 'c'. I bet 'c99' support in USE_LANGUAGES was only tested on -current. On -current there is no g77 command so mk/compiler/gcc.mk includes mk/compiler/f2c.mk which adds 'c' to USE_LANGUAGES ;) @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.57 2006/12/02 22:32:59 jschauma Exp $ d20 1 d89 1 a89 1 _COMPILERS= ccc gcc icc ido mipspro mipspro-ucode sunpro xlc @ 1.57 log @Instead of setting compiler flags in each package if it uses C99, allow USE_LANGUAGES+=c99 and let gcc and mipspro do the right thing. May need to be reviewed/added for other compilers. ok rillig@@ @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.56 2006/11/16 02:42:13 markd Exp $ d76 5 @ 1.56 log @Allow CPP to be set to something not on the PATH (as used to work in pre wrapper days). Especially useful for Solaris where cpp tends to live in /usr/css/lib/cpp. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.55 2006/07/27 20:07:06 joerg Exp $ d52 2 a53 2 # Valid values are: c, c++, fortran, java, objc. The default # is "c". @ 1.55 log @Make the language warning a bit less forceful, since it is often a false warning. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.54 2006/07/22 05:01:17 rillig Exp $ d130 4 @ 1.54 log @The C compiler is also used for Objective C, so the c-fail-wrapper is only created if none of these languages is mentioned in USE_LANGUAGE. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.53 2006/07/20 16:44:01 rillig Exp $ d165 2 a166 2 ${ECHO} ${ECHO:Q} '"*** Please add USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." >> $$wrapperlog'; \ ${ECHO} ${ECHO:Q} '"*** Please add USE_LANGUAGES+='${.TARGET:T:S/-fail-wrapper//:Q}' to the package Makefile." > ${WARNING_DIR}/${.TARGET:T}'; \ @ 1.53 log @Up to now, the language "c" has always been enabled, no matter if the package said USE_LANGUAGES=#none or USE_LANGUAGES=fortran. Added a c-fail-wrapper that works like the other fail-wrappers. The default value for USE_LANGUAGES is still "c". Some problems are expected with packages that say USE_LANGUAGES+=c++ or with packages containing GNU configure scripts and setting USE_LANGUAGES=c++, as those scripts always need a working C compiler. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.52 2006/07/02 23:09:19 rillig Exp $ d53 1 a53 1 # is "c" ("c" is actually _always_ implicitly in this list). d170 1 a170 1 .if empty(USE_LANGUAGES:Mc) @ 1.52 log @Reordered the variables in the interface comment so that all user-settable variables come first. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.51 2006/06/09 13:59:08 jlam Exp $ d73 1 a73 1 # Always require a C compiler for proper compiler detection. a74 3 .if empty(USE_LANGUAGES:Mc) USE_LANGUAGES:= c ${USE_LANGUAGES} .endif d150 1 d154 1 d170 5 @ 1.51 log @Introduce the capability to gather all the warnings and errors that are generated for a target and output them all at once at the conclusion of the target's invocation. The implementation is in bsd.pkg.error.mk, which defines a macro target "error-check" that will print out any non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR} and exit appropriately if there were errors. Convert some targets that were just long sequences of ${ERROR_MSG} or ${WARNING_MSG} within a single shell statement to use the new delayed error output via error-check. Modify the compiler "fail" wrappers for C++ and Fortran to be less verbose during invocation. Instead collect the warnings and only print them at the end of the completed phase, e.g. after "configure" and/or "build" completes. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.50 2006/05/12 21:37:08 jlam Exp $ d6 1 a6 1 # The following variables are used by this file: d33 6 a48 6 # USE_PKGSRC_GCC # Force using the appropriate version of GCC from pkgsrc based on # GCC_REQD instead of the native compiler. Should only be set in # /etc/mk.conf. # # @ 1.50 log @Fix a problem that occurs if compiler.mk is included in a package's Makefile, which means it occurs before bsd.tools.mk is included and thus misses the definition of TOOLS_DIR. We now create a new subdirectory of ${WRKDIR} to house the wrappers instead of re-using ${TOOLS_DIR}. Problem noted by Roland Illig on tech-pkg: http://mail-index.netbsd.org/tech-pkg/2006/05/12/0011.html @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.49 2006/05/11 22:13:19 jlam Exp $ d162 7 a168 1 ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${ECHO:Q}" 1>&2 \"===>\"; "${ECHO:Q}" 1>&2 \"===> Please add USE_LANGUAGES+="${.TARGET:T:S/-fail-wrapper//:Q}" to the package Makefile.\"; "${ECHO:Q}" 1>&2 \"===>\"; exit 1" > ${.TARGET} @ 1.49 log @Make build failures due to the previous commit less mysterious by using a wrapper script that emits a hint of what went wrong. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.48 2006/05/06 15:20:05 tv Exp $ d153 2 a154 2 _FAIL_WRAPPER.CXX= ${TOOLS_DIR}/bin/c++-fail-wrapper _FAIL_WRAPPER.FC= ${TOOLS_DIR}/bin/fortran-fail-wrapper d161 1 d166 1 a166 1 PKG_CXX:= ${TOOLS_DIR}/bin/c++-fail-wrapper d171 1 a171 1 PKG_FC:= ${TOOLS_DIR}/bin/fortran-fail-wrapper @ 1.48 log @Force unrequested languages to be unavailable by setting them to ${FALSE}. This way, missing language dependencies will be caught at build time. (Tested without problems on several C++ packages by unsetting LANGUAGES in them. I don't have a machine fast enough to bulk build, but I shall be watching the next round on pkgsrc-bulk to fix what I may not know about right now.) @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.47 2005/10/16 19:44:44 schwarz Exp $ d153 11 d165 1 a165 1 PKG_CXX:= ${FALSE} d167 1 d170 2 a171 1 PKG_FC:= ${FALSE} @ 1.47 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: compiler.mk,v 1.46 2005/02/16 08:41:20 grant Exp $ d150 11 @ 1.46 log @note that xlc support is on Darwin. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.45 2005/02/15 07:43:43 grant Exp $ d18 1 d86 1 a86 1 _COMPILERS= ccc gcc icc mipspro mipspro-ucode sunpro xlc @ 1.45 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: compiler.mk,v 1.44 2005/01/24 18:07:56 tv Exp $ d23 1 a23 1 # xlc IBM's XL C/C++ compiler suite @ 1.44 log @Merge down janitorial change from tv-derecurse branch: Move definition of PKGSRC_COMPILER to defaults/mk.conf, to make it more readily seen by the user. @ text @d1 1 a1 1 # $NetBSD$ d17 1 d85 1 a85 1 _COMPILERS= ccc gcc mipspro mipspro-ucode sunpro xlc @ 1.43 log @Nuke USE_FORTRAN and bring the f2c handling within the mk/compiler framework. The list of changes include: * Modify compiler.mk so that "c" is always prepended to USE_LANGUAGES, so we no longer need to say it in package Makefiles. Packages should now append to USE_LANGUAGES instead of setting it. * Create mk/compiler/f2c.mk which implements another pseudo-compiler "f2c" that may be used with any C compiler backend, e.g. PKGSRC_COMPILER= f2c ccache gcc * Teach the various "real" compiler files, e.g., sunpro.mk, mipspro.mk, etc., to use f2c if the native Fortran compiler isn't present. Packages that use Fortran should now simply include the line: USE_LANGUAGES+= fortran in the package Makefile. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.42 2005/01/10 09:05:01 jlam Exp $ a76 3 # Default to using gcc. PKGSRC_COMPILER?= gcc @ 1.42 log @Sort the compiler list in the comments. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.41 2004/11/30 15:07:26 jlam Exp $ d16 1 d24 6 a29 4 # The default is "gcc". You can use ccache and/or distcc with an # appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc". # The chain should always end in a real compiler. This should only # be set in /etc/mk.conf. d51 1 a51 1 # is "c". d71 1 a71 1 # By default, assume that the package requires a C compiler. d73 3 d82 1 d88 1 a88 1 _PSEUDO_COMPILERS= ccache distcc @ 1.41 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: compiler.mk,v 1.40 2004/11/30 14:50:37 jlam Exp $ d13 2 a15 1 # ccache compiler cache (chainable) a21 1 # ccc Compaq C Compilers (Tru64) @ 1.40 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: compiler.mk,v 1.39 2004/11/28 21:32:47 jlam Exp $ d131 3 d135 1 @ 1.39 log @Set initial values for PKG_{CC,CPP,CXX,FC} which are used within the ${compiler}.mk files to discover the short names of the compilers. This allows ccache.mk to properly create symlinks when CC is set explicitly within /etc/mk.conf. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.38 2004/11/22 22:24:47 wiz Exp $ d120 1 a120 7 # Set initial values for PKG_{CC,CPP,CXX,FC} which are used within the # ${compiler}.mk files to discover the short names of the compilers. # PKG_CC:= ${CC} PKG_CPP:= ${CPP} PKG_CXX:= ${CXX} PKG_FC:= ${FC} d125 8 @ 1.38 log @Now that no package uses USE_GCC_SHLIB any longer, remove support for it from compiler.mk. Move the variable of the same name used by compiler/gcc.mk and the gcc* buildlink3 files into private namespace (_USE_GCC_SHLIB). @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.37 2004/11/20 04:37:08 grant Exp $ d120 8 @ 1.38.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: compiler.mk,v 1.38 2004/11/22 22:24:47 wiz Exp $ d71 3 @ 1.38.2.2 log @merge from HEAD @ text @d1 1 a1 1 # $NetBSD$ a116 2 _COMPILER_STRIP_VARS= # empty a119 8 .undef _compiler_ # Strip the leading paths from the toolchain variables since we manipulate # the PATH to use the correct executable. # .for _var_ in ${_COMPILER_STRIP_VARS} ${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} ${${_var_}:C/^/_asdf_/1:N_asdf_*} .endfor @ 1.38.2.3 log @merge from HEAD @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.38.2.2 2004/11/30 15:06:34 tv Exp $ a127 3 . if empty(${_var_}:C/^/_asdf_/1:N_asdf_*) ${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//:T} . else a128 1 . endif @ 1.38.2.4 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.38.2.3 2004/11/30 15:10:47 tv Exp $ d13 1 a13 1 # ccc Compaq C Compilers (Tru64) a14 1 # distcc distributed C/C++ (chainable) d21 1 @ 1.38.2.5 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.38.2.4 2005/01/10 16:15:25 tv Exp $ a15 1 # f2c Fortran 77 to C compiler (chainable) d23 4 a26 6 # The default is "gcc". You can use ccache and/or distcc with # an appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc # gcc". You can also use "f2c" to overlay the lang/f2c package # over the C compiler instead of using the system Fortran # compiler. The chain should always end in a real compiler. # This should only be set in /etc/mk.conf. d48 1 a48 1 # is "c" ("c" is actually _always_ implicitly in this list). d68 1 a68 1 # Always require a C compiler for proper compiler detection. a69 3 .if empty(USE_LANGUAGES:Mc) USE_LANGUAGES:= c ${USE_LANGUAGES} .endif a72 1 # d78 1 a78 1 _PSEUDO_COMPILERS= ccache distcc f2c @ 1.38.2.6 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD$ a16 1 # icc Intel C++ Compiler (Linux) d84 1 a84 1 _COMPILERS= ccc gcc icc mipspro mipspro-ucode sunpro xlc @ 1.38.2.7 log @sync with HEAD @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.38.2.6 2005/02/15 16:25:22 tv Exp $ d23 1 a23 1 # xlc IBM's XL C/C++ compiler suite (Darwin/MacOSX) @ 1.38.2.8 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: compiler.mk,v 1.38.2.7 2005/02/25 14:46:51 tv Exp $ @ 1.37 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: compiler.mk,v 1.36 2004/10/06 09:49:53 grant Exp $ a42 3 # USE_GCC_SHLIB # Indicates that a package uses GCC shared libraries, so we # register a runtime dependency on the compiler package. a67 10 # XXX Add this gross and completely inaccurate hack. Packages that # XXX set USE_GCC_SHLIB should be adjusted to set USE_LANGUAGES # XXX correctly (most likely by saying it needs either "c++" or # XXX "c c++"). This is here for now so that ~85 packages won't # XXX suddenly break. # .if defined(USE_GCC_SHLIB) USE_LANGUAGES?= c c++ .endif @ 1.36 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: compiler.mk,v 1.35 2004/09/21 15:01:39 jlam Exp $ d21 1 d93 1 a93 1 _COMPILERS= gcc mipspro mipspro-ucode sunpro xlc @ 1.35 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: compiler.mk,v 1.34 2004/07/04 00:38:15 wiz Exp $ d20 1 d92 1 a92 1 _COMPILERS= gcc mipspro mipspro-ucode sunpro @ 1.34 log @Re-add USE_PKGSRC_GCC, and document it should only be used in /etc/mk.conf. Requested by Klaus Heinz. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.33 2004/07/04 00:28:30 wiz Exp $ d135 6 @ 1.33 log @Retire USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO, and USE_PKGSRC_GCC, now that all instances of packages using it have been fixed. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.32 2004/05/12 21:49:39 reed Exp $ d38 2 a39 1 # GCC_REQD instead of the native compiler. d85 6 @ 1.32 log @Change date of when deprecated USE_GCC2, USE_GCC3, USE_PKGSRC_GCC, USE_SUNPRO, USE_MIPSPRO variables would be removed. (According to jlam@@.) mk/compiler.mk CVS: ---------------------------------------------------------------------- @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.31 2004/05/09 00:04:14 grant Exp $ a61 3 # The following variables are deprecated: # # USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO d81 1 a81 11 # Support some deprecated variables for a while. They'll be removed # after the pkgsrc-2004Q2 branch is cut. # .if defined(USE_GCC2) GCC_REQD+= 2.8.0 PKGSRC_COMPILER?= gcc .elif defined(USE_GCC3) GCC_REQD+= 3.0 PKGSRC_COMPILER?= gcc .elif defined(USE_PKGSRC_GCC) _USE_PKGSRC_GCC= yes a82 7 .elif defined(USE_SUNPRO) PKGSRC_COMPILER?= sunpro .elif defined(USE_MIPSPRO) PKGSRC_COMPILER?= mipspro .else PKGSRC_COMPILER?= gcc .endif @ 1.31 log @add mipspro-ucode to _COMPILERS which was missed the first time. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.30 2004/05/08 16:36:55 grant Exp $ d85 1 a85 1 # after the pkgsrc-2004Q1 branch is cut. @ 1.30 log @correctly preserve the user-specified order of pseudo-compilers. patch from jlam@@. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.29 2004/05/08 15:09:31 grant Exp $ d104 1 a104 1 _COMPILERS= gcc mipspro sunpro @ 1.29 log @_PKGSRC_COMPILER needs to contain the real compiler first, then pseudo-compilers such as ccache and distcc. fixes problem where lang/gcc{,3} would be incorrectly pulled in when it should not be. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.28 2004/05/08 06:03:26 grant Exp $ a134 2 .else _PKGSRC_COMPILER:= ${_COMPILER} d137 3 a139 3 .for _compiler_ in ${_PSEUDO_COMPILERS} . if !empty(PKGSRC_COMPILER:M${_compiler_}) _PKGSRC_COMPILER:= ${_PKGSRC_COMPILER} ${_compiler_} d142 1 @ 1.28 log @implement {NOT,ONLY}_FOR_COMPILER so that packages can be marked as requiring a specific compiler (most often those which use gcc-specific hacks^wfeatures). this allows users to define PKGSRC_COMPILER to multiple real compilers in order to implement a compiler preference. for example, PKGSRC_COMPILER="sunpro gcc" will use sunpro as the default compiler, and fall back to gcc where a package is marked NOT_FOR_COMPILER=sunpro or ONLY_FOR_COMPILER=gcc. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.27 2004/03/31 09:38:36 sketch Exp $ d141 1 a141 1 _PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER} @ 1.27 log @Since revision 1.155 of bsd.prefs.mk, compiler.mk is required in package Makefiles for testing CC_VERSION, not bsd.prefs.mk. Reflect that change in the provided example. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.26 2004/02/18 13:32:38 jlam Exp $ d104 38 a141 4 _PKGSRC_COMPILER= # empty .for _compiler_ in ${PKGSRC_COMPILER} . if empty(_PKGSRC_COMPILER:M${_compiler_}) _PKGSRC_COMPILER:= ${_compiler_} ${_PKGSRC_COMPILER} @ 1.26 log @* Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc/mk/compiler.mk. Package Makefiles may now directly include compiler.mk. * Don't include compiler.mk within bsd.prefs.mk any longer. It was only included for the purposes of defining CC_VERSION. Packages that want to test the value of CC_VERSION should now first include "../../mk/compiler.mk". Any GCC_REQD statements in package Makefiles should be set before compiler.mk is included. * Simpllfy pkgsrc/mk/compiler/*.mk files as a result of not needing to be included indirectly by bsd.prefs.mk. We remove the special handling associated with detecting whether the file was included from within bsd.prefs.mk. These files are now much more straightforward to write and understand. * G/C the BSD_PREFS_MK stack mechanism as the only users (compiler/*) no longer need it. * Ensure that directories are prepended to the PATH only from within bsd.pkg.mk. @ text @d1 1 a1 1 # $NetBSD: bsd.compiler.mk,v 1.10 2004/02/18 11:18:43 jlam Exp $ d56 1 a56 1 # .include "../../mk/bsd.prefs.mk" @ 1.25 log @Garbage collect compiler.mk as it's superseded by the new compiler selection framework in pkgsrc/mk/compiler. @ text @d1 4 a4 4 # $NetBSD: compiler.mk,v 1.24 2003/12/10 09:08:24 sketch Exp $ # This Makefile fragment implements handling for supported # C/C++/fortran compilers. d6 1 a6 2 # This file should NOT be included from pkg Makefiles, as it is # automatically included by bsd.prefs.mk. d8 17 a24 1 # The following variables are used: d27 3 a29 3 # Sets the minimum required version of gcc. Packages can set # this if they are known to require gcc>2.8.0, which is the # compiler shipped with NetBSD 1.5. d31 2 a32 2 # Note: Be conservative when setting GCC_REQD, as lang/gcc3 is # known not to build on some platforms, eg. Darwin. If gcc3 is d36 4 d44 5 a48 18 # USE_GCC2 # Always use pkgsrc gcc2 from lang/gcc. This overrides any # GCC_REQD setting. Must NOT be set in package Makefiles. # # USE_GCC3 # Always use pkgsrc gcc3 from lang/gcc3. This overrides any # GCC_REQD setting. Must NOT be set in package Makefiles. # # USE_PKGSRC_GCC # Use the appropriate version of GCC from pkgsrc based on # GCC_REQD. # # USE_SUNPRO # Use the Sun Microsystems Inc. WorkShop/Forte/Sun ONE Studio # compiler collection. # # USE_MIPSPRO # Use the Silicon Graphics, Inc. MIPSpro compiler. d54 3 a56 10 # The compiler and version being used. For gcc, this is # 'gcc-' and the string reported by ${CC} -V | grep # '^cc' for others. # # e.g. # .include "../../mk/bsd.prefs.mk" # # .if !empty(CC_VERSION:Mgcc-3*) # ... # .endif d58 3 a60 15 .if !defined(COMPILER_MK) COMPILER_MK= # defined # Defaults for SunPro, work around sys.mk setting CC by default to # 'gcc'. These can be overriden by the user in /etc/mk.conf or on the # command line. .if defined(USE_SUNPRO) && defined(CC) && !empty(CC:Mgcc) CC= /opt/SUNWspro/bin/cc CPP= /opt/SUNWspro/bin/cc -E CXX= /opt/SUNWspro/bin/CC .endif # Do a dance to determine which version of gcc is being used, if any, # and whether it satisfies GCC_REQD. d62 1 a62 2 # We only pull in lang/gcc or lang/gcc3 if necessary, or if # USE_PKGSRC_GCC is defined. d64 1 a64 2 .if !defined(USE_SUNPRO) && !defined(USE_MIPSPRO) && \ !defined(USE_GCC2) && !defined(USE_GCC3) d66 2 a67 5 # Darwin's gcc reports "Apple Computer ... based on gcc version ...", # so we can't just grep for ^gcc. _CC_VERSION_STRING!= if ${CC} -v 2>&1 | ${GREP} -q 'gcc version'; then \ echo `${CC} -v 2>&1 | ${GREP} 'gcc version'`; \ fi d69 1 a69 8 # egcs is considered to be gcc-2.8.1. . if !empty(_CC_VERSION_STRING:Megcs*) _CC_VERSION= 2.8.1 _CC_IS_GCC= YES . elif !empty(_CC_VERSION_STRING:Mgcc*) _CC_VERSION!= ${CC} -dumpversion _CC_IS_GCC= YES . endif d71 8 a78 122 . if defined(_CC_IS_GCC) GCC_REQD?= 2.8.0 _GCC_VERSION_REQD= gcc>=${GCC_REQD} # packages should define USE_PKGSRC_GCC to force install and use of # pkgsrc gcc, which defaults to gcc2. . if defined(USE_PKGSRC_GCC) GCC_REQD= 2.95.3 _NEED_PKGSRC_GCC= YES . else _GCC_IN_USE= gcc-${_CC_VERSION} _NEED_PKGSRC_GCC!= \ if ${PKG_ADMIN} pmatch '${_GCC_VERSION_REQD}' ${_GCC_IN_USE}; then \ ${ECHO} "NO"; \ else \ ${ECHO} "YES"; \ fi . endif # USE_PKGSRC_GCC . endif # _CC_IS_GCC .endif # !USE_MIPSPRO && !USE_SUNPRO && !USE_GCC2 && !USE_GCC3 # we default to gcc2 if all of the above determined that we need # pkgsrc gcc. .if defined(_NEED_PKGSRC_GCC) && ${_NEED_PKGSRC_GCC} == "YES" . if !empty(GCC_REQD:M3*) USE_GCC3= # defined . else USE_GCC2= # defined . endif .endif .if defined(USE_GCC2) && empty(_PKGSRC_DEPS:Mgcc-2*) GCC_REQD= 2.95.3 # we need to define these early, as they are used by gcc/buildlink2.mk. _GCC_SUBPREFIX= gcc-2.95.3/ _GCC_ARCHDIR= ${_GCC_PREFIX}${_GCC_ARCHSUBDIR} _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} _GCC_LIBGCCDIR!= \ if [ -x ${_GCC_PREFIX}bin/gcc ]; then \ dirname `${_GCC_PREFIX}bin/gcc --print-libgcc-file-name`; \ else \ ${ECHO} not-defined; \ fi _GCC_ARCHSUBDIR= \ ${_GCC_LIBGCCDIR:S|^${BUILDLINK_PREFIX.gcc}/${_GCC_SUBPREFIX}||} # Only pull in the pkg dependency if we're not actually building it . if empty(PKGPATH:Mlang/gcc) . if empty(USE_BUILDLINK2:M[nN][oO]) . include "../lang/gcc/buildlink2.mk" . else # Packages that link against gcc shared libraries need a full # dependency. . if defined(USE_GCC_SHLIB) DEPENDS+= gcc>=${GCC_REQD}:../../lang/gcc . else BUILD_DEPENDS+= gcc>=${GCC_REQD}:../../lang/gcc . endif . endif # buildlink2 . endif # PKGPATH != lang/gcc . if exists(${_GCC_PREFIX}bin/gcc) _CC_IS_GCC= YES PATH:= ${_GCC_PREFIX}bin:${PATH} CC= ${_GCC_PREFIX}bin/gcc CPP= ${_GCC_PREFIX}bin/cpp CXX= ${_GCC_PREFIX}bin/g++ F77= ${_GCC_PREFIX}bin/g77 PKG_FC:= ${F77} . endif .elif defined(USE_GCC3) && empty(_PKGSRC_DEPS:Mgcc-3*) GCC_REQD= 3.3 # we need to define these early, as they are used by gcc3/buildlink2.mk. _GCC_SUBPREFIX= gcc-3.3/ _GCC_ARCHDIR= ${_GCC_PREFIX}${_GCC_ARCHSUBDIR} _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} # Only pull in the pkg dependency if we're not actually building it . if empty(PKGPATH:Mlang/gcc3) . if empty(USE_BUILDLINK2:M[nN][oO]) . include "../lang/gcc3/buildlink2.mk" . else # Packages that link against gcc shared libraries need a full # dependency. . if defined(USE_GCC_SHLIB) DEPENDS+= gcc3>=${GCC_REQD}:../../lang/gcc3 . else BUILD_DEPENDS+= gcc3>=${GCC_REQD}:../../lang/gcc3 . endif . endif # buildlink2 . endif # PKGPATH != lang/gcc3 . if exists(${_GCC_PREFIX}bin/gcc) _GCC_LIBGCCDIR!= \ dirname `${_GCC_PREFIX}bin/gcc --print-libgcc-file-name` _GCC_ARCHSUBDIR= \ ${_GCC_LIBGCCDIR:S|^${LOCALBASE}/${_GCC_SUBPREFIX}||} _CC_IS_GCC= YES PATH:= ${_GCC_PREFIX}bin:${PATH} CC= ${_GCC_PREFIX}bin/gcc CPP= ${_GCC_PREFIX}bin/cpp CXX= ${_GCC_PREFIX}bin/g++ F77= ${_GCC_PREFIX}bin/g77 PKG_FC:= ${F77} . endif .endif # USE_GCC3 # Ensure that the correct rpath is passed to the linker if we need to # link against gcc shared libs. .if (defined(USE_GCC2) || defined(USE_GCC3)) && defined(USE_GCC_SHLIB) _GCC_LDFLAGS= -L${_GCC_ARCHDIR} -Wl,${RPATH_FLAG}${_GCC_ARCHDIR} -L${_GCC_PREFIX}lib -Wl,${RPATH_FLAG}${_GCC_PREFIX}lib LDFLAGS+= ${_GCC_LDFLAGS} d81 2 a82 16 # CC_VERSION can be tested by package Makefiles to tweak things based # on the compiler being used. # CC_VERSION?= # empty .if defined(_CC_IS_GCC) . if !defined(_CC_VERSION) _CC_VERSION!= if ${CC} -dumpversion > /dev/null 2>&1; then \ ${ECHO} `${CC} -dumpversion`; \ else \ ${ECHO} ""; \ fi . endif CC_VERSION= gcc-${_CC_VERSION} .else CC_VERSION!= ${CC} -V 2>&1 | ${GREP} '^cc' .endif d84 2 a85 2 # The SunPro C++ compiler doesn't support passing linker flags with # -Wl to CC, so we make buildlink2 perform the required magic. d87 13 a99 2 .if defined(USE_SUNPRO) _COMPILER_LD_FLAG= # SunPro compiler d101 1 a101 1 _COMPILER_LD_FLAG= -Wl, # GCC and others d104 6 a109 8 # Pass the required flags to imake to tell it we're using gcc on # Solaris. # .if ${OPSYS} == "SunOS" && defined(_CC_IS_GCC) IMAKEOPTS+= -DHasGcc2=YES -DHasGcc2ForCplusplus=YES .endif .endif # COMPILER_MK d111 3 a113 9 # XXX this test is outside if !defined(COMPILER_MK) because some # XXX packages include bsd.prefs.mk before defining USE_BUILDLINK2. # # create a fake libstdc++.la if one exists in /usr/lib. .if empty(USE_BUILDLINK2:M[nN][oO]) . if defined(_CC_IS_GCC) && exists(/usr/lib/libstdc++.la) . if (!defined(BUILDLINK_TARGETS) || \ defined(BUILDLINK_TARGETS) && empty(BUILDLINK_TARGETS:Mlibstdc++-buildlink-la)) BUILDLINK_TARGETS+= libstdc++-buildlink-la d115 1 a115 8 libstdc++-buildlink-la: ${_PKG_SILENT}${_PKG_DEBUG} \ lafile="${BUILDLINK_DIR}/lib/libstdc++.la"; \ libpattern="/usr/lib/libstdc++.*"; \ ${BUILDLINK_FAKE_LA} . endif . endif .endif @ 1.24 log @Ensure CPP is defined to use the Sun compiler when building packages under USE_SUNPRO, to avoid the possibility of picking up "cpp" from a local GCC installation. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.23 2003/11/12 13:13:43 grant Exp $ @ 1.23 log @backout previous, it is no longer needed. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.21 2003/10/18 09:14:47 grant Exp $ d68 1 @ 1.22 log @Remove '-' from the version part of _GCC_IN_USE so that pkg_admin can deal with the installed gcc when it has a localized version (such as our gcc-3.3.2-nb1). @ text @d105 1 a105 1 _GCC_IN_USE= gcc-${_CC_VERSION:S/-//g} @ 1.21 log @move the libstdc++ fake libtool archive stuff out of !defined(COMPILER_MK) for now. some packages include bsd.prefs.mk before defining USE_BUILDLINK2, which resulted in the libstdc++ fake-la target being missed. XXX the real fix is to include compiler.mk from both bsd.prefs.mk and XXX bsd.pkg.mk, and have compiler.mk make the right decisions based on XXX where it was included from. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.20 2003/10/12 03:05:37 grant Exp $ d105 1 a105 1 _GCC_IN_USE= gcc-${_CC_VERSION} @ 1.20 log @fix logic error introduced in last, sync comments about CC_VERSION with reality. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.19 2003/10/11 03:43:14 grant Exp $ a218 13 # create a fake libstdc++.la if one exists in /usr/lib. .if empty(USE_BUILDLINK2:M[nN][oO]) . if defined(_CC_IS_GCC) && exists(/usr/lib/libstdc++.la) BUILDLINK_TARGETS+= libstdc++-buildlink-la libstdc++-buildlink-la: ${_PKG_SILENT}${_PKG_DEBUG} \ lafile="${BUILDLINK_DIR}/lib/libstdc++.la"; \ libpattern="/usr/lib/libstdc++.*"; \ ${BUILDLINK_FAKE_LA} . endif .endif d253 19 @ 1.19 log @set CC_VERSION for non-gcc and use it in the BUILD_INFO file. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.18 2003/10/11 02:44:18 grant Exp $ d49 2 a50 1 # 'gcc-' and (currently) empty for other compilers. d233 1 a233 1 # on the compiler being used. This is only functional for gcc right now. d236 2 a237 2 .if !defined(_CC_VERSION) . if defined(_CC_IS_GCC) d243 1 d245 1 a245 1 . else a246 1 . endif @ 1.18 log @don't hardcode the -DHasGcc2... flags to imake, pass them only if we're actually using gcc on Solaris. fixes building of imake PIC code when the compiler is not gcc. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.17 2003/10/06 11:14:22 grant Exp $ d235 2 a236 2 .if defined(_CC_IS_GCC) . if !defined(_CC_VERSION) d242 3 a245 1 CC_VERSION= gcc-${_CC_VERSION} @ 1.17 log @allow lang/gcc{,3} to be used to build themselves by only adding the (build) dependency if the package being built is not the package which is providing the compiler. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.16 2003/10/06 07:11:19 grant Exp $ d253 7 @ 1.16 log @avoid F77/PKG_FC being recursively defined. reported by krister. XXX the Fortran gunk in bsd.pkg.mk will be moved to here later. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.15 2003/09/28 09:53:56 grant Exp $ d127 1 a127 1 .if defined(USE_GCC2) && empty(PKGPATH:Mlang/gcc) && empty(_PKGSRC_DEPS:Mgcc-2*) d143 6 a148 3 . if empty(USE_BUILDLINK2:M[nN][oO]) . include "../lang/gcc/buildlink2.mk" . else d152 1 a152 1 . if defined(USE_GCC_SHLIB) d154 1 a154 1 . else d156 3 a158 2 . endif . endif # buildlink2 d160 1 d168 1 d170 1 a170 1 .elif defined(USE_GCC3) && empty(PKGPATH:Mlang/gcc3) && empty(_PKGSRC_DEPS:Mgcc-3*) d176 1 d178 6 a183 10 . if empty(USE_BUILDLINK2:M[nN][oO]) . include "../lang/gcc3/buildlink2.mk" . else _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} . if exists(${_GCC_PREFIX}bin/gcc) _GCC_LIBGCCDIR!= \ dirname `${_GCC_PREFIX}bin/gcc --print-libgcc-file-name` _GCC_ARCHSUBDIR= \ ${_GCC_LIBGCCDIR:S|^${LOCALBASE}/${_GCC_SUBPREFIX}||} . endif d187 1 a187 1 . if defined(USE_GCC_SHLIB) d189 1 a189 1 . else d191 9 a199 2 . endif . endif # buildlink2 d208 1 @ 1.15 log @sync comments with reality. note once again that USE_GCC2/USE_GCC3 must not be defined in package Makefiles. also note CC_VERSION and provide a usage example. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.14 2003/09/28 09:48:00 grant Exp $ d162 1 a162 1 PKG_FC= ${F77} d197 1 a197 1 PKG_FC= ${F77} @ 1.14 log @if /usr/lib/libstdc++.la exists, create the corresponding fake libtool archive in ${BUILDLINK_DIR}/lib so packages can find and use it. fixes some build problems seen on Slackware Linux 9. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.13 2003/09/27 17:20:38 grant Exp $ d7 1 a7 1 # automatically included by bsd.pkg.mk. d26 2 a27 2 # Use pkgsrc gcc2 from lang/gcc. This overrides any GCC_REQD # setting. d30 2 a31 2 # Use pkgsrc gcc3 from lang/gcc3. This overrides any GCC_REQD # setting. d43 14 @ 1.13 log @set CC and CXX defaults for SunPro when USE_SUNPRO is defined. the path to cc and CC can be overridden in /etc/mk.conf or on the command line. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.12 2003/09/24 12:22:04 grant Exp $ d191 13 @ 1.12 log @make CC_VERSION available to packages by including bsd.prefs.mk. it is of the form 'gcc-' if gcc is being used, or empty otherwise (for now). requested by tron. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.11 2003/09/24 03:01:02 grant Exp $ d47 8 @ 1.11 log @remove redefine of _GCC_PREFIX, whitespace fix. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.10 2003/09/23 19:19:33 gavan Exp $ a47 2 .include "../../mk/bsd.prefs.mk" d134 1 d169 1 d183 15 @ 1.10 log @Work out _GCC_ARCHSUBDIR correctly, using the method from lang/gcc3/buildlink2.mk @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.9 2003/09/21 16:43:47 wiz Exp $ d111 2 a112 2 _GCC_SUBPREFIX= gcc-2.95.3/ _GCC_ARCHDIR= ${_GCC_PREFIX}${_GCC_ARCHSUBDIR} a125 1 _GCC_PREFIX= ${LOCALBASE}/${_GCC_SUBPREFIX} @ 1.9 log @Test for egcs needs to come first, since egcs -v output also contains "gcc". From Greg A. Woods in PR 22866. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.8 2003/09/17 19:58:08 grant Exp $ d113 9 a121 1 _GCC_ARCHSUBDIR= lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3 @ 1.8 log @explain why including this file in pkg Makefiles is useless. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.7 2003/09/17 14:37:32 grant Exp $ d66 4 a69 1 . if !empty(_CC_VERSION_STRING:Mgcc*) a70 3 _CC_IS_GCC= YES . elif !empty(_CC_VERSION_STRING:Megcs*) _CC_VERSION= 2.8.1 @ 1.7 log @honour GCC_REQD by testing $CC -v against it, and only pull in pkgsrc gcc if required. see the comments for how to use the variables which influence the decision. eliminate some spurious shell warnings while I'm here. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.6 2003/09/12 22:53:18 salo Exp $ d5 3 @ 1.6 log @Sync comments with reality. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.5 2003/09/12 20:10:17 grant Exp $ d8 14 d23 2 a24 1 # Use pkgsrc gcc2 from lang/gcc. d27 2 a28 1 # Use pkgsrc gcc3 from lang/gcc3. d30 3 a32 3 # USE_GCC_SHLIB # Indicates that a package uses GCC shared libraries, so we # register a runtime dependency on the compiler package. a37 2 # The following variable is reserved for future use: # d47 57 d105 1 a105 1 GCC_REQD?= 2.95.3 d134 1 a134 1 GCC_REQD?= 3.3 d144 1 d149 1 @ 1.5 log @remove redundant comment about USE_GCC2 and USE_GCC3 until they are better handled. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.4 2003/09/12 16:07:09 grant Exp $ d18 5 a22 1 # The following variables are reserved for future use: a25 4 # # USE_SUNPRO # Use the Sun Microsystems Inc. WorkShop/Forte/Sun ONE Studio # compiler collection. @ 1.4 log @move a SunPro tweak to compiler.mk. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.3 2003/09/12 15:54:40 grant Exp $ d9 1 a9 2 # Use pkgsrc gcc2 from lang/gcc. This is a user-only variable # which must NOT be set in package Makefiles. d12 1 a12 2 # Use pkgsrc gcc3 from lang/gcc3. This is a user-only variable # which must NOT be set in package Makefiles. @ 1.3 log @tidy up handling of LDFLAGS wrt USE_GCC_SHLIB a little. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.2 2003/09/12 13:35:29 salo Exp $ d102 9 @ 1.2 log @Typos/punctuation/caps. @ text @d1 1 a1 1 # $NetBSD: compiler.mk,v 1.1 2003/09/12 13:03:38 grant Exp $ a51 1 LDFLAGS+= -L${_GCC_ARCHDIR} -Wl,${RPATH_FLAG}${_GCC_ARCHDIR} -L${_GCC_PREFIX}lib -Wl,${RPATH_FLAG}${_GCC_PREFIX}lib d55 2 a56 1 . endif a83 1 LDFLAGS+= -L${_GCC_ARCHDIR} -Wl,${RPATH_FLAG}${_GCC_ARCHDIR} -L${_GCC_PREFIX}lib -Wl,${RPATH_FLAG}${_GCC_PREFIX}lib d87 2 a88 1 . endif d96 7 @ 1.1 log @start of improved compiler handling, mostly derived from the existing gcc buildlink2.mk files and splitting the non-buildlink2.mk bits out into compiler.mk. this allows USE_GCC2 and USE_GCC3 to work with non-buildlink2 packages again. @ text @d1 1 a1 1 # $NetBSD$ d13 1 a13 1 # use pkgsrc gcc3 from lang/gcc3. This is a user-only variable @