summaryrefslogtreecommitdiff
path: root/libc/Makefile.am
blob: eda5bc9eae213baea07b4ded168268f653732ba0 (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Makefile.am - Makefile template for libc
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
# Written by Marcus Brinkmann.
#
# This file is part of the GNU Hurd.
# 
# The GNU Hurd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# The GNU Hurd is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

noinst_LIBRARIES = libc.a

patch_files = 00-configure-touch.patch 01-configure.in-base-os.patch \
	02-configure.in-add-ons-generic.patch \
	03-sysdeps-generic-bits-socket-h.patch \
	04-sysdeps-generic-bits-sigcontext-h.patch \
	05-sysdeps-generic-getpeername.patch \
	06-sysdeps-generic-open.patch \
	07-sysdeps-generic-fcntl.patch \
	50-nptl-hurd-l4.patch
patches = $(addprefix patches/, $(patch_files))

hurd_l4_sysdeps_l4_hurd = bits/errno.h bits/fcntl.h bits/local_lim.h \
	bits/mman.h bits/posix_opt.h bits/stat.h bits/typesizes.h \
	closedir.c dirfd.c dirstream.h execve.c _exit.c exit-thread.c \
	fork.c fstatfs64.c fstatfs.c fstatvfs64.c fstatvfs.c fxstat64.c \
	fxstat.c _G_config.h getdtsz.c getegid.c geteuid.c getpagesize.c \
	getppid.c Implies init-first.c lxstat64.c lxstat.c Makefile \
	mremap.c opendir.c readdir.c readdir_r.c rewinddir.c \
	sys/param.h syscall.c telldir.c uname.c xstat64.c xstat.c
hurd_l4 = configure configure.in Makeconfig Makefile \
	$(addprefix sysdeps/l4/hurd/,$(hurd_l4_sysdeps_l4_hurd))
hurd_l4_add_on = $(addprefix hurd-l4/, $(hurd_l4))


EXTRA_DIST = $(patches) $(hurd_l4_add_on)


# The GNU C library version that we build against.
glibc_repository = :pserver:anoncvs@sources.redhat.com:/cvs/glibc
glibc_module = libc
glibc_version = 2004-01-23

libc-cvs:
	test ! -e libc || (echo "GNU C library already checked out." && false)
	cvs -z3 -d $(glibc_repository) \
		co -D $(glibc_version) -d libc $(glibc_module)

libc-checkout-stamp:
	test -e libc || (echo "You must setup the libc source (see README)." \
			&& false)
	touch libc-checkout-stamp

libc-patch-stamp: libc-checkout-stamp
	for p in $(patches) ; do \
		(cd libc; sh ../$(srcdir)/$${p}) || exit 1 ; \
	done
	touch libc-patch-stamp

# FIXME: Order should be reversed.
rpatch:
	for p in $(patches) ; do \
		(cd libc; sh ../$(srcdir)/$${p} -R) || exit 1 ; \
	done
	rm libc-patch-stamp

libc-add-on-stamp: libc-checkout-stamp
	for f in $(hurd_l4_add_on) ; do \
		install -D $(srcdir)/$${f} libc/$${f} ; \
	done
	touch libc-add-on-stamp

libc-configure-stamp: libc-patch-stamp libc-add-on-stamp
	test ! -e libc-build || (echo "Build dir already exists." && false)
	mkdir libc-build
	(cd libc-build && ../libc/configure --disable-shared \
	--disable-profile --without-cvs --enable-add-ons=nptl,hurd-l4 \
	--prefix=$(prefix) --build=$(build_alias) --host=$(host_alias))
	touch libc-configure-stamp

libc-build-stamp: libc-configure-stamp
	(cd libc-build; make)
	touch libc-build-stamp

libc.a: libc-build-stamp
	ln -sf libc-build/libc.a libc.a

# clean:
#	rm -fR libc.a libc-build
#
# distclean:
#	rm -fR libc