summaryrefslogtreecommitdiffstats
path: root/rules/libpng125.make
blob: 16445dfda578bf3bdc66751b66494ac9b70a67f4 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Robert Schwebel <r.schwebel@pengutronix.de>
#                       Pengutronix <info@pengutronix.de>, Germany
#          
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_LIBPNG125) += libpng125

#
# Paths and names
#
LIBPNG125_VERSION	= 1.2.8
LIBPNG125		= libpng-$(LIBPNG125_VERSION)-config
LIBPNG125_SUFFIX	= tar.gz
LIBPNG125_URL		= $(PTXCONF_SETUP_SFMIRROR)/libpng/$(LIBPNG125).$(LIBPNG125_SUFFIX)
LIBPNG125_SOURCE	= $(SRCDIR)/$(LIBPNG125).$(LIBPNG125_SUFFIX)
LIBPNG125_DIR		= $(BUILDDIR)/$(LIBPNG125)

-include $(call package_depfile)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

libpng125_get: $(STATEDIR)/libpng125.get

libpng125_get_deps	=  $(LIBPNG125_SOURCE)


$(STATEDIR)/libpng125.get: $(libpng125_get_deps) $(STATEDIR)/libpng125-patches.get
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(STATEDIR)/libpng125-patches.get:
	@$(call targetinfo, $@)
	@$(call get_patches, $(LIBPNG125))
	@$(call touch, $@)

$(LIBPNG125_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(LIBPNG125_URL))

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

libpng125_extract: $(STATEDIR)/libpng125.extract

libpng125_extract_deps	=  $(STATEDIR)/libpng125.get

$(STATEDIR)/libpng125.extract: $(libpng125_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(LIBPNG125_DIR))
	@$(call extract, $(LIBPNG125_SOURCE))
	@$(call patchin, $(LIBPNG125))
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

libpng125_prepare: $(STATEDIR)/libpng125.prepare

#
# dependencies
#
libpng125_prepare_deps =  \
	$(STATEDIR)/libpng125.extract \
	$(STATEDIR)/zlib.install \
	$(STATEDIR)/virtual-xchain.install

LIBPNG125_PATH	   = PATH=$(CROSS_PATH)
LIBPNG125_ENV      = $(CROSS_ENV)

LIBPNG125_AUTOCONF =  $(CROSS_AUTOCONF_USR)
# FIXME: this should be fixed upstream, the package doesn't take care of
# DESTDIR. When fixed, the following option shouldn't be needed any
# more.  
LIBPNG125_AUTOCONF += --with-pkgconfigdir=$(SYSROOT)/lib

$(STATEDIR)/libpng125.prepare: $(libpng125_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(LIBPNG125_BUILDDIR))
	@echo "FIXME: broken autoconf, see .make file"
	cd $(LIBPNG125_DIR) && \
		$(LIBPNG125_PATH) $(LIBPNG125_ENV) \
		./configure $(LIBPNG125_AUTOCONF)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

libpng125_compile: $(STATEDIR)/libpng125.compile

libpng125_compile_deps =  $(STATEDIR)/libpng125.prepare
libpng125_compile_deps += $(STATEDIR)/zlib.install

$(STATEDIR)/libpng125.compile: $(libpng125_compile_deps)
	@$(call targetinfo, $@)
	cd $(LIBPNG125_DIR) && $(LIBPNG125_PATH) $(LIBPNG125_ENV) make
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

libpng125_install: $(STATEDIR)/libpng125.install

$(STATEDIR)/libpng125.install: $(STATEDIR)/libpng125.compile
	@$(call targetinfo, $@)
	@$(call install, LIBPNG125)
# and now the ugly part
#	cd $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/include/libpng12 && \
#		ln -s ../zlib.h .
#	cd $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/include/libpng12 && \
#		ln -s ../zconf.h .
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

libpng125_targetinstall: $(STATEDIR)/libpng125.targetinstall

libpng125_targetinstall_deps	=  $(STATEDIR)/libpng125.compile

$(STATEDIR)/libpng125.targetinstall: $(libpng125_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,libpng125)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(LIBPNG125_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	@$(call install_copy, 0, 0, 0644, \
		$(LIBPNG125_DIR)/.libs/libpng12.so.0.0.0, \
		/usr/lib/libpng12.so.0.0.0)
	@$(call install_link, libpng12.so.0.0.0, /usr/lib/libpng12.so.0.0)
	@$(call install_link, libpng12.so.0.0.0, /usr/lib/libpng12.so.0)

	@$(call install_copy, 0, 0, 0644, \
		$(LIBPNG125_DIR)/.libs/libpng.so.3.0.0, \
		/usr/lib/libpng.so.3.0.0)
	@$(call install_link, libpng.so.3.0.0, /usr/lib/libpng.so.3.0)
	@$(call install_link, libpng.so.3.0.0, /usr/lib/libpng.so.3)

	@$(call install_finish)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

libpng125_clean:
	rm -rf $(STATEDIR)/libpng125.*
	rm -rf $(IMAGEDIR)/libpng125_*
	rm -rf $(LIBPNG125_DIR)

# vim: syntax=make