<p dir="ltr"><br>
On Sep 13, 2015 4:07 PM, &quot;Reindl Harald&quot; &lt;<a href="mailto:h.reindl@thelounge.net">h.reindl@thelounge.net</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Am 13.09.2015 um 16:01 schrieb arnaud gaboury:<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Sep 13, 2015 at 3:53 PM, Reindl Harald &lt;<a href="mailto:h.reindl@thelounge.net">h.reindl@thelounge.net</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; export CFFLAGS= &#39;-xHost -mavx -fp-model precise&#39;<br>
&gt;&gt;&gt;&gt; %configure<br>
&gt;&gt;&gt;&gt;      CFFLAGS=&quot;${CFLAGS:-%optflags}&quot; ; export CFLAGS ; \<br>
&gt;&gt;&gt;&gt;      ........<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Is above the the best way?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; no<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; * there is no reason to mention CFLAGS in %configure again<br>
&gt;&gt;&gt; * you don&#39;t want the default macro at the end because<br>
&gt;&gt;&gt;    it would probably override your overrides<br>
&gt;&gt;&gt; * export CFFLAGS=&quot;%optflags -xHost -mavx -fp-model precise&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Got it. Found this way in /usr/lib/rpm/macros file:<br>
&gt;<br>
&gt;<br>
&gt; well, that below defines the default %configure macro which you want to override which can be replaced / overriden in ~/.rpm macros</p>
<p dir="ltr">OK. Thank you. It is clear then<br></p>
<p dir="ltr">&gt;<br>
&gt; [builduser@testserver:~]$ cat .rpmmacros<br>
&gt; %_topdir %(echo $HOME)/rpmbuild<br>
&gt; %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot<br>
&gt;<br>
&gt; %dist                   .fc22.%(echo $(/bin/date +%Y%m%d)).rh<br>
&gt; %fedora                 22<br>
&gt; %fc22                   1<br>
&gt; %packager               Reindl Harald<br>
&gt; %vendor                 thelounge interactive design<br>
&gt; %_smp_mflags            -j10<br>
&gt; %_include_minidebuginfo 0<br>
&gt; %_binary_payload        w1.gzdio<br>
&gt; %_source_payload        w1.gzdio<br>
&gt; %__global_ldflags       -Wl,-z,now -Wl,-z,relro,-z,noexecstack<br>
&gt;<br>
&gt;<br>
&gt; %configure \<br>
&gt;   CFLAGS=&quot;${CFLAGS:-%optflags}&quot;; export CFLAGS; \<br>
&gt;   CXXFLAGS=&quot;${CXXFLAGS:-%optflags}&quot;; export CXXFLAGS; \<br>
&gt;   FFLAGS=&quot;${FFLAGS:-%optflags -I%_fmoddir}&quot;; export FFLAGS; \<br>
&gt;   FCFLAGS=&quot;${FCFLAGS:-%optflags -I%_fmoddir}&quot;; export FCFLAGS; \<br>
&gt;   LDFLAGS=&quot;${LDFLAGS:-%__global_ldflags}&quot;; export LDFLAGS; \<br>
&gt;   ./configure \\\<br>
&gt;    --host=x86_64-redhat-linux \\\<br>
&gt;    --build=x86_64-redhat-linux \\\<br>
&gt;    --target=x86_64-redhat-linux \\\<br>
&gt;    --program-prefix=%{?_program_prefix} \\\<br>
&gt;    --disable-dependency-tracking \\\<br>
&gt;    --prefix=%{_prefix} \\\<br>
&gt;    --exec-prefix=%{_exec_prefix} \\\<br>
&gt;    --bindir=%{_bindir} \\\<br>
&gt;    --sbindir=%{_sbindir} \\\<br>
&gt;    --sysconfdir=%{_sysconfdir} \\\<br>
&gt;    --datadir=%{_datadir} \\\<br>
&gt;    --includedir=%{_includedir} \\\<br>
&gt;    --libdir=%{_libdir} \\\<br>
&gt;    --libexecdir=%{_libexecdir} \\\<br>
&gt;    --localstatedir=%{_localstatedir} \\\<br>
&gt;    --sharedstatedir=%{_sharedstatedir} \\\<br>
&gt;    --mandir=%{_mandir} \\\<br>
&gt;    --infodir=%{_infodir}<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; ....<br>
&gt;&gt; # ---- specfile macros.<br>
&gt;&gt; # Macro(s) here can be used reliably for reproducible builds.<br>
&gt;&gt; # (Note: Above is the goal, below are the macros under development)<br>
&gt;&gt; #<br>
&gt;&gt; # The configure macro runs autoconf configure script with platform specific<br>
&gt;&gt; # directory structure (--prefix, --libdir etc) and compiler flags<br>
&gt;&gt; # such as CFLAGS.<br>
&gt;&gt; #<br>
&gt;&gt; # The configure macro should be invoked as %configure (rather than %{configure})<br>
&gt;&gt; # because the rest of the arguments will be expanded using %*.<br>
&gt;&gt; #<br>
&gt;&gt; %_configure ./configure<br>
&gt;&gt; %configure \<br>
&gt;&gt;    CFLAGS=&quot;${CFLAGS:-%optflags}&quot; ; export CFLAGS ; \<br>
&gt;&gt;    CXXFLAGS=&quot;${CXXFLAGS:-%optflags}&quot; ; export CXXFLAGS ; \<br>
&gt;&gt;    FFLAGS=&quot;${FFLAGS:-%optflags}&quot; ; export FFLAGS ; \<br>
&gt;&gt;    %{_configure} --host=%{_host} --build=%{_build} \\\<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; devel mailing list<br>
&gt; <a href="mailto:devel@lists.fedoraproject.org">devel@lists.fedoraproject.org</a><br>
&gt; <a href="https://admin.fedoraproject.org/mailman/listinfo/devel">https://admin.fedoraproject.org/mailman/listinfo/devel</a><br>
&gt; Fedora Code of Conduct: <a href="http://fedoraproject.org/code-of-conduct">http://fedoraproject.org/code-of-conduct</a><br>
</p>