[osm2pgsql] 02/09: Don't use --without-lockfree option, add patch to link boost_atomic properly instead.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Mon Jul 6 06:50:51 UTC 2015


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

sebastic pushed a commit to branch master
in repository osm2pgsql.

commit 2c174c6fe35fe5cbc5e0f636e00470cad3720ee9
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Mon May 25 00:50:40 2015 +0200

    Don't use --without-lockfree option, add patch to link boost_atomic properly instead.
---
 debian/changelog                                   |   3 +-
 debian/patches/0001-add-boost-atomic-library.patch | 164 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 debian/rules                                       |   6 +-
 4 files changed, 168 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 28ca951..7a2744b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 osm2pgsql (0.87.3-4) UNRELEASED; urgency=medium
 
-  * Don't use --without-lockfree option, link boost_atomic explicitly instead.
+  * Don't use --without-lockfree option, add patch to link boost_atomic
+    properly instead.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 01 May 2015 19:08:56 +0200
 
diff --git a/debian/patches/0001-add-boost-atomic-library.patch b/debian/patches/0001-add-boost-atomic-library.patch
new file mode 100644
index 0000000..e18b6ad
--- /dev/null
+++ b/debian/patches/0001-add-boost-atomic-library.patch
@@ -0,0 +1,164 @@
+From c770d077cf9250a3c66801f2c071d355ae30c8ca Mon Sep 17 00:00:00 2001
+From: Sarah Hoffmann <lonvia at denofr.de>
+Date: Sun, 24 May 2015 21:27:33 +0200
+Origin: https://github.com/openstreetmap/osm2pgsql/commit/c770d077cf9250a3c66801f2c071d355ae30c8ca
+Bug: https://github.com/openstreetmap/osm2pgsql/issues/231
+Subject: add boost atomic library
+
+Fixes #231.
+
+Also fail if any of the mandatory boost libraries is missing, fixes #256.
+---
+ Makefile.am           |   2 +-
+ configure.ac          |   5 +++
+ m4/ax_boost_atomic.m4 | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 125 insertions(+), 1 deletion(-)
+ create mode 100644 m4/ax_boost_atomic.m4
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -160,7 +160,7 @@ osm2pgsqldir = $(datadir)/osm2pgsql
+ AM_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @POSTGRESQL_CPPFLAGS@ @XML2_CFLAGS@ @BZIP2_CFLAGS@ @GEOS_CFLAGS@ @PROJ_CFLAGS@ @PROTOBUF_C_CFLAGS@ @ZLIB_CFLAGS@ -DOSM2PGSQL_DATADIR='"$(osm2pgsqldir)"' -DVERSION='"@PACKAGE_VERSION@"' @LUA_INCLUDE@
+ AM_CPPFLAGS = @PTHREAD_CFLAGS@ @POSTGRESQL_CPPFLAGS@ @XML2_CFLAGS@ @BZIP2_CFLAGS@ @GEOS_CFLAGS@ @PROJ_CFLAGS@ -DOSM2PGSQL_DATADIR='"$(osm2pgsqldir)"' -Igeos-fallback @LUA_INCLUDE@ @BOOST_CPPFLAGS@
+ 
+-GLOBAL_LDFLAGS = @PTHREAD_CFLAGS@ @ZLIB_LDFLAGS@ @ZLIB_LIBS@ @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@ @XML2_LDFLAGS@ @BZIP2_LDFLAGS@ @BZIP2_LIBS@ @GEOS_LDFLAGS@ @GEOS_LIBS@ @PROJ_LDFLAGS@ @PROJ_LIBS@ @PROTOBUF_C_LDFLAGS@ @PROTOBUF_C_LIBS@ -L/usr/lib/x86_64-linux-gnu @LUA_LIB@ @BOOST_LDFLAGS@ @BOOST_FILESYSTEM_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_THREAD_LIB@
++GLOBAL_LDFLAGS = @PTHREAD_CFLAGS@ @ZLIB_LDFLAGS@ @ZLIB_LIBS@ @POSTGRESQL_LDFLAGS@ @POSTGRESQL_LIBS@ @XML2_LDFLAGS@ @BZIP2_LDFLAGS@ @BZIP2_LIBS@ @GEOS_LDFLAGS@ @GEOS_LIBS@ @PROJ_LDFLAGS@ @PROJ_LIBS@ @PROTOBUF_C_LDFLAGS@ @PROTOBUF_C_LIBS@ -L/usr/lib/x86_64-linux-gnu @LUA_LIB@ @BOOST_LDFLAGS@ @BOOST_FILESYSTEM_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_ATOMIC_LIB@
+ osm2pgsql_LDADD += $(GLOBAL_LDFLAGS)
+ tests_test_parse_xml2_LDADD += $(GLOBAL_LDFLAGS)
+ tests_test_middle_ram_LDADD += $(GLOBAL_LDFLAGS)
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,6 +112,11 @@ AX_BOOST_BASE([1.48], , [AC_MSG_ERROR([c
+ AX_BOOST_SYSTEM
+ AX_BOOST_FILESYSTEM
+ AX_BOOST_THREAD
++AX_BOOST_ATOMIC
++if test "x$BOOST_SYSTEM_LIB" = "x" -o "x$BOOST_FILESYSTEM_LIB" = "x" -o "x$BOOST_THREAD_LIB" = "x" -o "x$BOOST_ATOMIC_LIB" = "x"
++then
++    AC_MSG_ERROR([One or more of the mandatory Boost libraries not found.])
++fi
+ 
+ dnl Check if Boost is recent enough for lockfree, and if it hasn't been overridden
+ AC_ARG_WITH([lockfree],
+--- /dev/null
++++ b/m4/ax_boost_atomic.m4
+@@ -0,0 +1,119 @@
++# SYNOPSIS
++#
++#   AX_BOOST_ATOMIC
++#
++# DESCRIPTION
++#
++#   Test for Atomic library from the Boost C++ libraries. The macro requires
++#   a preceding call to AX_BOOST_BASE. Further documentation is available at
++#   <http://randspringer.de/boost/index.html>.
++#
++#   This macro calls:
++#
++#     AC_SUBST(BOOST_ATOMIC_LIB)
++#
++#   And sets:
++#
++#     HAVE_BOOST_ATOMIC
++
++#
++# LICENSE
++#
++#   Copyright (c) 2015 Sarah Hoffmann <lonvia at denofr.de>
++#   Copyright (c) 2008 Thomas Porschberg <thomas at randspringer.de>
++#   Copyright (c) 2008 Michael Tindal
++#   Copyright (c) 2008 Daniel Casimiro <dan.casimiro at gmail.com>
++#
++#   Copying and distribution of this file, with or without modification, are
++#   permitted in any medium without royalty provided the copyright notice
++#   and this notice are preserved. This file is offered as-is, without any
++#   warranty.
++
++#serial 1
++
++AC_DEFUN([AX_BOOST_ATOMIC],
++[
++    AC_ARG_WITH([boost-atomic],
++    AS_HELP_STRING([--with-boost-atomic@<:@=special-lib@:>@],
++                   [use the Atomic library from boost - it is possible to specify a certain library for the linker
++                        e.g. --with-boost-atomic=boost_atomic-gcc-mt ]),
++        [
++        if test "$withval" = "no"; then
++            want_boost="no"
++        elif test "$withval" = "yes"; then
++            want_boost="yes"
++            ax_boost_user_atomic_lib=""
++        else
++            want_boost="yes"
++        ax_boost_user_atomic_lib="$withval"
++        fi
++        ],
++        [want_boost="yes"]
++    )
++
++    if test "x$want_boost" = "xyes"; then
++        AC_REQUIRE([AC_PROG_CC])
++        AC_REQUIRE([AC_CANONICAL_BUILD])
++        CPPFLAGS_SAVED="$CPPFLAGS"
++        CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
++        export CPPFLAGS
++
++        LDFLAGS_SAVED="$LDFLAGS"
++        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
++        export LDFLAGS
++
++        AC_CACHE_CHECK(whether the Boost::Atomic library is available,
++                       ax_cv_boost_atomic,
++        [AC_LANG_PUSH([C++])
++             CXXFLAGS_SAVE=$CXXFLAGS
++
++             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/atomic.hpp>]],
++                                   [[boost::atomic_size_t x;]])],
++                   ax_cv_boost_atomic=yes, ax_cv_boost_atomic=no)
++             CXXFLAGS=$CXXFLAGS_SAVE
++             AC_LANG_POP([C++])
++        ])
++        if test "x$ax_cv_boost_atomic" = "xyes"; then
++            AC_SUBST(BOOST_CPPFLAGS)
++
++            AC_DEFINE(HAVE_BOOST_ATOMIC,,[define if the Boost::Atomic library is available])
++            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
++
++            LDFLAGS_SAVE=$LDFLAGS
++            if test "x$ax_boost_user_atomic_lib" = "x"; then
++                for libextension in `ls -r $BOOSTLIBDIR/libboost_atomic* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
++                     ax_lib=${libextension}
++                    AC_CHECK_LIB($ax_lib, exit,
++                                 [BOOST_ATOMIC_LIB="-l$ax_lib"; AC_SUBST(BOOST_ATOMIC_LIB) link_atomic="yes"; break],
++                                 [link_atomic="no"])
++                done
++                if test "x$link_atomic" != "xyes"; then
++                for libextension in `ls -r $BOOSTLIBDIR/boost_atomic* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
++                     ax_lib=${libextension}
++                    AC_CHECK_LIB($ax_lib, exit,
++                                 [BOOST_ATOMIC_LIB="-l$ax_lib"; AC_SUBST(BOOST_ATOMIC_LIB) link_atomic="yes"; break],
++                                 [link_atomic="no"])
++                done
++                fi
++
++            else
++               for ax_lib in $ax_boost_user_atomic_lib boost_atomic-$ax_boost_user_atomic_lib; do
++                      AC_CHECK_LIB($ax_lib, exit,
++                                   [BOOST_ATOMIC_LIB="-l$ax_lib"; AC_SUBST(BOOST_ATOMIC_LIB) link_atomic="yes"; break],
++                                   [link_atomic="no"])
++                  done
++
++            fi
++            if test "x$ax_lib" = "x"; then
++                AC_MSG_ERROR(Could not find a version of the library!)
++            fi
++            if test "x$link_atomic" = "xno"; then
++                AC_MSG_ERROR(Could not link against $ax_lib !)
++            fi
++        fi
++
++        CPPFLAGS="$CPPFLAGS_SAVED"
++    LDFLAGS="$LDFLAGS_SAVED"
++    fi
++])
++
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..314d5b2
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-add-boost-atomic-library.patch
diff --git a/debian/rules b/debian/rules
index d17aaa8..fa13a9e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,17 +12,13 @@ export VERBOSE=1
 CFLAGS += $(CPPFLAGS)
 CXXFLAGS += $(CPPFLAGS)
 
-ifneq (,$(findstring $(DEB_HOST_ARCH),"arm64 armel mips mipsel powerpc ppc64el s390x sparc alpha hppa ppc64"))
-        LDFLAGS += -lboost_atomic
-endif
-
 %:
 	dh $@ \
 		--with autoreconf \
 		--parallel
 
 override_dh_auto_configure:
-	dh_auto_configure -- $(CONFIGURE_OPTS) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)"
+	dh_auto_configure -- CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)"
 
 override_dh_auto_test:
 	dh_auto_test || echo "Ignoring test failures"

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



More information about the Pkg-grass-devel mailing list