tech-pkg archive

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

Re: Detecting binary package build

On 09/23/17 05:49, Manuel Bouyer wrote:
On Fri, Sep 22, 2017 at 03:01:13PM -0500, Jason Bacon wrote:
Is there a canonical way to detect a binary package build within the package
Makefile, whether the build was invoked by pbulk or just "make package"?

I just added wip/openblas and I want to use different build options for a
binary package and a local source build.

I.e. if building a binary package for distribution on x86, I would enable
DYNAMIC_ARCH, which generates CPU-agnostic code. When doing a local source
build, I would turn this off so the upstream build system can optimize for
the local CPU.
I think this is a bad idea. packages built by pbulk, or by 'make' from shell in
the package's directory should produce the same result (I expect so, at last).

So digging a little deeper, I realized there's an important difference between FreeBSD ports and pkgsrc.

When doing a "make install" in FreeBSD ports, there is no package saved under ${PORTSDIR}/packages.

As stated in my original post, my hope was to generate universal binaries when building a package and optimized binaries when only installing on the local host.  However, since pkgsrc always creates and saves a package in ${PKGSRC}/packages, I agree that this would not be a good idea.  The package generated would be a land-mine for unsuspecting users who copy it to other systems.

So I will leave it to the user and default to the universal.

For those who don't like negative options, this can be stated as DYNAMIC_ARCH (universal binary) defaulting to on.

Earth is a beta site.

Home | Main Index | Thread Index | Old Index