File: kfreebsd.mk

package info (click to toggle)
glibc 2.19-16
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 203,652 kB
  • sloc: ansic: 969,800; asm: 241,205; sh: 10,063; makefile: 8,471; cpp: 3,595; perl: 2,077; pascal: 1,839; awk: 1,704; yacc: 317; sed: 73
file content (60 lines) | stat: -rw-r--r-- 1,910 bytes parent folder | download | duplicates (10)
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
# When changing this, make sure to update debian/debhelper.in/libc.preinst!
MIN_KERNEL_SUPPORTED := 8.3.0
libc = libc0.1

# Build and expect pt_chown on this platform
pt_chown = yes

# NPTL Config
threads = yes
libc_add-ons = ports fbtl $(add-ons)
libc_extra_config_options = $(extra_config_options)

ifndef KFREEBSD_SOURCE
  ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
    KFREEBSD_HEADERS := /usr/include
  else
    KFREEBSD_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
  endif
else
  KFREEBSD_HEADERS := $(KFREEBSD_SOURCE)/sys
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
	for file in bsm net netatalk netipx nfs osreldate.h sys x86 vm ; do \
	    if test -e $(KFREEBSD_HEADERS)/$$file ; then \
	        ln -s $(KFREEBSD_HEADERS)/$$file debian/include ; \
	    fi ; \
	done

        # Link all machine directories.  We can't just link machine
        # because of explicit references to <machine-amd64/*> and
	# <machine-i386/*>.
	find $(KFREEBSD_HEADERS) -maxdepth 1 -xtype d -name machine\* \
		-exec ln -s '{}' debian/include ';'

	# To make configure happy if libc0.1-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 FreeBSD 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 \* 10000 + \2 \* 100 + \3/'`)); \
current=$$((`echo $(CURRENT_KERNEL_VERSION) | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 10000 + \2 \* 100/'`)); \
if [ $$current -lt $$minimum ]; then \
  false; \
fi)
endef