Commit 78cb6186 authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 1.8.3

parent b2c27c2d
......@@ -8,4 +8,7 @@ Leonard Norrgård - CountVisitor in C API
leonard.norrgard@refactor.fi
Matthias (nitro) - CustomStorage in C API
nitro@dr-code.org
\ No newline at end of file
nitro@dr-code.org
Norman Barker - flush(), index paging, C API improvements
norman.barker@gmail.com
\ No newline at end of file
......@@ -16,17 +16,19 @@ set(CMAKE_COLOR_MAKEFILE ON)
mark_as_advanced(CMAKE_VERBOSE_MAKEFILE)
# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
if (CMAKE_MAJOR_VERSION GREATER 2)
cmake_policy(SET CMP0042 OLD) # osx rpath
endif()
#------------------------------------------------------------------------------
# libspatialindex general settings
#------------------------------------------------------------------------------
SET(SIDX_VERSION_MAJOR "1")
SET(SIDX_VERSION_MINOR "8")
SET(SIDX_VERSION_PATCH "1")
SET(SIDX_LIB_SOVERSION "3.0.0")
SET(SIDX_VERSION_PATCH "3")
SET(SIDX_LIB_SOVERSION "3.2.0")
set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}")
......@@ -39,7 +41,7 @@ set(SIDX_C_LIB_NAME spatialindex_c)
if(WIN32)
if (MSVC)
if (MSVC80 OR MSVC90 OR MSVC10)
if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11 OR MSVC12)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( SIDX_LIB_NAME "spatialindex-64" )
set( SIDX_C_LIB_NAME "spatialindex_c-64" )
......@@ -63,7 +65,7 @@ check_function_exists(memcpy HAVE_MEMCPY)
check_function_exists(bcopy HAVE_BCOPY)
INCLUDE (CheckIncludeFiles)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_include_files(pthread.h HAVE_PTHREAD_H)
if (HAVE_SRAND48)
......@@ -94,10 +96,6 @@ if (HAVE_PTHREAD_H)
add_definitions(-DHAVE_PTHREAD_H=1)
endif()
# Choose to use pkg-config or not
#set(WITH_PKGCONFIG FALSE CACHE BOOL
# "Choose whether a pkgconfig file (PDAL.pc) should be installed")
#------------------------------------------------------------------------------
# General build settings
#------------------------------------------------------------------------------
......@@ -114,7 +112,7 @@ endif()
set(SIDX_BUILD_TYPE ${CMAKE_BUILD_TYPE})
# TODO: Still testing the output paths --mloskot
set(SIDX_BUILD_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(SIDX_BUILD_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
# Output directory in which to build RUNTIME target files.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SIDX_BUILD_OUTPUT_DIRECTORY})
......@@ -132,23 +130,15 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SIDX_BUILD_OUTPUT_DIRECTORY})
if(WIN32)
if (MSVC)
if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11)
if (MSVC80 OR MSVC90 OR MSVC10 OR MSVC11 OR MSVC12 OR MSVC13)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DSPATIALINDEX_CREATE_DLL=1)
add_definitions(-DNOMINMAX)
set(SIDX_COMPILER_MSVC 1)
if (MSVC11)
set(SIDX_COMPILER_VC11 1)
elseif (MSVC10)
set(SIDX_COMPILER_VC10 1)
elseif (MSVC9)
set(SIDX_COMPILER_VC9 1)
elseif (MSVC8)
set(SIDX_COMPILER_VC8 1)
endif()
endif()
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
......
2014-09-11
* Howard Butler <howard@hobu.co> Changelog update (10:57:08)
* Howard Butler <howard@hobu.co> clean up integer warning (10:56:53)
* Howard Butler <howard@hobu.co> Merge pull request #42 from libspatialindex/issues/42-automake-exports (10:54:58)
* Howard Butler <howard@hobu.co> Add sidx_export to Makefile.am #42 (10:54:07)
2014-08-27
* Howard Butler <howard@hobu.co> Merge pull request #41 from cloudant/capi_mvrtree (10:20:03)
2014-08-26
* Norman Barker <norman@cloudant.com> fixed typo in MVRIntersects_Count (17:18:32)
* Norman Barker <norman@cloudant.com> added MVR index type to the C API (17:16:03)
2014-08-03
* Howard Butler <hobu.inc@gmail.com> fix up Release name (14:14:35)
2014-07-28
* Howard Butler <hobu.inc@gmail.com> unused parameters (10:04:59)
* Howard Butler <hobu.inc@gmail.com> clean up C API for numResults being a uint64_t when it is only possible to specify uint32_t of nResults (09:53:36)
* Howard Butler <hobu.inc@gmail.com> more C API warning cleanups (09:50:55)
* Howard Butler <hobu.inc@gmail.com> leaf node counts are uint32_t, not size_t (09:34:41)
* Howard Butler <hobu@hobu.co> silence condition expression warning 4127 on msvc (09:20:58)
* Howard Butler <hobu.inc@gmail.com> unreferenced parameter cleanup (09:13:36)
* Howard Butler <hobu.inc@gmail.com> nuke assignment and empty constructor of C API Index class (09:13:01)
* Howard Butler <hobu.inc@gmail.com> children count is uint32_t (09:11:04)
* Howard Butler <hobu.inc@gmail.com> clean up LeafQuery visitor id management (09:09:20)
* Howard Butler <hobu.inc@gmail.com> clean up more unused parameters (08:37:24)
* Howard Butler <hobu.inc@gmail.com> fix mismatched type warning (using uint32_t as an id instead of SpatialIndex::id_type (08:37:15)
* Howard Butler <hobu.inc@gmail.com> remove unused and potentially problematic throw specification for DataStream (08:28:49)
* Howard Butler <hobu.inc@gmail.com> export all C API stuff to the DLL (08:23:49)
2014-07-27
* Howard Butler <hobu.inc@gmail.com> more unreferenced parameter cleanups (23:37:25)
* Howard Butler <hobu.inc@gmail.com> screw 20ad010a1b55a4437b73c805270837c294b57251 and MSVC's dumb C4127 warning (23:36:15)
* Howard Butler <hobu.inc@gmail.com> more unreferenced parameter warnings (23:34:20)
* Howard Butler <hobu.inc@gmail.com> use ;; to denote looping forever to silence C4127 warning on MSVC (23:34:11)
* Howard Butler <hobu@hobu.co> support MSVC 2012 and 2013 (23:30:59)
* Howard Butler <hobu.inc@gmail.com> big unreferenced variable cleanup (23:30:35)
* Howard Butler <hobu.inc@gmail.com> clean up some unreferenced parameters warnings (23:17:14)
* Howard Butler <hobu.inc@gmail.com> Merge branch 'master' of github.com:libspatialindex/libspatialindex (23:03:10)
* Howard Butler <howard@hobu.co> Merge pull request #40 from libspatialindex/issues/40-capi-property-copying (23:03:04)
* Howard Butler <hobu.inc@gmail.com> clean up file open mode (23:02:48)
* Howard Butler <hobu.inc@gmail.com> bump versions to 1.8.2 in preparation for release (22:59:49)
* Howard Butler <hobu.inc@gmail.com> Update ChangeLog in preparation for release (22:59:21)
* Howard Butler <hobu.inc@gmail.com> add Norman to AUTHORS (22:57:12)
* Howard Butler <hobu.inc@gmail.com> Implement a fix for #40 to maintain pointers to IndexProperty references rather than copying (18:15:38)
2014-07-22
* Howard Butler <hobu.inc@gmail.com> only do policy check for CMAKE > 2.x (11:25:02)
* Howard Butler <hobu.inc@gmail.com> turn off osx rpath cmake complaint (11:05:29)
2014-07-14
* Howard Butler <hobu.inc@gmail.com> more cmake quoting #27 (16:07:21)
* Howard Butler <hobu.inc@gmail.com> fix up unfixed LGPL file from test suite (16:07:04)
2014-07-12
* Howard Butler <hobu.inc@gmail.com> add BUILD_WITH_INSTALL_RPATH target property for OSX (23:59:03)
* Howard Butler <hobu.inc@gmail.com> CMake config quoting #27 (23:50:05)
* Howard Butler <hobu.inc@gmail.com> FSF postal adress update #5 (23:38:24)
* Howard Butler <hobu.inc@gmail.com> support wide character as possible tools::Variant type -- doesn't work yet though (23:32:19)
* Howard Butler <hobu.inc@gmail.com> add VT_PWCHAR to support wide character pointer for the Variant type (23:31:15)
* Howard Butler <hobu.inc@gmail.com> add MSVC 2013 and 2014 defns (23:27:45)
* Howard Butler <hobu.inc@gmail.com> fix redundant checks in destructor #28 (23:25:39)
* Howard Butler <hobu.inc@gmail.com> Remove LDFLAGS from Libs for pkg-config #23 (23:24:32)
2014-05-12
* Howard Butler <howard@hobu.co> Merge pull request #38 from cloudant/c_tpr (10:22:16)
2014-05-10
* Norman Barker <norman@cloudant.com> added temporal function to capi (16:49:28)
2014-05-08
* Howard Butler <howard@hobu.co> Merge pull request #37 from cloudant/paging (13:48:51)
2014-05-07
* Norman Barker <norman@cloudant.com> added paging to all indexes (19:11:58)
2014-03-13
* Howard Butler <hobu.inc@gmail.com> turn off the unused m_rwLock for now (21:15:39)
* Howard Butler <hobu.inc@gmail.com> switch to int64_t instead of uint64_t when checking result counts (21:15:14)
* Howard Butler <hobu.inc@gmail.com> add newline to end of file (21:07:45)
2014-02-13
* Howard Butler <howard@hobu.co> Merge pull request #32 from cloudant/empty_index (19:00:32)
* Howard Butler <howard@hobu.co> Merge pull request #33 from mlt/nominmax (19:00:07)
2014-02-12
* Mikhail Titov <mlt@gmx.us> Prevent min/max from windef.h interference (15:09:53)
2014-02-11
* Norman Barker <norman@cloudant.com> Added support for empty index files (17:46:14)
2013-09-09
* Howard Butler <howard@hobu.co> update download location for new release (12:07:03)
2013-08-21
* Howard Butler <howard@hobu.co> Merge pull request #26 from cloudant/skip_results (15:32:33)
2013-08-19
* Norman Barker <norman@cloudant.com> made files protected variables (21:37:25)
* Norman Barker <norman@cloudant.com> added paging and flushing (21:35:32)
2013-07-29
* Norman Barker <norman@cloudant.com> Added error handling to the C API (20:52:47)
2013-07-25
* Norman Barker <norman@cloudant.com> Added Result Set Limit so that the number of items can be controlled. (17:58:54)
2013-06-26
* Howard Butler <hobu.inc@gmail.com> fixups for MSVC2008 compilation (14:17:28)
* Howard Butler <hobu.inc@gmail.com> updates for v1.8.1 release (13:51:45)
* Howard Butler <hobu.inc@gmail.com> Merge branch 'master' of github.com:libspatialindex/libspatialindex (13:44:32)
* Howard Butler <hobu.inc@gmail.com> increment versions in preparation for 1.8.1 release (13:43:28)
* Howard Butler <hobu.inc@gmail.com> Merge pull request #22 from libspatialindex/issues/22-lgpl-fixups (13:40:35)
* Howard Butler <hobu.inc@gmail.com> update licenses for #22 (13:39:34)
* Howard Butler <hobu.inc@gmail.com> Merge branch 'libspatialindex-issues/19-mingw64' (13:26:44)
2013-06-04
......
......@@ -3,7 +3,7 @@ SUBDIRS = src . test include
lib_LTLIBRARIES = libspatialindex.la libspatialindex_c.la
libspatialindex_la_SOURCES =
libspatialindex_la_SOURCES =
libspatialindex_la_LIBADD = \
src/spatialindex/liblibrary.la \
src/storagemanager/libstoragemanager.la \
......@@ -17,8 +17,8 @@ libspatialindex_c_la_LIBADD = \
libspatialindex.la \
src/capi/libsidxc.la
libspatialindex_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
libspatialindex_c_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
libspatialindex_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
libspatialindex_c_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
EXTRA_DIST = INSTALL.WIN \
spatialindex.sln \
......
# Makefile.in generated by automake 1.13.1 from Makefile.am.
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -15,23 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
test $$am__dry = yes; \
}
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
......@@ -54,8 +82,8 @@ subdir = .
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) mkinstalldirs \
COPYING config.guess config.sub depcomp install-sh missing \
ltmain.sh
COPYING compile config.guess config.sub depcomp install-sh \
missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
......@@ -370,8 +398,8 @@ libspatialindex_c_la_LIBADD = \
libspatialindex.la \
src/capi/libsidxc.la
libspatialindex_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
libspatialindex_c_la_LDFLAGS = -version-info 3:0:0 -no-undefined -lstdc++
libspatialindex_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
libspatialindex_c_la_LDFLAGS = -version-info 3:2:0 -no-undefined -lstdc++
EXTRA_DIST = INSTALL.WIN \
spatialindex.sln \
spatialindex-vc/spatialindex.vcproj \
......@@ -459,8 +487,10 @@ clean-libLTLIBRARIES:
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libspatialindex.la: $(libspatialindex_la_OBJECTS) $(libspatialindex_la_DEPENDENCIES) $(EXTRA_libspatialindex_la_DEPENDENCIES)
$(AM_V_CCLD)$(libspatialindex_la_LINK) -rpath $(libdir) $(libspatialindex_la_OBJECTS) $(libspatialindex_la_LIBADD) $(LIBS)
libspatialindex_c.la: $(libspatialindex_c_la_OBJECTS) $(libspatialindex_c_la_DEPENDENCIES) $(EXTRA_libspatialindex_c_la_DEPENDENCIES)
$(AM_V_CCLD)$(libspatialindex_c_la_LINK) -rpath $(libdir) $(libspatialindex_c_la_OBJECTS) $(libspatialindex_c_la_LIBADD) $(LIBS)
......@@ -486,13 +516,12 @@ distclean-libtool:
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
......@@ -666,10 +695,16 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
......@@ -711,9 +746,10 @@ distcheck: dist
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
......
......@@ -4,7 +4,7 @@
:Author: Marios Hadjieleftheriou
:Contact: mhadji@gmail.com
:Revision: 1.8.1
:Date: 06/26/2013
:Revision: 1.8.3
:Date: 09/20/2014
See http://libspatialindex.org for full documentation.
\ No newline at end of file
See http://libspatialindex.org for full documentation.
This diff is collapsed.
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2