early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

158
externals/vcpkg/ports/gsl/0001-configure.patch vendored Executable file
View File

@@ -0,0 +1,158 @@
---
diff --git a/config.h.in b/config.h
index adab7a58d..f6dc2278e 100644
--- a/config.h.in
+++ b/config.h
@@ -11,19 +11,19 @@
/* Define to 1 if you have the declaration of `acosh', and to 0 if you don't.
*/
-#undef HAVE_DECL_ACOSH
+#define HAVE_DECL_ACOSH 1
/* Define to 1 if you have the declaration of `asinh', and to 0 if you don't.
*/
-#undef HAVE_DECL_ASINH
+#define HAVE_DECL_ASINH 1
/* Define to 1 if you have the declaration of `atanh', and to 0 if you don't.
*/
-#undef HAVE_DECL_ATANH
+#define HAVE_DECL_ATANH 1
/* Define to 1 if you have the declaration of `expm1', and to 0 if you don't.
*/
-#undef HAVE_DECL_EXPM1
+#define HAVE_DECL_EXPM1 1
/* Define to 1 if you have the declaration of `feenableexcept', and to 0 if
you don't. */
@@ -43,31 +43,31 @@
/* Define to 1 if you have the declaration of `frexp', and to 0 if you don't.
*/
-#undef HAVE_DECL_FREXP
+#define HAVE_DECL_FREXP 1
/* Define to 1 if you have the declaration of `hypot', and to 0 if you don't.
*/
-#undef HAVE_DECL_HYPOT
+#define HAVE_DECL_HYPOT 1
/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
don't. */
-#undef HAVE_DECL_ISFINITE
+#define HAVE_DECL_ISFINITE 1
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
*/
-#undef HAVE_DECL_ISINF
+#define HAVE_DECL_ISINF 1
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
*/
-#undef HAVE_DECL_ISNAN
+#define HAVE_DECL_ISNAN 1
/* Define to 1 if you have the declaration of `ldexp', and to 0 if you don't.
*/
-#undef HAVE_DECL_LDEXP
+#define HAVE_DECL_LDEXP 1
/* Define to 1 if you have the declaration of `log1p', and to 0 if you don't.
*/
-#undef HAVE_DECL_LOG1P
+#define HAVE_DECL_LOG1P 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -76,13 +76,13 @@
#undef HAVE_DOPRNT
/* Defined if you have ansi EXIT_SUCCESS and EXIT_FAILURE in stdlib.h */
-#undef HAVE_EXIT_SUCCESS_AND_FAILURE
+#define HAVE_EXIT_SUCCESS_AND_FAILURE 1
/* Defined on architectures with excess floating-point precision */
#undef HAVE_EXTENDED_PRECISION_REGISTERS
/* Define if x86 processor has sse extensions. */
-#undef HAVE_FPU_X86_SSE
+#define HAVE_FPU_X86_SSE 1
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
@@ -97,43 +97,43 @@
#undef HAVE_INLINE
/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
+#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
+#define HAVE_MEMCPY 1
/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
+#define HAVE_MEMMOVE 1
/* Define this if printf can handle %Lf for long double */
#undef HAVE_PRINTF_LONGDOUBLE
/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
+#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
+#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
+#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
+#define HAVE_STRDUP 1
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+#define HAVE_STRING_H 1
/* Define to 1 if you have the `strtol' function. */
-#undef HAVE_STRTOL
+#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
-#undef HAVE_STRTOUL
+#define HAVE_STRTOUL 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -145,7 +145,7 @@
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
+#define HAVE_VPRINTF 1
/* Define if you need to hide the static definitions of inline functions */
#undef HIDE_INLINE_STATIC
@@ -180,7 +180,7 @@
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
-#undef STDC_HEADERS
+#define STDC_HEADERS 1
/* Version number of package */
#undef VERSION
---

View File

@@ -0,0 +1,97 @@
---
ieee-utils/fp-win.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++
ieee-utils/fp.c | 2 ++
2 files changed, 72 insertions(+)
create mode 100644 ieee-utils/fp-win.c
diff --git a/ieee-utils/fp-win.c b/ieee-utils/fp-win.c
new file mode 100644
index 0000000..e024eae
--- /dev/null
+++ b/ieee-utils/fp-win.c
@@ -0,0 +1,70 @@
+/* fp-win.c
+ *
+ * Author: Brian Gladman
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <float.h>
+
+#include <config.h>
+#include <gsl/gsl_ieee_utils.h>
+#include <gsl/gsl_errno.h>
+
+const char *fp_env_string = "round-to-nearest,double-precision,mask-all";
+
+int
+gsl_ieee_set_mode (int precision, int rounding, int exception_mask)
+{
+ unsigned int old, mode = _DN_SAVE, mask = _MCW_DN | _MCW_RC | _MCW_EM;
+
+ switch(precision)
+ {
+ case GSL_IEEE_SINGLE_PRECISION: mode |= _PC_24; break;
+ case GSL_IEEE_EXTENDED_PRECISION: mode |= _PC_64; break;
+ case GSL_IEEE_DOUBLE_PRECISION:
+ default: mode |= _PC_53;
+ }
+#ifndef _M_AMD64
+ mask |= _MCW_PC;
+#endif
+
+ switch(rounding)
+ {
+ case GSL_IEEE_ROUND_DOWN: mode |= _RC_DOWN; break;
+ case GSL_IEEE_ROUND_UP: mode |= _RC_UP; break;
+ case GSL_IEEE_ROUND_TO_ZERO: mode |= _RC_CHOP; break;
+ case GSL_IEEE_ROUND_TO_NEAREST:
+ default: mode |= _RC_NEAR;
+ }
+
+ if(exception_mask & GSL_IEEE_MASK_INVALID)
+ mode |= _EM_INVALID;
+ if(exception_mask & GSL_IEEE_MASK_DENORMALIZED)
+ mode |= _EM_DENORMAL;
+ if(exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZERO)
+ mode |= _EM_ZERODIVIDE;
+ if(exception_mask & GSL_IEEE_MASK_OVERFLOW)
+ mode |= _EM_OVERFLOW;
+ if(exception_mask & GSL_IEEE_MASK_UNDERFLOW)
+ mode |= _EM_UNDERFLOW;
+ if(exception_mask & GSL_IEEE_TRAP_INEXACT)
+ mode &= ~_EM_INEXACT;
+ else
+ mode |= _EM_INEXACT;
+
+ _controlfp_s( &old, mode, mask);
+ return GSL_SUCCESS;
+}
diff --git a/ieee-utils/fp.c b/ieee-utils/fp.c
index 445a14f..b6ae5af 100644
--- a/ieee-utils/fp.c
+++ b/ieee-utils/fp.c
@@ -45,6 +45,8 @@
#endif
#elif HAVE_DECL_FEENABLEEXCEPT || HAVE_DECL_FESETTRAPENABLE
#include "fp-gnuc99.c"
+#elif _MSC_VER
+#include "fp-win.c"
#else
#include "fp-unknown.c"
#endif
--

86
externals/vcpkg/ports/gsl/CMakeLists.txt vendored Executable file
View File

@@ -0,0 +1,86 @@
cmake_minimum_required(VERSION 3.8)
project(gsl C)
option(INSTALL_HEADERS "Install public header files" ON)
# Function to extract parameter from makefile. Space separated values are returned as lists
function(extract_from_makefile PATTERN RETURN FILEPATH)
file(READ ${FILEPATH} MAKEFILE_CONTENT)
string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}")
set(CONTENTS ${CMAKE_MATCH_1})
# Split string into list
string(REGEX REPLACE "([\t ]+(\\\\\n)?)+" ";" CONTENTS "${CONTENTS}")
string(REGEX REPLACE "[\t ]*\\\\\n[\t ]*;" "" CONTENTS "${CONTENTS}")
if("${CONTENTS}" STREQUAL "")
message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}")
endif()
# Return
set(${RETURN} ${CONTENTS} PARENT_SCOPE)
endfunction(extract_from_makefile)
# Function to extract C sources from makefile
function(extract_sources SUBFOLDER ALLSOURCES)
extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*(((\\\\\n)?[^\n])*)" SOURCEFILES "${SUBFOLDER}/Makefile.am")
# Add the folder in front of the file names
string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}")
# Return
set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE)
endfunction(extract_sources)
set(SOURCES)
set(CBLAS_SOURCES)
extract_from_makefile("SUBDIRS = (((\\\\\n)?[^\n])*)" FOLDERS "./Makefile.am")
extract_sources("." SOURCES)
foreach(DIR IN LISTS FOLDERS)
if("${DIR}" STREQUAL "cblas")
extract_sources("${DIR}" CBLAS_SOURCES)
else()
extract_sources("${DIR}" SOURCES)
endif()
endforeach()
file(READ gsl_types.h GSLTYPES_H)
string(REPLACE "#ifdef WIN32" "#if 1 /*WIN32*/" GSLTYPES_H "${GSLTYPES_H}")
if(BUILD_SHARED_LIBS)
string(REPLACE "# ifdef GSL_DLL" "# if 1 /*GSL_DLL*/" GSLTYPES_H "${GSLTYPES_H}")
endif()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h "${GSLTYPES_H}")
file(GLOB_RECURSE PUBLIC_HEADERS gsl*.h)
list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/gsl_types.h)
# The debug libraries have a "d" postfix so that CMake's FindGSL.cmake
# module can distinguish between Release and Debug libraries
set(CMAKE_DEBUG_POSTFIX "d")
add_library(gslcblas ${CBLAS_SOURCES})
set_target_properties(gslcblas PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(gsl ${SOURCES})
set_target_properties(gsl PROPERTIES DEFINE_SYMBOL DLL_EXPORT WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_link_libraries(gsl PUBLIC gslcblas)
if(INSTALL_HEADERS)
set_target_properties(gsl PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
endif()
target_include_directories(gslcblas PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(gsl PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
# For the build, we need to copy all headers to the gsl directory
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gsl)
file(COPY ${PUBLIC_HEADERS} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/gsl")
set(TARGET_INSTALL_OPTIONS)
if(INSTALL_HEADERS)
set(TARGET_INSTALL_OPTIONS PUBLIC_HEADER DESTINATION include/gsl)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gsl.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gsl.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gsl.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(TARGETS gsl gslcblas
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
${TARGET_INSTALL_OPTIONS}
)

31
externals/vcpkg/ports/gsl/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,31 @@
set(GSL_VERSION 2.7.1)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/gsl/gsl-${GSL_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gsl/gsl-${GSL_VERSION}.tar.gz"
FILENAME "gsl-${GSL_VERSION}.tar.gz"
SHA512 3300a748b63b583374701d5ae2a9db7349d0de51061a9f98e7c145b2f7de9710b3ad58b3318d0be2a9a287ace4cc5735bb9348cdf48075b98c1f6cc1029df131
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
0001-configure.patch
0002-add-fp-control.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)

4
externals/vcpkg/ports/gsl/usage vendored Executable file
View File

@@ -0,0 +1,4 @@
The package gsl is compatible with built-in CMake targets:
find_package(GSL REQUIRED)
target_link_libraries(main PRIVATE GSL::gsl GSL::gslcblas)

View File

@@ -0,0 +1,11 @@
_find_package(${ARGS})
if(GSL_FOUND AND TARGET GSL::gsl)
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release )
set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Release )
if( EXISTS "${GSL_LIBRARY_DEBUG}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG}")
set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gsl PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG}" )
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" )
endif()
endif()

18
externals/vcpkg/ports/gsl/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,18 @@
{
"name": "gsl",
"version": "2.7.1",
"port-version": 1,
"description": "The GNU Scientific Library is a numerical library for C and C++ programmers",
"homepage": "https://www.gnu.org/software/gsl/",
"license": "GPL-3.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}