initial commit
[glibc.git] / debian / sysdeps / linux.mk
1 # When changing this, make sure:
2 # - to update debian/debhelper.in/libc.preinst!
3 # - that all builds for a given gnu triplet have the same minimum version (see bug#882255)
4 MIN_KERNEL_SUPPORTED := 3.2
5 libc = libc6
6
7 # Do not build pt_chown on this platform
8 pt_chown = no
9 # Expect pldd on this platform
10 pldd = yes
11
12 # NPTL Config
13 threads = yes
14
15 ifeq ($(filter stage1 stage2,$(DEB_BUILD_PROFILES)),)
16 libc_extra_config_options = --with-selinux $(extra_config_options)
17 endif
18
19 ifndef LINUX_SOURCE
20 ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
21 LINUX_HEADERS := /usr/include
22 else
23 LINUX_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
24 endif
25 else
26 LINUX_HEADERS := $(LINUX_SOURCE)/include
27 endif
28
29 # Minimum Kernel supported
30 with_headers = --with-headers=$(shell pwd)/debian/include --enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)
31
32 KERNEL_HEADER_DIR = $(stamp)mkincludedir
33 $(stamp)mkincludedir:
34 rm -rf debian/include
35 mkdir debian/include
36
37 # Kernel and library headers
38 for h in arch asm asm-generic libaudit.h linux selinux sys/capability.h ; do \
39 mkdir -p debian/include/$$(dirname $$h) ; \
40 if [ -e "$(LINUX_HEADERS)/$$h" ]; then \
41 ln -s $(LINUX_HEADERS)/$$h debian/include/$$h ; \
42 elif [ -e "/usr/include/$(DEB_HOST_MULTIARCH)/$$h" ]; then \
43 ln -s /usr/include/$(DEB_HOST_MULTIARCH)/$$h debian/include/$$h ; \
44 elif [ -e "/usr/include/$$h" ]; then \
45 ln -s /usr/include/$$h debian/include/$$h ; \
46 fi ; \
47 done
48
49 # To make configure happy if libc6-dev is not installed.
50 touch debian/include/assert.h
51
52 touch $@
53
54 # Also to make configure happy.
55 export CPPFLAGS = -isystem $(shell pwd)/debian/include
56
57 # This round of ugliness decomposes the Linux kernel version number
58 # into an integer so it can be easily compared and then does so.
59 CURRENT_KERNEL_VERSION=$(shell uname -r)
60 define kernel_check
61 (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/'`)); \
62 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/'`)); \
63 if [ $$current -lt $$minimum ]; then \
64 false; \
65 fi)
66 endef