[gringo] 10/11: debian/rules: use cmake without rpath and force g++-7

Thomas Krennwallner tkren-guest at moszumanska.debian.org
Wed Nov 1 16:16:05 UTC 2017


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

tkren-guest pushed a commit to branch devel
in repository gringo.

commit ebc75f81e7d1f3bf465651b3e915bec807227c99
Author: Thomas Krennwallner <tkren at kr.tuwien.ac.at>
Date:   Sat Oct 14 07:43:46 2017 +0000

    debian/rules: use cmake without rpath and force g++-7
---
 debian/rules | 70 +++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/debian/rules b/debian/rules
index abde58c..168c0cd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,41 +5,40 @@
 #export DH_VERBOSE=1
 
 # gringo requires c++11 threads with 64bit __atomic_exchange, we need to
-# link with libatomic on powerpc, powerpcspe, m68k, mips, mipsel, and
+# link with libatomic on armel, powerpc, powerpcspe, m68k, mips, mipsel, and
 # sh4, see also
 # https://gcc.gnu.org/wiki/Atomic
 # https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary
-arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH | egrep -v -x "(powerpc|powerpcspe|m68k|mips|mipsel|sh4)")
+arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH | egrep -x "(armel|powerpc|powerpcspe|m68k|mips|mipsel|sh4)")
 
-# currently, libstdc++ on armel does not support std::exception_ptr, see
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938
-#
-# we define BROKEN_STD_EXCEPTION_PTR below to enable replacement code in
-# gringo-broken-std-exception_ptr.patch
-broken_exception_ptr = $(shell dpkg-architecture -qDEB_BUILD_ARCH | grep "armel")
-
-# force g++-6
-CONFIGPARMS = CXX='g++-6'
+# use custom hardening config flags for compiling clasp
+CONFIG=hardening
+CONFIGPARMS = -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -LAH -DCMAKE_SKIP_RPATH=YES -DCLINGO_MANAGE_RPATH=OFF -DLIB_POTASSCO_BUILD_APP=ON -DCLASP_BUILD_APP=OFF -DCLASP_BUILD_TESTS=OFF -DCLASP_BUILD_EXAMPLES=OFF -DCLINGO_BUILD_EXAMPLES=OFF -DCLINGO_BUILD_TESTS=OFF
+TOPBUILDDIR = build/$(CONFIG)_mt
 
-# use c++11 threads, lua5.3, and python2.7
-ifneq ($(if $(broken_exception_ptr),broken), broken)
-	CONFIGPARMS += WITH_THREADS='posix' WITH_LUA='lua5.3' WITH_PYTHON='python2.7' CPPPATH='$${["/usr/include/lua5.3","/usr/include/python2.7"]}'
+#
+# export CXXFLAGS and LDFLAGS for cmake
+#
+# add -O3 and NDEBUG and enable all hardening flags
+# link with libatomic on architectures without built-in atomic
+#
+DEB_CXXFLAGS_MAINT_APPEND = -O3 -DNDEBUG
+DEB_LDFLAGS_MAINT_APPEND =
+ifeq ($(if $(arch),atomic), atomic)
+	DEB_LDFLAGS_MAINT_APPEND += -latomic
 endif
 
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
 #
 # export CPPFLAGS, CXXFLAGS, and LDFLAGS for scons
 #
-# default to -O3 -std=c++11 -Wall -DNDEBUG and enable all hardening flags
+# default to -O3 -Wall -DNDEBUG and enable all hardening flags
 #
-DEB_CXXFLAGS_MAINT_APPEND = -std=c++11 -O3 -Wall
+DEB_CXXFLAGS_MAINT_APPEND = -O3 -Wall
 DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
 DEB_LDFLAGS_MAINT_APPEND =
-
-ifeq ($(if $(broken_exception_ptr),broken), broken)
-	DEB_CPPFLAGS_MAINT_APPEND += -DBROKEN_STD_EXCEPTION_PTR
-endif
-
-ifeq ($(and $(if $(arch),,atomic), $(if $(broken_exception_ptr),,atomic)), atomic)
+ifeq ($(if $(arch),atomic), atomic)
 	DEB_LDFLAGS_MAINT_APPEND += -latomic
 endif
 
@@ -48,26 +47,29 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
-# inject compiler and linker flags to scons variables
-SCCXXFLAGS =  $(shell echo $(CXXFLAGS) $(CPPFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/')
-SCLINKFLAGS = $(shell echo $(LDFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/')
+# force g++-7
+export CXX = g++-7
+export CC = gcc-7
+# inject CPPFLAGS to CXXFLAGS
+CXXFLAGS += $(CPPFLAGS)
 
 %:
 	dh $@
 
-# configure with LUA, Python; forcibly turn off threads if std::exception_ptr is broken
+# configure with cmake
 override_dh_auto_configure:
-	scons configure --build-dir=release $(CONFIGPARMS) CXXFLAGS='$(SCCXXFLAGS)' LINKFLAGS='$(SCLINKFLAGS)' || cat build/release.log build/release.py
-ifeq ($(if $(broken_exception_ptr),broken), broken)
-	sed -i -e 's/WITH_THREADS =.*/WITH_THREADS = None/' -e 's/WITH_LUA =.*/WITH_LUA = None/' -e 's/WITH_PYTHON =.*/WITH_PYTHON = None/' ./build/release.py
-endif
+	dh_auto_configure --builddirectory=$(TOPBUILDDIR) -- $(CONFIGPARMS)
 
-# build gringo clingo reify
+# build binaries in $(TOPBUILDDIR)
 override_dh_auto_build:
-	scons --build-dir=release gringo clingo reify lpconvert
+	dh_auto_build --builddirectory=$(TOPBUILDDIR)
 
 override_dh_auto_clean:
-	rm -rf ./build .sconf_temp .sconsign.dblite
+	dh_auto_clean --builddirectory=$(TOPBUILDDIR)
 
+# install CHANGES.md as changelog
 override_dh_installchangelogs:
-	dh_installchangelogs CHANGES
+	dh_installchangelogs CHANGES.md
+
+override_dh_shlibdeps:
+	dh_shlibdeps -l$(shell pwd)/$(TOPBUILDDIR)/bin

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gringo.git



More information about the debian-science-commits mailing list