raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f04316e3f0395e746b3047344d398ea281e0880e

commit f04316e3f0395e746b3047344d398ea281e0880e
Author: Vincent Torri <[email protected]>
Date:   Thu Jun 18 14:35:46 2020 +0100

    meson: add Solaris support
    
    Summary: Add Solaris support for meson
    
    Test Plan: test on OpenIndiana
    
    Reviewers: raster, bu5hm4n, stefan_schmidt
    
    Reviewed By: raster, stefan_schmidt
    
    Subscribers: alarcher, stefan_schmidt, bu5hm4n, cedric, #reviewers, 
#committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11973
---
 header_checks/meson.build      | 7 ++++++-
 meson.build                    | 9 ++++++++-
 src/bin/elementary/meson.build | 9 ++++++---
 src/lib/ecore/meson.build      | 4 ++++
 src/lib/eina/meson.build       | 4 ++++
 5 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/header_checks/meson.build b/header_checks/meson.build
index 955c0082f2..c71fdbf216 100644
--- a/header_checks/meson.build
+++ b/header_checks/meson.build
@@ -88,7 +88,6 @@ function_checks = [
   ['getxattr', ['sys/types.h', 'sys/xattr.h']],
   ['iconv', ['iconv.h']],
   ['listxattr', ['sys/types.h', 'sys/xattr.h']],
-  ['mallinfo', ['malloc.h']],
   ['malloc_info', ['malloc.h']],
   ['malloc_usable_size', ['malloc.h']],
   ['mkdirat', ['sys/stat.h']],
@@ -114,6 +113,7 @@ function_checks = [
   ['dlopen', ['dlfcn.h'],                               ['dl']],
   ['dlsym', ['dlfcn.h'],                                ['dl']],
   ['lround', ['math.h'],                                ['m']],
+  ['mallinfo', ['malloc.h'],                            ['malloc']],
   ['shm_open', ['sys/mman.h', 'sys/stat.h', 'fcntl.h'], ['rt']],
 #from here on we specify arguments
   ['splice', ['fcntl.h'],                               [],      
'-D_GNU_SOURCE=1'],
@@ -157,6 +157,11 @@ m = cc.find_library('m')
 dl = cc.find_library('dl', required: false)
 rt = cc.find_library('rt', required: false)
 
+if sys_sun == true
+  malloc = cc.find_library('malloc', required: true)
+  socket = cc.find_library('socket', required: true)
+endif
+
 thread_dep = dependency('threads')
 
 #check for the headers
diff --git a/meson.build b/meson.build
index af9e8b031e..b2c2d7ff5d 100644
--- a/meson.build
+++ b/meson.build
@@ -48,11 +48,13 @@ windows = ['windows', 'cygwin']
 bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
 linux = ['linux']
 osx = ['darwin']
+sun = ['sunos']
 
 sys_linux = linux.contains(host_machine.system())
 sys_bsd = bsd.contains(host_machine.system())
 sys_windows = windows.contains(host_machine.system())
 sys_osx = osx.contains(host_machine.system())
+sys_sun = sun.contains(host_machine.system())
 
 module_files = []
 evas_loader_map = []
@@ -126,6 +128,11 @@ foreach lang : ['c', 'objc', 'cpp']
   endif
 endforeach
 
+if sys_sun == true
+# for getpwuid_r()
+  add_global_arguments('-D_POSIX_PTHREAD_SEMANTICS', language: 'c')
+endif
+
 config_h = configuration_data()
 config_h.set_quoted('MODULE_ARCH', version_name)
 config_h.set_quoted('PACKAGE', meson.project_name())
@@ -200,7 +207,7 @@ endif
 config_dir = [include_directories('.')]
 eolian_include_directories = []
 
-if sys_linux == true or sys_bsd == true
+if sys_linux == true or sys_bsd == true or sys_sun == true
   sys_lib_extension = 'so'
   sys_exe_extension = ''
   sys_mod_extension = 'so'
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 1bad71570c..f31ed793e3 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -167,12 +167,15 @@ elementary_test_src = [
   'test.h'
 ]
 
+link_args = []
 if sys_windows == false
-  link_args = ['-rdynamic', '-fPIC', '-pie']
+  link_args += ['-rdynamic', '-fPIC']
   package_c_args =  package_c_args + ['-fPIC']
-else
-  link_args = []
 endif
+if sys_windows == false and sys_sun == false
+  link_args += ['-pie']
+endif
+
 elementary_test = executable('elementary_test',
         elementary_test_src,
         dependencies: [elementary, intl] + elementary_deps + 
elementary_pub_deps,
diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build
index 0f72f4ba28..dfc2dece55 100644
--- a/src/lib/ecore/meson.build
+++ b/src/lib/ecore/meson.build
@@ -2,6 +2,10 @@ ecore_deps = []
 ecore_pub_deps = [eina, eo, efl]
 ecore_ext_deps = [intl, m, buildsystem]
 
+if sys_sun == true
+   ecore_deps += [malloc]
+endif
+
 pub_legacy_eo_files = [
   'ecore_event_message.eo',
   'ecore_event_message_handler.eo',
diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build
index 7aa1afa7ba..272c8fda82 100644
--- a/src/lib/eina/meson.build
+++ b/src/lib/eina/meson.build
@@ -7,6 +7,10 @@ if sys_windows == true
    eina_pub_deps += [evil]
 endif
 
+if sys_sun == true
+   eina_deps += [socket]
+endif
+
 public_sub_headers = [
 'eina_promise.h',
 'eina_safety_checks.h',

-- 


Reply via email to