Add AArch64-specific options to cflags
[platform/framework/native/compat.git] / packaging / osp-compat.spec
1 Name:       osp-compat
2 Summary:    osp-compat library
3 Version:    1.3.0.0
4 Release:    1
5 Group:      Application Framwork/Libraries
6 License:    Apache-2.0 or BSD-2-Clause or BSD-like
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires:  cmake
9 BuildRequires:  pkgconfig(osp-appfw)
10 BuildRequires:  pkgconfig(osp-net)
11 BuildRequires:  pkgconfig(osp-nfc)
12 BuildRequires:  pkgconfig(osp-social)
13 BuildRequires:  pkgconfig(osp-uifw)
14
15 Provides:       libosp-compat.so.1
16
17 %description
18 osp-compat library
19
20 %prep
21 %setup -q
22
23 %build
24 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
25
26 %ifarch %{ix86}
27         ARCH=x86
28         CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_"
29         %if 0%{?simulator}
30                 CXXFLAGS="$CXXFLAGS -D_OSP_EMUL_"
31         %endif
32 %else
33         ARCH=arm
34 %ifarch aarch64
35         CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv8-a+fp+simd -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_"
36 %else
37         CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_"
38 %endif
39 %endif
40
41 %if 0%{?tizen_build_binary_release_type_eng}
42         CXXFLAGS="$CXXFLAGS -D_SECURE_LOG"
43 %endif
44
45 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DOBS=1 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=${ARCH}
46
47 # Call make instruction with smp support
48 make %{?_smp_mflags}
49
50 %install
51 %make_install
52
53 %post -p /sbin/ldconfig
54
55 %postun -p /sbin/ldconfig
56
57 %files
58 %manifest osp-compat.manifest
59 %license LICENSE.Apache-2.0 LICENSE.NEWLIB
60 %defattr(-,root,root,-)
61 %{_libdir}/osp/libosp-compat.so*