aboutsummaryrefslogtreecommitdiff
path: root/package/ruby/ruby.mk
blob: c7dc31fc3d136db28be01b4e8b14411b7e9197f5 (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
#############################################################
#
# ruby
#
#############################################################
RUBY_VERSION:=1.8.2
RUBY_SOURCE:=ruby-$(RUBY_VERSION).tar.gz
RUBY_SITE:=ftp://ftp.ruby-lang.org/pub/ruby/1.8
RUBY_DIR:=$(BUILD_DIR)/ruby-$(RUBY_VERSION)
RUBY_CAT:=$(ZCAT)
RUBY_BINARY:=ruby
RUBY_TARGET_BINARY:=usr/bin/ruby

$(DL_DIR)/$(RUBY_SOURCE):
	 $(call DOWNLOAD,$(RUBY_SITE),$(RUBY_SOURCE))

ruby-source: $(DL_DIR)/$(RUBY_SOURCE)

$(RUBY_DIR)/.unpacked: $(DL_DIR)/$(RUBY_SOURCE)
	$(RUBY_CAT) $(DL_DIR)/$(RUBY_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(RUBY_DIR) package/ruby/ ruby-\*.patch
	(cd $(RUBY_DIR); autoreconf)
	touch $(RUBY_DIR)/.unpacked

$(RUBY_DIR)/.configured: $(RUBY_DIR)/.unpacked
	(cd $(RUBY_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libdir=/lib \
		--libexecdir=/usr/lib \
		--sysconfdir=/etc \
		--datadir=/usr/share \
		--localstatedir=/var \
		--mandir=/usr/man \
		--infodir=/usr/info \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
	)
	touch $(RUBY_DIR)/.configured

$(RUBY_DIR)/$(RUBY_BINARY): $(RUBY_DIR)/.configured
	$(MAKE) -C $(RUBY_DIR)

$(TARGET_DIR)/$(RUBY_TARGET_BINARY): $(RUBY_DIR)/$(RUBY_BINARY)
	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(RUBY_DIR) install
	rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc

ruby: uclibc $(TARGET_DIR)/$(RUBY_TARGET_BINARY)

ruby-clean:
	$(MAKE) DESTDIR=$(TARGET_DIR) -C $(RUBY_DIR) uninstall
	-$(MAKE) -C $(RUBY_DIR) clean

ruby-dirclean:
	rm -rf $(RUBY_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_RUBY),y)
TARGETS+=ruby
endif