File: rules

package info (click to toggle)
libdevel-declare-perl 0.006000-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 296 kB
  • ctags: 238
  • sloc: perl: 1,605; ansic: 756; makefile: 25
file content (35 lines) | stat: -rwxr-xr-x 1,092 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
PERL ?= /usr/bin/perl

# there are some alignment problems on sparc, fixed in perl 5.10.1
# we work around them by using -O1, but only on sparc and only for perls before 5.10.1
PERL_VER=$(shell $(PERL) -e 'my ($$rev, $$ver, $$subver) = $$] =~ /(\d+)\.(\d\d\d)(\d\d\d)/; print join(".", $$rev+0, $$ver+0, $$subver+0)')
GOOD_PERL=$(shell if dpkg --compare-versions $(PERL_VER) -gt 5.10.1~; then echo "yes"; fi)

CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -O0
else
    ifeq (sparc,$(DEB_HOST_ARCH))
        ifeq (yes,$(GOOD_PERL))
            $(info Building on sparc, with Perl $(PERL_VER), use -O2)
            CFLAGS+=-O2
        else
            $(info Building on sparc, with Perl $(PERL_VER), use -O1)
            CFLAGS+=-O1
        endif
    else
        $(info Not building on sparc (Perl $(PERL_VER)), use -O2)
        CFLAGS+=-O2
    endif
endif

override_dh_auto_configure:
	dh_auto_configure -- OPTIMIZE="$(CFLAGS)"

# end of sparc alignment workaround

%:
	dh $@