Support dual ABI 93/138393/13
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Thu, 23 Mar 2017 10:05:21 +0000 (13:05 +0300)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 4 Sep 2017 03:08:35 +0000 (12:08 +0900)
Change-Id: I9f0f491d6485fe3c8c535d732f824a030825b1e5

build/tizen/Makefile.am
build/tizen/configure.ac
build/tizen/dali-core-cxx03.pc.in [new file with mode: 0644]
build/tizen/dali-core.pc.in
build/tizen/dali-core/Makefile.am
packaging/dali.spec

index b97d9e4..d8b0edc 100644 (file)
 SUBDIRS = dali-core
 
 pkgconfigdir = $(libdir)/pkgconfig
+
+if ENABLE_CXX03_ABI
+pkgconfig_DATA = dali-core-cxx03.pc
+else
 pkgconfig_DATA = dali-core.pc
+endif
+
 
 MAINTAINERCLEANFILES = \
     aclocal.m4 \
@@ -44,9 +50,9 @@ rename_cov_data:
        @test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
        @rm -f $(COVERAGE_DIR)/*
        @cp dali-core/.libs/*.gcda dali-core/.libs/*.gcno $(COVERAGE_DIR)
-       @for i in `find $(COVERAGE_DIR) -name "libdali_core_la-*.gcda" -o -name "libdali_core_la-*.gcno"` ;\
+       @for i in `find $(COVERAGE_DIR) -name "libdali_core_la-*.gcda" -o -name "libdali_core*_la-*.gcno"` ;\
                do mv $$i `echo $$i | sed s/libdali_core_la-//` ; echo $$i ; done
-       @for i in `find $(COVERAGE_DIR) -name "libdali_la-*.gcda" -o -name "libdali_la-*.gcno"` ;\
+       @for i in `find $(COVERAGE_DIR) -name "libdali_la-*.gcda" -o -name "libdali*_la-*.gcno"` ;\
                do mv $$i `echo $$i | sed s/libdali_la-//` ; done
 
 cov_data: rename_cov_data
index 3ed3fca..d7fee53 100644 (file)
@@ -31,7 +31,7 @@ AC_SUBST(DALI_VERSION)
 DALI_CFLAGS=-DPLATFORM_TIZEN
 
 # Use C++ 11
-DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast"
+DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal"
 
 AC_ARG_ENABLE(exportall,
               [AC_HELP_STRING([--enable-exportall],
@@ -63,6 +63,25 @@ AC_ARG_ENABLE([gles],
               [enable_gles=$enableval],
               [enable_gles=20])
 
+AC_ARG_ENABLE([cxx03_abi],
+              [AC_HELP_STRING([--enable-cxx03-abi],
+                              [Specify abi for the build])],
+              [enable_cxx03_abi=$enableval],
+              [enable_cxx03_abi=no])
+
+AC_ARG_ENABLE([rename_so],
+              [AC_HELP_STRING([--enable-rename-so],
+                              [Specify whether so file is renamed or not])],
+              [enable_rename_so=$enableval],
+              [enable_rename_so=yes])
+
+AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
+AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
+
+if test "x$enable_cxx03_abi" = "xyes"; then
+  DALI_CFLAGS="$DALI_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
+fi
+
 DALI_CFLAGS="$DALI_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
 
 if test "x$enable_debug" = "xyes"; then
@@ -107,11 +126,15 @@ AC_SUBST(DALI_LDFLAGS)
 devincludepath=${includedir}
 AC_SUBST(devincludepath)
 
-AC_CONFIG_FILES([
- Makefile
- dali-core/Makefile
- dali-core.pc
-])
+AC_CONFIG_FILES([Makefile dali-core/Makefile])
+
+if test "x$enable_cxx03_abi" = "xyes"; then
+AC_CONFIG_FILES([dali-core-cxx03.pc])
+fi
+
+if test "x$enable_cxx03_abi" != "xyes"; then
+AC_CONFIG_FILES([dali-core.pc])
+fi
 
 AC_OUTPUT
 
diff --git a/build/tizen/dali-core-cxx03.pc.in b/build/tizen/dali-core-cxx03.pc.in
new file mode 100644 (file)
index 0000000..31f09d2
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+apiversion=@DALI_VERSION@
+libdir=@libdir@
+includedir=@devincludepath@
+
+Name: Dali 3D engine
+Description: Cross platform 3D Engine
+Version: ${apiversion}
+Requires:
+Libs: -L${libdir} -ldali-core-cxx03
+Cflags: -I${includedir} -std=c++11
index 9c5eb39..f04c7b6 100644 (file)
@@ -4,8 +4,8 @@ apiversion=@DALI_VERSION@
 libdir=@libdir@
 includedir=@devincludepath@
 
-Name: Samsung OpenGLES Toolkit
-Description: 3D Canvas Toolkit using OpenGLES
+Name: Dali 3D engine
+Description: Cross platform 3D Engine
 Version: ${apiversion}
 Requires:
 Libs: -L${libdir} -ldali-core
index ad081d5..5ab447e 100644 (file)
@@ -34,27 +34,41 @@ include ../../../doc/file.list
 
 # Build the Dali libtool library
 
-lib_LTLIBRARIES = libdali-core.la
+DALI_CORE_LA_SOURCES = $(internal_src_files) \
+                       $(platform_abstraction_src_files) \
+                       $(public_api_src_files) \
+                       $(devel_api_src_files)
+
+DALI_CORE_LA_CXXFLAGS = -DDALI_COMPILATION \
+                        -DDALI_DATA_RW_DIR="\"${daliReadWriteDir}\"" \
+                        -DDALI_DATA_RO_DIR="\"${daliReadOnlyDir}\"" \
+                         $(cxx_flags) \
+                         $(dali_core_includes) \
+                         $(DALI_CFLAGS)
 
-libdali_core_la_SOURCES = $(internal_src_files) \
-                          $(platform_abstraction_src_files) \
-                          $(public_api_src_files) \
-                          $(devel_api_src_files)
+DALI_CORE_LA_LIBADD = $(DALI_LDFLAGS) \
+                      -lpthread
 
 dali_core_includes = \
         -I../../..
 
-cxx_flags = -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal
+if ENABLE_CXX03_ABI
+
+lib_LTLIBRARIES = libdali-core.la
+
+libdali_core_la_SOURCES = $(DALI_CORE_LA_SOURCES)
+libdali_core_la_CXXFLAGS = $(DALI_CORE_LA_CXXFLAGS)
+libdali_core_la_LIBADD = $(DALI_CORE_LA_LIBADD)
+
+else
+
+lib_LTLIBRARIES = libdali-core-cxx11.la
 
-libdali_core_la_CXXFLAGS = -DDALI_COMPILATION \
-                           -DDALI_DATA_RW_DIR="\"${daliReadWriteDir}\"" \
-                           -DDALI_DATA_RO_DIR="\"${daliReadOnlyDir}\"" \
-                           $(cxx_flags) \
-                           $(dali_core_includes) \
-                           $(DALI_CFLAGS)
+libdali_core_cxx11_la_SOURCES = $(DALI_CORE_LA_SOURCES)
+libdali_core_cxx11_la_CXXFLAGS = $(DALI_CORE_LA_CXXFLAGS)
+libdali_core_cxx11_la_LIBADD = $(DALI_CORE_LA_LIBADD)
 
-libdali_core_la_LIBADD = $(DALI_LDFLAGS) \
-                         -lpthread
+endif
 
 # Install headers under the correct subdirectories
 platformabstractiondir = $(includedir)/dali/integration-api
@@ -141,6 +155,32 @@ linker_test_CXXFLAGS = \
   $(dali_core_includes) \
   $(DALI_CFLAGS)
 
+if ENABLE_CXX03_ABI
+
 linker_test_DEPENDENCIES = libdali-core.la
 linker_test_LDADD = \
   libdali-core.la
+
+if ENABLE_RENAME_SO
+#rename
+install: install-am
+       rm -rf $(libdir)/libdali-core.so
+       rm -rf $(libdir)/libdali-core-cxx03.so
+       ln -s $(libdir)/libdali-core.so.0.0.* $(libdir)/libdali-core-cxx03.so
+endif
+
+else
+
+linker_test_DEPENDENCIES = libdali-core-cxx11.la
+linker_test_LDADD = \
+  libdali-core-cxx11.la
+
+if ENABLE_RENAME_SO
+#rename
+install: install-am
+       rm -rf $(libdir)/libdali-core-cxx11.so
+       rm -rf $(libdir)/libdali-core.so
+       ln -s $(libdir)/libdali-core-cxx11.so.0.0.* $(libdir)/libdali-core.so
+endif
+
+endif
index 6ba4fca..03ec81f 100644 (file)
@@ -1,5 +1,5 @@
 Name:       dali
-Summary:    The OpenGLES Canvas Core Library
+Summary:    DALi 3D Engine
 Version:    1.2.55
 Release:    1
 Group:      System/Libraries
@@ -16,32 +16,70 @@ BuildRequires:  gawk
 BuildRequires:  pkgconfig(libtzplatform-config)
 %endif
 
+%if 0%{?tizen_version_major} < 4
+%define disable_cxx03_build 1
+%endif
 
 %description
-The OpenGLES Canvas Core Library provides a 3D scene graph
+DALi 3D Engine
+
+%if !0%{?disable_cxx03_build}
+##############################
+# cxx03
+##############################
+%package cxx03
+Summary:       DALi 3D Engine with cxx03 abi
+Provides:      %{name}-cxx03 = %{version}-%{release}
+
+%description cxx03
+DALi 3D Engine with cxx03 abi with cxx03 abi
+
+##############################
+# devel-cxx03
+##############################
+%package devel-cxx03
+Summary:    Development components for DALi 3D Engine with cxx03 abi
+Group:      Development/Building
+Requires:   %{name}-cxx03 = %{version}-%{release}
+Requires:   %{name}-integration-devel-cxx03 = %{version}-%{release}
+
+%description devel-cxx03
+Development components for DALi 3D Engine - public headers and package config
+
+##############################
+# integration-devel-cxx03
+##############################
+%package integration-devel-cxx03
+Summary:    Integration development package for DALi 3D Engine witch cxx03 abi
+Group:      Development/Building
+Requires:   %{name}-cxx03 = %{version}-%{release}
+
+%description integration-devel-cxx03
+Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
+%endif
 
 ##############################
 # devel
 ##############################
 %package devel
-Summary:    Development components for the OpenGLES Canvas Core Library
+Summary:    Development components for DALi 3D Engine
 Group:      Development/Building
 Requires:   %{name} = %{version}-%{release}
 Requires:   %{name}-integration-devel = %{version}-%{release}
 
 %description devel
-Development components for the OpenGLES Canvas Core Library - public headers and package config
+Development components for DALi 3D Engine - public headers and package config
 
 ##############################
 # integration-devel
 ##############################
 %package integration-devel
-Summary:    Integration development package for the OpenGLES Canvas
+Summary:    Integration development package for DALi 3D Engine
 Group:      Development/Building
 Requires:   %{name} = %{version}-%{release}
 
 %description integration-devel
-Integration development package for the OpenGLES Canvas - headers for integrating with an adaptor/platform abstraction library.
+Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
 
 ##############################
 # Preparation
@@ -92,6 +130,7 @@ export DALI_DATA_RO_DIR
 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
+
 ./configure \
       --program-prefix=%{?_program_prefix} \
       --prefix=%{_prefix} \
@@ -110,18 +149,73 @@ LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
 %if 0%{?enable_debug}
       --enable-debug \
 %endif
-      --infodir=%{_infodir}
+      --infodir=%{_infodir} \
+      --enable-rename-so=no
 
 make %{?jobs:-j%jobs}
 
+pushd %{_builddir}/%{name}-%{version}/build/tizen
+%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
+popd
+
+pushd %{buildroot}%{_libdir}
+for FILE in libdali-core-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+mv pkgconfig/dali-core.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-core.pc
+popd
+
+%if !0%{?disable_cxx03_build}
+make clean
+
+./configure \
+      --program-prefix=%{?_program_prefix} \
+      --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} \
+      --enable-cxx03-abi=yes  \
+      --enable-gles=%{target_gles_version} \
+%if 0%{?enable_debug}
+      --enable-debug \
+%endif
+      --infodir=%{_infodir} \
+      --enable-rename-so=no
+
+make %{?jobs:-j%jobs}
+%endif
+
 ##############################
 # Installation
 ##############################
 %install
 rm -rf %{buildroot}
 cd build/tizen
+
+pushd %{_builddir}/%{name}-%{version}/build/tizen
 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
 
+for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
+mv dali-core.pc %{buildroot}%{_libdir}/pkgconfig/dali-core.pc
+popd
+
+#############################
+#rename
+#############################
+pushd  %{buildroot}%{_libdir}
+rm -rf libdali-core.so
+rm -rf libdali-core-cxx11.so
+%if !0%{?disable_cxx03_build}
+ln -s libdali-core.so.0.0.* libdali-core-cxx03.so
+%endif
+ln -s libdali-core-cxx11.so.0.0.* libdali-core.so
+popd
 
 
 ##############################
@@ -142,6 +236,20 @@ exit 0
 # Files in Binary Packages
 ##############################
 
+%if !0%{?disable_cxx03_build}
+%files cxx03
+%if 0%{?enable_dali_smack_rules}
+%manifest dali.manifest-smack
+%else
+%manifest dali.manifest
+%endif
+%defattr(-,root,root,-)
+%{_libdir}/libdali-core.so.*
+%{_libdir}/libdali-core-cxx03.so
+%defattr(-,app,app,-)
+%license LICENSE
+%endif
+
 %files
 %if 0%{?enable_dali_smack_rules}
 %manifest dali.manifest-smack
@@ -149,17 +257,31 @@ exit 0
 %manifest dali.manifest
 %endif
 %defattr(-,root,root,-)
-%{_libdir}/lib%{name}-core.so*
+%{_libdir}/libdali-core-cxx11.so.*
+%{_libdir}/libdali-core.so
 %defattr(-,app,app,-)
 %license LICENSE
 
+%if !0%{?disable_cxx03_build}
+%files devel-cxx03
+%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/dali-core-cxx03.pc
+%{dev_include_path}/dali/public-api/*
+%{dev_include_path}/dali/devel-api/*
+%{dev_include_path}/dali/doc/*
+
+%files integration-devel-cxx03
+%defattr(-,root,root,-)
+%{_includedir}/dali/integration-api/*
+%endif
+
 %files devel
 %defattr(-,root,root,-)
-%{_libdir}/pkgconfig/*.pc
-%{dev_include_path}/%{name}/public-api/*
-%{dev_include_path}/%{name}/devel-api/*
-%{dev_include_path}/%{name}/doc/*
+%{_libdir}/pkgconfig/dali-core.pc
+%{dev_include_path}/dali/public-api/*
+%{dev_include_path}/dali/devel-api/*
+%{dev_include_path}/dali/doc/*
 
 %files integration-devel
 %defattr(-,root,root,-)
-%{_includedir}/%{name}/integration-api/*
+%{_includedir}/dali/integration-api/*