зеркало из https://github.com/microsoft/vcpkg.git
[vcpkg] Improve make builds (#10402)
* update all 16 configure_make ports * add make wrappers for msvc * improve make builds * fix relativ path errors on linux (and osx?) * revisit all 16 portfiles again * remove trace from install * fix relative build path issues. * bump control of the 16 configure ports * never forget .... real linux is case sensitive .... * Revert "bump control of the 16 configure ports" This reverts commit40d6d81c01
. * Revert "Revert "bump control of the 16 configure ports"" This reverts commit9c9851ddfc
. * bump control again for real ci rebuild * add copy_source * remove message * pass parameters to vcpkg_build_make * fix healpix build. * fix libmagic regression * fix libwandio regression * pfring changes regression fix? (cannot test in wsl) * ws change to retrigger CI * fix libpq regression * fix libudns regression * add share/pkgconfig to PKG_CONFIG_PATH * cleanup of deprecated options * cleanup docs * Revert "bump control again for real ci rebuild" This reverts commitb4bc18edc2
. * shared binaries on linux should stay in lib. Only dlls are mvoed to bin * move pkgconfig check and add message about missing system packages * added autopoint as a build requirement * fix prerun shell working dir. * a few fixes from the x windows pr - add libpath setting - fixed pkgconfig search on windows platforms - fixed autopoint msys package on windows * fix release prefix * minimal cleanup and ws changes to trigger true CI rebuild * fix tcl by upgrading * remove unnecessary rename * fix pfring? can't test in WSL. Linux kernel headers required. * fix lowercase in patch * fix libwandio * remove x264 from fail list * replace wrappers with wrappers from automake * update make ports * remove unnecessary message * refactor vcpkg_configure_make * [tcl] remove stray ? * [farmhash] fix build * [freexl] ws change to retrigger ci build * [x264] add pthread as a dependency * [vcpkg/scripts] add ignore flag correctly * [sdl] fix vcpkg_fixup_pkgconfig call * [farmhash/freexl] delete configure and recreate it. * [libudns] remove trailing ? * [freexl] use empty build target * [freexl] add system library; remove previous change * Update ports/x264/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * [libwandio] remove unncessary comment Co-authored-by: dan-shaw <51385773+dan-shaw@users.noreply.github.com> Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
Родитель
f6dd5aee5b
Коммит
27c6c94202
|
@ -1,4 +1,5 @@
|
|||
Source: farmhash
|
||||
Version: 1.1
|
||||
Version: 1.1-1
|
||||
Homepage: https://github.com/google/farmhash
|
||||
Description: FarmHash, a family of hash functions.
|
||||
Supports: !arm
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "Windows")
|
||||
#Requires a compiler which understands '__builtin_unreachable':
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
|
@ -9,12 +9,12 @@ vcpkg_from_github(
|
|||
HEAD_REF master
|
||||
)
|
||||
|
||||
set(FLAGS "-g -mavx -maes -O3")
|
||||
if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This should be a compiler check
|
||||
set(ENV{CXXFLAGS} "-maes -msse4.2")
|
||||
endif()
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
CXXFLAGS=${FLAGS}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Source: freexl
|
||||
Version: 1.0.4-8
|
||||
Version: 1.0.4-9
|
||||
Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources
|
||||
Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet
|
||||
Build-Depends: libiconv
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
include(vcpkg_common_functions)
|
||||
set(FREEXL_VERSION_STR "1.0.4")
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
|
@ -37,7 +36,6 @@ if (VCPKG_TARGET_IS_WINDOWS)
|
|||
INST_DIR="${CURRENT_PACKAGES_DIR}"
|
||||
"LINK_FLAGS="
|
||||
"LIBS_ALL=${LIBS_ALL_REL}"
|
||||
|
||||
)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
|
||||
|
@ -64,7 +62,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
|
|||
ARCHIVE ${ARCHIVE}
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS_DEBUG
|
||||
|
@ -80,6 +78,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
|
|||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Source: healpix
|
||||
Version: 1.12.10
|
||||
Version: 1.12.10-1
|
||||
Homepage: http://healpix.sourceforge.net/
|
||||
Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere.
|
||||
Build-Depends: cfitsio
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(ON_TARGET "Windows" "OSX")
|
||||
|
||||
set(HEALPIX_VER 3.50)
|
||||
set(HEALPIX_PACK_NAME ${HEALPIX_VER}_2018Dec10)
|
||||
|
||||
|
@ -17,25 +15,31 @@ vcpkg_extract_source_archive_ex(
|
|||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PROJECT_SUBPATH src/cxx
|
||||
AUTOCONFIG
|
||||
NO_DEBUG
|
||||
COPY_SOURCE
|
||||
OPTIONS
|
||||
--with-libcfitsio-include=${CURRENT_INSTALLED_DIR}/include/cfitsio
|
||||
--with-libcfitsio-lib=${CURRENT_INSTALLED_DIR}/lib
|
||||
)
|
||||
|
||||
vcpkg_build_make()
|
||||
vcpkg_build_make(BUILD_TARGET compile_all)
|
||||
#vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Install manually
|
||||
set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/src/cxx/auto)
|
||||
# Install manually because healpix has no install target
|
||||
set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/auto")
|
||||
file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*)
|
||||
file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
||||
file(INSTALL ${HEALPIX_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
||||
|
||||
file(GLOB_RECURSE HEALPIX_INCLUDES ${OBJ_DIR}/include/*)
|
||||
file(INSTALL ${HEALPIX_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
||||
file(INSTALL ${HEALPIX_INCLUDES} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
||||
|
||||
file(GLOB_RECURSE HEALPIX_TOOLS ${OBJ_DIR}/bin/*)
|
||||
file(INSTALL ${HEALPIX_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(INSTALL ${HEALPIX_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
||||
|
||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/")
|
||||
set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/auto")
|
||||
file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*)
|
||||
file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
endif()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Source: libb2
|
||||
Version: 0.98.1
|
||||
Version: 0.98.1-1
|
||||
Homepage: https://github.com/BLAKE2/libb2
|
||||
Description: C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO BLAKE2/libb2
|
||||
|
@ -8,12 +6,18 @@ vcpkg_from_github(
|
|||
HEAD_REF master
|
||||
)
|
||||
|
||||
set(OPTIONS)
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(OPTIONS --disable-native) # requires cpuid
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
OPTIONS ${OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Source: libcrafter
|
||||
Version: 0.3
|
||||
Version: 0.3-1
|
||||
Homepage: https://github.com/pellegre/libcrafter
|
||||
Description: Libcrafter is a high level library for C++ designed to create and decode network packets.
|
||||
Build-Depends: libpcap
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platforms" ON_TARGET "Windows" "OSX")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO pellegre/libcrafter
|
||||
|
@ -11,10 +9,9 @@ vcpkg_from_github(
|
|||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
PROJECT_SUBPATH libcrafter
|
||||
OPTIONS
|
||||
--with-libpcap=${CURRENT_INSTALLED_DIR}
|
||||
"--with-libpcap=${CURRENT_INSTALLED_DIR}"
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Source: libmagic
|
||||
Version: 5.37
|
||||
Version: 5.37-1
|
||||
Homepage: https://github.com/file/file
|
||||
Description: This library can be used to classify files according to magic number tests.
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platform" ON_TARGET "Windows")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO file/file
|
||||
|
@ -10,11 +8,8 @@ vcpkg_from_github(
|
|||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
|
@ -23,7 +18,7 @@ endif()
|
|||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man/man5)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/man5)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Source: libmesh
|
||||
Version: 1.5.0
|
||||
Version: 1.5.0-1
|
||||
Homepage: https://github.com/libMesh/libmesh
|
||||
Description: The libMesh library provides a framework for the numerical simulation of partial differential equations using arbitrary unstructured discretizations on serial and parallel platforms. A major goal of the library is to provide support for adaptive mesh refinement (AMR) computations in parallel while allowing a research scientist to focus on the physics they are modeling.
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libMesh/libmesh
|
||||
|
@ -8,9 +6,18 @@ vcpkg_from_github(
|
|||
HEAD_REF master
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(OPTIONS --disable-qhull )
|
||||
endif()
|
||||
# There a lot of configure options in this port which are not yet correctly handled by VCPKG
|
||||
# To only mention two:
|
||||
# --enable-vtk-required Error if VTK is not detected by configure
|
||||
# --enable-capnp-required Error if Cap'n Proto support is not detected by
|
||||
# but there are a lot more which need to be checked/fixed
|
||||
# So this port can only be considered a Work In Progress
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS ${OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
Source: libosip2
|
||||
Version: 5.1.0-3
|
||||
Version: 5.1.0-4
|
||||
Homepage: https://www.gnu.org/software/osip/
|
||||
Description: oSIP is an LGPL implementation of SIP. It's stable, portable, flexible and compliant! -may be more-! It is used mostly with eXosip2 stack (GPL) which provides simpler API for User-Agent implementation.
|
||||
Build-Depends: pthread
|
||||
Supports: !(windows|uwp)
|
|
@ -1,5 +1,3 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} only supports Unix currently." ON_TARGET "Windows")
|
||||
|
||||
set(LIBOSIP2_VER "5.1.0")
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
|
@ -13,24 +11,18 @@ vcpkg_extract_source_archive_ex(
|
|||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(OPTIONS --enable-mt=no)
|
||||
endif()
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
NO_DEBUG
|
||||
AUTO_HOST
|
||||
AUTO_DST
|
||||
PRERUN_SHELL autogen.sh
|
||||
OPTIONS ${OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(GLOB_RECURSE LIBOSIP2_BINARIES ${CURRENT_PACKAGES_DIR}/lib *.so)
|
||||
foreach(LIBOSIP2_BINARY LIBOSIP2_BINARIES)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
file(COPY ${LIBOSIP2_BINARY} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
|
||||
endif()
|
||||
file(REMOVE ${LIBOSIP2_BINARY})
|
||||
endforeach()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
|
@ -247,8 +247,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
|
|||
else()
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
endif()
|
||||
#file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/)
|
||||
#vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
|
||||
message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done")
|
||||
else()
|
||||
if("${FEATURES}" MATCHES "openssl")
|
||||
|
@ -262,21 +261,19 @@ else()
|
|||
endif()
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
COPY_SOURCE
|
||||
OPTIONS
|
||||
${BUILD_OPTS}
|
||||
--with-includes=${CURRENT_INSTALLED_DIR}/include
|
||||
OPTIONS_RELEASE
|
||||
--exec-prefix=${CURRENT_PACKAGES_DIR}/tools/${PORT}
|
||||
--datarootdir=${CURRENT_PACKAGES_DIR}/share/${PORT}
|
||||
--with-libraries=${CURRENT_INSTALLED_DIR}/lib
|
||||
OPTIONS_DEBUG
|
||||
--exec-prefix=${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}
|
||||
--datarootdir=${CURRENT_PACKAGES_DIR}/debug/share/${PORT}
|
||||
--with-libraries=${CURRENT_INSTALLED_DIR}/debug/lib
|
||||
--enable-debug
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
# instead?
|
||||
# make -C src/include install
|
||||
# make -C src/interfaces install
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Source: libudns
|
||||
Version: 0.4-1
|
||||
Version: 0.4-2
|
||||
Homepage: https://github.com/ortclib/udns
|
||||
Description: The DNS library, udns, implements thread-safe stub DNS resolver functionality, which may be used both traditional, syncronous way and asyncronously, with application-supplied event loop.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/configure b/configure
|
||||
index dda98b3ab..6f5f8a3c8 100644
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -25,10 +25,9 @@ fi
|
||||
enable() {
|
||||
opt=`echo "$1" | sed 's/^--[^-]*-//'`
|
||||
case "$opt" in
|
||||
- ipv6) ;;
|
||||
- *) echo "configure: unrecognized option \`$1'" >&2; exit 1;;
|
||||
+ ipv6) eval enable_$opt=$2 ;;
|
||||
+ *) echo "configure: unrecognized option \`$1'" >&2;;
|
||||
esac
|
||||
- eval enable_$opt=$2
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
@@ -50,7 +49,7 @@ Optional features (all enabled by default if system supports a feature):
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
- *) echo "configure: unknown option \`$1'" >&2; exit 1 ;;
|
||||
+ *) echo "configure: unknown option \`$1'" >&2;;
|
||||
esac
|
||||
shift
|
||||
done
|
|
@ -6,15 +6,16 @@ vcpkg_from_github(
|
|||
REF udns_0_4
|
||||
SHA512 4df8def718c75872536d42a757237d6c8e0afce8a53aedd7fea73814dc5cf8b5d6c9ae8f01a8cfc76864aa8293c172f08953a6750a66749ba19a3721bb4cf2ec
|
||||
HEAD_REF master
|
||||
PATCHES ignore_unknown_options.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
DISABLE_AUTO_DST
|
||||
COPY_SOURCE
|
||||
)
|
||||
|
||||
vcpkg_build_make()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
# Install
|
||||
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
|
||||
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/libudns.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Source: libwandio
|
||||
Version: 4.2.1
|
||||
Version: 4.2.1-2
|
||||
Homepage: https://github.com/wanduow/wandio
|
||||
Description: C library for simple and efficient file IO.
|
||||
Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2
|
|
@ -0,0 +1,140 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index 4579fbb3d..f6be008c8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -112,10 +112,11 @@ AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(stddef.h inttypes.h sys/prctl.h)
|
||||
|
||||
# Checks for various "optional" libraries
|
||||
-AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0)
|
||||
+# AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0)
|
||||
+AC_SEARCH_LIBS(pthread_create, [pthreadGC pthreadVC pthread], have_pthread=1, have_pthread=0)
|
||||
|
||||
if test "$have_pthread" = 1; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lpthread"
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_pthread_create"
|
||||
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported])
|
||||
fi
|
||||
|
||||
@@ -128,12 +129,13 @@ AC_ARG_WITH([bzip2],
|
||||
|
||||
AS_IF([test "x$with_bzip2" != "xno"],
|
||||
[
|
||||
- AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no)
|
||||
+ AC_SEARCH_LIBS(BZ2_bzDecompressInit, [bz2 bz2d bzip2 bzip2d], have_bzip=yes, have_bzip=no)
|
||||
+ # AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no)
|
||||
], [have_bzip=no])
|
||||
|
||||
AS_IF([test "x$have_bzip" = "xyes"], [
|
||||
- if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lbz2"
|
||||
+ if test "$ac_cv_search_BZ2_bzDecompressInit" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_BZ2_bzDecompressInit"
|
||||
fi
|
||||
with_bzip2=yes
|
||||
AC_DEFINE(HAVE_LIBBZ2, 1, "Compiled with bzip2 support")],
|
||||
@@ -149,12 +151,13 @@ AC_ARG_WITH([zlib],
|
||||
|
||||
AS_IF([test "x$with_zlib" != "xno"],
|
||||
[
|
||||
- AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no)
|
||||
+ AC_SEARCH_LIBS(deflate, [z zlib zlibd zd], have_zlib=yes, have_zlib=no)
|
||||
+ # AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no)
|
||||
], [have_zlib=no])
|
||||
|
||||
AS_IF([test "x$have_zlib" = "xyes"], [
|
||||
- if test "$ac_cv_lib_z_deflate" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lz"
|
||||
+ if test "$ac_cv_search_deflate" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_deflate"
|
||||
fi
|
||||
AC_DEFINE(HAVE_LIBZ, 1, "Compiled with zlib support")
|
||||
with_zlib=yes],
|
||||
@@ -193,12 +196,13 @@ AC_ARG_WITH([lzma],
|
||||
|
||||
AS_IF([test "x$with_lzma" != "xno"],
|
||||
[
|
||||
- AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no)
|
||||
+ # AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no)
|
||||
+ AC_SEARCH_LIBS(lzma_free, [lzma lzmad], have_lzma=yes, have_lzma=no)
|
||||
], [have_lzma=no])
|
||||
|
||||
AS_IF([test "x$have_lzma" = "xyes"], [
|
||||
- if test "$ac_cv_lib_lzma_code" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzma"
|
||||
+ if test "$ac_cv_search_lzma_free" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_lzma_free"
|
||||
fi
|
||||
AC_DEFINE(HAVE_LIBLZMA, 1, "Compiled with lzma support")
|
||||
with_lzma=yes],
|
||||
@@ -215,12 +219,13 @@ AC_ARG_WITH([zstd],
|
||||
|
||||
AS_IF([test "x$with_zstd" != "xno"],
|
||||
[
|
||||
- AC_CHECK_LIB(zstd, ZSTD_createDStream, have_zstd=yes, have_zstd=no)
|
||||
+ AC_SEARCH_LIBS(ZSTD_createDStream, [zstd zstdd], have_zstd=yes, have_zstd=no)
|
||||
+ # AC_CHECK_LIB(zstd, ZSTD_createDStream, have_zstd=yes, have_zstd=no)
|
||||
], [have_zstd=no])
|
||||
|
||||
AS_IF([test "x$have_zstd" = "xyes"], [
|
||||
- if test "$ac_cv_lib_zstd_code" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lzstd"
|
||||
+ if test "$ac_cv_search_ZSTD_createDStream" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_ZSTD_createDStream"
|
||||
fi
|
||||
AC_DEFINE(HAVE_LIBZSTD, 1, "Compiled with zstd support")
|
||||
with_zstd=yes],
|
||||
@@ -259,25 +264,28 @@ AC_ARG_WITH([lz4],
|
||||
|
||||
AS_IF([test "x$with_lz4" != "xno"],
|
||||
[
|
||||
- AC_CHECK_LIB(lz4, LZ4F_createDecompressionContext, have_lz4f=yes, have_lz4f=no)
|
||||
+ AC_SEARCH_LIBS(LZ4F_createDecompressionContext, [lz4 lz4d], have_lz4f=yes, have_lz4f=no)
|
||||
+ # AC_CHECK_LIB(lz4, LZ4F_createDecompressionContext, have_lz4f=yes, have_lz4f=no)
|
||||
], [have_zstd=no])
|
||||
|
||||
AS_IF([test "x$have_lz4f" = "xyes"], [
|
||||
- if test "$ac_cv_lib_lz4_code" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4"
|
||||
+ if test "$ac_cv_search_LZ4F_createDecompressionContext" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4F_createDecompressionContext"
|
||||
fi
|
||||
AC_DEFINE(HAVE_LIBLZ4F, 1, "Compiled with lz4 frame support")
|
||||
- AC_CHECK_LIB(lz4, LZ4F_getVersion, have_lz4_173=yes, have_lz4_173=no)
|
||||
+ AC_SEARCH_LIBS(LZ4F_getVersion, [lz4 lz4d], have_lz4_173=yes, have_lz4_173=no)
|
||||
+ # AC_CHECK_LIB(lz4, LZ4F_getVersion, have_lz4_173=yes, have_lz4_173=no)
|
||||
if test "x$have_lz4_173" = "xyes"; then
|
||||
AC_DEFINE(HAVE_LIBLZ4_MOVABLE, 1, "If defined then liblz4 does NOT have the ERROR_srcPtr_wrong bug")
|
||||
fi
|
||||
with_lz4=frameapi],
|
||||
[
|
||||
AC_DEFINE(HAVE_LIBLZ4F, 0, "Compiled with lz4 frame support")
|
||||
- AC_CHECK_LIB(lz4, LZ4_decompress_safe_continue, have_lz4s=yes, have_lz4s=no)
|
||||
+ AC_SEARCH_LIBS(LZ4_decompress_safe_continue, [lz4 lz4d], have_lz4s=yes, have_lz4s=no)
|
||||
+ # AC_CHECK_LIB(lz4, LZ4_decompress_safe_continue, have_lz4s=yes, have_lz4s=no)
|
||||
AS_IF([test "x$have_lz4s" = "xyes"], [
|
||||
- if test "$ac_cv_lib_lz4_code" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llz4"
|
||||
+ if test "$ac_cv_search_LZ4_decompress_safe_continue" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_LZ4_decompress_safe_continue"
|
||||
fi
|
||||
AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support")
|
||||
with_lz4=streamapi
|
||||
@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
|
||||
AS_IF([test "x$with_http" != "xno"],
|
||||
[
|
||||
# we need curl_easy_pause which was added in 7.18.0
|
||||
- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
|
||||
+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl])
|
||||
+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
|
||||
], [have_curl=no])
|
||||
|
||||
AS_IF([test "x$have_curl" = "xyes"], [
|
||||
- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
|
||||
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
|
||||
+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
|
||||
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
|
||||
+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
|
||||
fi
|
||||
AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
|
||||
with_http=yes],
|
|
@ -1,18 +1,16 @@
|
|||
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platform" ON_TARGET "Windows")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO wanduow/wandio
|
||||
REF 012b646e7ba7ab191a5a2206488adfac493fcdc6
|
||||
SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d
|
||||
HEAD_REF master
|
||||
PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed.
|
||||
)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
COPY_SOURCE
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Source: libxslt
|
||||
Version: 1.1.33-6
|
||||
Version: 1.1.33-7
|
||||
Homepage: https://github.com/GNOME/libxslt
|
||||
Description: Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT
|
||||
Build-Depends: libxml2, liblzma
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO GNOME/libxslt
|
||||
|
@ -105,6 +103,7 @@ else()
|
|||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
#vcpkg_fixup_pkgconfig()?
|
||||
|
||||
if (EXISTS ${CURRENT_PACKAGES_DIR}/bin/xslt-config)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/xslt-config DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Source: pfring
|
||||
Version: 2019-10-17-1
|
||||
Version: 2019-10-17-2
|
||||
Homepage: https://github.com/ntop/PF_RING
|
||||
Description: PF_RING™ is a Linux kernel module and user-space framework that allows you to process packets at high-rates while providing you a consistent API for packet processing applications.
|
||||
Build-Depends: libpcap
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 4b377c628..39cbf5cb4 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,10 +1,12 @@
|
||||
all:
|
||||
- cd kernel; make
|
||||
- cd userland; ./configure; make
|
||||
- cd drivers; make
|
||||
+ $(MAKE) -C kernel;
|
||||
+ #cd kernel; make
|
||||
+ cd userland; ./configure;
|
||||
+ $(MAKE) -C userland;
|
||||
+ $(MAKE) -C drivers;
|
||||
|
||||
install:
|
||||
- cd userland; make install
|
||||
+ $(MAKE) install -C userland;
|
||||
|
||||
clean:
|
||||
-cd kernel; make clean
|
||||
diff --git a/userland/Makefile b/userland/Makefile
|
||||
index 959470c0f..e35ca8de7 100644
|
||||
--- a/userland/Makefile
|
||||
+++ b/userland/Makefile
|
||||
@@ -9,22 +9,22 @@ lib/Makefile:
|
||||
config: lib/Makefile
|
||||
|
||||
libpfring: config
|
||||
- cd lib; make
|
||||
+ $(MAKE) -C lib
|
||||
|
||||
build_nbpf: config
|
||||
- cd nbpf; make
|
||||
+ $(MAKE) -C nbpf
|
||||
|
||||
build_c++: libpfring
|
||||
- cd c++; make
|
||||
+ $(MAKE) -C c++
|
||||
|
||||
tcpdump/Makefile:
|
||||
cd tcpdump; ./configure --with_system_libpcap=yes
|
||||
|
||||
build_tcpdump: libpfring tcpdump/Makefile
|
||||
- cd tcpdump; make
|
||||
+ $(MAKE) -C tcpdump
|
||||
|
||||
build_extcap: libpfring
|
||||
- cd wireshark/extcap; make
|
||||
+ $(MAKE) -C wireshark/extcap
|
||||
|
||||
###################
|
||||
|
||||
@@ -46,4 +46,4 @@ extcap_clean:
|
||||
cd wireshark/extcap; make clean
|
||||
|
||||
install: libpfring
|
||||
- cd lib; make install
|
||||
+ $(MAKE) -C lib install
|
|
@ -8,16 +8,20 @@ vcpkg_from_github(
|
|||
HEAD_REF dev
|
||||
PATCHES
|
||||
use-vcpkg-libpcap.patch
|
||||
makefile.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
SKIP_CONFIGURE
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
file(COPY "${SOURCE_PATH}/" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
endif()
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
file(COPY "${SOURCE_PATH}/" DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
endif()
|
||||
set(ENV{VCPKG_LIBPCAP_DIR} "${CURRENT_INSTALLED_DIR}")
|
||||
|
||||
vcpkg_build_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# Install manually because pfring cannot set prefix
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Source: sdl1
|
||||
Version: 1.2.15-10
|
||||
Version: 1.2.15-11
|
||||
Homepage: https://www.libsdl.org
|
||||
Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.
|
||||
|
|
|
@ -53,27 +53,12 @@ if (VCPKG_TARGET_IS_WINDOWS)
|
|||
else()
|
||||
message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".")
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(BUILD_SHARED yes)
|
||||
set(BUILD_STATIC no)
|
||||
else()
|
||||
set(BUILD_SHARED no)
|
||||
set(BUILD_STATIC yes)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/m4)
|
||||
file(MAKE_DIRECTORY ${SOURCE_PATH}/m4)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
NO_DEBUG
|
||||
PRERUN_SHELL autogen.sh
|
||||
OPTIONS
|
||||
--enable-shared=${BUILD_SHARED}
|
||||
--enable-static=${BUILD_STATIC}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread)
|
||||
|
||||
file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*")
|
||||
foreach (SDL1_TOOL ${SDL1_TOOLS})
|
||||
|
@ -83,4 +68,5 @@ else()
|
|||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
endif()
|
|
@ -1,5 +1,5 @@
|
|||
Source: tcl
|
||||
Version: 8.6.10-3
|
||||
Version: core-9-0-a1
|
||||
Homepage: https://github.com/tcltk/tcl
|
||||
Description: Tcl provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications.
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO tcltk/tcl
|
||||
REF 2abfa2c03ddc0419e6525f86c2c0323b2ba1932e
|
||||
SHA512 d9bc83c389cf3b95ab64b75c57eb9a2b23b957503d2dadc2d3f6854e9e784d87d9b2059a82f35accb419693bfe675b523c4751af91efac700644e118ff689fd7)
|
||||
REF 0fa6a4e5aad821a5c34fdfa070c37c3f1ffc8c8e
|
||||
SHA512 9d7f35309fe8b1a7c116639aaea50cc01699787c7afb432389bee2b9ad56a67034c45d90c9585ef1ccf15bdabf0951cbef86257c0c6aedbd2591bbfae3e93b76)
|
||||
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
||||
|
@ -92,13 +92,14 @@ if (VCPKG_TARGET_IS_WINDOWS)
|
|||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
else()
|
||||
file(REMOVE "${SOURCE_PATH}/unix/configure")
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
NO_DEBUG
|
||||
PROJECT_SUBPATH unix
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Source: x264
|
||||
Version: 157-303c484ec828ed0-7
|
||||
Version: 157-303c484ec828ed0-8
|
||||
Homepage: https://github.com/mirror/x264
|
||||
Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format
|
||||
Build-Depends: pthread (linux&osx)
|
|
@ -1,6 +1,6 @@
|
|||
set(X264_VERSION 157)
|
||||
|
||||
vcpkg_fail_port_install(ON_TARGET "Linux" "OSX")
|
||||
vcpkg_fail_port_install(ON_TARGET "OSX")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
|
@ -27,11 +27,7 @@ vcpkg_configure_make(
|
|||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_UWP)
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x264)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x264.exe ${CURRENT_PACKAGES_DIR}/tools/x264/x264.exe)
|
||||
endif()
|
||||
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl)
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/lib/pkgconfig
|
||||
|
|
|
@ -1955,7 +1955,6 @@ wxwidgets:x64-linux=fail
|
|||
x264:arm64-windows=fail
|
||||
x264:arm-uwp=fail
|
||||
x264:x64-uwp=ignore
|
||||
x264:x64-linux=fail
|
||||
x264:x64-osx=fail
|
||||
x264:x86-windows=ignore
|
||||
x264:x64-windows=ignore
|
||||
|
|
|
@ -4,16 +4,26 @@
|
|||
##
|
||||
## ## Usage:
|
||||
## ```cmake
|
||||
## vcpkg_build_make([TARGET <target>])
|
||||
## vcpkg_build_make([BUILD_TARGET <target>]
|
||||
## [ADD_BIN_TO_PATH]
|
||||
## [ENABLE_INSTALL])
|
||||
## [LOGFILE_ROOT <logfileroot>])
|
||||
## ```
|
||||
##
|
||||
## ### TARGET
|
||||
## The target passed to the configure/make build command (`./configure/make/make install`). If not specified, no target will
|
||||
## ### BUILD_TARGET
|
||||
## The target passed to the make build command (`./make <target>`). If not specified, the 'all' target will
|
||||
## be passed.
|
||||
##
|
||||
## ### ADD_BIN_TO_PATH
|
||||
## Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs.
|
||||
##
|
||||
## ### ENABLE_INSTALL
|
||||
## IF the port supports the install target use vcpkg_install_make() instead of vcpkg_build_make()
|
||||
##
|
||||
## ### BUILD_TARGET
|
||||
## The target passed to the make build command (`./make <target>`). If not specified, the 'all' target will
|
||||
## be passed.
|
||||
##
|
||||
## ## Notes:
|
||||
## This command should be preceeded by a call to [`vcpkg_configure_make()`](vcpkg_configure_make.md).
|
||||
## You can use the alias [`vcpkg_install_make()`](vcpkg_configure_make.md) function if your CMake script supports the
|
||||
|
@ -26,59 +36,92 @@
|
|||
## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
|
||||
## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
|
||||
function(vcpkg_build_make)
|
||||
cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT" "" ${ARGN})
|
||||
cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT;BUILD_TARGET" "" ${ARGN})
|
||||
|
||||
if(NOT _bc_LOGFILE_ROOT)
|
||||
set(_bc_LOGFILE_ROOT "build")
|
||||
endif()
|
||||
|
||||
if (_VCPKG_PROJECT_SUBPATH)
|
||||
set(_VCPKG_PROJECT_SUBPATH /${_VCPKG_PROJECT_SUBPATH}/)
|
||||
if(NOT _bc_BUILD_TARGET)
|
||||
set(_bc_BUILD_TARGET "all")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(_VCPKG_PREFIX ${CURRENT_PACKAGES_DIR})
|
||||
set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
|
||||
else()
|
||||
string(REPLACE " " "\ " _VCPKG_PREFIX "${CURRENT_PACKAGES_DIR}")
|
||||
string(REPLACE " " "\ " _VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}")
|
||||
endif()
|
||||
|
||||
set(MAKE )
|
||||
set(MAKE_OPTS )
|
||||
set(INSTALL_OPTS )
|
||||
if (_VCPKG_MAKE_GENERATOR STREQUAL "make")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
# Compiler requriements
|
||||
vcpkg_find_acquire_program(YASM)
|
||||
vcpkg_find_acquire_program(PERL)
|
||||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES make)
|
||||
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
||||
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
||||
|
||||
set(PATH_GLOBAL "$ENV{PATH}")
|
||||
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}")
|
||||
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
|
||||
# Set make command and install command
|
||||
set(MAKE ${BASH} --noprofile --norc -c "${_VCPKG_PROJECT_SUBPATH}make")
|
||||
# Must use absolute path to call make in windows
|
||||
set(MAKE_OPTS -j ${VCPKG_CONCURRENCY})
|
||||
set(INSTALL_OPTS install -j ${VCPKG_CONCURRENCY})
|
||||
# These should be moved into the portfile!
|
||||
# vcpkg_find_acquire_program(YASM)
|
||||
# get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
||||
# vcpkg_add_to_path("${YASM_EXE_PATH}")
|
||||
# vcpkg_find_acquire_program(PERL)
|
||||
# get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
||||
# vcpkg_add_to_path("${PERL_EXE_PATH}")
|
||||
|
||||
vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper")
|
||||
vcpkg_acquire_msys(MSYS_ROOT)
|
||||
find_program(MAKE make REQUIRED) #mingw32-make
|
||||
set(MAKE_COMMAND "${MAKE}")
|
||||
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f Makefile ${_bc_BUILD_TARGET})
|
||||
|
||||
string(REPLACE " " "\\\ " _VCPKG_PACKAGE_PREFIX ${CURRENT_PACKAGES_DIR})
|
||||
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}")
|
||||
set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} --trace -f Makefile install DESTDIR=${_VCPKG_PACKAGE_PREFIX})
|
||||
#TODO: optimize for install-data (release) and install-exec (release/debug)
|
||||
else()
|
||||
# Compiler requriements
|
||||
# set(MAKE_BASH)
|
||||
find_program(MAKE make REQUIRED)
|
||||
set(MAKE make;)
|
||||
set(MAKE_COMMAND "${MAKE}")
|
||||
# Set make command and install command
|
||||
set(MAKE_OPTS -j;${VCPKG_CONCURRENCY})
|
||||
set(INSTALL_OPTS install;-j;${VCPKG_CONCURRENCY})
|
||||
endif()
|
||||
elseif (_VCPKG_MAKE_GENERATOR STREQUAL "nmake")
|
||||
find_program(NMAKE nmake REQUIRED)
|
||||
get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
|
||||
set(PATH_GLOBAL "$ENV{PATH}")
|
||||
set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
|
||||
set(ENV{CL} "$ENV{CL} /MP")
|
||||
# Set make command and install command
|
||||
set(MAKE ${NMAKE} /NOLOGO /G /U)
|
||||
set(MAKE_OPTS -f makefile all)
|
||||
set(INSTALL_OPTS install)
|
||||
else()
|
||||
message(FATAL_ERROR "${_VCPKG_MAKE_GENERATOR} not supported.")
|
||||
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f Makefile ${_bc_BUILD_TARGET})
|
||||
set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR})
|
||||
endif()
|
||||
|
||||
set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
|
||||
# Backup enviromnent variables
|
||||
set(C_FLAGS_BACKUP "$ENV{CFLAGS}")
|
||||
set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}")
|
||||
set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}")
|
||||
set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}")
|
||||
set(INCLUDE_BACKUP "$ENV{INCLUDE}")
|
||||
set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}")
|
||||
set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}")
|
||||
_vcpkg_backup_env_variable(LD_LIBRARY_PATH)
|
||||
_vcpkg_backup_env_variable(LIBRARY_PATH)
|
||||
set(LIBPATH_BACKUP "$ENV{LIBPATH}")
|
||||
|
||||
# Setup include enviromnent
|
||||
set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}")
|
||||
set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}")
|
||||
|
||||
# Setup global flags
|
||||
set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}")
|
||||
set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}")
|
||||
set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
string(APPEND C_FLAGS_GLOBAL " -fPIC")
|
||||
string(APPEND CXX_FLAGS_GLOBAL " -fPIC")
|
||||
else()
|
||||
string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS")
|
||||
string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS")
|
||||
string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
||||
string(APPEND LD_FLAGS_GLOBAL " /machine:x64")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
|
||||
string(APPEND LD_FLAGS_GLOBAL " /machine:x86")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(BUILDTYPE "debug" "release")
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
|
||||
|
@ -88,6 +131,7 @@ function(vcpkg_build_make)
|
|||
continue()
|
||||
endif()
|
||||
set(SHORT_BUILDTYPE "-dbg")
|
||||
set(CMAKE_BUILDTYPE "DEBUG")
|
||||
else()
|
||||
# In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
|
||||
if (_VCPKG_NO_DEBUG)
|
||||
|
@ -95,44 +139,69 @@ function(vcpkg_build_make)
|
|||
else()
|
||||
set(SHORT_BUILDTYPE "-rel")
|
||||
endif()
|
||||
set(CMAKE_BUILDTYPE "RELEASE")
|
||||
endif()
|
||||
|
||||
if (CMAKE_HOST_WIN32)
|
||||
# In windows we can remotely call make
|
||||
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
|
||||
else()
|
||||
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
|
||||
endif()
|
||||
set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
|
||||
|
||||
message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
|
||||
|
||||
if(_bc_ADD_BIN_TO_PATH)
|
||||
set(_BACKUP_ENV_PATH "$ENV{PATH}")
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(_PATHSEP ";")
|
||||
else()
|
||||
set(_PATHSEP ":")
|
||||
endif()
|
||||
if(BUILDTYPE STREQUAL "debug")
|
||||
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin${_PATHSEP}$ENV{PATH}")
|
||||
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin")
|
||||
else()
|
||||
set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}")
|
||||
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_execute_build_process(
|
||||
COMMAND "${MAKE} ${MAKE_OPTS}"
|
||||
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
||||
LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
|
||||
)
|
||||
set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" TMP_CFLAGS "${TMP_CFLAGS}")
|
||||
set(ENV{CFLAGS} ${TMP_CFLAGS})
|
||||
|
||||
set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" TMP_CXXFLAGS "${TMP_CXXFLAGS}")
|
||||
set(ENV{CXXFLAGS} ${TMP_CXXFLAGS})
|
||||
|
||||
set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" TMP_LDFLAGS "${TMP_LDFLAGS}")
|
||||
set(ENV{LDFLAGS} ${TMP_LDFLAGS})
|
||||
|
||||
string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}")
|
||||
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}")
|
||||
string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}")
|
||||
if(BUILDTYPE STREQUAL "debug")
|
||||
set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}/debug)
|
||||
else()
|
||||
set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF})
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(ENV{CFLAGS} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
|
||||
if(BUILDTYPE STREQUAL "debug")
|
||||
set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/debug/lib/ -L${_VCPKG_INSTALLED}/debug/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
else()
|
||||
set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/lib/ -L${_VCPKG_INSTALLED}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}")
|
||||
set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MAKE_BASH)
|
||||
set(MAKE_CMD_LINE "${MAKE_COMMAND} ${MAKE_OPTS}")
|
||||
else()
|
||||
set(MAKE_CMD_LINE ${MAKE_COMMAND} ${MAKE_OPTS})
|
||||
endif()
|
||||
vcpkg_execute_build_process(
|
||||
COMMAND "${MAKE};${MAKE_OPTS}"
|
||||
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
||||
COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
|
||||
WORKING_DIRECTORY "${WORKING_DIRECTORY}"
|
||||
LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(_bc_ADD_BIN_TO_PATH)
|
||||
set(ENV{PATH} "${_BACKUP_ENV_PATH}")
|
||||
|
@ -159,27 +228,44 @@ function(vcpkg_build_make)
|
|||
endif()
|
||||
|
||||
message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
# In windows we can remotely call make
|
||||
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
|
||||
vcpkg_execute_build_process(
|
||||
COMMAND "${MAKE} ${INSTALL_OPTS}"
|
||||
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
||||
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
|
||||
)
|
||||
|
||||
if(MAKE_BASH)
|
||||
set(MAKE_CMD_LINE "${MAKE_COMMAND} ${INSTALL_OPTS}")
|
||||
else()
|
||||
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
|
||||
set(MAKE_CMD_LINE ${MAKE_COMMAND} ${INSTALL_OPTS})
|
||||
endif()
|
||||
|
||||
set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
|
||||
vcpkg_execute_build_process(
|
||||
COMMAND "${MAKE};${INSTALL_OPTS}"
|
||||
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
||||
COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
|
||||
WORKING_DIRECTORY "${WORKING_DIRECTORY}"
|
||||
LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}_tmp")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${_VCPKG_INSTALL_PREFIX}/" "${CURRENT_PACKAGES_DIR}")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp")
|
||||
endif()
|
||||
|
||||
# Restore enviromnent
|
||||
set(ENV{CFLAGS} "${C_FLAGS_BACKUP}")
|
||||
set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}")
|
||||
set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}")
|
||||
|
||||
set(ENV{INCLUDE} "${INCLUDE_BACKUP}")
|
||||
set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}")
|
||||
_vcpkg_restore_env_variable(LIBRARY_PATH)
|
||||
_vcpkg_restore_env_variable(LD_LIBRARY_PATH)
|
||||
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(ENV{PATH} "${PATH_GLOBAL}")
|
||||
endif()
|
||||
|
||||
|
||||
endfunction()
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
## vcpkg_configure_make(
|
||||
## SOURCE_PATH <${SOURCE_PATH}>
|
||||
## [AUTOCONFIG]
|
||||
## [DISABLE_AUTO_HOST]
|
||||
## [DISABLE_AUTO_DST]
|
||||
## [GENERATOR]
|
||||
## [NO_DEBUG]
|
||||
## [SKIP_CONFIGURE]
|
||||
## [PROJECT_SUBPATH <${PROJ_SUBPATH}>]
|
||||
|
@ -28,10 +25,6 @@
|
|||
## ### PROJECT_SUBPATH
|
||||
## Specifies the directory containing the ``configure`/`configure.ac`.
|
||||
## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
|
||||
## Should use `GENERATOR NMake` first.
|
||||
##
|
||||
## ### NO_DEBUG
|
||||
## This port doesn't support debug mode.
|
||||
##
|
||||
## ### SKIP_CONFIGURE
|
||||
## Skip configure process
|
||||
|
@ -39,21 +32,8 @@
|
|||
## ### AUTOCONFIG
|
||||
## Need to use autoconfig to generate configure file.
|
||||
##
|
||||
## ### DISABLE_AUTO_HOST
|
||||
## Don't set host automatically, the default value is `i686`.
|
||||
## If use this option, you will need to set host manually.
|
||||
##
|
||||
## ### DISABLE_AUTO_DST
|
||||
## Don't set installation path automatically, the default value is `${CURRENT_PACKAGES_DIR}` and `${CURRENT_PACKAGES_DIR}/debug`
|
||||
## If use this option, you will need to set dst path manually.
|
||||
##
|
||||
## ### GENERATOR
|
||||
## Specifies the precise generator to use.
|
||||
## NMake: nmake(windows) make(unix)
|
||||
## MAKE: make(windows) make(unix)
|
||||
##
|
||||
## ### PRERUN_SHELL
|
||||
## Script that needs to be called before configuration
|
||||
## Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure)
|
||||
##
|
||||
## ### OPTIONS
|
||||
## Additional options passed to configure during the configuration.
|
||||
|
@ -73,300 +53,444 @@
|
|||
## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
|
||||
## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
|
||||
## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
|
||||
macro(_vcpkg_determine_host)
|
||||
# --build: the machine you are building on
|
||||
# --host: the machine you are building for
|
||||
# --target: the machine that GCC will produce binary for
|
||||
set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE})
|
||||
set(MINGW_W w64)
|
||||
set(MINGW_PACKAGES)
|
||||
#message(STATUS "${HOST_ARCH}")
|
||||
if(HOST_ARCH MATCHES "(amd|AMD)64")
|
||||
set(MSYS_HOST x86_64)
|
||||
set(HOST_ARCH x64)
|
||||
set(BITS 64)
|
||||
#list(APPEND MINGW_PACKAGES mingw-w64-x86_64-cccl)
|
||||
elseif(HOST_ARCH MATCHES "(x|X)86")
|
||||
set(MSYS_HOST i686)
|
||||
set(HOST_ARCH x86)
|
||||
set(BITS 32)
|
||||
#list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl)
|
||||
elseif(HOST_ARCH MATCHES "^(ARM|arm)64$")
|
||||
set(MSYS_HOST arm)
|
||||
set(HOST_ARCH arm)
|
||||
set(BITS 32)
|
||||
#list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl)
|
||||
elseif(HOST_ARCH MATCHES "^(ARM|arm)$")
|
||||
set(MSYS_HOST arm)
|
||||
set(HOST_ARCH arm)
|
||||
set(BITS 32)
|
||||
#list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl)
|
||||
message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" )
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" )
|
||||
endif()
|
||||
set(TARGET_ARCH ${VCPKG_TARGET_ARCHITECTURE})
|
||||
endmacro()
|
||||
|
||||
macro(_vcpkg_backup_env_variable envvar)
|
||||
if(ENV{${envvar}})
|
||||
set(${envvar}_BACKUP "$ENV{${envvar}}")
|
||||
set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}")
|
||||
else()
|
||||
set(${envvar}_PATHLIKE_CONCAT)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(_vcpkg_restore_env_variable envvar)
|
||||
if(${envvar}_BACKUP)
|
||||
set(ENV{${envvar}} ${${envvar}_BACKUP})
|
||||
else()
|
||||
unset(ENV{${envvar}})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
function(vcpkg_configure_make)
|
||||
cmake_parse_arguments(_csc
|
||||
"AUTOCONFIG;DISABLE_AUTO_HOST;DISABLE_AUTO_DST;NO_DEBUG;SKIP_CONFIGURE"
|
||||
"SOURCE_PATH;PROJECT_SUBPATH;GENERATOR;PRERUN_SHELL"
|
||||
"AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE"
|
||||
"SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL"
|
||||
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE"
|
||||
${ARGN}
|
||||
)
|
||||
# Backup enviromnent variables
|
||||
set(C_FLAGS_BACKUP "$ENV{CFLAGS}")
|
||||
set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}")
|
||||
set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}")
|
||||
set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}")
|
||||
set(INCLUDE_BACKUP "$ENV{INCLUDE}")
|
||||
set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}")
|
||||
set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}")
|
||||
#set(LD_LIBRARY_PATH_BACKUP "$ENV{LD_LIBRARY_PATH}")
|
||||
_vcpkg_backup_env_variable(LD_LIBRARY_PATH)
|
||||
#set(LIBRARY_PATH_BACKUP "$ENV{LIBRARY_PATH}")
|
||||
_vcpkg_backup_env_variable(LIBRARY_PATH)
|
||||
set(LIBPATH_BACKUP "$ENV{LIBPATH}")
|
||||
|
||||
if(NOT VCPKG_PLATFORM_TOOLSET)
|
||||
message(FATAL_ERROR "Vcpkg has been updated with VS2017 support; "
|
||||
"however, vcpkg.exe must be rebuilt by re-running bootstrap-vcpkg.bat\n")
|
||||
if(${CURRENT_PACKAGES_DIR} MATCHES " " OR ${CURRENT_INSTALLED_DIR} MATCHES " ")
|
||||
# Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)!
|
||||
message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail")
|
||||
endif()
|
||||
|
||||
if (_csc_OPTIONS_DEBUG STREQUAL _csc_OPTIONS_RELEASE OR NMAKE_OPTION_RELEASE STREQUAL NMAKE_OPTION_DEBUG)
|
||||
message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_configure_make")
|
||||
endif()
|
||||
# Select compiler
|
||||
if(_csc_GENERATOR MATCHES "NMake")
|
||||
message(FATAL_ERROR "Sorry, NMake does not supported currently.")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(GENERATOR "nmake")
|
||||
else()
|
||||
set(GENERATOR "make")
|
||||
endif()
|
||||
elseif(NOT _csc_GENERATOR OR _csc_GENERATOR MATCHES "MAKE")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(GENERATOR "make")
|
||||
else()
|
||||
set(GENERATOR "make")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "${_csc_GENERATOR} not supported.")
|
||||
endif()
|
||||
|
||||
set(WIN_TARGET_ARCH )
|
||||
set(WIN_TARGET_COMPILER )
|
||||
# Detect compiler
|
||||
if (GENERATOR STREQUAL "nmake")
|
||||
message(STATUS "Using generator NMAKE")
|
||||
find_program(NMAKE nmake REQUIRED)
|
||||
elseif (GENERATOR STREQUAL "make")
|
||||
message(STATUS "Using generator make")
|
||||
find_program(MAKE make REQUIRED)
|
||||
else()
|
||||
message(FATAL_ERROR "${GENERATOR} not supported.")
|
||||
endif()
|
||||
# Pre-processing windows configure requirements
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_find_acquire_program(YASM)
|
||||
vcpkg_find_acquire_program(PERL)
|
||||
set(MSYS_REQUIRE_PACKAGES diffutils)
|
||||
# YASM and PERL are not strictly required by all ports.
|
||||
# So this should probably be moved into the portfile
|
||||
# vcpkg_find_acquire_program(YASM)
|
||||
# get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
||||
# vcpkg_add_to_path("${YASM_EXE_PATH}")
|
||||
|
||||
# vcpkg_find_acquire_program(PERL)
|
||||
# get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
||||
# vcpkg_add_to_path("${PERL_EXE_PATH}")
|
||||
|
||||
list(APPEND MSYS_REQUIRE_PACKAGES diffutils
|
||||
pkg-config
|
||||
binutils
|
||||
libtool
|
||||
gettext
|
||||
gettext-devel
|
||||
make)
|
||||
if (_csc_AUTOCONFIG)
|
||||
set(MSYS_REQUIRE_PACKAGES ${MSYS_REQUIRE_PACKAGES} autoconf automake m4 libtool perl)
|
||||
list(APPEND MSYS_REQUIRE_PACKAGES autoconf
|
||||
autoconf-archive
|
||||
automake
|
||||
m4
|
||||
)
|
||||
endif()
|
||||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES})
|
||||
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
||||
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
||||
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
|
||||
set(BASH "${MSYS_ROOT}/usr/bin/bash.exe")
|
||||
|
||||
if (NOT _csc_DISABLE_AUTO_HOST)
|
||||
# This is required because PATH contains sort and find from Windows but the MSYS versions are needed
|
||||
# ${MSYS_ROOT}/urs/bin cannot be prepended to PATH due to other conflicts
|
||||
file(CREATE_LINK "${MSYS_ROOT}/usr/bin/sort.exe" "${SCRIPTS}/buildsystems/make_wrapper/sort.exe" COPY_ON_ERROR)
|
||||
file(CREATE_LINK "${MSYS_ROOT}/usr/bin/find.exe" "${SCRIPTS}/buildsystems/make_wrapper/find.exe" COPY_ON_ERROR)
|
||||
vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there
|
||||
|
||||
# --build: the machine you are building on
|
||||
# --host: the machine you are building for
|
||||
# --target: the machine that CC will produce binaries for
|
||||
_vcpkg_determine_host() # VCPKG_HOST => machine you are building on => --build=
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
|
||||
set(WIN_TARGET_ARCH --host=i686-pc-mingw32)
|
||||
set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=i686-pc-mingw32 --host=i686-pc-mingw32")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
||||
set(WIN_TARGET_ARCH --host=i686-pc-mingw64)
|
||||
set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm)
|
||||
set(WIN_TARGET_ARCH --host=arm-pc-mingw32)
|
||||
endif()
|
||||
endif()
|
||||
set(WIN_TARGET_COMPILER CC=cl)
|
||||
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}")
|
||||
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
|
||||
elseif (_csc_AUTOCONFIG)
|
||||
find_program(autoreconf autoreconf REQUIRED)
|
||||
set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=arm-pc-mingw32 --host=i686-pc-mingw32")
|
||||
endif()
|
||||
|
||||
if (NOT _csc_NO_DEBUG)
|
||||
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
macro(_vcpkg_append_to_configure_enviromnent inoutstring var defaultval)
|
||||
# Allows to overwrite settings in custom triplets via the enviromnent
|
||||
if(ENV{${var}})
|
||||
string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'")
|
||||
else()
|
||||
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
|
||||
string(APPEND ${inoutstring} " ${var}='${defaultval}'")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(CONFIGURE_ENV "")
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV CC "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo")
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV CXX "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo")
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV LD "link.exe -verbose")
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV AR "${MSYS_ROOT}/usr/share/automake-1.16/ar-lib lib.exe -verbose")
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV RANLIB ":") # Trick to ignore the RANLIB call
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV CCAS ":") # If required set the ENV variable CCAS in the portfile correctly
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers -all")
|
||||
# Would be better to have a true nm here! Some symbols (mainly exported variables) get not properly imported with dumpbin as nm
|
||||
# and require __declspec(dllimport) for some reason (same problem CMake has with WINDOWS_EXPORT_ALL_SYMBOLS)
|
||||
_vcpkg_append_to_configure_enviromnent(CONFIGURE_ENV DLLTOOL "link.exe -verbose -dll")
|
||||
|
||||
# Other maybe interesting variables to control
|
||||
# COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line.
|
||||
# LINK This is the command used to actually link a C program.
|
||||
# CXXCOMPILE The command used to actually compile a C++ source file. The file name is appended to form the complete command line.
|
||||
# CXXLINK The command used to actually link a C++ program.
|
||||
|
||||
#Some PATH handling for dealing with spaces....some tools will still fail with that!
|
||||
string(REPLACE " " "\\\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR})
|
||||
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PREFIX "${_VCPKG_PREFIX}")
|
||||
set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
|
||||
string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF ${CURRENT_INSTALLED_DIR})
|
||||
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF ${_VCPKG_INSTALLED_PKGCONF})
|
||||
string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF ${_VCPKG_INSTALLED_PKGCONF})
|
||||
set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile!
|
||||
else()
|
||||
string(REPLACE " " "\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR})
|
||||
string(REPLACE " " "\ " _VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
|
||||
set(_VCPKG_INSTALLED_PKGCONF ${CURRENT_INSTALLED_DIR})
|
||||
set(EXTRA_QUOTES)
|
||||
set(prefix_var "\${prefix}")
|
||||
endif()
|
||||
|
||||
if (NOT _csc_DISABLE_AUTO_DST)
|
||||
# Cleanup previous build dirs
|
||||
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
|
||||
|
||||
set(ENV{V} "1") #Enabel Verbose MODE
|
||||
|
||||
# Set configure paths
|
||||
set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE}
|
||||
--prefix=${CURRENT_PACKAGES_DIR}
|
||||
--bindir=${CURRENT_PACKAGES_DIR}/bin
|
||||
--sbindir=${CURRENT_PACKAGES_DIR}/bin
|
||||
--libdir=${CURRENT_PACKAGES_DIR}/lib
|
||||
--includedir=${CURRENT_PACKAGES_DIR}/include)
|
||||
|
||||
"--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}"
|
||||
# Important: These should all be relative to prefix!
|
||||
"--bindir=${prefix_var}/tools/${PORT}/bin"
|
||||
"--sbindir=${prefix_var}/tools/${PORT}/sbin"
|
||||
#"--libdir='\${prefix}'/lib" # already the default!
|
||||
#"--includedir='\${prefix}'/include" # already the default!
|
||||
"--mandir=${prefix_var}/share/${PORT}"
|
||||
"--docdir=${prefix_var}/share/${PORT}"
|
||||
"--datarootdir=${prefix_var}/share/${PORT}")
|
||||
set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG}
|
||||
--prefix=${CURRENT_PACKAGES_DIR}/debug
|
||||
--bindir=${CURRENT_PACKAGES_DIR}/debug/bin
|
||||
--sbindir=${CURRENT_PACKAGES_DIR}/debug/bin
|
||||
--libdir=${CURRENT_PACKAGES_DIR}/debug/lib
|
||||
--includedir=${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
endif()
|
||||
|
||||
set(base_cmd )
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(base_cmd ${BASH} --noprofile --norc -c)
|
||||
"--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}"
|
||||
# Important: These should all be relative to prefix!
|
||||
"--bindir=${prefix_var}/../tools/${PORT}/debug/bin"
|
||||
"--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin"
|
||||
#"--libdir='\${prefix}'/lib" # already the default!
|
||||
"--includedir=${prefix_var}/../include"
|
||||
"--datarootdir=${prefix_var}/share/${PORT}")
|
||||
|
||||
# Setup common options
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(_csc_OPTIONS ${_csc_OPTIONS} --enable-shared)
|
||||
list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-shared --disable-static)
|
||||
if (VCPKG_TARGET_IS_UWP)
|
||||
set(_csc_OPTIONS ${_csc_OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib)
|
||||
list(APPEND _csc_OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib)
|
||||
endif()
|
||||
else()
|
||||
set(_csc_OPTIONS ${_csc_OPTIONS} --enable-static)
|
||||
list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-static --disable-shared)
|
||||
endif()
|
||||
|
||||
file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}")
|
||||
|
||||
set(base_cmd)
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(base_cmd ${BASH} --noprofile --norc --debug)
|
||||
# Load toolchains
|
||||
if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake")
|
||||
endif()
|
||||
include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
|
||||
|
||||
set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}")
|
||||
set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}")
|
||||
set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS}")
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
# Flags should be set in the toolchain instead
|
||||
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
|
||||
set(_csc_OPTIONS ${_csc_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00)
|
||||
endif()
|
||||
|
||||
#Join the options list as a string with spaces between options
|
||||
list(JOIN _csc_OPTIONS " " _csc_OPTIONS)
|
||||
list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE)
|
||||
list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG)
|
||||
endif()
|
||||
|
||||
set(rel_command
|
||||
${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}"
|
||||
)
|
||||
set(dbg_command
|
||||
${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}"
|
||||
# Setup include enviromnent
|
||||
set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}")
|
||||
set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}")
|
||||
|
||||
# Setup global flags -> TODO: Further improve with toolchain file in mind!
|
||||
set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}")
|
||||
set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}")
|
||||
set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}")
|
||||
# Flags should be set in the toolchain instead
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
string(APPEND C_FLAGS_GLOBAL " -fPIC")
|
||||
string(APPEND CXX_FLAGS_GLOBAL " -fPIC")
|
||||
else()
|
||||
string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS")
|
||||
string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS")
|
||||
string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
||||
string(APPEND LD_FLAGS_GLOBAL " /machine:x64")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
|
||||
string(APPEND LD_FLAGS_GLOBAL " /machine:x86")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ENV{PKG_CONFIG})
|
||||
find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED)
|
||||
debug_message("Using pkg-config from: ${PKGCONFIG}")
|
||||
if(NOT PKGCONFIG)
|
||||
message(STATUS "${PORT} requires pkg-config from the system package manager (example: \"sudo apt-get install pkg-config\")")
|
||||
endif()
|
||||
else()
|
||||
debug_message("ENV{PKG_CONFIG} found! Using: $ENV{PKG_CONFIG}")
|
||||
set(PKGCONFIG $ENV{PKG_CONFIG})
|
||||
endif()
|
||||
|
||||
set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}")
|
||||
|
||||
# Run autoconf if necessary
|
||||
if(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE)
|
||||
set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac
|
||||
set(REQUIRES_AUTOGEN FALSE) # use autogen.sh
|
||||
elseif(EXISTS "${SRC_DIR}/configure.ac")
|
||||
set(REQUIRES_AUTOCONFIG TRUE)
|
||||
set(REQUIRES_AUTOGEN FALSE)
|
||||
elseif(EXISTS "${SRC_DIR}/autogen.sh")
|
||||
set(REQUIRES_AUTOGEN TRUE)
|
||||
set(REQUIRES_AUTOCONFIG FALSE)
|
||||
endif()
|
||||
set(_GENERATED_CONFIGURE FALSE)
|
||||
if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG)
|
||||
find_program(AUTORECONF autoreconf REQUIRED)
|
||||
if(NOT AUTORECONF)
|
||||
message(STATUS "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")")
|
||||
endif()
|
||||
find_program(LIBTOOL libtool REQUIRED)
|
||||
if(NOT LIBTOOL)
|
||||
message(STATUS "${PORT} requires libtool from the system package manager (example: \"sudo apt-get install libtool libtool-bin\")")
|
||||
endif()
|
||||
find_program(AUTOPOINT autopoint REQUIRED)
|
||||
if(NOT AUTOPOINT)
|
||||
message(STATUS "${PORT} requires autopoint from the system package manager (example: \"sudo apt-get install autopoint\")")
|
||||
endif()
|
||||
message(STATUS "Generating configure for ${TARGET_TRIPLET}")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd} -c "autoreconf -vfi"
|
||||
WORKING_DIRECTORY "${SRC_DIR}"
|
||||
LOGNAME autoconf-${TARGET_TRIPLET}
|
||||
)
|
||||
else()
|
||||
set(base_cmd ./)
|
||||
set(rel_command
|
||||
${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_RELEASE}"
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND autoreconf -vfi
|
||||
WORKING_DIRECTORY "${SRC_DIR}"
|
||||
LOGNAME autoconf-${TARGET_TRIPLET}
|
||||
)
|
||||
set(dbg_command
|
||||
${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_DEBUG}"
|
||||
endif()
|
||||
message(STATUS "Finished generating configure for ${TARGET_TRIPLET}")
|
||||
endif()
|
||||
if(REQUIRES_AUTOGEN)
|
||||
message(STATUS "Generating configure for ${TARGET_TRIPLET} via autogen.sh")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd} -c "./autogen.sh"
|
||||
WORKING_DIRECTORY "${SRC_DIR}"
|
||||
LOGNAME autoconf-${TARGET_TRIPLET}
|
||||
)
|
||||
else()
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "./autogen.sh"
|
||||
WORKING_DIRECTORY "${SRC_DIR}"
|
||||
LOGNAME autoconf-${TARGET_TRIPLET}
|
||||
)
|
||||
endif()
|
||||
message(STATUS "Finished generating configure for ${TARGET_TRIPLET}")
|
||||
endif()
|
||||
|
||||
if (_csc_PRERUN_SHELL)
|
||||
message(STATUS "Prerun shell with ${TARGET_TRIPLET}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd} -c "${_csc_PRERUN_SHELL}"
|
||||
WORKING_DIRECTORY "${SRC_DIR}"
|
||||
LOGNAME prerun-${TARGET_TRIPLET}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Configure debug
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT _csc_NO_DEBUG)
|
||||
if (CMAKE_HOST_WIN32)
|
||||
unset(ENV{CFLAGS})
|
||||
unset(ENV{CXXFLAGS})
|
||||
unset(ENV{LDFLAGS})
|
||||
set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
|
||||
string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}")
|
||||
set(ENV{CFLAGS} ${TMP_CFLAGS})
|
||||
set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}")
|
||||
set(ENV{CXXFLAGS} ${TMP_CXXFLAGS})
|
||||
set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL}")
|
||||
string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}")
|
||||
set(ENV{LDFLAGS} ${TMP_LDFLAGS})
|
||||
endif()
|
||||
|
||||
set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
||||
set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH})
|
||||
|
||||
file(MAKE_DIRECTORY ${OBJ_DIR})
|
||||
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*)
|
||||
foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
|
||||
get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
|
||||
string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
|
||||
file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (_csc_PRERUN_SHELL)
|
||||
message(STATUS "Prerun shell with ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd}${_csc_PRERUN_SHELL}
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME prerun-${TARGET_TRIPLET}-dbg
|
||||
)
|
||||
endif()
|
||||
|
||||
if (_csc_AUTOCONFIG)
|
||||
message(STATUS "Generating configure with ${TARGET_TRIPLET}-dbg")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd} autoreconf -vfi
|
||||
WORKING_DIRECTORY ${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}
|
||||
LOGNAME prerun-${TAR_TRIPLET_DIR}
|
||||
)
|
||||
set(_VAR_SUFFIX DEBUG)
|
||||
set(PATH_SUFFIX_${_VAR_SUFFIX} "/debug")
|
||||
set(SHORT_NAME_${_VAR_SUFFIX} "dbg")
|
||||
list(APPEND _buildtypes ${_VAR_SUFFIX})
|
||||
if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead
|
||||
string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}")
|
||||
else()
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND autoreconf -vfi
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME prerun-${TAR_TRIPLET_DIR}
|
||||
)
|
||||
set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}")
|
||||
set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}")
|
||||
set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}")
|
||||
endif()
|
||||
unset(_VAR_SUFFIX)
|
||||
endif()
|
||||
|
||||
if (NOT _csc_SKIP_CONFIGURE)
|
||||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${dbg_command}
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME config-${TARGET_TRIPLET}-dbg
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Configure release
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
unset(ENV{CFLAGS})
|
||||
unset(ENV{CXXFLAGS})
|
||||
unset(ENV{LDFLAGS})
|
||||
set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
|
||||
string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}")
|
||||
set(ENV{CFLAGS} ${TMP_CFLAGS})
|
||||
|
||||
set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}")
|
||||
set(ENV{CXXFLAGS} ${TMP_CXXFLAGS})
|
||||
|
||||
set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}")
|
||||
set(ENV{LDFLAGS} ${TMP_LDFLAGS})
|
||||
endif()
|
||||
|
||||
if (_csc_NO_DEBUG)
|
||||
set(TAR_TRIPLET_DIR ${TARGET_TRIPLET})
|
||||
set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR})
|
||||
set(_VAR_SUFFIX RELEASE)
|
||||
set(PATH_SUFFIX_${_VAR_SUFFIX} "")
|
||||
set(SHORT_NAME_${_VAR_SUFFIX} "rel")
|
||||
list(APPEND _buildtypes ${_VAR_SUFFIX})
|
||||
if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead
|
||||
string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}")
|
||||
string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}")
|
||||
else()
|
||||
set(TAR_TRIPLET_DIR ${TARGET_TRIPLET}-rel)
|
||||
set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR})
|
||||
set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}")
|
||||
set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}")
|
||||
set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}")
|
||||
endif()
|
||||
set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH})
|
||||
|
||||
file(MAKE_DIRECTORY ${OBJ_DIR})
|
||||
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*)
|
||||
foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
|
||||
get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
|
||||
string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
|
||||
file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
|
||||
endforeach()
|
||||
unset(_VAR_SUFFIX)
|
||||
endif()
|
||||
|
||||
if (_csc_PRERUN_SHELL)
|
||||
message(STATUS "Prerun shell with ${TAR_TRIPLET_DIR}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd}${_csc_PRERUN_SHELL}
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME prerun-${TAR_TRIPLET_DIR}
|
||||
)
|
||||
foreach(_buildtype IN LISTS _buildtypes)
|
||||
set(TAR_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}")
|
||||
file(MAKE_DIRECTORY "${TAR_DIR}")
|
||||
file(RELATIVE_PATH RELATIVE_BUILD_PATH "${TAR_DIR}" "${SRC_DIR}")
|
||||
|
||||
if(_csc_COPY_SOURCE)
|
||||
file(COPY "${SRC_DIR}/" DESTINATION "${TAR_DIR}")
|
||||
set(RELATIVE_BUILD_PATH .)
|
||||
endif()
|
||||
|
||||
if (_csc_AUTOCONFIG)
|
||||
message(STATUS "Generating configure with ${TAR_TRIPLET_DIR}")
|
||||
if (CMAKE_HOST_WIN32)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${base_cmd} autoreconf -vfi
|
||||
WORKING_DIRECTORY ${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}
|
||||
LOGNAME prerun-${TAR_TRIPLET_DIR}
|
||||
)
|
||||
set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_buildtype}}/lib/pkgconfig")
|
||||
set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig")
|
||||
|
||||
if(ENV{PKG_CONFIG_PATH})
|
||||
set(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype} $ENV{PKG_CONFIG_PATH})
|
||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:$ENV{PKG_CONFIG_PATH}")
|
||||
else()
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND autoreconf -vfi
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME prerun-${TAR_TRIPLET_DIR}
|
||||
)
|
||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}")
|
||||
endif()
|
||||
|
||||
# Setup enviromnent
|
||||
set(ENV{CFLAGS} ${CFLAGS_${_buildtype}})
|
||||
set(ENV{CXXFLAGS} ${CXXFLAGS_${_buildtype}})
|
||||
set(ENV{LDFLAGS} ${LDFLAGS_${_buildtype}})
|
||||
set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}")
|
||||
set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib${VCPKG_HOST_PATH_SEPARATOR}${LIBPATH_BACKUP}")
|
||||
|
||||
set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}")
|
||||
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${BUILD_TARGET} ${HOST_TYPE}${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}")
|
||||
else()
|
||||
set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}})
|
||||
endif()
|
||||
|
||||
if (NOT _csc_SKIP_CONFIGURE)
|
||||
message(STATUS "Configuring ${TAR_TRIPLET_DIR}")
|
||||
message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${rel_command}
|
||||
WORKING_DIRECTORY ${PRJ_DIR}
|
||||
LOGNAME config-${TAR_TRIPLET_DIR}
|
||||
COMMAND ${command}
|
||||
WORKING_DIRECTORY "${TAR_DIR}"
|
||||
LOGNAME config-${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}
|
||||
)
|
||||
if(EXISTS "${TAR_DIR}/libtool" AND VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(_file "${TAR_DIR}/libtool")
|
||||
file(READ "${_file}" _contents)
|
||||
string(REPLACE ".dll.lib" ".lib" _contents "${_contents}")
|
||||
file(WRITE "${_file}" "${_contents}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Restore envs
|
||||
if (CMAKE_HOST_WIN32)
|
||||
set(ENV{CFLAGS} "${C_FLAGS_GLOBAL}")
|
||||
set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL}")
|
||||
set(ENV{LDFLAGS} "${LD_FLAGS_GLOBAL}")
|
||||
if(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype})
|
||||
set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}}")
|
||||
else()
|
||||
unset(ENV{PKG_CONFIG_PATH})
|
||||
endif()
|
||||
unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype})
|
||||
endforeach()
|
||||
|
||||
set(_VCPKG_MAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE)
|
||||
set(_VCPKG_NO_DEBUG ${_csc_NO_DEBUG} PARENT_SCOPE)
|
||||
# Restore enviromnent
|
||||
set(ENV{CFLAGS} "${C_FLAGS_BACKUP}")
|
||||
set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}")
|
||||
set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}")
|
||||
|
||||
set(ENV{INCLUDE} "${INCLUDE_BACKUP}")
|
||||
set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}")
|
||||
set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}")
|
||||
_vcpkg_restore_env_variable(LIBRARY_PATH)
|
||||
_vcpkg_restore_env_variable(LD_LIBRARY_PATH)
|
||||
set(ENV{LIBPATH} "${LIBPATH_BACKUP}")
|
||||
SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE)
|
||||
set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
|
|
@ -144,6 +144,8 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib
|
|||
# endif()
|
||||
# get_filename_component(PTHREAD_LIB "${PTHREAD_LIB}" NAME_WE)
|
||||
# string(REPLACE "Libs: -pthread" "Libs: -L\${libdir} -l${PTHREAD_LIB}" _contents ${_contents})
|
||||
elseif(_lib STREQUAL _ignore_flags)
|
||||
message(STATUS "${_lib} found in *.pc file and ignored!")
|
||||
else()
|
||||
message(FATAL_ERROR "Found ${_lib} and no rule to analyse the flag! Please check the *.pc file")
|
||||
endif()
|
||||
|
@ -240,7 +242,6 @@ function(vcpkg_fixup_pkgconfig)
|
|||
message(STATUS "Checking file: ${_file}")
|
||||
get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY)
|
||||
file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/")
|
||||
message(STATUS "REL PATH: ${RELATIVE_PC_PATH}")
|
||||
string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}")
|
||||
string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}")
|
||||
file(READ "${_file}" _contents)
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
|
||||
|
||||
function(vcpkg_install_make)
|
||||
vcpkg_build_make(LOGFILE_ROOT ENABLE_INSTALL)
|
||||
vcpkg_build_make(${ARGN} LOGFILE_ROOT ENABLE_INSTALL)
|
||||
endfunction()
|
||||
|
|
Загрузка…
Ссылка в новой задаче