From c4863cf367102e17c76da6dc28cc5d25256a2dcd Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 5 Oct 2019 18:35:00 +0100 Subject: [PATCH] build - images loaders and saver modules need to link to evas if your platform is picky enough it won't want to leave unresolved symbols (which wshould be resovled at runtime from the host lib) so we need to link these modules to evas. the problem is due to the complicated build of some modules being static and some shared, evas is declared with evas_goal and this has to be declared after static modules are declared but since i was declaring static and shared at the same time from a table this breaks. so i have to move all the static and shared module stuff into evas_goal into 2 phases. one phase for the static and one for the shared after evas is delcared so evas as a target exists to link to. Gbp-Pq: Name 0005-build-images-loaders-and-saver-modules-need-to-link-.patch --- meson.build | 2 + src/lib/evas_goal/meson.build | 143 +++++++++++++++++++++ src/modules/evas/image_loaders/meson.build | 51 -------- src/modules/evas/image_savers/meson.build | 42 ------ src/modules/evas/meson.build | 25 ---- 5 files changed, 145 insertions(+), 118 deletions(-) delete mode 100644 src/modules/evas/image_loaders/meson.build delete mode 100644 src/modules/evas/image_savers/meson.build diff --git a/meson.build b/meson.build index 9c94f8b..ecc1e47 100644 --- a/meson.build +++ b/meson.build @@ -247,6 +247,8 @@ endif ecore_evas_wayland_engine_include_dir = [] +evas_static_list = [] + evas_lib = ['evas' ,[], false, true, false, false, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']] evas_img_modules = ['evas' ,[], true, false, false, false, false, false, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']] evas_engines = [join_paths('evas', 'engines'),[], true, false, false, false, false, false, [], []] diff --git a/src/lib/evas_goal/meson.build b/src/lib/evas_goal/meson.build index 5746006..59473fe 100644 --- a/src/lib/evas_goal/meson.build +++ b/src/lib/evas_goal/meson.build @@ -1,3 +1,98 @@ +#fixed dependencies by efl +png = dependency('libpng') +tiff = dependency('libtiff-4', required: get_option('evas-loaders-disabler').contains('tiff') == false) +giflib = cc.find_library('gif') +webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false) + +evas_loader_saver_mod_bmp = ['bmp', 'shared', []] +evas_loader_saver_mod_eet = ['eet', 'static', [eet]] +evas_loader_saver_mod_generic = ['generic', 'shared', [rt]] +evas_loader_saver_mod_gif = ['gif', 'shared', [giflib]] +evas_loader_saver_mod_ico = ['ico', 'shared', []] +evas_loader_saver_mod_jpeg = ['jpeg', 'static', [jpeg]] +evas_loader_saver_mod_pmaps = ['pmaps', 'shared', []] +evas_loader_saver_mod_png = ['png', 'static', [png]] +evas_loader_saver_mod_psd = ['psd', 'shared', []] +evas_loader_saver_mod_tga = ['tga', 'shared', []] +evas_loader_saver_mod_tgv = ['tgv', 'shared', [rg_etc, lz4]] +evas_loader_saver_mod_tiff = ['tiff', 'shared', [tiff]] +evas_loader_saver_mod_wbmp = ['wbmp', 'shared', []] +evas_loader_saver_mod_webp = ['webp', 'shared', [webp]] +evas_loader_saver_mod_xpm = ['xpm', 'shared', []] + +evas_image_loaders_file = [ + evas_loader_saver_mod_bmp, + evas_loader_saver_mod_eet, + evas_loader_saver_mod_generic, + evas_loader_saver_mod_gif, + evas_loader_saver_mod_ico, + evas_loader_saver_mod_jpeg, + evas_loader_saver_mod_pmaps, + evas_loader_saver_mod_png, + evas_loader_saver_mod_psd, + evas_loader_saver_mod_tga, + evas_loader_saver_mod_tgv, + evas_loader_saver_mod_tiff, + evas_loader_saver_mod_wbmp, + evas_loader_saver_mod_webp, + evas_loader_saver_mod_xpm +] + +evas_image_savers_file = [ + evas_loader_saver_mod_eet, + evas_loader_saver_mod_jpeg, + evas_loader_saver_mod_png, + evas_loader_saver_mod_tgv, + evas_loader_saver_mod_tiff, + evas_loader_saver_mod_webp +] + +foreach loader_inst : evas_image_loaders_file + loader = loader_inst[0] + loader_type = loader_inst[1] + loader_deps = loader_inst[2] + if get_option('evas-loaders-disabler').contains(loader) == false + if loader_type == 'static' + config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') + file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_loaders', loader, 'evas_image_load_'+loader+'.c') + config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1') + tmp = static_library('image_loader_'+loader, file, + include_directories : config_dir, + dependencies : [evas_pre] + loader_deps + ) + evas_static_list += [declare_dependency( + sources: file, + dependencies: loader_deps, + )] + endif + else + message('Image loader '+loader+' disabled') + endif +endforeach + +foreach loader_inst : evas_image_savers_file + loader = loader_inst[0] + loader_type = loader_inst[1] + loader_deps = loader_inst[2] + if get_option('evas-loaders-disabler').contains(loader) == false + if loader_type == 'static' + config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') + file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_savers', loader, 'evas_image_save_'+loader+'.c') + config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1') + tmp = static_library('image_saver_'+loader, file, + include_directories : config_dir, + dependencies : [evas_pre] + loader_deps + ) + evas_static_list += [declare_dependency( + sources: file, + dependencies: loader_deps, + )] + endif + else + message('Image saver '+loader+' disabled') + endif +endforeach + evas_lib = library('evas', 'empty.c', #all the source code is coming from evas_pre_lib_dep @@ -34,3 +129,51 @@ pkgconfig.generate(evas_lib, version : version_major + '.' + version_minor + '.' + version_micro, libraries : [eina, ecore, ector, emile, lua], ) + +foreach loader_inst : evas_image_loaders_file + loader = loader_inst[0] + loader_type = loader_inst[1] + loader_deps = loader_inst[2] + if get_option('evas-loaders-disabler').contains(loader) == false + if loader_type == 'shared' + config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') + file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_loaders', loader, 'evas_image_load_'+loader+'.c') + evas_package_modules = join_paths(dir_lib, 'evas', 'modules') + mod_install_dir = join_paths(evas_package_modules, 'image_loaders', loader, version_name) + shared_module('shared_loader_'+loader, file, + include_directories : config_dir, + dependencies : [eina, evas] + loader_deps, + install : true, + install_dir : mod_install_dir, + name_suffix : sys_mod_extension + ) + module_files += join_paths(mod_install_dir, 'libshared_loader_'+loader + '.' + sys_mod_extension) + endif + else + message('Image loader '+loader+' disabled') + endif +endforeach + +foreach loader_inst : evas_image_savers_file + loader = loader_inst[0] + loader_type = loader_inst[1] + loader_deps = loader_inst[2] + if get_option('evas-loaders-disabler').contains(loader) == false + if loader_type == 'shared' + config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') + file = join_paths(meson.source_root(), 'src', 'modules', 'evas', 'image_savers', loader, 'evas_image_save_'+loader+'.c') + evas_package_modules = join_paths(dir_lib, 'evas', 'modules') + mod_install_dir = join_paths(evas_package_modules, 'image_savers', loader, version_name) + shared_module('shared_saver_'+loader, file, + include_directories : config_dir, + dependencies : [eina, evas] + loader_deps, + install : true, + install_dir : mod_install_dir, + name_suffix : sys_mod_extension + ) + module_files += join_paths(mod_install_dir, 'libshared_saver_'+loader + '.' + sys_mod_extension) + endif + else + message('Image saver '+loader+' disabled') + endif +endforeach diff --git a/src/modules/evas/image_loaders/meson.build b/src/modules/evas/image_loaders/meson.build deleted file mode 100644 index 4273a25..0000000 --- a/src/modules/evas/image_loaders/meson.build +++ /dev/null @@ -1,51 +0,0 @@ -evas_image_loaders_file = [ - evas_loader_saver_mod_bmp, - evas_loader_saver_mod_eet, - evas_loader_saver_mod_generic, - evas_loader_saver_mod_gif, - evas_loader_saver_mod_ico, - evas_loader_saver_mod_jpeg, - evas_loader_saver_mod_pmaps, - evas_loader_saver_mod_png, - evas_loader_saver_mod_psd, - evas_loader_saver_mod_tga, - evas_loader_saver_mod_tgv, - evas_loader_saver_mod_tiff, - evas_loader_saver_mod_wbmp, - evas_loader_saver_mod_webp, - evas_loader_saver_mod_xpm -] - -foreach loader_inst : evas_image_loaders_file - loader = loader_inst[0] - loader_type = loader_inst[1] - loader_deps = loader_inst[2] - if get_option('evas-loaders-disabler').contains(loader) == false - config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') - file = join_paths(loader, 'evas_image_load_'+loader+'.c') - if loader_type == 'shared' - evas_package_modules = join_paths(dir_lib, 'evas', 'modules') - mod_install_dir = join_paths(evas_package_modules, 'image_loaders', loader, version_name) - shared_module(loader, file, - include_directories : config_dir, - dependencies : [evas_pre] + loader_deps, - install : true, - install_dir : mod_install_dir, - name_suffix : sys_mod_extension - ) - module_files += join_paths(mod_install_dir, 'lib'+loader + '.' + sys_mod_extension) - else - config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1') - tmp = static_library('image_loader_'+loader, file, - include_directories : config_dir, - dependencies : [evas_pre] + loader_deps - ) - evas_static_list += [declare_dependency( - sources: file, - dependencies: loader_deps, - )] - endif - else - message('Image loader '+loader+' disabled') - endif -endforeach diff --git a/src/modules/evas/image_savers/meson.build b/src/modules/evas/image_savers/meson.build deleted file mode 100644 index 35883f2..0000000 --- a/src/modules/evas/image_savers/meson.build +++ /dev/null @@ -1,42 +0,0 @@ -evas_image_savers_file = [ - evas_loader_saver_mod_eet, - evas_loader_saver_mod_jpeg, - evas_loader_saver_mod_png, - evas_loader_saver_mod_tgv, - evas_loader_saver_mod_tiff, - evas_loader_saver_mod_webp -] - -foreach loader_inst : evas_image_savers_file - loader = loader_inst[0] - loader_type = loader_inst[1] - loader_deps = loader_inst[2] - if get_option('evas-loaders-disabler').contains(loader) == false - config_h.set('BUILD_LOADER_'+loader.to_upper(), '1') - file = join_paths(loader, 'evas_image_save_'+loader+'.c') - if loader_type == 'shared' - evas_package_modules = join_paths(dir_lib, 'evas', 'modules') - mod_install_dir = join_paths(evas_package_modules, 'image_savers', loader, version_name) - shared_module(loader, file, - include_directories : config_dir, - dependencies : [evas_pre] + loader_deps, - install : true, - install_dir : mod_install_dir, - name_suffix : sys_mod_extension - ) - module_files += join_paths(mod_install_dir, 'lib'+loader + '.' + sys_mod_extension) - else - config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1') - tmp = static_library('image_saver_'+loader, file, - include_directories : config_dir, - dependencies : [evas_pre] + loader_deps - ) - evas_static_list += [declare_dependency( - sources: file, - dependencies: loader_deps, - )] - endif - else - message('Image saver '+loader+' disabled') - endif -endforeach diff --git a/src/modules/evas/meson.build b/src/modules/evas/meson.build index 869665b..e8f335d 100644 --- a/src/modules/evas/meson.build +++ b/src/modules/evas/meson.build @@ -1,31 +1,6 @@ #fixed dependencies by efl -png = dependency('libpng') -tiff = dependency('libtiff-4', required: get_option('evas-loaders-disabler').contains('tiff') == false) -giflib = cc.find_library('gif') json = dependency('rlottie', required: get_option('evas-loaders-disabler').contains('json') == false) -webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false) -evas_loader_saver_mod_bmp = ['bmp', 'shared', []] -evas_loader_saver_mod_eet = ['eet', 'static', [eet]] -evas_loader_saver_mod_generic = ['generic', 'shared', [rt]] -evas_loader_saver_mod_gif = ['gif', 'shared', [giflib]] -evas_loader_saver_mod_ico = ['ico', 'shared', []] -evas_loader_saver_mod_jpeg = ['jpeg', 'static', [jpeg]] -evas_loader_saver_mod_pmaps = ['pmaps', 'shared', []] -evas_loader_saver_mod_png = ['png', 'static', [png]] -evas_loader_saver_mod_psd = ['psd', 'shared', []] -evas_loader_saver_mod_tga = ['tga', 'shared', []] -evas_loader_saver_mod_tgv = ['tgv', 'shared', [rg_etc, lz4]] -evas_loader_saver_mod_tiff = ['tiff', 'shared', [tiff]] -evas_loader_saver_mod_wbmp = ['wbmp', 'shared', []] -evas_loader_saver_mod_webp = ['webp', 'shared', [webp]] -evas_loader_saver_mod_xpm = ['xpm', 'shared', []] - -#there are a few modules that should NEVER be build as a module but rather be build as static lib and linked in later -evas_static_list = [] - -subdir('image_loaders') -subdir('image_savers') subdir('model_savers') subdir('model_loaders') subdir('vg_savers')