3 # debian/rules file for GNU libc.
4 # Copyright 1998, 1999 by Joel Klecker <espy@debian.org>
5 # Copyright 2000 Ben Collins <bcollins@debian.org>
6 # Copyright 2003 Jeff Bailey <jbailey@debian.org>
7 # This Makefile is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # What are the phases to building glibc?
15 # Do any necessary overlays
17 # Determine how many builds there are to do. For Each build:
19 # Create build directory
23 # Install to package directories
25 # Run debian magic to build packages.
27 # Things you may need to customise:
29 # These are done as absolute paths so that in the case of filesystem size
30 # limitations, they can be overridden and spread all over.
31 build-tree
:= build-tree
32 debian-tmp
= debian
/tmp
$(filter-out -libc
,-$(curpass
))
33 stamp
:= $(CURDIR
)/stamp-dir
/
34 DUMMY
:= $(shell mkdir
-p
$(stamp
))
36 # Beyond here you shouldn't need to customise anything:
37 DEB_HOST_ARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH
)
38 DEB_HOST_ARCH_CPU ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_CPU
)
39 DEB_HOST_ARCH_ENDIAN ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_ENDIAN
)
40 DEB_HOST_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_OS
)
41 DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
42 DEB_HOST_MULTIARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_MULTIARCH
)
43 DEB_BUILD_ARCH ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
44 DEB_BUILD_ARCH_BITS ?
= $(shell dpkg-architecture
-qDEB_BUILD_ARCH_BITS
)
45 DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
47 include /usr
/share
/dpkg
/pkg-info.mk
49 # The minimum package version with which these packages are compatible.
50 shlib_dep_ver
= $(DEB_VERSION_UPSTREAM
)
51 shlib_dep
= $(libc
) (>= $(shlib_dep_ver
))
53 DEB_BUILDDIR ?
= $(build-tree
)/$(DEB_HOST_ARCH
)-$(curpass
)
54 DEB_BUILDDIRLIBC ?
= $(build-tree
)/$(DEB_HOST_ARCH
)-libc
56 GLIBC_SOURCES
= $(filter-out debian
$(shell basename $(stamp
)) $(build-tree
), $(wildcard *))
58 # Support multiple makes at once based on number of processors
59 ifneq (,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
60 NJOBS
:= -j
$(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
63 # use the package settings, not the settings from the environment
68 $(foreach v
, CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
, $(if
$(filter environment
,$(origin $(v
))),$(eval
$(call unsetenv
, $(v
)))))
70 # export debhelper substitution variables
78 datadir=$(prefix)/share
79 complocaledir
=$(prefix)/lib
/locale
81 libexecdir
=$(prefix)/lib
83 includedir=$(prefix)/include
84 docdir
=$(prefix)/share
/doc
85 mandir=$(prefix)/share
/man
86 sbindir
=$(prefix)/sbin
87 vardbdir
=/var
/lib
/misc
89 slibdir
=/lib
/$(DEB_HOST_MULTIARCH
)
90 libdir=/usr
/lib
/$(DEB_HOST_MULTIARCH
)
93 rtld_so
=$(shell awk
'BEGIN {FS="="} /^ld\.so-version/ {print $$2}' $(DEB_BUILDDIR
)/soversions.mk
)
94 libc_so
=$(shell awk
'BEGIN {FS="="} /^libc\.so-version/ {print "libc.so"$$2}' $(DEB_BUILDDIR
)/soversions.mk
)
99 DEB_GCC_VERSION ?
= -12
104 # Set cross and native compiler names, including version.
105 CC
= $(DEB_HOST_GNU_TYPE
)-$(BASE_CC
)$(DEB_GCC_VERSION
)
106 CXX
= $(DEB_HOST_GNU_TYPE
)-$(BASE_CXX
)$(DEB_GCC_VERSION
)
107 MIG
= $(DEB_HOST_GNU_TYPE
)-$(BASE_MIG
)
108 BUILD_CC
= $(DEB_BUILD_GNU_TYPE
)-$(BASE_CC
)
109 BUILD_CXX
= $(DEB_BUILD_GNU_TYPE
)-$(BASE_CXX
)
111 BUILD_CFLAGS
= -O2
-g
-fdebug-prefix-map
=$(CURDIR
)=.
112 HOST_CFLAGS
= -pipe
-O2
-g
-fdebug-prefix-map
=$(CURDIR
)=.
$(call xx
,extra_cflags
)
114 extra_cflags
+= -mno-altivec
-mno-vsx
-mno-htm
-mno-crypto
116 # 32-bit MIPS builders have a 2GB memory space. This is not enough to
117 # build test-tgmath3.o with GCC, unless tweaking the garbage collector.
118 ifeq ($(findstring mips
,$(DEB_BUILD_ARCH
))-$(DEB_BUILD_ARCH_BITS
), mips-32
)
119 CC
+= --param ggc-min-expand
=10
122 configure_target
:= $(DEB_HOST_GNU_TYPE
)
124 # Normally we'll just use this for --build. If the architecture requires
125 # that build daemons be able to run a particular optimized library, then
126 # they can set the --build to match --host for that optimized build.
127 # Among other things this lets tests run.
128 configure_build
:= $(DEB_BUILD_GNU_TYPE
)
130 # Which build pass are we on?
131 curpass
= $(filter-out %_
,$(subst _
,_
,$@
))
133 ifneq ($(filter stage1
,$(DEB_BUILD_PROFILES
)),)
134 DEB_ARCH_REGULAR_PACKAGES
= $(libc
)-dev
135 DEB_INDEP_REGULAR_PACKAGES
=
137 ifeq ($(filter nocheck
,$(DEB_BUILD_OPTIONS
)),)
138 DEB_BUILD_OPTIONS
+=nocheck
141 DEB_ARCH_REGULAR_PACKAGES
= $(libc
) $(libc
)-dev
$(libc
)-dbg libc-bin libc-dev-bin
142 ifeq ($(filter stage2
,$(DEB_BUILD_PROFILES
)),)
143 DEB_ARCH_REGULAR_PACKAGES
+= libc-devtools
145 DEB_INDEP_REGULAR_PACKAGES
= glibc-doc glibc-source libc-l10n locales
146 ifneq ($(filter noudeb
,$(DEB_BUILD_PROFILES
)),)
149 DEB_UDEB_PACKAGES
= $(libc
)-udeb
151 ## Locales can only be pre-generated during native compiles
152 ifeq ($(DEB_HOST_ARCH
),$(DEB_BUILD_ARCH
))
153 DEB_ARCH_REGULAR_PACKAGES
+= locales-all
157 # Generic kernel version check
159 (if
[ $(CURRENT_KERNEL_VERSION
) -lt
$(1) ]; then \
164 # Include libidn for both NPTL and FBTL targets.
165 standard-add-ons
= libidn
,
167 # Pull in all the per-arch magic!
169 -include debian
/sysdeps
/$(DEB_HOST_ARCH_OS
).mk
170 -include debian
/sysdeps
/$(DEB_HOST_ARCH
).mk
172 ifneq ($(filter stage1
,$(DEB_BUILD_PROFILES
)),)
173 DEB_ARCH_REGULAR_PACKAGES
+= $(foreach p
,$(DEB_ARCH_MULTILIB_PACKAGES
), $(if
$(findstring -dev
,$(p
)), $(p
)))
175 DEB_ARCH_REGULAR_PACKAGES
+= $(DEB_ARCH_MULTILIB_PACKAGES
)
178 # Don't run dh_strip on this package
179 NOSTRIP_
$(libc
)-dbg
= 1
181 # Put the debug files from these packages in $(libc)-dbg
183 DEBUG_libc6.1
-alphaev67
= 1
185 ifeq ($(filter stage1
,$(DEB_BUILD_PROFILES
)),)
186 ifeq ($(threads
),yes
)
187 DEB_ARCH_REGULAR_PACKAGES
+= nscd
191 # And now the rules...
192 include debian
/rules.d
/*.mk
195 rm -rf
$(patsubst %,debian
/tmp-
%,$(GLIBC_PASSES
))
198 rm -rf debian
/include
199 rm -f debian
/control.in
/libc0.1 debian
/control.in
/libc0.3 \
200 debian
/control.in
/libc6 debian
/control.in
/libc6.1 \
201 debian
/*.preinst.
* debian
/*.links.
*
203 # Required Debian targets
204 build-arch
: $(stamp
)info \
205 $(patsubst %,$(stamp
)build_
%,$(GLIBC_PASSES
)) \
206 $(patsubst %,$(stamp
)check_
%,$(GLIBC_PASSES
)) \
207 build-arch-post-check
209 ifeq ($(filter stage1
,$(DEB_BUILD_PROFILES
)),)
210 build-arch
: $(stamp
)build_C.utf8 \
211 $(stamp
)build_locales-all
214 build-indep
: $(stamp
)source
$(stamp
)build_libc
216 build
: build-arch build-indep
219 binary-indep
: build-indep testroot debian
/control
$(build-tree
) \
220 $(patsubst %,$(stamp
)binaryinst_
%,$(DEB_INDEP_REGULAR_PACKAGES
))
222 binary-arch
: build-arch testroot debian
/control
$(build-tree
) \
223 $(patsubst %,$(stamp
)binaryinst_
%,$(DEB_ARCH_REGULAR_PACKAGES
)) \
224 $(patsubst %,$(stamp
)binaryinst_
%,$(DEB_UDEB_PACKAGES
))
226 binary
: binary-indep binary-arch