File: rules

package info (click to toggle)
quantlib-swig 1.40-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,280 kB
  • sloc: python: 6,024; java: 1,552; cs: 774; makefile: 349; sh: 22
file content (90 lines) | stat: -rwxr-xr-x 3,952 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! /usr/bin/make -f
#                                                       -*- makefile -*-
#
# debian/rules file for the Debian Linux quantlib-swig package
# Copyright (C) 2001 - 2026 by Dirk Eddelbuettel <edd@debian.org>

export PYBUILD_VERSIONS = $(shell py3versions -sv)

arch		:= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)

## edd 01 Feb 2002  	allow -ffunction-sections on hppa
## edd 26 Oct 2007      turn strict aliasing warning off
## edd 01 May 2011      add -fpermissive as g++ is more of a stickler
## edd 06 May 2011      remove -fpermissive with QL 1.1 betas
## edd 09 Sep 2018      bringing over a few extra settings for hppa
#compilerflags	= -O2 -Wall -Wno-strict-aliasing -DBOOST_NO_AUTO_PTR
## edd 07 Aug 2019      turning optimisation off or else linking (with lto) fails
## bunk 28 Oct 2023     no longer turning optimisation off
compilerflags	= -g0 -Wall -Wno-strict-aliasing -DBOOST_NO_AUTO_PTR
ifeq ($(cpu),hppa)
compilerflags   = -O0 -g0 -mlong-calls -ffunction-sections --param ggc-min-expand=20 -DBOOST_NO_AUTO_PTR
endif

## edd 18 May 2002	no optimisation or debugging on baby systems
## edd 14 May 2005	don't do it on mipsel or mips either
## edd 01 Jun 2007      no longer activate this on mips/mipsel
## edd 26 Jun 2007 	use cpu test, not arch test -- thanks to Riku via #430709
## edd 26 Oct 2007      s390+powerpc also die, so add'em (and remove mips(el), see next item)
## edd 27 May 2012      added mips/mipsel/armel/armhf here too
## edd 11 Mar 2015      remove powerpc and armhf from the list as they built on Ubuntu (cf
##                      https://launchpad.net/ubuntu/+source/quantlib-swig/1.5-1ubuntu1) and #779720)
##                      also remove mips, mipsel as they are getting taken care of below
## edd 16 Nov 2025      add armhf again as it currently runs OOM during build
#ifneq "$(findstring $(cpu), m68k arm armeb s390 powerpc armel armhf mips mipsel)" ""
ifneq "$(findstring $(cpu), m68k arm armeb s390 armel armhf)" ""
compilerflags   = -O0 -g0 -DBOOST_NO_AUTO_PTR
endif

## edd 26 Oct 2007      really reset mips/mips to -O2 (see #419742)
## edd 27 May 2012      move to previos section
## edd 06 Dec 2014      patch by Dejan Latinovic (see #772028) to add -mxgot
## edd 23 Jun 2016      patch by Daniel Knezevic (see #827979) to add gcc-min-expand=20
## edd 29 Sep 2018      adding mips64el here as well as it recently timed out
## bunk 28 Oct 2023     removing mips64el here since current buildds should be fast enough
## edd 03 Jan 2025      adding mips64el again as it failed for 1.35 and 1.36
ifneq "$(findstring $(cpu), mipsel mips mips64el)" ""
#compilerflags   = -O2 -g0
compilerflags   = -O0 -g0 -mxgot --param ggc-min-expand=20 -DBOOST_NO_AUTO_PTR
endif

## edd 21 Aug 2018      i386 now seems to be hosted on amd64
ifneq "$(findstring $(arch), i386)" ""
compilerflags   = -O0 -g0 --param ggc-min-expand=20 -DBOOST_NO_AUTO_PTR
endif

## edd 22 Aug 2018      trying to help a few other systems with their memory exhaustion
ifneq "$(findstring $(cpu), hurd-i386 kfreebsd-i386 m68k powerpc x32)" ""
compilerflags   = -O0 -g0 --param ggc-min-expand=20 -DBOOST_NO_AUTO_PTR
endif

## edd 06 Jan 2026      use DEB_CXXFLAGS_MAINT_APPEND
export DEB_CXXFLAGS_MAINT_APPEND = ${compilerflags}


%:
	dh $@ --with python3 --buildsystem=pybuild --sourcedirectory=Python

override_dh_clean:
	rm -f build-stamp test-stamp install-stamp 
	-test -f Makefile && $(MAKE) realclean
	rm -f Python/setup.cfg
	dh_clean

override_dh_auto_build:
	./autogen.sh
	# need to build the Makefile for R (and Ruby ?)
	./configure 	--prefix=/usr 				\
			--build $(arch)
	(cd Python && \
			swig -python -c++ -outdir src/QuantLib  \
                             -o src/QuantLib/quantlib_wrap.cpp  \
                             ../SWIG/quantlib.i			\
			)
	dh_auto_build

execute_after_dh_auto_clean:
	cd Python
	rm -rfv .pybuild build */build src/*.egg-info */src/*.egg-info
	find . -name __pycache__ | rm -rfv