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

View File

@@ -0,0 +1,51 @@
From 8b5b2ea5ba695252abaad4234c951675d5f733ec Mon Sep 17 00:00:00 2001
From: Hiroshi Miura <miurahr@linux.com>
Date: Wed, 7 Feb 2018 12:28:54 +0900
Subject: [PATCH 1/2] VS2015 provides snprintf
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
---
lib/common.h | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/lib/common.h b/lib/common.h
index c5db1ed..73c4118 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -39,10 +39,29 @@ extern "C" {
/** \addtogroup misc Miscellanea */
/*@{*/
-/* Use _snprintf instead of snprintf under MSVC compiler */
-#if defined(_WIN32) && !defined(__MINGW32__)
-#define snprintf _snprintf
-#endif
+#ifdef _MSC_VER
+#if _MSC_VER < 1900 // VS2015/17 provides snprintf
+#include <stdio.h>
+#include <stdarg.h>
+/* Want safe, 'n += snprintf(b + n ...)' like function. If cp_max_len is 1
+* then assume cp is pointing to a null char and do nothing. Returns number
+* number of chars placed in cp excluding the trailing null char. So for
+* cp_max_len > 0 the return value is always < cp_max_len; for cp_max_len
+* <= 0 the return value is 0 (and no chars are written to cp). */
+static int snprintf(char * cp, int cp_max_len, const char * fmt, ...)
+{
+ va_list args;
+ int n;
+
+ if (cp_max_len < 2)
+ return 0;
+ va_start(args, fmt);
+ n = vsnprintf(cp, cp_max_len, fmt, args);
+ va_end(args);
+ return (n < cp_max_len) ? n : (cp_max_len - 1);
+}
+#endif // _MSC_VER < 1900
+#endif // _MSC_VER
#ifdef HAVE_CONFIG_H
# include <config.h>
--
2.16.1

View File

@@ -0,0 +1,81 @@
From 4969dd6e7b656e92bf1bc921f0cd1af00707e17f Mon Sep 17 00:00:00 2001
From: Hiroshi Miura <miurahr@linux.com>
Date: Wed, 7 Feb 2018 10:47:53 +0900
Subject: [PATCH 2/2] Add CFLAGS for CRT selection and warning supression
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
---
makefile.vc | 2 +-
nmake.opt | 42 +++++++++++++++++++++++++++++++++++++++---
2 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/makefile.vc b/makefile.vc
index 33f1f34..64fb9f3 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -20,7 +20,7 @@ EPSILON_EXE = epsilon.exe
-CFLAGS = /nologo -IC:\OSGeo4W\include -I.\lib -I.\lib\msvc \
+CFLAGS = /nologo -I$(INSTALLED_ROOT)\include -I.\lib -I.\lib\msvc \
-I.\src -I..\popt\include \
- $(OPTFLAGS)
+ $(OPTFLAGS) $(WARNFLAGS)
default: all
diff --git a/nmake.opt b/nmake.opt
index d5a51e2..d8088df 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -1,9 +1,45 @@
# Directory tree where EPSILON will be installed.
+!IFNDEF INSTDIR
INSTDIR=C:\OSGeo4W
+!ENDIF
+
+# Flags to choose CRT variant to link against (e.g. static: /MT, /MTd, dynamic: /MD, /MDd)
+!IFNDEF CRT_FLAGS
+!IFNDEF DEBUG
+CRT_FLAGS=/MD
+!ELSE
+CRT_FLAGS=/MDd
+!ENDIF
+!ENDIF
+
+# Flags for enforcing PDB use
+!IFNDEF PDB_FLAGS
+PDB_FLAGS=/Fdepsilon.pdb
+!ENDIF
+
+# Set flags controlling warnings level, and suppression of some warnings.
+!IFNDEF WARNFLAGS
+# 4127: conditional expression is constant
+# 4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
+# 4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
+# 4786: ??????????
+# 4100: 'identifier' : unreferenced formal parameter
+# 4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
+# 4206: nonstandard extension used : translation unit is empty (only applies to C source code)
+# 4351: new behavior: elements of array 'array' will be default initialized (needed for https://trac.osgeo.org/gdal/changeset/35593)
+# 4611: interaction between '_setjmp' and C++ object destruction is non-portable
+#
+WARNFLAGS = /W3 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611
+!ENDIF
+
+!IFNDEF OPTFLAGS
+!IFNDEF DEBUG
+OPTFLAGS= $(PDB_FLAGS) /nologo $(CRT_FLAGS) /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
+!ELSE
+OPTFLAGS= $(PDB_FLAGS) /nologo $(CRT_FLAGS) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
+!ENDIF
+!ENDIF
-# Uncomment the first for an optimized build, or the second for debug.
-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS
-#OPTFLAGS= /nologo /Zi /MD /Fdepsilon.pdb
# Set the version number for the DLL. Normally we leave this blank since
# we want software that is dynamically loading the DLL to have no problem
--
2.16.1

View File

@@ -0,0 +1,52 @@
diff --git a/makefile.vc b/makefile.vc
index cd0fc5a..7ce6861 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -32,6 +32,12 @@ epsilon.lib: $(LIBOBJ)
$(EPSILON_DLL): epsilon_i.lib
+!IFNDEF DEBUG
+POPTLIB=$(LIBPATH)popt.lib
+!ELSE
+POPTLIB=$(LIBPATH)poptd.lib
+!ENDIF
+
epsilon_i.lib: $(LIBOBJ)
link /debug /dll /def:libepsilon.def /out:$(EPSILON_DLL) \
/implib:epsilon_i.lib $(LIBOBJ)
@@ -48,8 +54,8 @@ $(EPSILON_EXE): $(EPSILON_DLL) src\epsilon.obj \
src\cmd_truncate_file.obj src\cmd_decode_file.obj \
src\cmd_encode_file.obj src\misc.obj \
src\psi.obj src\pbm.obj \
- ..\popt\lib\libpopt.lib
- /Fe$(EPSILON_EXE)
+ $(POPTLIB) \
+ /Fe"$(EPSILON_EXE)"
if exist $(EPSILON_EXE).manifest mt -manifest \
$(EPSILON_EXE).manifest -outputresource:$(EPSILON_EXE);1
@@ -71,8 +77,9 @@ install: all
-mkdir $(INSTDIR)\bin
-mkdir $(INSTDIR)\lib
-mkdir $(INSTDIR)\include
+ -mkdir $(INSTDIR)\tools
copy *.dll $(INSTDIR)\bin
copy *.lib $(INSTDIR)\lib
- copy *.exe $(INSTDIR)\bin
+ copy *.exe $(INSTDIR)\tools
copy lib\epsilon.h $(INSTDIR)\include
diff --git a/src/misc.h b/src/misc.h
index 9023dce..d8ce602 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -30,7 +30,7 @@ extern "C" {
#endif
/* Use _snprintf instead of snprintf under MSVC compiler */
-#if defined(_WIN32) && !defined(__MINGW32__)
+#if 0
#define snprintf _snprintf
#endif

48
externals/vcpkg/ports/epsilon/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,48 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO epsilon-project/epsilon
REF 0.9.2
FILENAME "epsilon-0.9.2.tar.gz"
SHA512 95f427c68a4a4eb784f7d484d87fc573133983510f6b030663f88955e2446490a07b1343ae4668251b466f67cf9a79bd834b933c57c5ed12327f32174f20ac0f
PATCHES
0001-VS2015-provides-snprintf.patch
0002-Add-CFLAGS-for-CRT-selection-and-warning-supression.patch
0003-Fix-build-error.patch
)
if (VCPKG_CRT_LINKAGE STREQUAL static)
set(CL_FLAGS_REL "/MT /Ox /fp:precise")
set(CL_FLAGS_DBG "/MTd /Zi")
set(TARGET_LIB epsilon.lib)
else()
set(CL_FLAGS_REL "/MD /Ox /fp:precise")
set(CL_FLAGS_DBG "/MDd /Zi")
set(TARGET_LIB epsilon_i.lib)
endif()
vcpkg_install_nmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
OPTIONS_DEBUG
INSTDIR="${CURRENT_PACKAGES_DIR}/debug"
MSVC_VER=1900
CRT_FLAGS=${CL_FLAGS_DBG}
DEBUG=1
${TARGET_LIB}
LIBPATH="${CURRENT_INSTALLED_DIR}/debug/lib/"
OPTIONS_RELEASE
INSTDIR="${CURRENT_PACKAGES_DIR}"
MSVC_VER=1900
CRT_FLAGS=${CL_FLAGS_REL}
${TARGET_LIB}
LIBPATH="${CURRENT_INSTALLED_DIR}/lib/"
)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

11
externals/vcpkg/ports/epsilon/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,11 @@
{
"name": "epsilon",
"version-string": "0.9.2",
"port-version": 6,
"description": "EPSILON is an Open Source wavelet image compressor, that is aimed on parallel and robust image processing.",
"homepage": "https://sourceforge.net/projects/epsilon-project/",
"supports": "windows",
"dependencies": [
"libpopt"
]
}