зеркало из https://github.com/microsoft/vcpkg.git
[jemalloc|vcpkg_configure_make] update and some script fixes (#25009)
* WIP commit * more jemalloc wip * v db * add license * v db * apply format diff * fix script * WIP commit * fix ARFLAGS for the wrapper * CR stuff * v db * use separate_arguments to add -Wl, to linker flags * say "-Xlinker" three times and it will come. * make assembler compile only. * disable _FOR_BUILD if crosscompiling. use function instead of macro. Remove AS settings * ignore settings for osx until somebody knows how to fix it. * CR z_vcpkg_make_set_env * CI retrigger * make conflicting options an error * remove DEFINED since the options are always defined
This commit is contained in:
Родитель
ef9628f449
Коммит
624f1b4eca
|
@ -9,7 +9,7 @@ Configure configure for Debug and Release builds of a project.
|
|||
vcpkg_configure_make(
|
||||
SOURCE_PATH <${SOURCE_PATH}>
|
||||
[AUTOCONFIG]
|
||||
[USE_WRAPPERS]
|
||||
[USE_WRAPPERS] [NO_WRAPPERS]
|
||||
[DETERMINE_BUILD_TRIPLET]
|
||||
[BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"]
|
||||
[NO_ADDITIONAL_PATHS]
|
||||
|
@ -42,6 +42,9 @@ Skip configure process
|
|||
### USE_WRAPPERS
|
||||
Use autotools ar-lib and compile wrappers (only applies to windows cl and lib)
|
||||
|
||||
### NO_WRAPPERS
|
||||
Deactivate the use of autotools ar-lib and compile wrappers (only applies to windows cl and lib)
|
||||
|
||||
### BUILD_TRIPLET
|
||||
Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET
|
||||
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 06e83ef..229e17a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -57,6 +57,7 @@ option(enable-lazy-lock "Enable lazy locking (only lock when multi-threaded" OFF
|
||||
option(force_lazy_lock "Forcing lazy-lock to avoid allocator/threading bootstrap issues" OFF)
|
||||
# install_prefix - installation directory prefix
|
||||
# with-xslroot=<path> XSL stylesheet root path
|
||||
+option(build-tests "Build tests" OFF)
|
||||
|
||||
set (PACKAGE_NAME "jemalloc")
|
||||
project (${PACKAGE_NAME} C)
|
||||
@@ -711,12 +712,8 @@ endif()
|
||||
|
||||
# The original library, delivery product
|
||||
set(LIBJEMALLOCLIB jemalloc${install_suffix})
|
||||
-add_library(${LIBJEMALLOCLIB} STATIC ${C_SRCS})
|
||||
-
|
||||
-# Now add shared library. Needed for integration tests
|
||||
-# and a benchmark
|
||||
-set(LIBJEMALLOCSO jemallocso${install_suffix})
|
||||
-add_library(${LIBJEMALLOCSO} SHARED ${C_SRCS})
|
||||
+set(LIBJEMALLOCSO ${LIBJEMALLOCLIB})
|
||||
+add_library(${LIBJEMALLOCLIB} ${C_SRCS})
|
||||
|
||||
if(WIN32)
|
||||
# May want to replace /d2Zi+ to /Zo
|
||||
@@ -745,8 +745,6 @@ if(WIN32)
|
||||
# either impport or export which is both wrong for a static library
|
||||
set_target_properties(${LIBJEMALLOCLIB}
|
||||
PROPERTIES
|
||||
- COMPILE_DEFINITIONS
|
||||
- "JEMALLOC_EXPORT="
|
||||
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG
|
||||
${PROJECT_BINARY_DIR}/Debug
|
||||
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE
|
||||
@@ -754,6 +752,9 @@ if(WIN32)
|
||||
COMPILE_PDB_NAME
|
||||
${LIBJEMALLOCLIB}
|
||||
)
|
||||
+ if(NOT BUILD_SHARED_LIBS)
|
||||
+ target_compile_definitions(${LIBJEMALLOCLIB} "JEMALLOC_EXPORT=")
|
||||
+ endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -825,6 +822,14 @@ if(C_UTIL_INTEGRATION_DEFS)
|
||||
"${C_UTIL_INTEGRATION_DEFS}")
|
||||
endif()
|
||||
|
||||
+install(FILES include/jemalloc/jemalloc${install_suffix}.h
|
||||
+ DESTINATION include/jemalloc)
|
||||
+
|
||||
+install(TARGETS ${LIBJEMALLOCSO}
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+if (build-tests)
|
||||
##################################################################
|
||||
# Common source for Unit, Integration and stress test libraries
|
||||
set(C_TESTLIB_SRCS
|
||||
@@ -1028,4 +1033,4 @@ foreach(sourcefile ${TESTS_INTEGRATION})
|
||||
add_test(NAME ${exename} COMMAND ${exename})
|
||||
add_dependencies(check ${exename})
|
||||
endforeach(sourcefile ${TESTS_UNIT})
|
||||
-
|
||||
+endif()
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index f6d25f334..3115504e2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1592,7 +1592,7 @@ fi
|
||||
[enable_uaf_detection="0"]
|
||||
)
|
||||
if test "x$enable_uaf_detection" = "x1" ; then
|
||||
- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ])
|
||||
+ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"])
|
||||
fi
|
||||
AC_SUBST([enable_uaf_detection])
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0b8959a..55e6a5f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -826,10 +826,16 @@ endif()
|
||||
install(FILES include/jemalloc/jemalloc${install_suffix}.h
|
||||
DESTINATION include/jemalloc)
|
||||
|
||||
-install(TARGETS ${LIBJEMALLOCSO}
|
||||
- RUNTIME DESTINATION bin
|
||||
- LIBRARY DESTINATION lib
|
||||
- ARCHIVE DESTINATION lib)
|
||||
+if (without-export)
|
||||
+ install(TARGETS ${C_JETLIB}
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+else()
|
||||
+ install(TARGETS ${LIBJEMALLOCSO}
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+endif()
|
||||
if (build-tests)
|
||||
##################################################################
|
||||
# Common source for Unit, Integration and stress test libraries
|
|
@ -1,30 +0,0 @@
|
|||
diff --git a/Utilities.cmake b/Utilities.cmake
|
||||
index 562e948..d2d3530 100644
|
||||
--- a/Utilities.cmake
|
||||
+++ b/Utilities.cmake
|
||||
@@ -633,9 +633,11 @@ file(TO_NATIVE_PATH "${file_path}" ntv_file_path)
|
||||
# This converts #undefs into #cmakedefines so configure_file can handle it
|
||||
set(PS_CMD
|
||||
"Get-Content \"${ntv_file_path}\" |
|
||||
-ForEach {
|
||||
+ForEach {
|
||||
if($_ -match '^#undef[ \t]*[^ \t]*')
|
||||
- { $_ -replace '^#undef[ \t]*([^ \t]*)','#cmakedefine $1 @$1@' } else {$_}}"
|
||||
+ { $_ -replace '^#undef[ \t]*([^ \t]*)','#cmakedefine $1 @$1@' } else {$_}
|
||||
+} |
|
||||
+Set-Content \"${ntv_file_path}.cmake\""
|
||||
)
|
||||
|
||||
if(EXISTS ${file_path})
|
||||
@@ -646,9 +648,8 @@ if(EXISTS ${file_path})
|
||||
# Convert autoconf .in into a cmake .in
|
||||
execute_process(COMMAND powershell -Command "${PS_CMD}"
|
||||
RESULT_VARIABLE error_level
|
||||
- ERROR_VARIABLE error_output
|
||||
- OUTPUT_FILE ${file_path}.cmake)
|
||||
-
|
||||
+ ERROR_VARIABLE error_output)
|
||||
+
|
||||
if(NOT ${error_level} EQUAL 0)
|
||||
message(FATAL_ERROR "Powershell completed with ${error_level} : ${error_output}")
|
||||
endif()
|
|
@ -1,35 +1,54 @@
|
|||
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO jemalloc/jemalloc-cmake
|
||||
REF jemalloc-cmake.4.3.1
|
||||
SHA512 e94b62ec3a53acc0ab5acb247d7646bc172108e80f592bb41c2dd50d181cbbeb33d623adf28415ffc0a0e2de3818af2dfe4c04af75ac891ef5042bc5bb186886
|
||||
REPO jemalloc/jemalloc
|
||||
REF 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c
|
||||
SHA512 527bfbf5db9a5c2b7b04df4785b6ae9d445cff8cb17298bf3e550c88890d2bd7953642d8efaa417580610508279b527d3a3b9e227d17394fd2013c88cb7ae75a
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-cmakelists.patch
|
||||
fix-utilities.patch
|
||||
fix-static-build.patch
|
||||
fix-configure-ac.patch
|
||||
preprocessor.patch
|
||||
)
|
||||
|
||||
if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
||||
set(BUILD_STATIC_LIBRARY OFF)
|
||||
else()
|
||||
set(BUILD_STATIC_LIBRARY ON)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(opts "ac_cv_search_log=none required" "--without-private-namespace")
|
||||
endif()
|
||||
vcpkg_configure_cmake(
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DGIT_FOUND=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -Dwithout-export=${BUILD_STATIC_LIBRARY}
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
NO_WRAPPERS
|
||||
OPTIONS ${opts}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_install_make()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/bin/jemalloc.dll")
|
||||
endif()
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/jemalloc.dll")
|
||||
endif()
|
||||
endif()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/jemalloc)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/jemalloc/COPYING ${CURRENT_PACKAGES_DIR}/share/jemalloc/copyright)
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index 3115504e2..ffb504b08 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -749,6 +749,7 @@ case "${host}" in
|
||||
so="dll"
|
||||
if test "x$je_cv_msvc" = "xyes" ; then
|
||||
importlib="lib"
|
||||
+ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE)
|
||||
DSO_LDFLAGS="-LD"
|
||||
EXTRA_LDFLAGS="-link -DEBUG"
|
||||
CTARGET='-Fo$@'
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "jemalloc",
|
||||
"version-string": "4.3.1",
|
||||
"port-version": 5,
|
||||
"version": "5.3.0",
|
||||
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
|
||||
"homepage": "https://github.com/jemalloc/jemalloc-cmake"
|
||||
"homepage": "https://jemalloc.net/",
|
||||
"license": "BSD-2-Clause"
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ endmacro()
|
|||
function(vcpkg_configure_make)
|
||||
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
|
||||
cmake_parse_arguments(PARSE_ARGV 0 arg
|
||||
"AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;NO_DEBUG;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET"
|
||||
"AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;NO_DEBUG;USE_WRAPPERS;NO_WRAPPERS;DETERMINE_BUILD_TRIPLET"
|
||||
"SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET"
|
||||
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES"
|
||||
)
|
||||
|
@ -133,6 +133,10 @@ function(vcpkg_configure_make)
|
|||
message(WARNING "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
if(arg_USE_WRAPPERS AND arg_NO_WRAPPERS)
|
||||
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed conflicting options USE_WRAPPERS and NO_WRAPPERS. Please remove one of them!")
|
||||
endif()
|
||||
|
||||
z_vcpkg_get_cmake_vars(cmake_vars_file)
|
||||
debug_message("Including cmake vars from: ${cmake_vars_file}")
|
||||
include("${cmake_vars_file}")
|
||||
|
@ -145,12 +149,9 @@ function(vcpkg_configure_make)
|
|||
|
||||
set(requires_autogen OFF) # use autogen.sh
|
||||
set(requires_autoconfig OFF) # use autotools and configure.ac
|
||||
if(EXISTS "${src_dir}/configure" AND "${src_dir}/configure.ac") # remove configure; rerun autoconf
|
||||
if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time
|
||||
set(requires_autoconfig ON)
|
||||
file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts
|
||||
set(arg_AUTOCONFIG ON)
|
||||
endif()
|
||||
if(EXISTS "${src_dir}/configure" AND EXISTS "${src_dir}/configure.ac" AND arg_AUTOCONFIG) # remove configure; rerun autoconf
|
||||
set(requires_autoconfig ON)
|
||||
file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts
|
||||
elseif(EXISTS "${src_dir}/configure" AND NOT arg_SKIP_CONFIGURE) # run normally; no autoconf or autogen required
|
||||
elseif(EXISTS "${src_dir}/configure.ac") # Run autoconfig
|
||||
set(requires_autoconfig ON)
|
||||
|
@ -175,10 +176,13 @@ function(vcpkg_configure_make)
|
|||
else()
|
||||
set(arg_USE_WRAPPERS OFF)
|
||||
endif()
|
||||
if(arg_NO_WRAPPERS)
|
||||
set(arg_USE_WRAPPERS OFF)
|
||||
endif()
|
||||
|
||||
# Backup environment variables
|
||||
# CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y
|
||||
set(cm_FLAGS AS CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y RC)
|
||||
set(cm_FLAGS AR AS CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y RC)
|
||||
list(TRANSFORM cm_FLAGS APPEND "FLAGS")
|
||||
vcpkg_backup_env_variables(VARS ${cm_FLAGS})
|
||||
|
||||
|
@ -289,7 +293,16 @@ function(vcpkg_configure_make)
|
|||
z_vcpkg_append_to_configure_environment(configure_env CPP "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
|
||||
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
if(NOT VCPKG_CROSSCOMPILING)
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CPP_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
|
||||
else()
|
||||
# Silly trick to make configure accept CC_FOR_BUILD but in reallity CC_FOR_BUILD is deactivated.
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CPP_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
endif()
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX "compile ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env RC "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env WINDRES "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
|
||||
|
@ -301,7 +314,15 @@ function(vcpkg_configure_make)
|
|||
else()
|
||||
z_vcpkg_append_to_configure_environment(configure_env CPP "${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
if(NOT VCPKG_CROSSCOMPILING)
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CPP_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX_FOR_BUILD "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
|
||||
else()
|
||||
z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CPP_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX_FOR_BUILD "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
endif()
|
||||
z_vcpkg_append_to_configure_environment(configure_env CXX "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env RC "${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
|
||||
z_vcpkg_append_to_configure_environment(configure_env WINDRES "${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
|
||||
|
@ -363,6 +384,39 @@ function(vcpkg_configure_make)
|
|||
# Currently needed for arm because objdump yields: "unrecognised machine type (0x1c4) in Import Library Format archive"
|
||||
list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all)
|
||||
endif()
|
||||
elseif(NOT VCPKG_TARGET_IS_OSX)
|
||||
# Because OSX dosn't like CMAKE_C(XX)_COMPILER (cc) in CC/CXX and rather wants to have gcc/g++
|
||||
function(z_vcpkg_make_set_env envvar cmakevar)
|
||||
set(prog "${VCPKG_DETECTED_CMAKE_${cmakevar}} ${ARGN}")
|
||||
string(STRIP "${prog}" prog)
|
||||
if(DEFINED ENV{${envvar}})
|
||||
return()
|
||||
endif()
|
||||
if(VCPKG_DETECTED_CMAKE_${cmakevar})
|
||||
set(ENV{${envvar}} "${prog}")
|
||||
endif()
|
||||
endfunction()
|
||||
z_vcpkg_make_set_env(CC C_COMPILER)
|
||||
if(NOT VCPKG_CROSSCOMPILING)
|
||||
z_vcpkg_make_set_env(CC_FOR_BUILD C_COMPILER)
|
||||
z_vcpkg_make_set_env(CPP_FOR_BUILD C_COMPILER "-E")
|
||||
z_vcpkg_make_set_env(CXX_FOR_BUILD C_COMPILER)
|
||||
else()
|
||||
set(ENV{CC_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
set(ENV{CPP_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
set(ENV{CXX_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true")
|
||||
endif()
|
||||
z_vcpkg_make_set_env(CXX CXX_COMPILER)
|
||||
z_vcpkg_make_set_env(NM NM)
|
||||
z_vcpkg_make_set_env(RC RC)
|
||||
z_vcpkg_make_set_env(WINDRES RC)
|
||||
z_vcpkg_make_set_env(DLLTOOL DLLTOOL)
|
||||
z_vcpkg_make_set_env(STRIP STRIP)
|
||||
z_vcpkg_make_set_env(OBJDUMP OBJDUMP)
|
||||
z_vcpkg_make_set_env(RANLIB RANLIB)
|
||||
z_vcpkg_make_set_env(AR AR)
|
||||
z_vcpkg_make_set_env(LD LINKER)
|
||||
unset(z_vcpkg_make_set_env)
|
||||
endif()
|
||||
|
||||
# Some PATH handling for dealing with spaces....some tools will still fail with that!
|
||||
|
@ -537,7 +591,7 @@ function(vcpkg_configure_make)
|
|||
debug_message("ENV{LIBS}:$ENV{LIBS}")
|
||||
|
||||
# Run autoconf if necessary
|
||||
if (arg_AUTOCONFIG OR requires_autoconfig)
|
||||
if (arg_AUTOCONFIG OR requires_autoconfig AND NOT arg_NO_AUTOCONFIG)
|
||||
find_program(AUTORECONF autoreconf)
|
||||
if(NOT AUTORECONF)
|
||||
message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")")
|
||||
|
@ -593,53 +647,17 @@ function(vcpkg_configure_make)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT arg_NO_DEBUG)
|
||||
set(var_suffix DEBUG)
|
||||
set(path_suffix_${var_suffix} "/debug")
|
||||
set(short_name_${var_suffix} "dbg")
|
||||
list(APPEND all_buildtypes ${var_suffix})
|
||||
macro(z_vcpkg_setup_make_linker_flags_vars var_suffix)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}")
|
||||
else() # dynamic
|
||||
set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${var_suffix}}")
|
||||
endif()
|
||||
z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix})
|
||||
if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe")
|
||||
set(ARFLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}")
|
||||
set(LDFLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${var_suffix}}")
|
||||
if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES [[cl\.exe$]])
|
||||
if(NOT vcm_paths_with_spaces)
|
||||
set(LDFLAGS_${var_suffix} "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
endif()
|
||||
if(DEFINED ENV{_LINK_})
|
||||
set(LINK_ENV_${var_suffix} "$ENV{_LINK_} ${LINKER_FLAGS_${var_suffix}}")
|
||||
else()
|
||||
set(LINK_ENV_${var_suffix} "${LINKER_FLAGS_${var_suffix}}")
|
||||
endif()
|
||||
else()
|
||||
set(link_required_dirs)
|
||||
if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib")
|
||||
set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib")
|
||||
endif()
|
||||
if(EXISTS "{CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
endif()
|
||||
string(STRIP "${link_required_dirs}" link_required_dirs)
|
||||
set(LDFLAGS_${var_suffix} "${link_required_dirs} ${LINKER_FLAGS_${var_suffix}}")
|
||||
endif()
|
||||
unset(var_suffix)
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
set(var_suffix RELEASE)
|
||||
set(path_suffix_${var_suffix} "")
|
||||
set(short_name_${var_suffix} "rel")
|
||||
list(APPEND all_buildtypes ${var_suffix})
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}")
|
||||
else() # dynamic
|
||||
set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${var_suffix}}")
|
||||
endif()
|
||||
z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix})
|
||||
if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe")
|
||||
if(NOT vcm_paths_with_spaces)
|
||||
set(LDFLAGS_${var_suffix} "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
string(APPEND LDFLAGS_${var_suffix} " -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
endif()
|
||||
if(DEFINED ENV{_LINK_})
|
||||
set(LINK_ENV_${var_suffix} "$ENV{_LINK_} ${LINKER_FLAGS_${var_suffix}}")
|
||||
|
@ -651,12 +669,53 @@ function(vcpkg_configure_make)
|
|||
if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib")
|
||||
set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib")
|
||||
endif()
|
||||
if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
if(EXISTS "{CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link")
|
||||
endif()
|
||||
string(STRIP "${link_required_dirs}" link_required_dirs)
|
||||
set(LDFLAGS_${var_suffix} "${link_required_dirs} ${LINKER_FLAGS_${var_suffix}}")
|
||||
if(link_required_dirs)
|
||||
string(PREPEND LDFLAGS_${var_suffix} "${link_required_dirs} ")
|
||||
# ARFLAGS doesn't need -L search paths since it just bundles object files
|
||||
endif()
|
||||
if(ARFLAGS_${var_suffix})
|
||||
# ARFLAGS need to know the command for creating an archive (Maybe needs user customization?)
|
||||
# or extract it from CMake via CMAKE_${lang}_ARCHIVE_CREATE ?
|
||||
# or from CMAKE_${lang}_${rule} with rule being one of CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE
|
||||
string(PREPEND ARFLAGS_${var_suffix} "cr ")
|
||||
endif()
|
||||
string(STRIP "${LDFLAGS_${var_suffix}}" LDFLAGS_${var_suffix})
|
||||
string(STRIP "${ARFLAGS_${var_suffix}}" ARFLAGS_${var_suffix})
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_DETECTED_CMAKE_LINKER MATCHES [[link\.exe$]])
|
||||
# Do not touch autotools quirks incoming!
|
||||
# -Xlinker is repeated three times because:
|
||||
# - libtool script eats -Xlinker
|
||||
# - the compile wrapper eats -Xlinker
|
||||
# - passing through both tools requires 3 -Xlinker; two being eaten in the first script.
|
||||
# passing only through one script will keep one -Xlinker (done in configure)
|
||||
# but cl will just ignore those with a warning. (Just like -Xcompiler)
|
||||
separate_arguments(LDFLAGS_LIST NATIVE_COMMAND "${LDFLAGS_${var_suffix}}")
|
||||
list(JOIN LDFLAGS_LIST " -Xlinker -Xlinker -Xlinker " LDFLAGS_${var_suffix})
|
||||
string(PREPEND LDFLAGS_${var_suffix} "-Xlinker -Xlinker -Xlinker ")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT arg_NO_DEBUG)
|
||||
set(var_suffix DEBUG)
|
||||
set(path_suffix_${var_suffix} "/debug")
|
||||
set(short_name_${var_suffix} "dbg")
|
||||
list(APPEND all_buildtypes ${var_suffix})
|
||||
z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix})
|
||||
z_vcpkg_setup_make_linker_flags_vars(${var_suffix})
|
||||
unset(var_suffix)
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
set(var_suffix RELEASE)
|
||||
set(path_suffix_${var_suffix} "")
|
||||
set(short_name_${var_suffix} "rel")
|
||||
list(APPEND all_buildtypes ${var_suffix})
|
||||
z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix})
|
||||
z_vcpkg_setup_make_linker_flags_vars(${var_suffix})
|
||||
unset(var_suffix)
|
||||
endif()
|
||||
|
||||
|
@ -699,7 +758,10 @@ function(vcpkg_configure_make)
|
|||
set(ENV{CXXFLAGS} "${CXXFLAGS_${current_buildtype}}")
|
||||
set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${current_buildtype}}")
|
||||
set(ENV{LDFLAGS} "${LDFLAGS_${current_buildtype}}")
|
||||
|
||||
if(ARFLAGS_${current_buildtype} AND NOT (arg_USE_WRAPPERS AND VCPKG_TARGET_IS_WINDOWS))
|
||||
# Target windows with wrappers enabled cannot forward ARFLAGS since it breaks the wrapper
|
||||
set(ENV{ARFLAGS} "${ARFLAGS_${current_buildtype}}")
|
||||
endif()
|
||||
# https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html
|
||||
# -avoid-version is handled specially by libtool link mode, this flag is not forwarded to linker,
|
||||
# and libtool tries to avoid versioning for shared libraries and no symbolic links are created.
|
||||
|
|
|
@ -3101,8 +3101,8 @@
|
|||
"port-version": 5
|
||||
},
|
||||
"jemalloc": {
|
||||
"baseline": "4.3.1",
|
||||
"port-version": 5
|
||||
"baseline": "5.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"jinja2cpplight": {
|
||||
"baseline": "2018-05-08",
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "6baf5d3d5e323c49a4f91a2e67f778421af4a4c5",
|
||||
"version": "5.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "0ced62e7a268f8442b2e808df7b094afe8998c38",
|
||||
"version-string": "4.3.1",
|
||||
|
|
Загрузка…
Ссылка в новой задаче