Tcl build fix
[gumsense-br.git] / package / fakeroot / fakeroot.mk
blob13064613c85d4880d7afd2d86c53abffc2734bb4
1 #############################################################
3 # fakeroot
5 #############################################################
6 FAKEROOT_VERSION:=1.2.13
7 FAKEROOT_SOURCE:=fakeroot_$(FAKEROOT_VERSION).tar.gz
8 FAKEROOT_SITE:=http://ftp.debian.org/debian/pool/main/f/fakeroot
9 FAKEROOT_CAT:=zcat
10 FAKEROOT_DIR1:=$(TOOL_BUILD_DIR)/fakeroot-$(FAKEROOT_VERSION)
11 FAKEROOT_DIR2:=$(BUILD_DIR)/fakeroot-$(FAKEROOT_VERSION)
14 $(DL_DIR)/$(FAKEROOT_SOURCE):
15 $(WGET) -P $(DL_DIR) $(FAKEROOT_SITE)/$(FAKEROOT_SOURCE)
17 fakeroot-source: $(DL_DIR)/$(FAKEROOT_SOURCE)
20 #############################################################
22 # build fakeroot for use on the host system
24 #############################################################
25 $(FAKEROOT_DIR1)/.unpacked: $(DL_DIR)/$(FAKEROOT_SOURCE)
26 $(FAKEROOT_CAT) $(DL_DIR)/$(FAKEROOT_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
27 $(SED) "s,getopt --version,getopt --version 2>/dev/null," \
28 $(FAKEROOT_DIR1)/scripts/fakeroot.in
29 touch $(FAKEROOT_DIR1)/.unpacked
31 $(FAKEROOT_DIR1)/.configured: $(FAKEROOT_DIR1)/.unpacked
32 (cd $(FAKEROOT_DIR1); rm -rf config.cache; \
33 CC="$(HOSTCC)" \
34 ./configure \
35 --prefix=/usr \
37 touch $(FAKEROOT_DIR1)/.configured
39 $(FAKEROOT_DIR1)/faked: $(FAKEROOT_DIR1)/.configured
40 $(MAKE) -C $(FAKEROOT_DIR1)
42 $(STAGING_DIR)/usr/bin/fakeroot: $(FAKEROOT_DIR1)/faked
43 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(FAKEROOT_DIR1) install
44 $(SED) 's,^PREFIX=.*,PREFIX=$(STAGING_DIR)/usr,g' $(STAGING_DIR)/usr/bin/fakeroot
45 $(SED) 's,^BINDIR=.*,BINDIR=$(STAGING_DIR)/usr/bin,g' $(STAGING_DIR)/usr/bin/fakeroot
46 $(SED) 's,^PATHS=.*,PATHS=$(FAKEROOT_DIR1)/.libs:/lib:/usr/lib,g' $(STAGING_DIR)/usr/bin/fakeroot
48 host-fakeroot: uclibc $(STAGING_DIR)/usr/bin/fakeroot
50 host-fakeroot-clean:
51 $(MAKE) -C $(FAKEROOT_DIR1) clean
53 host-fakeroot-dirclean:
54 rm -rf $(FAKEROOT_DIR1)
57 #############################################################
59 # build fakeroot for use on the target system
61 #############################################################
62 $(FAKEROOT_DIR2)/.unpacked: $(DL_DIR)/$(FAKEROOT_SOURCE)
63 $(FAKEROOT_CAT) $(DL_DIR)/$(FAKEROOT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
64 # If using busybox getopt, make it be quiet.
65 $(SED) "s,getopt --version,getopt --version 2>/dev/null," \
66 $(FAKEROOT_DIR2)/scripts/fakeroot.in
67 touch $(FAKEROOT_DIR2)/.unpacked
69 $(FAKEROOT_DIR2)/.configured: $(FAKEROOT_DIR2)/.unpacked
70 (cd $(FAKEROOT_DIR2); rm -rf config.cache; \
71 $(TARGET_CONFIGURE_OPTS) \
72 ./configure \
73 --target=$(GNU_TARGET_NAME) \
74 --host=$(GNU_TARGET_NAME) \
75 --build=$(GNU_HOST_NAME) \
76 --prefix=/usr \
77 --exec-prefix=/usr \
78 --bindir=/usr/bin \
79 --sbindir=/usr/sbin \
80 --libdir=/usr/lib/libfakeroot \
81 --sysconfdir=/etc \
82 --datadir=/usr/share \
83 --localstatedir=/var \
84 --mandir=/usr/man \
85 --infodir=/usr/info \
86 $(DISABLE_NLS) \
88 touch $(FAKEROOT_DIR2)/.configured
90 $(FAKEROOT_DIR2)/faked: $(FAKEROOT_DIR2)/.configured
91 $(MAKE) CC=$(TARGET_CC) -C $(FAKEROOT_DIR2)
93 $(TARGET_DIR)/usr/bin/fakeroot: $(FAKEROOT_DIR2)/faked
94 $(MAKE) DESTDIR=$(TARGET_DIR) -C $(FAKEROOT_DIR2) install
95 -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-faked $(TARGET_DIR)/usr/bin/faked
96 -mv $(TARGET_DIR)/usr/bin/$(ARCH)-linux-fakeroot $(TARGET_DIR)/usr/bin/fakeroot
97 rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
98 $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
100 fakeroot: uclibc $(TARGET_DIR)/usr/bin/fakeroot
102 fakeroot-clean:
103 $(MAKE) -C $(FAKEROOT_DIR2) clean
105 fakeroot-dirclean:
106 rm -rf $(FAKEROOT_DIR2)
109 #############################################################
111 # Toplevel Makefile options
113 #############################################################
114 ifeq ($(strip $(BR2_PACKAGE_FAKEROOT)),y)
115 TARGETS+=fakeroot
116 endif