-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dane Springmeyer
committed
Apr 7, 2016
1 parent
2547135
commit f525fe4
Showing
25 changed files
with
1,949 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
|
||
set GDAL_DIR=c:\gdal114 | ||
|
||
if exist %GDAL_DIR%\SETUP_GDAL.BAT goto DIROK | ||
|
||
echo ----------------------------------------------------------------------- | ||
echo It appears that the GDAL_DIR environment variable is not set properly | ||
echo in SETUP_GDAL.BAT. Please edit GDAL_SETUP.BAT, and modify the GDAL_DIR | ||
echo variable to contain the directory containing the SETUP_GDAL.BAT ... the | ||
echo base directory of the unzipped GDAL tree. | ||
echo ----------------------------------------------------------------------- | ||
|
||
goto Done | ||
|
||
:DIROK | ||
|
||
set PATH=%GDAL_DIR%\bin;%PATH% | ||
set INCLUDE=%GDAL_DIR%\include;%INCLUDE% | ||
set LIB=%GDAL_DIR%\include;%LIB% | ||
set PYTHONPATH=%GDAL_DIR%\pymod;%PYTHONPATH% | ||
set GEOTIFF_CSV=%GDAL_DIR%\data | ||
|
||
:Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
const static int block_size = 10000; | ||
|
||
/************************************************************************/ | ||
/* main() */ | ||
/************************************************************************/ | ||
int main( int argc, char ** argv ) | ||
|
||
{ | ||
FILE *fp; | ||
int offset, size, overlap; | ||
const char *marker; | ||
const char *path; | ||
const char *targetfile; | ||
char blockbuf[block_size+1]; | ||
|
||
/* -------------------------------------------------------------------- */ | ||
/* Usage message. */ | ||
/* -------------------------------------------------------------------- */ | ||
if( argc < 4 ) | ||
{ | ||
printf( "\n" ); | ||
printf( "Usage: burnpath <targetfile> <marker_string> <path>\n" ); | ||
printf( "\n" ); | ||
printf( "eg. \n" ); | ||
printf( " %% burnpath /opt/lib/libgdal.1.1.so __INST_DATA_TARGET: /opt/share/gdal\n" ); | ||
exit( 1 ); | ||
} | ||
|
||
targetfile = argv[1]; | ||
marker = argv[2]; | ||
path = argv[3]; | ||
|
||
overlap = strlen(marker) + strlen(path) + 1; | ||
|
||
/* -------------------------------------------------------------------- */ | ||
/* Open the target file. */ | ||
/* -------------------------------------------------------------------- */ | ||
fp = fopen( targetfile, "r+" ); | ||
if( fp == NULL ) | ||
{ | ||
perror( "fopen" ); | ||
exit( 1 ); | ||
} | ||
|
||
/* -------------------------------------------------------------------- */ | ||
/* Establish the file length. */ | ||
/* -------------------------------------------------------------------- */ | ||
fseek( fp, 0, SEEK_END ); | ||
size = ftell( fp ); | ||
fseek( fp, 0, SEEK_SET ); | ||
|
||
/* -------------------------------------------------------------------- */ | ||
/* Read in the file in overlapping chunks. We assume the */ | ||
/* "space" after the marker could be up to 200 bytes. */ | ||
/* -------------------------------------------------------------------- */ | ||
for( offset = 0; offset < size; offset += block_size - overlap ) | ||
{ | ||
int block_bytes, block_modified = 0, i; | ||
|
||
if( offset + block_size < size ) | ||
block_bytes = block_size; | ||
else | ||
block_bytes = size - offset; | ||
|
||
if( fseek( fp, offset, SEEK_SET ) != 0 ) | ||
{ | ||
perror( "fseek" ); | ||
exit( 1 ); | ||
} | ||
|
||
if( fread( blockbuf, block_bytes, 1, fp ) != 1 ) | ||
{ | ||
perror( "fread" ); | ||
exit( 1 ); | ||
} | ||
blockbuf[block_bytes] = '\0'; | ||
|
||
for( i = 0; i < block_bytes - overlap; i++ ) | ||
{ | ||
if( blockbuf[i] == marker[0] | ||
&& strncmp( blockbuf + i, marker, strlen(marker) ) == 0 ) | ||
{ | ||
strcpy( blockbuf+i+strlen(marker), path ); | ||
block_modified = 1; | ||
} | ||
} | ||
|
||
if( block_modified ) | ||
{ | ||
if( fseek( fp, offset, SEEK_SET ) != 0 ) | ||
{ | ||
perror( "fseek" ); | ||
exit( 1 ); | ||
} | ||
|
||
if( fwrite( blockbuf, block_bytes, 1, fp ) != 1 ) | ||
{ | ||
perror( "fwrite" ); | ||
exit( 1 ); | ||
} | ||
} | ||
} | ||
|
||
/* -------------------------------------------------------------------- */ | ||
/* We are done. */ | ||
/* -------------------------------------------------------------------- */ | ||
fclose( fp ); | ||
|
||
exit( 0 ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/sh | ||
|
||
if test $# -eq 0; then | ||
echo "Usage: install_unx.sh install-path" | ||
echo | ||
echo "This script will attempt to install GDAL binaries, and shared" | ||
echo "library in the named location." | ||
exit 1 | ||
fi | ||
|
||
PREFIX=$1 | ||
|
||
if test ! -d $PREFIX ; then | ||
echo "Directory $PREFIX does not exist. Please create or correct." | ||
exit 1 | ||
fi | ||
|
||
if test ! -f bin/gdalinfo ; then | ||
echo "This script must be run from within the unpacked binary distribution" | ||
echo "directory." | ||
exit 1 | ||
fi | ||
|
||
############################################################################### | ||
# Ensure required subdirectories exist. | ||
# | ||
|
||
if test ! -d $PREFIX/lib ; then | ||
mkdir $PREFIX/lib | ||
fi | ||
if test ! -d $PREFIX/bin ; then | ||
mkdir $PREFIX/bin | ||
fi | ||
if test ! -d $PREFIX/share ; then | ||
mkdir $PREFIX/share | ||
fi | ||
if test ! -d $PREFIX/share/gdal ; then | ||
mkdir $PREFIX/share/gdal | ||
fi | ||
|
||
############################################################################### | ||
# The following is intended to "burn" an updated INST_DATA location | ||
# into the given file over the preformatted message embedded in the so. | ||
# Look at gcore/gdaldrivermanager.cpp for a clue as to what is going on there. | ||
# | ||
|
||
SHARED_LIB=libgdal.1.1.so | ||
|
||
for SHARED_LIB in lib/* ; do | ||
cp $SHARED_LIB $PREFIX/lib | ||
bin/burnpath $PREFIX/$SHARED_LIB __INST_DATA_TARGET: $PREFIX/share/gdal | ||
done | ||
|
||
############################################################################### | ||
# Copy the rest of the files. | ||
# | ||
|
||
cp share/gdal/* $PREFIX/share/gdal | ||
|
||
for EXECUTABLE in bin/* ; do | ||
if test "$EXECUTABLE" == "bin/gdal-config" -o "$EXECUTABLE" == "bin/burnpath" ; then | ||
/bin/true | ||
else | ||
cp $EXECUTABLE $PREFIX/bin | ||
bin/burnpath $PREFIX/$EXECUTABLE __INST_DATA_TARGET: $PREFIX/share/gdal | ||
fi | ||
done | ||
|
||
echo "Installation of GDAL to $PREFIX complete." | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
################################################################################# | ||
# | ||
# This file is part of CMake configuration for PROJ4 library (inspired from SOCI | ||
# CMake, Copyright (C) 2009-2010 Mateusz Loskot <[email protected]> ) | ||
# | ||
# Copyright (C) 2011 Nicolas David <[email protected]> | ||
# Distributed under the MIT license | ||
# | ||
################################################################################# | ||
# General settings | ||
################################################################################# | ||
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) | ||
|
||
# proj4 is an ANSI C project | ||
project(PROJ4 C) | ||
set(PROJECT_INTERN_NAME PROJ) | ||
|
||
################################################################################# | ||
# PROJ4 CMake modules | ||
################################################################################# | ||
# Path to additional CMake modules | ||
set(CMAKE_MODULE_PATH ${PROJ4_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) | ||
set(CMAKE_MODULE_PATH ${PROJ4_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) | ||
|
||
include(Proj4Utilities) | ||
|
||
message(STATUS "") | ||
colormsg(_HIBLUE_ "Configuring PROJ:") | ||
|
||
################################################################################# | ||
#PROJ version information | ||
################################################################################# | ||
include(Proj4Version) | ||
proj_version(MAJOR 4 MINOR 9 PATCH 2) | ||
set(PROJ_API_VERSION "9") | ||
set(PROJ_BUILD_VERSION "10.0.1") | ||
|
||
################################################################################# | ||
# Build features and variants | ||
################################################################################# | ||
include(Proj4SystemInfo) | ||
include(Proj4Config) | ||
include(Proj4Mac) | ||
include(policies) | ||
|
||
################################################################################# | ||
# threading configuration | ||
################################################################################# | ||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) | ||
find_package (Threads) | ||
|
||
include(CheckIncludeFiles) | ||
include(CheckSymbolExists) | ||
CHECK_SYMBOL_EXISTS(PTHREAD_MUTEX_RECURSIVE pthread.h HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) | ||
if (HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN) | ||
add_definitions(-DHAVE_PTHREAD_MUTEX_RECURSIVE=1) | ||
endif() | ||
|
||
boost_report_value(PROJ_PLATFORM_NAME) | ||
boost_report_value(PROJ_COMPILER_NAME) | ||
|
||
# Set a default build type for single-configuration cmake generators if | ||
# no build type is set. | ||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE Release) | ||
endif () | ||
|
||
if (MSVC OR CMAKE_CONFIGURATION_TYPES) | ||
# For multi-config systems and for Visual Studio, the debug version of | ||
# the library has _d appended. | ||
set (CMAKE_DEBUG_POSTFIX _d) | ||
endif () | ||
|
||
option(PROJ4_TESTS "Enable build of collection of PROJ4 tests" ON) | ||
boost_report_value(PROJ4_TESTS) | ||
if(PROJ4_TESTS) | ||
include(CTest) | ||
enable_testing() | ||
endif(PROJ4_TESTS) | ||
include(Proj4Test) | ||
|
||
# Put the libaries and binaries that get built into directories at the | ||
# top of the build tree rather than in hard-to-find leaf | ||
# directories. This simplifies manual testing and the use of the build | ||
# tree rather than installed Boost libraries. | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | ||
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) | ||
|
||
################################################################################# | ||
# Installation | ||
################################################################################# | ||
include(Proj4InstallPath) | ||
set(BINDIR "${DEFAULT_BINDIR}" CACHE PATH "The directory to install binaries into.") | ||
set(LIBDIR "${DEFAULT_LIBDIR}" CACHE PATH "The directory to install libraries into.") | ||
set(DATADIR "${DEFAULT_DATADIR}" CACHE PATH "The directory to install data files into.") | ||
set(DOCDIR "${DEFAULT_DOCDIR}" CACHE PATH "The directory to install doc files into.") | ||
set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}" CACHE PATH "The directory to install includes into.") | ||
|
||
################################################################################# | ||
# Build configured components | ||
################################################################################# | ||
include_directories(${PROJ4_SOURCE_DIR}/src) | ||
|
||
message(STATUS "") | ||
add_subdirectory(nad) | ||
add_subdirectory(src) | ||
add_subdirectory(man) | ||
add_subdirectory(cmake) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# proj-config.cmake for the install tree. It's installed in | ||
# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative | ||
# path to the root from there. (Note that the whole install tree can | ||
# be relocated.) | ||
if (NOT WIN32) | ||
set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") | ||
set (PROJECT_ROOT_DIR "../../..") | ||
else () | ||
set (INSTALL_CMAKE_DIR "cmake") | ||
set (PROJECT_ROOT_DIR "..") | ||
endif () | ||
|
||
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) | ||
configure_file (project-config.cmake.in project-config.cmake @ONLY) | ||
configure_file (project-config-version.cmake.in | ||
project-config-version.cmake @ONLY) | ||
install (FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake" | ||
DESTINATION "${INSTALL_CMAKE_DIR}" | ||
RENAME "${PROJECT_NAME_LOWER}-config.cmake") | ||
install (FILES | ||
"${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake" | ||
DESTINATION "${INSTALL_CMAKE_DIR}" | ||
RENAME "${PROJECT_NAME_LOWER}-config-version.cmake") | ||
# Make information about the cmake targets (the library and the tools) | ||
# available. | ||
install (EXPORT targets | ||
FILE ${PROJECT_NAME_LOWER}-targets.cmake | ||
DESTINATION "${INSTALL_CMAKE_DIR}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
################################################################################ | ||
# SociConfig.cmake - CMake build configuration of SOCI library | ||
################################################################################ | ||
# Copyright (C) 2010 Mateusz Loskot <[email protected]> | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
################################################################################ | ||
include (CheckIncludeFiles) | ||
include (CheckLibraryExists) | ||
include (CheckFunctionExists) | ||
|
||
# check needed include file | ||
check_include_files (dlfcn.h HAVE_DLFCN_H) | ||
check_include_files (inttypes.h HAVE_INTTYPES_H) | ||
check_include_files (jni.h HAVE_JNI_H) | ||
check_include_files (memory.h HAVE_MEMORY_H) | ||
check_include_files (stdint.h HAVE_STDINT_H) | ||
check_include_files (stdlib.h HAVE_STDLIB_H) | ||
check_include_files (string.h HAVE_STRING_H) | ||
check_include_files (sys/stat.h HAVE_SYS_STAT_H) | ||
check_include_files (sys/types.h HAVE_SYS_TYPES_H) | ||
check_include_files (unistd.h HAVE_UNISTD_H) | ||
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) | ||
|
||
CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) | ||
|
||
# check libm need on unix | ||
check_library_exists(m ceil "" HAVE_LIBM) | ||
|
||
set(PACKAGE "proj") | ||
set(PACKAGE_BUGREPORT "[email protected]") | ||
set(PACKAGE_NAME "PROJ.4 Projections") | ||
set(PACKAGE_STRING "PROJ.4 Projections ${${PROJECT_INTERN_NAME}_VERSION}") | ||
set(PACKAGE_TARNAME "proj") | ||
set(PACKAGE_VERSION "${${PROJECT_INTERN_NAME}_VERSION}") | ||
|
||
configure_file(cmake/proj_config.cmake.in src/proj_config.h) | ||
|
||
|
Oops, something went wrong.