mirror of https://github.com/microsoft/vcpkg.git
[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang (#27787)
This commit is contained in:
parent
1e2c7c3d57
commit
e461f6dc35
|
|
@ -0,0 +1,73 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index bd92bc4..bd2c0af 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3704,6 +3704,8 @@ if test "$gmp_asm_syntax_testing" != no; then
|
||||
case $host in
|
||||
*-*-darwin*)
|
||||
GMP_INCLUDE_MPN(arm64/darwin.m4) ;;
|
||||
+ *-pc-mingw32)
|
||||
+ GMP_INCLUDE_MPN(arm64/coff.m4) ;;
|
||||
*)
|
||||
GMP_INCLUDE_MPN(arm64/arm64-defs.m4) ;;
|
||||
esac
|
||||
diff --git a/mpn/arm64/coff.m4 b/mpn/arm64/coff.m4
|
||||
new file mode 100644
|
||||
index 0000000..88605b3
|
||||
--- /dev/null
|
||||
+++ b/mpn/arm64/coff.m4
|
||||
@@ -0,0 +1,54 @@
|
||||
+divert(-1)
|
||||
+
|
||||
+dnl m4 macros for ARM64 COFF assembler.
|
||||
+
|
||||
+dnl Copyright 2020 Free Software Foundation, Inc.
|
||||
+
|
||||
+dnl This file is part of the GNU MP Library.
|
||||
+dnl
|
||||
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
||||
+dnl it under the terms of either:
|
||||
+dnl
|
||||
+dnl * the GNU Lesser General Public License as published by the Free
|
||||
+dnl Software Foundation; either version 3 of the License, or (at your
|
||||
+dnl option) any later version.
|
||||
+dnl
|
||||
+dnl or
|
||||
+dnl
|
||||
+dnl * the GNU General Public License as published by the Free Software
|
||||
+dnl Foundation; either version 2 of the License, or (at your option) any
|
||||
+dnl later version.
|
||||
+dnl
|
||||
+dnl or both in parallel, as here.
|
||||
+dnl
|
||||
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
||||
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+dnl for more details.
|
||||
+dnl
|
||||
+dnl You should have received copies of the GNU General Public License and the
|
||||
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
||||
+dnl see https://www.gnu.org/licenses/.
|
||||
+
|
||||
+
|
||||
+dnl Standard commenting is with @, the default m4 # is for constants and we
|
||||
+dnl don't want to disable macro expansions in or after them.
|
||||
+
|
||||
+changecom
|
||||
+
|
||||
+
|
||||
+dnl LEA_HI(reg,gmp_symbol), LEA_LO(reg,gmp_symbol)
|
||||
+dnl
|
||||
+dnl Load the address of gmp_symbol into a register. We split this into two
|
||||
+dnl parts to allow separation for manual insn scheduling.
|
||||
+
|
||||
+define(`LEA_HI', `ldr $1, =$2')dnl
|
||||
+define(`LEA_LO')dnl
|
||||
+
|
||||
+dnl Usage: ALIGN(bytes)
|
||||
+dnl
|
||||
+dnl Emit a ".align" directive.
|
||||
+
|
||||
+define(`ALIGN', ` .align 8')dnl
|
||||
+
|
||||
+divert`'dnl
|
||||
|
|
@ -33,51 +33,14 @@ diff --git a/mpn/Makeasm.am b/mpn/Makeasm.am
|
|||
index 5d7306c22..75692128d 100644
|
||||
--- a/mpn/Makeasm.am
|
||||
+++ b/mpn/Makeasm.am
|
||||
@@ -32,7 +32,7 @@
|
||||
@@ -31,8 +31,9 @@
|
||||
|
||||
# COMPILE minus CC.
|
||||
#
|
||||
+# Only used with CCAS
|
||||
COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
|
||||
+ $(CPPFLAGS) $(ASMFLAGS)
|
||||
|
||||
# Flags used for preprocessing (in ansi2knr rules).
|
||||
#
|
||||
diff --git a/mpn/Makefile.in b/mpn/Makefile.in
|
||||
index 2bc061012..59c805976 100644
|
||||
--- a/mpn/Makefile.in
|
||||
+++ b/mpn/Makefile.in
|
||||
@@ -403,7 +403,7 @@ EXTRA_DIST = asm-defs.m4 cpp-ccas m4-ccas $(TARG_DIST)
|
||||
# COMPILE minus CC.
|
||||
#
|
||||
COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
|
||||
+ $(CPPFLAGS) $(ASMFLAGS)
|
||||
|
||||
|
||||
# Flags used for preprocessing (in ansi2knr rules).
|
||||
diff --git a/tests/Makefile.in b/tests/Makefile.in
|
||||
index 9742a4016..430603cef 100644
|
||||
--- a/tests/Makefile.in
|
||||
+++ b/tests/Makefile.in
|
||||
@@ -666,7 +666,7 @@ SUBDIRS = . devel mpn mpz mpq mpf rand misc cxx
|
||||
# COMPILE minus CC.
|
||||
#
|
||||
COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
|
||||
+ $(CPPFLAGS) $(ASMFLAGS)
|
||||
|
||||
|
||||
# Flags used for preprocessing (in ansi2knr rules).
|
||||
diff --git a/tune/Makefile.in b/tune/Makefile.in
|
||||
index f82cd13e2..351bcd9b1 100644
|
||||
--- a/tune/Makefile.in
|
||||
+++ b/tune/Makefile.in
|
||||
@@ -549,7 +549,7 @@ TUNE_MPN_SRCS_BASIC = div_qr_2.c bdiv_q.c bdiv_qr.c \
|
||||
# COMPILE minus CC.
|
||||
#
|
||||
COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS)
|
||||
+ $(CPPFLAGS) $(ASMFLAGS)
|
||||
|
||||
|
||||
# Flags used for preprocessing (in ansi2knr rules).
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 1c24694..9f92a4f 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -1,3 +1,7 @@
|
||||
+# Using native tools, either this build or from host triplet
|
||||
+HOST_TOOLS_PREFIX ?= .
|
||||
+CC_FOR_BUILD = $(CC) $(CPPFLAGS) $(CFLAGS)
|
||||
+
|
||||
## Process this file with automake to generate Makefile.in
|
||||
|
||||
|
||||
@@ -344,8 +348,8 @@ install-data-hook:
|
||||
|
||||
EXTRA_DIST += bootstrap.c
|
||||
|
||||
-fac_table.h: gen-fac$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fac_table.h || (rm -f fac_table.h; exit 1)
|
||||
+fac_table.h: $(HOST_TOOLS_PREFIX)/gen-fac$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fac_table.h || (rm -f fac_table.h; exit 1)
|
||||
BUILT_SOURCES += fac_table.h
|
||||
|
||||
gen-fac$(EXEEXT_FOR_BUILD): gen-fac$(U_FOR_BUILD).c bootstrap.c
|
||||
@@ -354,12 +358,12 @@ DISTCLEANFILES += gen-fac$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-fac.c
|
||||
|
||||
|
||||
-fib_table.h: gen-fib$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1)
|
||||
+fib_table.h: $(HOST_TOOLS_PREFIX)/gen-fib$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1)
|
||||
BUILT_SOURCES += fib_table.h
|
||||
|
||||
-mpn/fib_table.c: gen-fib$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/fib_table.c || (rm -f mpn/fib_table.c; exit 1)
|
||||
+mpn/fib_table.c: $(HOST_TOOLS_PREFIX)/gen-fib$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/fib_table.c || (rm -f mpn/fib_table.c; exit 1)
|
||||
BUILT_SOURCES += mpn/fib_table.c
|
||||
|
||||
gen-fib$(EXEEXT_FOR_BUILD): gen-fib$(U_FOR_BUILD).c bootstrap.c
|
||||
@@ -368,12 +372,12 @@ DISTCLEANFILES += gen-fib$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-fib.c
|
||||
|
||||
|
||||
-mp_bases.h: gen-bases$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1)
|
||||
+mp_bases.h: $(HOST_TOOLS_PREFIX)/gen-bases$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1)
|
||||
BUILT_SOURCES += mp_bases.h
|
||||
|
||||
-mpn/mp_bases.c: gen-bases$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/mp_bases.c || (rm -f mpn/mp_bases.c; exit 1)
|
||||
+mpn/mp_bases.c: $(HOST_TOOLS_PREFIX)/gen-bases$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/mp_bases.c || (rm -f mpn/mp_bases.c; exit 1)
|
||||
BUILT_SOURCES += mpn/mp_bases.c
|
||||
|
||||
gen-bases$(EXEEXT_FOR_BUILD): gen-bases$(U_FOR_BUILD).c bootstrap.c
|
||||
@@ -382,8 +386,8 @@ DISTCLEANFILES += gen-bases$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-bases.c
|
||||
|
||||
|
||||
-trialdivtab.h: gen-trialdivtab$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1)
|
||||
+trialdivtab.h: $(HOST_TOOLS_PREFIX)/gen-trialdivtab$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1)
|
||||
BUILT_SOURCES += trialdivtab.h
|
||||
|
||||
gen-trialdivtab$(EXEEXT_FOR_BUILD): gen-trialdivtab$(U_FOR_BUILD).c bootstrap.c
|
||||
@@ -392,8 +396,8 @@ DISTCLEANFILES += gen-trialdivtab$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-trialdivtab.c
|
||||
|
||||
|
||||
-mpn/jacobitab.h: gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1)
|
||||
+mpn/jacobitab.h: $(HOST_TOOLS_PREFIX)/gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1)
|
||||
BUILT_SOURCES += mpn/jacobitab.h
|
||||
|
||||
gen-jacobitab$(EXEEXT_FOR_BUILD): gen-jacobitab$(U_FOR_BUILD).c
|
||||
@@ -402,8 +406,8 @@ DISTCLEANFILES += gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-jacobitab.c
|
||||
|
||||
|
||||
-mpn/perfsqr.h: gen-psqr$(EXEEXT_FOR_BUILD)
|
||||
- ./gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1)
|
||||
+mpn/perfsqr.h: $(HOST_TOOLS_PREFIX)/gen-psqr$(EXEEXT_FOR_BUILD)
|
||||
+ $(HOST_TOOLS_PREFIX)/gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1)
|
||||
BUILT_SOURCES += mpn/perfsqr.h
|
||||
|
||||
gen-psqr$(EXEEXT_FOR_BUILD): gen-psqr$(U_FOR_BUILD).c bootstrap.c
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index 86175ce..82b7ea1 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -3833,6 +3833,7 @@ if AC_TRY_EVAL(gmp_compile); then
|
||||
if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&AC_FD_CC 2>&1; then
|
||||
cc_for_build_works=yes
|
||||
fi
|
||||
+ cc_for_build_works=yes # forced
|
||||
fi
|
||||
rm -f conftest* a.out b.out a.exe a_out.exe
|
||||
AC_MSG_RESULT($cc_for_build_works)
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index cafdb3c71..bd92bc4bb 100644
|
||||
index cafdb3c..3c3e3c8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2703,8 +2703,8 @@ Use "--disable-static --enable-shared" to build just a DLL.])
|
||||
@@ -2702,9 +2702,7 @@ Use "--disable-static --enable-shared" to build just a DLL.])
|
||||
# __isascii, but for some reason not the plain isascii.
|
||||
#
|
||||
if test "$enable_shared" = yes; then
|
||||
GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
|
||||
- GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols"
|
||||
- LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
|
||||
- LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
|
||||
+ #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def"
|
||||
+ #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def"
|
||||
+ GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined"
|
||||
LIBGMP_DLL=1
|
||||
fi
|
||||
;;
|
||||
diff --git a/gmp-h.in b/gmp-h.in
|
||||
index 3d449d427..18a03b753 100644
|
||||
index 3d449d4..18a03b7 100644
|
||||
--- a/gmp-h.in
|
||||
+++ b/gmp-h.in
|
||||
@@ -398,7 +398,7 @@ typedef __mpq_struct *mpq_ptr;
|
||||
|
|
|
|||
|
|
@ -2,49 +2,81 @@ if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/
|
|||
message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.")
|
||||
endif()
|
||||
|
||||
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
||||
|
||||
vcpkg_download_distfile(
|
||||
ARCHIVE
|
||||
URLS https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
|
||||
FILENAME gmp-6.2.1.tar.xz
|
||||
URLS "https://gmplib.org/download/gmp/gmp-${VERSION}.tar.xz"
|
||||
FILENAME "gmp-${VERSION}.tar.xz"
|
||||
SHA512 c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
set(PATCHES yasm.patch
|
||||
msvc_symbol.patch)
|
||||
endif()
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
REF gmp-6.2.1
|
||||
PATCHES
|
||||
${PATCHES}
|
||||
tools.patch
|
||||
# Avoid the x18 register since it is reserved on arm64 osx and windows.
|
||||
vcpkg_download_distfile(
|
||||
ARM64PATCH
|
||||
URLS https://gmplib.org/repo/gmp/raw-rev/5f32dbc41afc
|
||||
FILENAME gmp-arm64-asm-fix-5f32dbc41afc.patch
|
||||
SHA512 4a7c50dc0a78e6c297c0ac53129ed367dbf669100a613653987d0eddf175376296254ed26ecce15d02b0544b99e44719af49635e54982b22e745f22e2f8d1eda
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
SOURCE_BASE "v${VERSION}"
|
||||
PATCHES
|
||||
asmflags.patch
|
||||
cross-tools.patch
|
||||
subdirs.patch
|
||||
msvc_symbol.patch
|
||||
arm64-coff.patch
|
||||
"${ARM64PATCH}"
|
||||
)
|
||||
|
||||
vcpkg_list(SET OPTIONS)
|
||||
if("fat" IN_LIST FEATURES)
|
||||
vcpkg_list(APPEND OPTIONS "--enable-fat")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
set(ENV{CCAS} "${CURRENT_HOST_INSTALLED_DIR}/tools/yasm/yasm${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(asmflag win64)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(asmflag win32)
|
||||
vcpkg_list(APPEND OPTIONS
|
||||
"ac_cv_func_memset=yes"
|
||||
"gmp_cv_asm_w32=.word"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(disable_assembly OFF)
|
||||
set(ccas "")
|
||||
set(asmflags "-c")
|
||||
vcpkg_cmake_get_vars(cmake_vars_file)
|
||||
include("${cmake_vars_file}")
|
||||
if(VCPKG_DETECTED_CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
string(APPEND asmflags " --target=i686-pc-windows-msvc")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
string(APPEND asmflags " --target=x86_64-pc-windows-msvc")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
string(APPEND asmflags " --target=arm64-pc-windows-msvc")
|
||||
else()
|
||||
set(disable_assembly ON)
|
||||
endif()
|
||||
set(ENV{ASMFLAGS} "-Xvc -f ${asmflag} -pgas -rraw")
|
||||
set(OPTIONS ac_cv_func_memset=yes
|
||||
"gmp_cv_asm_w32=.word"
|
||||
)
|
||||
|
||||
if(NOT disable_assembly)
|
||||
vcpkg_find_acquire_program(CLANG)
|
||||
set(ccas "${CLANG}")
|
||||
endif()
|
||||
elseif(VCPKG_CROSSCOMPILING)
|
||||
set(ccas "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
|
||||
endif()
|
||||
|
||||
if(disable_assembly)
|
||||
vcpkg_list(APPEND OPTIONS "--enable-assembly=no")
|
||||
elseif(ccas)
|
||||
cmake_path(GET ccas PARENT_PATH ccas_dir)
|
||||
vcpkg_add_to_path("${ccas_dir}")
|
||||
cmake_path(GET ccas FILENAME ccas_command)
|
||||
vcpkg_list(APPEND OPTIONS "CCAS=${ccas_command}" "ASMFLAGS=${asmflags}")
|
||||
endif()
|
||||
|
||||
if(VCPKG_CROSSCOMPILING)
|
||||
# Silly trick to make configure accept CC_FOR_BUILD but in reallity CC_FOR_BUILD is deactivated.
|
||||
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")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "^(arm|arm64)$")
|
||||
list(APPEND OPTIONS --enable-assembly=no)
|
||||
set(ENV{HOST_TOOLS_PREFIX} "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}")
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
|
|
@ -54,32 +86,37 @@ vcpkg_configure_make(
|
|||
${OPTIONS}
|
||||
--enable-cxx
|
||||
--with-pic
|
||||
--with-readline=no
|
||||
"gmp_cv_prog_exeext_for_build=${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
)
|
||||
|
||||
set(tool_names bases fac fib jacobitab psqr trialdivtab)
|
||||
list(TRANSFORM tool_names PREPEND "gen-")
|
||||
list(TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
|
||||
if(VCPKG_CROSSCOMPILING)
|
||||
list(TRANSFORM tool_names PREPEND "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}/")
|
||||
file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" )
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
if(NOT VCPKG_CROSSCOMPILING)
|
||||
list(TRANSFORM tool_names PREPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/")
|
||||
file(COPY ${tool_names} DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" )
|
||||
file(INSTALL
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-bases${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-fac${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-fib${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-jacobitab${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-psqr${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen-trialdivtab${VCPKG_HOST_EXECUTABLE_SUFFIX}"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
)
|
||||
vcpkg_copy_tool_dependencies("${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}")
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/info")
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
vcpkg_install_copyright(
|
||||
FILE_LIST
|
||||
"${SOURCE_PATH}/README"
|
||||
"${SOURCE_PATH}/COPYING.LESSERv3"
|
||||
"${SOURCE_PATH}/COPYINGv3"
|
||||
"${SOURCE_PATH}/COPYINGv2"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 9f92a4f..e35629d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -116,7 +116,7 @@ LIBGMPXX_LT_REVISION = 1
|
||||
LIBGMPXX_LT_AGE = 6
|
||||
|
||||
|
||||
-SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
|
||||
+SUBDIRS = mpn mpz mpq mpf printf rand cxx
|
||||
|
||||
EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
|
||||
COPYING.LESSERv3 COPYINGv2 COPYINGv3
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 1c24694..656aa3a 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -349,7 +349,7 @@ fac_table.h: gen-fac$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += fac_table.h
|
||||
|
||||
gen-fac$(EXEEXT_FOR_BUILD): gen-fac$(U_FOR_BUILD).c bootstrap.c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-fac$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fac$(U_FOR_BUILD).c -o gen-fac$(EXEEXT_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-fac$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fac$(U_FOR_BUILD).c $(CFLAGS) -o gen-fac$(EXEEXT_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-fac$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-fac.c
|
||||
|
||||
@@ -363,7 +363,7 @@ mpn/fib_table.c: gen-fib$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += mpn/fib_table.c
|
||||
|
||||
gen-fib$(EXEEXT_FOR_BUILD): gen-fib$(U_FOR_BUILD).c bootstrap.c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-fib$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fib$(U_FOR_BUILD).c -o gen-fib$(EXEEXT_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-fib$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-fib$(U_FOR_BUILD).c $(CFLAGS) -o gen-fib$(EXEEXT_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-fib$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-fib.c
|
||||
|
||||
@@ -377,7 +377,7 @@ mpn/mp_bases.c: gen-bases$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += mpn/mp_bases.c
|
||||
|
||||
gen-bases$(EXEEXT_FOR_BUILD): gen-bases$(U_FOR_BUILD).c bootstrap.c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-bases$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-bases$(U_FOR_BUILD).c -o gen-bases$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-bases$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-bases$(U_FOR_BUILD).c $(CFLAGS) -o gen-bases$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-bases$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-bases.c
|
||||
|
||||
@@ -387,7 +387,7 @@ trialdivtab.h: gen-trialdivtab$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += trialdivtab.h
|
||||
|
||||
gen-trialdivtab$(EXEEXT_FOR_BUILD): gen-trialdivtab$(U_FOR_BUILD).c bootstrap.c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-trialdivtab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-trialdivtab$(U_FOR_BUILD).c -o gen-trialdivtab$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-trialdivtab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-trialdivtab$(U_FOR_BUILD).c $(CFLAGS) -o gen-trialdivtab$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-trialdivtab$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-trialdivtab.c
|
||||
|
||||
@@ -397,7 +397,7 @@ mpn/jacobitab.h: gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += mpn/jacobitab.h
|
||||
|
||||
gen-jacobitab$(EXEEXT_FOR_BUILD): gen-jacobitab$(U_FOR_BUILD).c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-jacobitab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-jacobitab$(U_FOR_BUILD).c -o gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-jacobitab$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-jacobitab$(U_FOR_BUILD).c $(CFLAGS) -o gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-jacobitab$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-jacobitab.c
|
||||
|
||||
@@ -407,7 +407,7 @@ mpn/perfsqr.h: gen-psqr$(EXEEXT_FOR_BUILD)
|
||||
BUILT_SOURCES += mpn/perfsqr.h
|
||||
|
||||
gen-psqr$(EXEEXT_FOR_BUILD): gen-psqr$(U_FOR_BUILD).c bootstrap.c
|
||||
- $(CC_FOR_BUILD) `test -f 'gen-psqr$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-psqr$(U_FOR_BUILD).c -o gen-psqr$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
+ $(CC_FOR_BUILD) `test -f 'gen-psqr$(U_FOR_BUILD).c' || echo '$(srcdir)/'`gen-psqr$(U_FOR_BUILD).c $(CFLAGS) -o gen-psqr$(EXEEXT_FOR_BUILD) $(LIBM_FOR_BUILD)
|
||||
DISTCLEANFILES += gen-psqr$(EXEEXT_FOR_BUILD)
|
||||
EXTRA_DIST += gen-psqr.c
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "gmp",
|
||||
"version": "6.2.1",
|
||||
"port-version": 13,
|
||||
"port-version": 14,
|
||||
"description": "The GNU Multiple Precision Arithmetic Library",
|
||||
"homepage": "https://gmplib.org",
|
||||
"license": "LGPL-3.0-only OR GPL-2.0-only",
|
||||
|
|
@ -11,12 +11,14 @@
|
|||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "yasm",
|
||||
"host": true,
|
||||
"features": [
|
||||
"tools"
|
||||
],
|
||||
"platform": "windows"
|
||||
"name": "vcpkg-cmake-get-vars",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"features": {
|
||||
"fat": {
|
||||
"description": "Enable runtime selection of optimized low level routines",
|
||||
"supports": "x86 | x64"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2694,7 +2694,7 @@
|
|||
},
|
||||
"gmp": {
|
||||
"baseline": "6.2.1",
|
||||
"port-version": 13
|
||||
"port-version": 14
|
||||
},
|
||||
"gmsh": {
|
||||
"baseline": "4.9.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "78ec3d2e22e85904faa5c2e72b2f5b938f631b75",
|
||||
"version": "6.2.1",
|
||||
"port-version": 14
|
||||
},
|
||||
{
|
||||
"git-tree": "28b5b46e27a69da50c1cd0a8be5d0a32cbca120b",
|
||||
"version": "6.2.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue