tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Using cpuflags in pkgsrc

        Currently using cpuflags in pkgsrc involves adding
        .sinclude "/usr/pkg/share/mk/"
        to /etc/mk.conf, at which point it will happily set the
        compiler flags to target the current CPU.

        Unfortunately, if a package requires a different gcc version
        (qemu on NetBSD 4 or later is a good example), or the user
        has set GCC_REQD this fails as the include
        happens before is processed. (PR pkg/24811)

        Thw following (when combined with a pkgsrc tree containing
        cpuflags 1.35 or later) allows the user to set USE_CPUFLAGS=yes
        and have include from within the
        pkgsrc tree.

        An installed cpuflags is still useful to someone using,
        or just compiling software outside of pkgsrc, so it can still
        be included in the normal fashion.

        This dual usage of does feel a little awkward
        (read: trying to be too clever)

        What do people think?

                David/absolute       -- No hype required --

Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.68
diff -u -r1.68
--- mk/      20 Oct 2008 20:44:49 -0000      1.68
+++ mk/      20 Jan 2009 17:30:37 -0000
@@ -155,6 +155,12 @@
 .  endif

+# If USE_CPUFLAGS is set, include from within the pkgsrc tree
+.if defined(USE_CPUFLAGS) && ${USE_CPUFLAGS} == "yes"
+. include "../devel/cpuflags/files/"
 .if defined(ABI) && !empty(ABI)

Home | Main Index | Thread Index | Old Index