X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm.macros;h=3dfbcc14043d5fd876fa7c1f80984036567db8a6;hb=247445a9899779f20b6168a4572e4f7eeae829fb;hp=37f5d0746ad6f53a59be61536b4100e09acb4821;hpb=650cc6814608345efd60db774723bbdadd4a67ad;p=packages%2Frpm.git diff --git a/rpm.macros b/rpm.macros index 37f5d07..3dfbcc1 100644 --- a/rpm.macros +++ b/rpm.macros @@ -91,6 +91,20 @@ fi; \ %{filter_out} }') +# rpmldflags with stripped -Wl, -- in the form flags have to be passed to 'ld' +# but, don't use it, better use gcc as linker +%ld_rpmldflags %(awk 'BEGIN { + split("%{rpmldflags}",F); + for (f in F) { + s = F[f]; + if (s ~ /^-Wl,/) { + s = substr(s,5); + gsub(/,/," ",s); + }; + printf(s FS); + }; +}') + #----------------------------------------------------------------- %configure2_13 { \ if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \ @@ -128,6 +142,18 @@ CXXFLAGS="%{rpmcxxflags}" \ cmake \ } +# waf. see waf.spec +# override __waf to add -j1 in your ~/.rpmmacros +%__waf /usr/bin/waf +%waf { \ +CC="%{__cc}" \ +CXX="%{__cxx}" \ +CPP="%{__cpp}" \ +CFLAGS="%{rpmcflags}" \ +CXXFLAGS="%{rpmcxxflags}" \ +%{__waf} \ +} + #---------------------------------------------------------------- %global configure_cache 0 %configure_cache_file %{buildroot}.configure.cache @@ -1073,6 +1099,7 @@ done \ # without .ko extension, may be placed in subdirectory # -C -- change to before doing anything # -p , -P -- arguments passeed to make scripts +# -c -- do not execute make clean # -- all additional arguments will be passed to # make modules # @@ -1090,7 +1117,7 @@ done \ # - in last line \ has to touch arguments so arguments passing # in new lines (using \) will be supported -%build_kernel_modules(p:P:m:C:) \ +%build_kernel_modules(p:P:m:C:c) \ %{!?-m:%{error:%{0}: Required module name/list missing} exit 1} \ \ %define Opts \\\\\\\ @@ -1106,14 +1133,15 @@ done \ %define MakeOpts HOSTCC="%{__cc}" SYSSRC=%{_kernelsrcdir} SYSOUT=$PWD/o \\\\\\\ O=$PWD/o %{?with_verbose:V=1} %{Opts} \ \ +%{?-C:cd %{-C*}} \ compile() { \ L="<"; [[ '%{*}' != *$L$L* ]] || PATCH_SH="set -x -e;$(cat)" \ set -e -x \ -%{?-C:cd %{-C*}} \ \ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do \ [ -r "%{_kernelsrcdir}/config-$cfg" ] || exit 1 \ \ + rm -rf o \ install -d o/include/linux \ ln -sf %{_kernelsrcdir}/config-$cfg o/.config \ ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers \ @@ -1133,9 +1161,9 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist} ln -sf %{_kernelsrcdir}/scripts o/scripts \ %endif \ \ - %{__make} -C %{_kernelsrcdir} clean \\\ + %{!?-c:%{__make} -C %{_kernelsrcdir} clean \\\ RCS_FIND_IGNORE="-name '*.ko' -o" \\\ - M=$PWD %{MakeOpts} \ + M=$PWD %{MakeOpts}} \ %{__make} -C %{_kernelsrcdir} modules \\\ ${1+"$@"} \\\ M=$PWD %{MakeOpts} \