chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / sysdeps / kfreebsd.mk
1 EGLIBC_OVERLAYS ?= $(shell ls glibc-linuxthreads* glibc-ports* glibc-libidn*)
2 MIN_KERNEL_SUPPORTED := 6.0.0
3 libc = libc0.1
4
5 # Linuxthreads Config
6 threads = yes
7 libc_add-ons = ports linuxthreads $(add-ons)
8 libc_extra_config_options = $(extra_config_options) --disable-compatible-utmp
9
10 ifndef KFREEBSD_SOURCE
11   ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
12     KFREEBSD_HEADERS := /usr/include
13   else
14     KFREEBSD_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
15   endif
16 else
17   KFREEBSD_HEADERS := $(KFREEBSD_SOURCE)/sys
18 endif
19
20 # Minimum Kernel supported
21 with_headers = --with-headers=$(shell pwd)/debian/include --enable-kernel=$(call xx,MIN_KERNEL_SUPPORTED)
22
23 KERNEL_HEADER_DIR = $(stamp)mkincludedir
24 $(stamp)mkincludedir:
25         rm -rf debian/include
26         mkdir debian/include
27         ln -s $(KFREEBSD_HEADERS)/bsm debian/include
28         ln -s $(KFREEBSD_HEADERS)/net debian/include
29         ln -s $(KFREEBSD_HEADERS)/netatalk debian/include
30         ln -s $(KFREEBSD_HEADERS)/netipx debian/include
31         ln -s $(KFREEBSD_HEADERS)/nfs debian/include
32         ln -s $(KFREEBSD_HEADERS)/osreldate.h debian/include
33         ln -s $(KFREEBSD_HEADERS)/sys debian/include
34         ln -s $(KFREEBSD_HEADERS)/vm debian/include
35
36         # Link all machine directories.  We can't just link machine
37         # because of explicit references to <machine-amd64/*> and
38         # <machine-i386/*>.
39         find $(KFREEBSD_HEADERS) -maxdepth 1 -xtype d -name machine\* \
40                 -exec ln -s '{}' debian/include ';'
41
42         # To make configure happy if libc0.1-dev is not installed.
43         touch debian/include/assert.h
44
45         touch $@
46
47 # Also to make configure happy.
48 export CPPFLAGS = -isystem $(shell pwd)/debian/include
49
50 # This round of ugliness decomposes the FreeBSD kernel version number
51 # into an integer so it can be easily compared and then does so.
52 CURRENT_KERNEL_VERSION=$(shell uname -r)
53 define kernel_check
54 (minimum=$$((`echo $(1) | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1 \* 10000 + \2 \* 100 + \3/'`)); \
55 current=$$((`echo $(CURRENT_KERNEL_VERSION) | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100/'`)); \
56 if [ $$current -lt $$minimum ]; then \
57   false; \
58 fi)
59 endef
60