spec: use openmp if arm arch 61/132961/7 accepted/tizen/unified/20170613.194535 submit/tizen/20170613.064539
authorJuyeon Lee <juyeonne.lee@samsung.com>
Thu, 8 Jun 2017 11:22:28 +0000 (20:22 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Tue, 13 Jun 2017 03:32:54 +0000 (03:32 +0000)
Change-Id: I2196de882ca7e2f6757a9e9689d85064047088db

configure.ac
packaging/enlightenment.spec

index 52bccd3..1de73f1 100755 (executable)
@@ -431,21 +431,37 @@ if test "x${have_wayland}" = "xyes"; then
   fi
 fi
 
-# Check for libgomp
-libgomp=no
-AC_ARG_ENABLE([libgomp],
-  AS_HELP_STRING([--enable-libgomp], [enable libgomp @<:@default=disabled@:>@]),
-  [libgomp=$enableval],
-  [libgomp=no])
-AC_MSG_CHECKING([whether libgomp is enabled])
-AC_MSG_RESULT([${libgomp}])
-
-if test "x$libgomp" != "xno"; then
-    AC_DEFINE([HAVE_LIBGOMP], [1], [Enable libgomp])
-    have_libgomp=yes
+# does this compiler support -fopenmp, does it have the include file
+# <omp.h> and does it have libgomp ?
+
+AC_MSG_CHECKING([for OpenMP])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-fopenmp $mflag_primary -Werror"
+
+AC_LINK_IFELSE([AC_LANG_SOURCE([
+#include <omp.h>
+int main(int argc, char** argv)
+{
+  omp_set_dynamic(0);
+  return 0;
+}
+])],
+[
+   have_libgomp=yes
+   AC_MSG_RESULT([yes])
+], [
+   have_libgomp=no
+   AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+if test "x$have_libgomp" != "xno"; then
+AC_DEFINE([HAVE_LIBGOMP], [1], [Enable libgomp])
+   have_libgomp=yes
 else
-    AC_DEFINE([HAVE_LIBGOMP], [0], [Disable libgomp])
-    have_libgomp=no
+AC_DEFINE([HAVE_LIBGOMP], [0], [Disable libgomp])
+   have_libgomp=no
 fi
 AM_CONDITIONAL([HAVE_LIBGOMP], [test "x${have_libgomp}" = "xyes"])
 
index 73d805e..b620c78 100755 (executable)
@@ -8,14 +8,9 @@ Group:          Graphics/EFL
 Source0:        enlightenment-%{version}.tar.bz2
 Source1001:     enlightenment.manifest
 
-%if 0%{?tizen_version_major} <= 3
-# use libgomp only in arm 32bit mobile
 %ifarch %{arm}
-%if "%{?profile}" == "mobile"
 %define LIBGOMP use
 %endif
-%endif
-%endif
 
 BuildRequires:  eet-tools
 BuildRequires:  pkgconfig(dbus-1)
@@ -80,9 +75,6 @@ export LDFLAGS+=" -pie "
       --enable-function-trace \
       --enable-wayland \
       --enable-quick-init \
-%if "%{LIBGOMP}" == "use"
-      --enable-libgomp \
-%endif
       --enable-hwc-multi
 
 make %{?_smp_mflags}