diff options
author | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2020-01-29 08:03:39 -0600 |
---|---|---|
committer | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2020-01-29 08:03:39 -0600 |
commit | 7a335a32ebbce103d429c82a8d60d25ead1ccf0e (patch) | |
tree | 926e1e976b31bfac01a0aee71e61c43f77ef8f6d | |
parent | ed3b07c4e214795931f8ab67cfe4be13755fa8f8 (diff) | |
download | libtiff-git-7a335a32ebbce103d429c82a8d60d25ead1ccf0e.tar.gz |
Simplify nmake configuration for building port directory. Now there
is only one boolean setting to enable building strtoll() and strtoull()
port functions. The boolean setting enables the necessary port files
to be built, but the remainder of the logic is via pre-processor code
in the common tif_config.h, which was prepared before entering the
port directory to do a build.
-rw-r--r-- | nmake.opt | 11 | ||||
-rw-r--r-- | port/Makefile.vc | 14 | ||||
-rw-r--r-- | port/libport.h | 4 |
3 files changed, 18 insertions, 11 deletions
@@ -110,12 +110,9 @@ CHECK_JPEG_YCBCR_SUBSAMPLING = 1 # -# Indicate if the compiler provides strtol/strtoul/strtoll/strtoull. -# Users of MSVC++ 14.0 ("Visual Studio 2015") and later should set all of these to 1 -HAVE_STRTOL = 1 -HAVE_STRTOUL = 1 -HAVE_STRTOLL = 0 -HAVE_STRTOULL = 0 +# Indicate if the compiler provides strtoll/strtoull (default 1) +# Users of MSVC++ 14.0 ("Visual Studio 2015") and later should set this to 1 +HAVE_STRTOLL = 1 # # Pick debug or optimized build flags. We default to an optimized build @@ -148,7 +145,7 @@ LD = link /nologo CFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS) CXXFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS) -EXTRAFLAGS = +EXTRAFLAGS = -DHAVE_CONFIG_H LIBS = # Name of the output shared library diff --git a/port/Makefile.vc b/port/Makefile.vc index 6122b192..e4471af5 100644 --- a/port/Makefile.vc +++ b/port/Makefile.vc @@ -27,30 +27,36 @@ !INCLUDE ..\nmake.opt +HAVE_STRTOL = 1 +HAVE_STRTOUL = 1 + +# strtoul()/strtoull() are provided together +!IF $(HAVE_STRTOLL) +HAVE_STRTOULL = 1 +!ELSE +HAVE_STRTOULL = 0 +!endif + !IF $(HAVE_STRTOL) STRTOL_OBJ = -EXTRAFLAGS = -DHAVE_STRTOL $(EXTRAFLAGS) !ELSE STRTOL_OBJ = strtol.obj !ENDIF !IF $(HAVE_STRTOUL) STRTOUL_OBJ = -EXTRAFLAGS = -DHAVE_STRTOUL $(EXTRAFLAGS) !ELSE STRTOUL_OBJ = strtoul.obj !ENDIF !IF $(HAVE_STRTOLL) STRTOLL_OBJ = -EXTRAFLAGS = -DHAVE_STRTOLL $(EXTRAFLAGS) !ELSE STRTOLL_OBJ = strtoll.obj !ENDIF !IF $(HAVE_STRTOULL) STRTOULL_OBJ = -EXTRAFLAGS = -DHAVE_STRTOULL $(EXTRAFLAGS) !ELSE STRTOULL_OBJ = strtoull.obj !ENDIF diff --git a/port/libport.h b/port/libport.h index cb302ef4..9f2dace1 100644 --- a/port/libport.h +++ b/port/libport.h @@ -24,6 +24,10 @@ #ifndef _LIBPORT_ #define _LIBPORT_ +#if defined(HAVE_CONFIG_H) +# include <tif_config.h> +#endif + int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int opterr; |