File: rules

package info (click to toggle)
pkg-config 0.29-4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 12,280 kB
  • ctags: 7,679
  • sloc: ansic: 131,421; sh: 12,530; perl: 1,105; makefile: 625; python: 461
file content (39 lines) | stat: -rwxr-xr-x 1,507 bytes parent folder | download | duplicates (3)
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
#! /usr/bin/make -f

DEB_HOST_MULTIARCH     := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE     := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE     := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

export LC_ALL=C

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
   SET_PKG_CONFIG = PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
   GCC = $(DEB_HOST_GNU_TYPE)-gcc
else
   GCC = gcc
endif

SYSTEM_LIBDIRS := $(shell for opt in '' $$($${CC-$(GCC)} -print-multi-lib | sed -n -e's/.*;@/-/p'); do \
     $(GCC) $$opt -print-search-dirs | sed -n -e's/^libraries: =//p' \
     | sed -e's/:/\n/g' | xargs -n1 readlink -f | grep -v 'gcc\|/[0-9.]\+$$'; \
    done | sort -u | tr '\n' : | sed 's/:$$//')

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	$(SET_PKG_CONFIG) ./configure --prefix=/usr \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info --disable-shared \
		--with-pc-path=/usr/local/lib/$(DEB_HOST_MULTIARCH)/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig \
		--with-system-library-path=$(SYSTEM_LIBDIRS)

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) distclean DIST_SUBDIRS="check"
	chmod +x debian/pkg-config-crosswrapper debian/pkg-config-dpkghook

override_dh_install:
	dh_install
	echo $(DEB_HOST_MULTIARCH) > debian/pkg-config/usr/lib/pkg-config.multiarch