Re: Rpmbuild SPEC file - variable declaration

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

 





Am 13.09.2015 um 16:01 schrieb arnaud gaboury:
On Sun, Sep 13, 2015 at 3:53 PM, Reindl Harald <h.reindl@xxxxxxxxxxxxx> wrote:
export CFFLAGS= '-xHost -mavx -fp-model precise'
%configure
     CFFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
     ........

Is above the the best way?


no

* there is no reason to mention CFLAGS in %configure again
* you don't want the default macro at the end because
   it would probably override your overrides
* export CFFLAGS="%optflags -xHost -mavx -fp-model precise"

Got it. Found this way in /usr/lib/rpm/macros file:

well, that below defines the default %configure macro which you want to override which can be replaced / overriden in ~/.rpmmacros

[builduser@testserver:~]$ cat .rpmmacros
%_topdir %(echo $HOME)/rpmbuild
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot

%dist                   .fc22.%(echo $(/bin/date +%Y%m%d)).rh
%fedora                 22
%fc22                   1
%packager               Reindl Harald
%vendor                 thelounge interactive design
%_smp_mflags            -j10
%_include_minidebuginfo 0
%_binary_payload        w1.gzdio
%_source_payload        w1.gzdio
%__global_ldflags       -Wl,-z,now -Wl,-z,relro,-z,noexecstack

%configure \
  CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS; \
  CXXFLAGS="${CXXFLAGS:-%optflags}"; export CXXFLAGS; \
  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}"; export FFLAGS; \
  FCFLAGS="${FCFLAGS:-%optflags -I%_fmoddir}"; export FCFLAGS; \
  LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \
  ./configure \\\
   --host=x86_64-redhat-linux \\\
   --build=x86_64-redhat-linux \\\
   --target=x86_64-redhat-linux \\\
   --program-prefix=%{?_program_prefix} \\\
   --disable-dependency-tracking \\\
   --prefix=%{_prefix} \\\
   --exec-prefix=%{_exec_prefix} \\\
   --bindir=%{_bindir} \\\
   --sbindir=%{_sbindir} \\\
   --sysconfdir=%{_sysconfdir} \\\
   --datadir=%{_datadir} \\\
   --includedir=%{_includedir} \\\
   --libdir=%{_libdir} \\\
   --libexecdir=%{_libexecdir} \\\
   --localstatedir=%{_localstatedir} \\\
   --sharedstatedir=%{_sharedstatedir} \\\
   --mandir=%{_mandir} \\\
   --infodir=%{_infodir}


....
# ---- specfile macros.
# Macro(s) here can be used reliably for reproducible builds.
# (Note: Above is the goal, below are the macros under development)
#
# The configure macro runs autoconf configure script with platform specific
# directory structure (--prefix, --libdir etc) and compiler flags
# such as CFLAGS.
#
# The configure macro should be invoked as %configure (rather than %{configure})
# because the rest of the arguments will be expanded using %*.
#
%_configure ./configure
%configure \
   CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
   CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
   FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
   %{_configure} --host=%{_host} --build=%{_build} \\\

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux