Skip to content
Snippets Groups Projects
Commit 21e965c1 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: update gtk search path and allowed system dlls for gcc4.9

parent a5e6ec3a
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ endforeach(req)
message("\n${vars}\n")
set(PKG_OTB_DEBUG OFF)
set(PKG_DEBUG OFF)
set(EXTRA_CACHE_CONFIG)
......
......@@ -49,7 +49,7 @@ macro(macro_setup_cmake_project pkg)
set(OTB_TARGET_SYSTEM_ARCH ${OTB_TARGET_SYSTEM_ARCH})
set(OTB_TARGET_SYSTEM_ARCH_IS_X64 ${OTB_TARGET_SYSTEM_ARCH_IS_X64})
set(OTB_WRAP_PYTHON ${OTB_WRAP_PYTHON})
set(PKG_OTB_DEBUG ${PKG_OTB_DEBUG})
set(PKG_DEBUG ${PKG_DEBUG})
${EXTRA_CACHE_CONFIG}
include(${SUPERBUILD_SOURCE_DIR}/Packaging/PackageMacros.cmake)
include(${SUPERBUILD_SOURCE_DIR}/Packaging/PackageHelper.cmake)
......
......@@ -101,6 +101,15 @@ else() #case for unixes
endif()
endif(WIN32)
# Take gtk libs from system. we should fix this to take from custom
# build location
set(PKG_GTK_SEARCHDIRS
/usr/lib64
/lib64
/lib/x86_64-linux-gnu/
/usr/lib/x86_64-linux-gnu/
)
#superbuild cannot manage build of gtk2+ just for qt gtkstyle.
# -gtkstyle option is deactivated by default in build of QT4
# So the list of requirements on building OTB with superbuild stays same.
......@@ -117,4 +126,5 @@ set(ALLOWED_SYSTEM_DLLS
libgobject-2.0.so.0
libXrender.so.1
libfontconfig.so.1
libpcre.so.3
)
......@@ -19,7 +19,7 @@ macro(macro_super_package)
endif()
#setting this variable. prints a lot of debug information
#set( PKG_OTB_DEBUG 1)
#set( PKG_DEBUG 1)
set(loader_program_PATHS)
set(eol_char "E")
......@@ -310,7 +310,7 @@ function(func_prepare_package)
unset(matched_vars CACHE)
get_vars_ending_with("_USED|_RESOLVED" matched_vars)
foreach (var_to_unset IN LISTS matched_vars)
if(PKG_OTB_DEBUG)
if(PKG_DEBUG)
message("unset ${var_to_unset} from cache")
endif()
unset(${var_to_unset} CACHE)
......@@ -324,10 +324,23 @@ function(func_prepare_package)
endfunction() #func_prepare_package
function(func_process_deps input_file)
search_library(${input_file} PKG_SEARCHDIRS input_file_full_path)
if(NOT input_file_full_path)
message(FATAL_ERROR "${input_file} not found. searched in ${PKG_SEARCHDIRS}")
endif()
if(LINUX)
setif_value_in_list(is_gtk_lib "${input_file}" ALLOWED_SYSTEM_DLLS)
if(is_gtk_lib)
search_library(${input_file} PKG_GTK_SEARCHDIRS input_file_full_path)
if( NOT input_file_full_path)
message(FATAL_ERROR "${input_file} not found. searched in ${PKG_GTK_SEARCHDIRS}")
endif()
endif()
if( NOT input_file_full_path)
message(FATAL_ERROR "${input_file} not found. searched in ${PKG_SEARCHDIRS}")
endif()
endif(LINUX)
endif() #if(NOT input_file_full_path)
message("Processing ${input_file_full_path}")
......@@ -422,7 +435,7 @@ function(func_process_deps input_file)
continue()
endif()
if(PKG_OTB_DEBUG)
if(PKG_DEBUG)
message("${raw_item} is not resolved, used. ${raw_item}_RESOLVED | ${raw_item}_USED")
endif()
......@@ -430,10 +443,10 @@ function(func_process_deps input_file)
endforeach()
if(PKG_OTB_DEBUG)
if(PKG_DEBUG)
string(REPLACE ";" "\n" raw_items_pretty_print "${raw_items}")
message(FATAL_ERROR "raw_items=${raw_items_pretty_print}")
endif(PKG_OTB_DEBUG)
endif(PKG_DEBUG)
if(raw_items)
list(REVERSE raw_items)
......@@ -441,7 +454,7 @@ function(func_process_deps input_file)
search_library(${item} PKG_SEARCHDIRS item_full_path)
set(is_a_symlink FALSE)
set(item_target_file)
if(PKG_OTB_DEBUG)
if(PKG_DEBUG)
message("item0=${item_full_path}")
endif()
func_is_file_a_symbolic_link("${item_full_path}" is_a_symlink item_target_file)
......@@ -449,7 +462,7 @@ function(func_process_deps input_file)
set(${item}_RESOLVED TRUE CACHE INTERNAL "")
set(item ${item_target_file})
endif()
if(PKG_OTB_DEBUG)
if(PKG_DEBUG)
message("running func_process_deps on '${item}'")
endif()
func_process_deps(${item})
......
......@@ -51,26 +51,23 @@ endmacro() #macro_empty_package_staging_directory
function(search_library input_file pkg_searchdirs result)
set(${result} "" PARENT_SCOPE)
set(found_lib FALSE)
foreach(SEARCHDIR ${${pkg_searchdirs}})
if(EXISTS ${SEARCHDIR}/${input_file} )
set(${result} "${SEARCHDIR}/${input_file}" PARENT_SCOPE)
foreach(pkg_searchdir ${${pkg_searchdirs}})
if(EXISTS ${pkg_searchdir}/${input_file} )
if(PKG_DEBUG)
message("searching for '${input_file}' in '${pkg_searchdir}'")
endif()
set(${result} "${pkg_searchdir}/${input_file}" PARENT_SCOPE)
return()
endif()
#check for file with lowercase
string(TOLOWER "${input_file}" input_file_lower )
if(EXISTS ${SEARCHDIR}/${input_file_lower})
set(${result} "${SEARCHDIR}/${input_file_lower}" PARENT_SCOPE)
if(EXISTS ${pkg_searchdir}/${input_file_lower})
set(${result} "${pkg_searchdir}/${input_file_lower}" PARENT_SCOPE)
return()
endif()
endforeach()
if(NOT found_lib)
check_for_gtk_libs(${input_file} gtk_lib_full_path)
if(gtk_lib_full_path)
set(${result} "${gtk_lib_full_path}" PARENT_SCOPE)
endif()
endif()
endforeach()
endfunction()
......@@ -103,34 +100,6 @@ macro(add_to_symlink_list src_file target_file)
endif()
endmacro()
function(check_for_gtk_libs input_file result)
# Take gtk libs from system. we should fix this to take from custom
# build location
set(GTK_LIBS_SEARCH_PATHS
/usr/lib64
/lib64
)
set(${result} "" PARENT_SCOPE)
if(NOT LINUX)
return()
endif()
setif_value_in_list(is_allowed "${input_file}" ALLOWED_SYSTEM_DLLS)
if(NOT is_allowed)
return()
endif()
foreach( search_path ${GTK_LIBS_SEARCH_PATHS})
if(EXISTS ${search_path}/${input_file} )
set(${result} ${search_path}/${input_file} PARENT_SCOPE)
endif()
endforeach()
endfunction()
function(is_file_executable2 file result_var)
#
# A file is not executable until proven otherwise:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment