File: linux.mk

package info (click to toggle)
glibc 2.42-8
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 312,640 kB
  • sloc: ansic: 1,060,899; asm: 238,416; makefile: 20,961; python: 13,509; sh: 11,828; cpp: 5,188; awk: 1,794; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (75 lines) | stat: -rw-r--r-- 2,651 bytes parent folder | download | duplicates (4)
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
# When changing this, make sure:
# - to update debian/debhelper.in/libc.preinst!
# - that all builds for a given gnu triplet have the same minimum version (see bug#882255)
MIN_KERNEL_SUPPORTED := 3.2
libc = libc6

# Do not build pt_chown on this platform
pt_chown = no
# Expect pldd on this platform
pldd = yes

# NPTL Config
threads = yes

libc_extra_config_options = $(extra_config_options)
ifeq ($(filter stage1 stage2,$(DEB_BUILD_PROFILES)),)
  libc_extra_config_options += --with-selinux
endif
ifeq ($(filter stage1 stage2 pkg.glibc.nosystemtap,$(DEB_BUILD_PROFILES)),)
  libc_extra_config_options += --enable-systemtap
endif

ifndef LINUX_SOURCE
  ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
    LINUX_HEADERS := /usr/include
  else
    LINUX_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
  endif
else
  LINUX_HEADERS := $(LINUX_SOURCE)/include
endif

# Minimum Kernel supported
with_headers = --with-headers=$(shell pwd)/debian/include --enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)

KERNEL_HEADER_DIR = $(stamp)mkincludedir
$(stamp)mkincludedir:
	rm -rf debian/include
	mkdir debian/include

	# Kernel and library headers
	for h in arch asm asm-generic libaudit.h linux selinux sys/capability.h ; do \
	    mkdir -p debian/include/$$(dirname $$h) ; \
	    if [ -e "$(LINUX_HEADERS)/$$h" ]; then \
	        ln -s $(LINUX_HEADERS)/$$h debian/include/$$h ; \
	    elif [ -e "/usr/include/$(DEB_HOST_MULTIARCH)/$$h" ]; then \
	        ln -s /usr/include/$(DEB_HOST_MULTIARCH)/$$h debian/include/$$h ; \
	    elif [ -e "/usr/include/$$h" ]; then \
	        ln -s /usr/include/$$h debian/include/$$h ; \
	    fi ; \
	done

ifeq ($(filter stage1 stage2 pkg.glibc.nosystemtap,$(DEB_BUILD_PROFILES)),)
	ln -s /usr/include/$(DEB_HOST_MULTIARCH)/sys/sdt.h debian/include/sys/sdt.h
	ln -s /usr/include/$(DEB_HOST_MULTIARCH)/sys/sdt-config.h debian/include/sys/sdt-config.h
endif

	# To make configure happy if libc6-dev is not installed.
	touch debian/include/assert.h

	touch $@

# Also to make configure happy.
export CPPFLAGS = -isystem $(shell pwd)/debian/include

# This round of ugliness decomposes the Linux kernel version number
# into an integer so it can be easily compared and then does so.
CURRENT_KERNEL_VERSION=$(shell uname -r)
define kernel_check
(minimum=$$((`echo $(1) | sed 's/^\([0-9]*\.[0-9]*\)\([^.0-9]\|$$\)/\1.0\2/; s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/'`)); \
current=$$((`echo $(CURRENT_KERNEL_VERSION) | sed 's/^\([0-9]*\.[0-9]*\)\([^.0-9]\|$$\)/\1.0\2/; s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100 + \3/'`)); \
if [ $$current -lt $$minimum ]; then \
  false; \
fi)
endef