diff options
author | Nikolai Merinov <n.merinov@samsung.com> | 2019-02-04 12:07:38 +0300 |
---|---|---|
committer | Nikolai Merinov <n.merinov@samsung.com> | 2019-02-05 16:53:18 +0300 |
commit | 318764763e5c25fcabfd977b6fb16d4bdc7dbebc (patch) | |
tree | 036712236d5c97d7e974c2080c783f5f8ff361df | |
parent | 0e876804216acd65de02eaaad64af0374ada2d45 (diff) | |
download | rpm-318764763e5c25fcabfd977b6fb16d4bdc7dbebc.tar.gz rpm-318764763e5c25fcabfd977b6fb16d4bdc7dbebc.tar.bz2 rpm-318764763e5c25fcabfd977b6fb16d4bdc7dbebc.zip |
Move linker flags to LDFLAGS, define CC_FOR_BUILD
-rw-r--r-- | packaging/rpm-tizen_macros | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/packaging/rpm-tizen_macros b/packaging/rpm-tizen_macros index 641237062..fbb84856c 100644 --- a/packaging/rpm-tizen_macros +++ b/packaging/rpm-tizen_macros @@ -213,15 +213,26 @@ unset DISPLAY\ %{nil} %build %%build\ -LANG=C\ -export LANG\ -unset DISPLAY\ -CFLAGS="%optflags" ; export CFLAGS ; \ -CXXFLAGS="${CXXFLAGS:-%optflags -std=gnu++11}" ; export CXXFLAGS ; \ -FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ -LDFLAGS="${LDFLAGS:-%{?global_LDFLAGS}}"; export LDFLAGS ; \ +LANG=C ; \ +export LANG ;\ +unset DISPLAY ;\ +CFLAGS="" ; \ +for flag in %optflags ; do \ + case $flag in \ + -Wl,*) __ldflags="$__ldflags $flag" ;; \ + -l*) __ldflags="$__ldflags $flag" ;; \ + -pie) __ldflags="$__ldflags $flag" ;; \ + *) CFLAGS="$CFLAGS $flag" ;; \ + esac ; \ +done ;\ +export CFLAGS ; \ +CXXFLAGS="${CXXFLAGS:-${CFLAGS} -std=gnu++11}" ; export CXXFLAGS ; \ +FFLAGS="${FFLAGS:-${CFLAGS} -I%_fmoddir}" ; export FFLAGS ; \ +LDFLAGS="${LDFLAGS:-%{?global_LDFLAGS}%{!?global_LDFLAGS:${__ldflags}}} "; export LDFLAGS ; \ CC="clang --target=%(echo %{_host} | sed -e 's/i686/i586/') -resource-dir %{_libdir}/clang/5.0.2"; export CC ; \ CXX="clang++ --target=%(echo %{_host} | sed -e 's/i686/i586/') -resource-dir %{_libdir}/clang/5.0.2"; export CXX ; \ +CC_FOR_BUILD="$CC" ; export CC_FOR_BUILD ; \ +CXX_FOR_BUILD="$CXX" ; export CXX_FOR_BUILD ; \ %{nil} %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\ |