[gmt] 01/04: Imported Upstream version 5.4.1+dfsg

Bas Couwenberg sebastic at debian.org
Wed May 10 06:17:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository gmt.

commit c34afb2a1246fc761f0b4a6f2630014104f21c73
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed May 10 07:29:43 2017 +0200

    Imported Upstream version 5.4.1+dfsg
---
 cmake/ConfigDefault.cmake    |   6 +-
 cmake/modules/FindGDAL.cmake | 139 +++++++++++++++++++++++++++++++++++++++++++
 src/gmt_io.c                 |   4 +-
 src/grdimage.c               |   4 +-
 src/postscriptlight.c        |   9 ++-
 5 files changed, 156 insertions(+), 6 deletions(-)

diff --git a/cmake/ConfigDefault.cmake b/cmake/ConfigDefault.cmake
index eef5fd8..d26d70a 100644
--- a/cmake/ConfigDefault.cmake
+++ b/cmake/ConfigDefault.cmake
@@ -1,5 +1,5 @@
 #
-# $Id: ConfigDefault.cmake 18194 2017-05-08 13:44:45Z jluis $
+# $Id: ConfigDefault.cmake 18208 2017-05-09 22:11:16Z jluis $
 #
 # Copyright (c) 1991-2017 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
 # See LICENSE.TXT file for copying and redistribution conditions.
@@ -42,14 +42,14 @@ set (GMT_VERSION_YEAR "2017")
 # The GMT package version.
 set (GMT_PACKAGE_VERSION_MAJOR 5)
 set (GMT_PACKAGE_VERSION_MINOR 4)
-set (GMT_PACKAGE_VERSION_PATCH 0)
+set (GMT_PACKAGE_VERSION_PATCH 1)
 
 # The subversion revision of the GMT source code.
 # This is manually set when making GMT *public* releases.
 # However, when making internal releases or just an ordinary developer build, leave it
 # empty; if it is empty, the revision number is automatically populated for you on build.
 #set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "18180")
-set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "18194")
+set (GMT_SOURCE_CODE_CONTROL_VERSION_STRING "18208")
 
 # The GMT package version.
 set (GMT_PACKAGE_VERSION "${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}")
diff --git a/cmake/modules/FindGDAL.cmake b/cmake/modules/FindGDAL.cmake
new file mode 100644
index 0000000..f18eed3
--- /dev/null
+++ b/cmake/modules/FindGDAL.cmake
@@ -0,0 +1,139 @@
+#
+# $Id: FindGDAL.cmake 18202 2017-05-09 10:22:12Z remko $
+#
+# Locate gdal
+#
+# This module accepts the following environment variables:
+#
+#    GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
+#
+# This module defines the following CMake variables:
+#
+#    GDAL_FOUND - True if libgdal is found
+#    GDAL_LIBRARY - A variable pointing to the GDAL library
+#    GDAL_INCLUDE_DIR - Where to find the headers
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See COPYING-CMAKE-SCRIPTS for more information.
+#=============================================================================
+# Note: this file is not an exact copy of the original file from Kitware.
+#       It has been modified for the needs of GMT.
+
+#
+# $GDAL_DIR is an environment variable that would
+# correspond to the ./configure --prefix=$GDAL_DIR
+# used in building gdal.
+#
+# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
+# for osgTerrain so I whipped this module together for completeness.
+# I actually don't know the conventions or where files are typically
+# placed in distros.
+# Any real gdal users are encouraged to correct this (but please don't
+# break the OS X framework stuff when doing so which is what usually seems
+# to happen).
+
+# This makes the presumption that you are include gdal.h like
+#
+#include "gdal.h"
+
+if (DEFINED GDAL_ROOT AND NOT GDAL_ROOT)
+	set (GDAL_LIBRARY "" CACHE INTERNAL "")
+	set (GDAL_INCLUDE_DIR "" CACHE INTERNAL "")
+	return()
+endif (DEFINED GDAL_ROOT AND NOT GDAL_ROOT)
+
+if (UNIX AND NOT GDAL_FOUND)
+	# Use gdal-config to obtain the library version (this should hopefully
+	# allow us to -lgdal1.x.y where x.y are correct version)
+	# For some reason, libgdal development packages do not contain
+	# libgdal.so...
+	find_program (GDAL_CONFIG gdal-config
+		HINTS
+		${GDAL_DIR}
+		${GDAL_ROOT}
+		$ENV{GDAL_DIR}
+		$ENV{GDAL_ROOT}
+		PATH_SUFFIXES bin
+		PATHS
+		/sw # Fink
+		/opt/local # DarwinPorts
+		/opt/csw # Blastwave
+		/opt
+		/usr/local
+	)
+
+	if (GDAL_CONFIG)
+		execute_process (COMMAND ${GDAL_CONFIG} --cflags
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE GDAL_CONFIG_CFLAGS)
+		if (GDAL_CONFIG_CFLAGS)
+			string (REGEX MATCHALL "-I[^ ]+" _gdal_dashI ${GDAL_CONFIG_CFLAGS})
+			string (REGEX REPLACE "-I" "" _gdal_includepath "${_gdal_dashI}")
+			string (REGEX REPLACE "-I[^ ]+" "" _gdal_cflags_other ${GDAL_CONFIG_CFLAGS})
+		endif (GDAL_CONFIG_CFLAGS)
+		execute_process (COMMAND ${GDAL_CONFIG} --libs
+			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
+			OUTPUT_VARIABLE GDAL_CONFIG_LIBS)
+		if (GDAL_CONFIG_LIBS)
+			string (REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})
+			string (REGEX REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")
+			string (REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})
+			string (REGEX REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")
+		endif (GDAL_CONFIG_LIBS)
+	endif (GDAL_CONFIG)
+endif (UNIX AND NOT GDAL_FOUND)
+
+find_path (GDAL_INCLUDE_DIR gdal.h
+	HINTS
+	${_gdal_includepath}
+	${GDAL_DIR}
+	${GDAL_ROOT}
+	$ENV{GDAL_DIR}
+	$ENV{GDAL_ROOT}
+	PATH_SUFFIXES
+	include/gdal
+	include/GDAL
+	include
+	PATHS
+	~/Library/Frameworks/gdal.framework/Headers
+	/Library/Frameworks/gdal.framework/Headers
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+)
+
+find_library (GDAL_LIBRARY
+	NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
+	HINTS
+	${GDAL_DIR}
+	${GDAL_ROOT}
+	$ENV{GDAL_DIR}
+	$ENV{GDAL_ROOT}
+	${_gdal_libpath}
+	PATH_SUFFIXES lib
+	PATHS
+	~/Library/Frameworks/gdal.framework
+	/Library/Frameworks/gdal.framework
+	/sw # Fink
+	/opt/local # DarwinPorts
+	/opt/csw # Blastwave
+	/opt
+	/usr/local
+)
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
+
+set (GDAL_LIBRARIES ${GDAL_LIBRARY})
+set (GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
+
+# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
diff --git a/src/gmt_io.c b/src/gmt_io.c
index 3c7c0e4..59a86e6 100644
--- a/src/gmt_io.c
+++ b/src/gmt_io.c
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------
- *	$Id: gmt_io.c 18134 2017-05-05 08:34:43Z pwessel $
+ *	$Id: gmt_io.c 18199 2017-05-09 10:09:30Z remko $
  *
  *	Copyright (c) 1991-2017 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
  *	See LICENSE.TXT file for copying and redistribution conditions.
@@ -7582,9 +7582,11 @@ struct GMT_IMAGE *gmtlib_create_image (struct GMT_CTRL *GMT) {
 	I->alloc_level = GMT->hidden.func_level;	/* Must be freed at this level. */
 	I->id = GMT->parent->unique_var_ID++;		/* Give unique identifier */
 	gmt_grd_init (GMT, I->header, NULL, false); /* Set default values */
+#ifdef HAVE_GDAL
 	if (GMT->current.gdal_read_in.O.mem_layout[0])
 		gmt_strncpy (I->header->mem_layout, GMT->current.gdal_read_in.O.mem_layout, 4);	/* Set the current memory layout */
 	else
+#endif
 		gmt_strncpy (I->header->mem_layout, GMT_IMAGE_LAYOUT, 4);	/* Set the default array memory layout */
 	GMT_Set_Index (GMT->parent, I->header, GMT_IMAGE_LAYOUT);
 	return (I);
diff --git a/src/grdimage.c b/src/grdimage.c
index 4c2ff1a..f287bc2 100644
--- a/src/grdimage.c
+++ b/src/grdimage.c
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------
- *	$Id: grdimage.c 18110 2017-05-03 01:29:16Z pwessel $
+ *	$Id: grdimage.c 18199 2017-05-09 10:09:30Z remko $
  *
  *	Copyright (c) 1991-2017 by P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis and F. Wobbe
  *	See LICENSE.TXT file for copying and redistribution conditions.
@@ -899,9 +899,11 @@ int GMT_grdimage (void *V_API, int mode, void *args) {
 			img_wesn[YLO] -= 0.5 * img_inc[1];		img_wesn[YHI] += 0.5 * img_inc[1];
 		}
 		if (Ctrl->Q.active) dim[GMT_Z]++;	/* Flag to remind us that we need to allocate a transparency array */
+#ifdef HAVE_GDAL
 		if (GMT->current.gdal_read_in.O.mem_layout[0])
 			strcpy (mem_layout, GMT->current.gdal_read_in.O.mem_layout);	/* Backup current layout */
 		else
+#endif
 			gmt_strncpy (mem_layout, "TRPa", 4);					/* Don't let it be empty (may it screw?) */
 		GMT_Set_Default (API, "API_IMAGE_LAYOUT", "TRPa");			/* This is the grdimage's mem layout */
 
diff --git a/src/postscriptlight.c b/src/postscriptlight.c
index afd884a..666cd92 100644
--- a/src/postscriptlight.c
+++ b/src/postscriptlight.c
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------
- *	$Id: postscriptlight.c 18069 2017-04-29 22:43:25Z pwessel $
+ *	$Id: postscriptlight.c 18205 2017-05-09 21:01:41Z pwessel $
  *
  *	Copyright (c) 2009-2017 by P. Wessel and R. Scharroo
  *
@@ -127,6 +127,9 @@
 #else
 #	define assert(e) ((void)0)
 #endif
+#ifdef HAVE_UNISTD_H_
+#	include <unistd.h>
+#endif
 
 /*
  * Windows headers
@@ -198,6 +201,8 @@ static inline uint32_t inline_bswap32 (uint32_t x) {
 #define PSL_exit(code) exit(code)
 #endif
 
+#define PSL_M_unused(x) (void)(x)
+
 /* ISO Font encodings.  Ensure that the order of PSL_ISO_names matches order of includes below */
 
 static char *PSL_ISO_name[] = {
@@ -1253,6 +1258,8 @@ static unsigned char *psl_deflate_encode (struct PSL_CTRL *PSL, size_t *nbytes,
 
 #else /* HAVE_ZLIB */
 	/* ZLIB not available */
+	PSL_M_unused(nbytes);
+	PSL_M_unused(input);
 	PSL_message (PSL, PSL_MSG_VERBOSE, "Cannot DEFLATE because ZLIB is not available.\n");
 	return NULL;
 #endif /* HAVE_ZLIB */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/gmt.git



More information about the Pkg-grass-devel mailing list