Remove Emscripten 50/136450/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 29 Jun 2017 15:30:05 +0000 (16:30 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 29 Jun 2017 16:26:48 +0000 (17:26 +0100)
Change-Id: Icf2d5b4cf4c0df3508996ff5bd4961a4e102b76d

README.md
build/scripts/dali_env
build/tizen/configure.ac
dali/internal/event/common/thread-local-storage.cpp
dali/public-api/common/dali-common.cpp
dali/public-api/common/dali-common.h
dali/public-api/dali-core-version.cpp
dali/public-api/signals/functor-delegate.cpp

index 2e4166c..220f0ba 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,9 +13,6 @@
          * [NON-SMACK Targets](#non-smack-targets)
          * [SMACK enabled Targets](#smack-enabled-targets)
          * [DEBUG Builds](#debug-builds)
-      * [3. Building DALi as Javascript using Emscripten](#3-building-dali-as-javascript-using-emscripten)
-         * [Environment for Emscripten Javascript builds](#environment-for-emscripten-javascript-builds)
-         * [Building the repository as Javascript using Emscripten](#building-the-repository-as-javascript-using-emscripten)
 
 # Build Instructions
 
@@ -97,47 +94,3 @@ See the README.md in dali-core/automated-tests.
 
          $ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
 
-## 3. Building DALi as Javascript using Emscripten
-
-
-### Environment for Emscripten Javascript builds
-
-To build the Javascript version of DALi, the Emscripten SDK is required.
-Installation of this is built in to the main dali_env script.
-
-First create a directory for the environment:
-
-         $ mkdir -p ~/dali-env-emscripten
-
-Now run the dali_env script. This will download and build the Emscripten SDK, which may take several minutes.
-The script may ask for your password as it will need to install any package prerequisites.
-Note the "-e" option for Emscripten.
-
-         $ cd ~/dali-env-emscripten
-         $ PATH-TO-DALI-CORE/build/scripts/dali_env -c -e
-
-Create the setenv script. A new section for Emscripten will be created at the top.
-
-         $ ./dali-env/opt/bin/dali_env -s > setenv
-
-Run the setenv script to setup environment variables.
-
-         $ . ./setenv
-
-Warning: As of 19/01/2015 with a userID > 6 digits there was a bug in llvm that caused
-the build to fail. So I've used the incoming branches of the emscripten sdk and not latest.
-
-### Building the repository as Javascript using Emscripten
-
-Clean the build first:
-
-         $ cd ./dali-core/build/tizen
-         $ git clean -dxf
-         $ autoreconf --install
-
-Use llvm's drop in replacements for configure & make:
-
-         $ emconfigure ./configure --verbose --prefix=$DESKTOP_PREFIX --enable-emscripten=yes --enable-debug=yes --enable-profile=UBUNTU --enable-gles=20
-         $ emmake make install -j8
-
-
index eaa4677..679be35 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# Copyright (c) 2016 Samsung Electronics Co., Ltd.
+# Copyright (c) 2017 Samsung Electronics Co., Ltd.
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -48,17 +48,7 @@ my @system_packages = (
     "doxygen",
     "lcov",
     "libcurl4-gnutls-dev",
-);
-
-my @emscripten_system_packages = (
-    "gnome-common",
     "curl",
-    "tar",
-    "build-essential",
-    "cmake",
-    "nodejs",
-    "default-jre",
-    "python2.7"
 );
 
 # Some packages like require building from source
@@ -74,10 +64,6 @@ my @source_pkgs = (
      # original version used with DALi is 3.25.19. 3.32.7 is the latest we can use before
      # upgrading DALi to use  c++0x or c++11
      "version" => " 3.32.7", "make" => "make -j8 library=shared", "build-mode" =>"debug" },
-
-    {"name" => "emscripten",
-     "portable" => "https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz"
-    }
 );
 
 ### Detect any http proxy, part of v8 installation requires this information
@@ -147,17 +133,14 @@ else
 my $src_path         = "$root_path/src-packages";
 my $sbs_path         = "$root_path/target";
 my $install_path     = "$root_path/opt";
-my $emscripten_path  = "$root_path/emsdk_portable";
 
 my $opt_create=0;
 my $opt_setenv=0;
 my $opt_help=0;
 my $opt_man=0;
-my $opt_emscripten=0;
 
 GetOptions("create"     => \$opt_create,
            "setenv"     => \$opt_setenv,
-           "emscripten" => \$opt_emscripten,
            "help"       => \$opt_help,
            "man"        => \$opt_man) or pod2usage(2);
 
@@ -193,23 +176,6 @@ sub in_dali_env
 
 sub create_setenv
 {
-    if( ( -d $emscripten_path ) || $opt_emscripten )
-    {
-        print <<"EOF";
-#
-# Emscripten environment
-#  - which brazenly overwrites PATH so we set this first
-#  - NB: If you change the tools within emsdk then you'll need to recreate this file
-#
-
-EOF
-        my $emsdk_env_file = $emscripten_path . '/emsdk_set_env.sh';
-        open(FILE, $emsdk_env_file) or die "Can't read file enscripten env file" . $emsdk_env_file;
-        my @emsdk_env = <FILE>;
-        close (FILE);
-        print @emsdk_env;
-    }
-
     print <<"EOF";
 #
 # To use the desktop libraries, please add the following lines to your .bashrc or
@@ -256,11 +222,6 @@ sub check_system_packages
 
     check_system_package(@system_packages);
 
-    if($opt_emscripten)
-    {
-        check_system_package(@emscripten_system_packages);
-    }
-
     my $gnome_v =`dpkg -l gnome-common| tail -1| sed "s/ \\+/ /g" | cut -d' ' -f 3`;
     my @am = split(/\./, `automake --version | head -1 | cut -f4 -d' '`);
     if($gnome_v =~ /$2.24/ && $am[1]>10)
@@ -290,10 +251,6 @@ sub check_source_packages
         {
             install_v8( $pkgref );
         }
-        elsif($pkg eq "emscripten" && $opt_emscripten)
-        {
-            install_emscripten( $pkgref );
-        }
     }
 }
 
@@ -577,62 +534,6 @@ END
 }
 
 ################################################################################
-#
-# install the latest emscripten in a portable directory
-#
-################################################################################
-sub install_emscripten
-{
-    my $info = $_[0];
-    my $ret;
-    print( "Checking if Emscripten is up to date\n");
-
-    my $portable = $info->{"portable"};
-
-    my $current_dir = getcwd();
-
-    print( "\n");
-    print( "Installing or updating Emscripten.\n");
-    print( ".....You may need a cup of tea.\n");
-    print( ".......... In fact, take the afternoon off.\n");
-    print( "\n");
-
-    if(-e $emscripten_path)
-    {
-        chdir( $emscripten_path );
-    }
-    else
-    {
-        chdir( $root_path );
-
-        system("curl -O " . $portable) == 0
-            or die "curl failed with error $?. :" . $portable;
-
-        my($filename, $dirs, $suffix) = fileparse($portable);
-
-        system("tar -xvf " . $filename . $suffix) == 0
-            or die "tar unpack failed (nb tar.gz is the presumed downloaded format):" . $filename . $suffix;
-
-        system("rm " . $filename . $suffix) == 0
-            or die "Cannot remove emsdk portable tar file:" . $filename . $suffix;
-
-        chdir( $emscripten_path );
-    }
-
-    system("./emsdk update") == 0
-        or die "Cannot run emsdk? Did the install fail?";
-
-    system("./emsdk install latest");
-    system("./emsdk activate latest");
-    system("bash -c \"source ./emsdk_env.sh\""); # emsdk uses popd ie expects bash
-
-    system("emsdk list");
-
-    chdir($current_dir);
-}
-
-
-################################################################################
 #                                       MAIN
 ################################################################################
 
@@ -705,10 +606,6 @@ Create a DALi environment directory in the current directory.
 
 Display environment variables to setup.
 
-=item B<-e|--emscripten>
-
-Include emscripten (use with -c to install with emscripten or -s to setup env vars with emscripten).
-
 =item B<-h|--help>
 
 Display this help
index ca4dd8e..3ed3fca 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2014 Samsung Electronics Co., Ltd.
+# Copyright (c) 2017 Samsung Electronics Co., Ltd.
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -45,12 +45,6 @@ AC_ARG_ENABLE([debug],
               [enable_debug=$enableval],
               [enable_debug=no])
 
-AC_ARG_ENABLE([emscripten],
-              [AC_HELP_STRING([--enable-emscripten],
-                              [Emscripten builds])],
-              [enable_emscripten=$enableval],
-              [enable_emscripten=no])
-
 AC_ARG_ENABLE([backtrace],
               [AC_HELP_STRING([--enable-backtrace],
                               [Backtrace for exceptions])],
@@ -79,20 +73,12 @@ if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
   DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
 fi
 
-if test "x$enable_emscripten" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -DEMSCRIPTEN -std=c++11"
-  # Automatically turn off backtrace support and mutex locks
-  enable_backtrace="no"
-  enable_lock_backtrace="no"
-fi
-
-# Must come after Emscripten feature test
 if test "x$enable_lock_backtrace" = "xyes"; then
   DALI_CFLAGS="$DALI_CFLAGS -DLOCK_BACKTRACE_ENABLED"
   enable_backtrace="yes"
 fi
 
-# Must come after Emscripten & locks backtrace feature test
+# Must come after locks backtrace feature test
 if test "x$enable_backtrace" = "xyes"; then
   DALI_CFLAGS="$DALI_CFLAGS -DBACKTRACE_ENABLED"
 fi
@@ -136,7 +122,6 @@ Configuration
   Debug Build:                      $enable_debug
   Data Dir (Read/Write):            $dataReadWriteDir
   Data Dir (Read Only):             $dataReadOnlyDir
-  Emscripten:                       $enable_emscripten
   Backtrace:                        $enable_backtrace
   ScopedLock Backtrace:             $enable_lock_backtrace
 "
index 627b668..f59bd27 100644 (file)
@@ -30,11 +30,7 @@ namespace Internal
 
 namespace
 {
-#if defined(EMSCRIPTEN)
-ThreadLocalStorage* threadLocal = NULL;
-#else
 __thread ThreadLocalStorage* threadLocal = NULL;
-#endif
 }
 
 ThreadLocalStorage::ThreadLocalStorage(Core* core)
index 78dd20d..79c6e69 100644 (file)
 #include <string>
 #include <cstdio>
 
-#ifndef EMSCRIPTEN // cxxabi not supported
-# include <execinfo.h>
-# include <cxxabi.h>
-#endif
+#include <execinfo.h>
+#include <cxxabi.h>
 
 #include <cstring>
 
index 7e2ba29..a76ff30 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_COMMON_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // EXTERNAL INCLUDES
 
-#ifdef EMSCRIPTEN
-#include <emscripten/emscripten.h>
-#endif
-
 /*
  * Definitions for shared library support.
  *
 // C++0x not supported
 #endif
 
-#ifdef EMSCRIPTEN
-
-#ifndef __clang__
-# error not clang?
-#endif
-
-// clang cpp11 check is per feature
-#if !__has_feature(cxx_constexpr)
-# error constexpr needed for compile-time-math. Use -std=c+11
-#endif
-
-#define _CPP11
-
-#endif
-
 /**
  * @brief Two macros to provide branch predictor information.
  * DALI_LIKELY should be used when a branch is taken in almost all cases so the
@@ -170,24 +151,12 @@ public:
 #define ASSERT_LOCATION NULL
 #endif
 
-#ifdef EMSCRIPTEN
-
-#define DALI_ASSERT_ALWAYS(cond)                \
-  if(DALI_UNLIKELY(!(cond))) \
-  { \
-    Dali::DaliAssertMessage( ASSERT_LOCATION, #cond );   \
-    throw Dali::DaliException( ASSERT_LOCATION, #cond );  \
-    EM_ASM(print(new Error().stack)); \
-  }
-#else
-
 #define DALI_ASSERT_ALWAYS(cond)                \
   if(DALI_UNLIKELY(!(cond))) \
   { \
     Dali::DaliAssertMessage( ASSERT_LOCATION, #cond );   \
     throw Dali::DaliException( ASSERT_LOCATION, #cond );  \
   }
-#endif
 
 #define DALI_ABORT(message)                \
   { \
index cd5e166..6749a07 100644 (file)
@@ -31,8 +31,6 @@ const unsigned int CORE_MINOR_VERSION = 2;
 const unsigned int CORE_MICRO_VERSION = 45;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
-#ifndef EMSCRIPTEN
-
 #ifdef DEBUG_ENABLED
 namespace
 {
@@ -48,6 +46,4 @@ PrintVersion CORE_VERSION;
 } // unnamed namespace
 #endif
 
-#endif // EMSCRIPTEN
-
 } // namespace Dali
index b8baee1..7f43284 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,9 +31,7 @@ namespace
  * functions and regular functions.
  * If this assert fails, please implement the template specialisation for C functions.
  */
-#if !defined(EMSCRIPTEN)
 DALI_COMPILE_TIME_ASSERT( sizeof(void*) == sizeof( &FunctorDispatcher<void>::Dispatch ) );
-#endif
 }
 
 FunctorDelegate::~FunctorDelegate()