File: rules

package info (click to toggle)
libtool 2.4.6-9
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,456 kB
  • sloc: sh: 53,997; ansic: 4,322; makefile: 861
file content (225 lines) | stat: -rwxr-xr-x 7,257 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#!/usr/bin/make -f
# debian/rules for the Debian GNU Libtool package.
# Copyright © 2003, 2004 Scott James Remnant <scott@netsplit.com>

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

DEBIAN_REVISION=$(strip $(shell dpkg-parsechangelog | awk -F: '/^Version:/ {print $$NF}'))

# libltdl needs to conform to policy
export DEB_CFLAGS_MAINT_PREPEND = -Wall
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

AM_VERSION=$(shell aclocal --version | head -1 | awk '{print $$4}' | cut -d. -f1-2) 

# Build libltdl the right way (tm)
DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	confflags += --build=$(DEB_HOST_GNU_TYPE)
	make_check = yes
else
	confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	make_check = no
endif

ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	make_check = no
endif

# Takes too long
#ifeq (m68k, $(DEB_HOST_ARCH))
#	make_check = no
#endif

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp config-stamp
	dh_clean

	[ ! -f Makefile ] || $(MAKE) -k distclean
	rm -f INSTALL build-aux/compile build-aux/config.guess build-aux/config.sub
	rm -f build-aux/texinfo.tex build-aux/missing build-aux/install-sh
	rm -f build-aux/mdate-sh build-aux/depcomp README-release doc/libtool.info-2
	rm -f .version .version~
	rm -f doc/libtool.1 doc/libtool.info doc/libtool.info-1 doc/libtool.info-2 doc/libtoolize.1
	rm -f build-aux/ltmain.sh
	rm -f Makefile.in configure libltdl/Makefile.in libltdl/configure
	rm -rf autom4te.cache
	rm -f build-aux/gnupload config-h.in m4/gnulib-cache.m4 m4/gnulib-comp.m4
	rm -f build-aux/update-copyright m4/gnulib-tool.m4 build-aux/useless-if-before-free
	rm -f build-aux/announce-gen build-aux/gendocs.sh build-aux/vc-list-files
	rm -f build-aux/do-release-commit-and-tag build-aux/gnu-web-doc-update 
	rm -f m4/gnulib-common.m4 m4/00gnulib.m4 maint.mk doc/fdl.texi
	rm -f doc/gendocs_template GNUmakefile
	# Undo the version change if there is any.
	sed -i -e "s/\$$scriptversion.*/\$$scriptversion/" libtoolize.in
	sed -i -e "s/\$$scriptversion.*/\$$scriptversion/" build-aux/ltmain.in
	sed -i -e 's/^VERSION.*/VERSION=@VERSION@/' build-aux/ltmain.in

config: config-stamp
Makefile: config-stamp
config-stamp:
	dh_testdir

	sed -i -e "s/\$$scriptversion.*/\$$scriptversion Debian-$(DEBIAN_REVISION)/" libtoolize.in
	sed -i -e "s/\$$scriptversion.*/\$$scriptversion Debian-$(DEBIAN_REVISION)/" build-aux/ltmain.in
	sed -i -e 's/^VERSION.*/VERSION="@VERSION@ Debian-$(DEBIAN_REVISION)"/' build-aux/ltmain.in

	touch README-release

	./bootstrap --force --no-git --skip-po --gnulib-srcdir=/usr/share/gnulib/ --copy
	CONFIG_SHELL=/bin/bash /bin/bash ./configure \
		--prefix=/usr \
		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
		$(confflags) \
		$(shell dpkg-buildflags --export=cmdline)
	touch config-stamp


build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: config-stamp
	dh_testdir

	$(MAKE)

#	The system libtool script in Debian must be able to support
#	invoking gcc as cc
	echo '# ### BEGIN LIBTOOL TAG CONFIG: BINCC' >> libtool
	sed -n -e '/^# ### BEGIN LIBTOOL CONFIG/,/^# ### END LIBTOOL CONFIG/p' < libtool \
		| grep -B 2 -A 1 -e '^LTCC=' -e '^CC=' \
		| sed '/^--/d;s/gcc/cc/g' >> libtool
	echo '# ### END LIBTOOL TAG CONFIG: BINCC' >> libtool
	echo >> libtool

#	The system libtool script in Debian must be able to support
#	invoking g++ both by the g++ and c++ names.
	sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: CXX$$/,/^# ### END LIBTOOL TAG CONFIG: CXX$$/p' < libtool \
		| sed -e 's/CONFIG: CXX/CONFIG: BINCXX/g' \
		      -e 's/g++/c++/g' >> libtool
	echo >> libtool

#	Add our BINCC and BINCXX tags
	sed -e 's/^\(available_tags\)=\"\(.*\)\"/\1=\"\2 BINCC BINCXX\"/' \
		< libtool > libtool.tags
	mv libtool.tags libtool

#	Don't hardcode gcc path information, and don't use nostdlib
	sed -e 's/^\(predep_objects\)=.*/\1=""/' \
	    -e 's/^\(postdep_objects\)=.*/\1=""/' \
	    -e 's/^\(compiler_lib_search_path\)=.*/\1=""/' \
	    -e 's:^\(sys_lib_search_path_spec\)=.*:\1="/lib/ /usr/lib/ /usr/X11R6/lib/ /usr/local/lib/":' \
	    -e 's/^\(archive_cmds=\".*\) -nostdlib /\1 /' \
	    -e 's/^\(archive_expsym_cmds=\".*\) -nostdlib /\1 /' \
	    < libtool > libtool.gcc-indep
	mv libtool.gcc-indep libtool

#	Make libtool executable again
	chmod 755 libtool

ifeq ($(make_check), yes)
#	Now make sure it works
	-$(MAKE) check || touch tests-failed
	-cat test-suite.log
	-cat tests/testsuite.log
	@test ! -f tests-failed
endif

	cd doc && makeinfo libtool.texi
	cd doc && makeinfo --html --no-split libtool.texi

	touch build-stamp

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) prefix=$(CURDIR)/debian/tmp/usr install
	rm -f debian/tmp/usr/share/info/dir

	dh_install --fail-missing --sourcedir=debian/tmp

# Build architecture-independent files here.
binary-indep: build-indep install
	dh_testdir -i
	dh_testroot -i

	# Create symlinks to the one in autotools-dev
	rm -f debian/libtool/usr/share/libtool/build-aux/config.guess
	ln -s ../../misc/config.guess debian/libtool/usr/share/libtool/build-aux
	rm -f debian/libtool/usr/share/libtool/build-aux/config.sub
	ln -s ../../misc/config.sub debian/libtool/usr/share/libtool/build-aux
	# Sanitize /usr-merge path builds
	for f in \
		debian/libtool-bin/usr/share/man/man1/libtool.1 \
		debian/libtool-bin/usr/bin/libtool ; do cat $$f | \
			sed -e 's%/usr/bin/grep%/bin/grep%g' | \
			sed -e 's%/usr/bin/sed%/bin/sed%g' | \
			sed -e 's%/usr/bin/dd%/bin/dd%g' | \
			sed -e 's%${CURDIR}%/build/libtool-2.4.6%g'  \
			> debian/tmpff ; \
		mv debian/tmpff $$f ; \
		done

	dh_installdocs -i
	dh_installinfo -plibtool-doc
	dh_installexamples -i
	dh_installchangelogs -i ChangeLog
	dh_link -i
	dh_lintian -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh_testdir -a
	dh_testroot -a

	# Sanitize /usr-merge path builds
	for f in \
		debian/libtool/usr/bin/libtoolize ; do \
		cat $$f | \
			sed -e 's%/usr/bin/grep%/bin/grep%g' | \
			sed -e 's%/usr/bin/sed%/bin/sed%g' | \
			sed -e 's%/usr/bin/dd%/bin/dd%g' | \
			sed -e 's%${CURDIR}%/build/libtool-2.4.6%g'  \
			> debian/tmpff ; \
		mv debian/tmpff $$f ; \
		done

	dh_installdocs -plibtool-bin
	dh_installdocs -plibltdl7
	mkdir -p debian/libltdl-dev/usr/share/doc
	cd debian/libltdl-dev/usr/share/doc && ln -sf libltdl7 libltdl-dev
	dh_installchangelogs -plibtool-bin
	dh_installchangelogs -plibltdl7 ChangeLog
	dh_strip -a
	dh_lintian -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V
	dh_installdeb -a
	dh_shlibdeps -a
	rm -f debian/libltdl-dev.substvars
	echo 'automake=automake-${AM_VERSION}' > debian/libltdl-dev.substvars
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean config patch unpatch binary-indep binary-arch binary install