root/trunk/make/apr-util.mk

Revision 10598, 8.3 kB (checked in by bzhou, 6 months ago)

apr-util: 1.3.8 -> 1.3.9

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 ###########################################################
2 #
3 # apr-util
4 #
5 ###########################################################
6 #
7 # $Id$
8 #
9 # APR_UTIL_VERSION, APR_UTIL_SITE and APR_UTIL_SOURCE define
10 # the upstream location of the source code for the package.
11 # APR_UTIL_DIR is the directory which is created when the source
12 # archive is unpacked.
13 # APR_UTIL_UNZIP is the command used to unzip the source.
14 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
15 #
16 APR_UTIL_SITE=http://www.apache.org/dist/apr
17 APR_UTIL_VERSION=1.3.9
18 APR_UTIL_SOURCE=apr-util-$(APR_UTIL_VERSION).tar.bz2
19 APR_UTIL_DIR=apr-util-$(APR_UTIL_VERSION)
20 APR_UTIL_UNZIP=bzcat
21 APR_UTIL_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
22 APR_UTIL_DESCRIPTION=Apache Portable Runtime utilities library
23 APR_UTIL_SECTION=lib
24 APR_UTIL_PRIORITY=optional
25 APR_UTIL_DEPENDS=apr (>= 1.3.8), e2fslibs, expat, gdbm, libdb
26 APR_UTIL_SUGGESTS=sqlite
27
28 #
29 # APR_UTIL_IPK_VERSION should be incremented when the ipk changes.
30 #
31 APR_UTIL_IPK_VERSION=1
32
33 #
34 # APR_UTIL_LOCALES defines which locales get installed
35 #
36 APR_UTIL_LOCALES=
37
38 ifeq (openldap, $(filter openldap, $(PACKAGES)))
39 APR_UTIL_CONFIGURE_TARGET_ARGS= \
40                 --with-ldap-library=$(STAGING_LIB_DIR) \
41                 --with-ldap-include=$(STAGING_INCLUDE_DIR) \
42                 --with-ldap
43 APR_UTIL_SUGGESTS +=, openldap-libs
44 else
45 APR_UTIL_CONFIGURE_TARGET_ARGS=
46 endif
47
48 #
49 # APR_UTIL_CONFFILES should be a list of user-editable files
50 #APR_UTIL_CONFFILES=/opt/etc/apr-util.conf /opt/etc/init.d/SXXapr-util
51
52 #
53 # APR_UTIL_PATCHES should list any patches, in the the order in
54 # which they should be applied to the source code.
55 #
56 APR_UTIL_PATCHES=$(APR_UTIL_SOURCE_DIR)/dbm-detect.patch
57 # $(APR_UTIL_SOURCE_DIR)/hostcc.patch
58
59 #
60 # If the compilation of the package requires additional
61 # compilation or linking flags, then list them here.
62 #
63 APR_UTIL_CPPFLAGS=-I$(STAGING_INCLUDE_DIR)/apache2
64 APR_UTIL_LDFLAGS=-Wl,-rpath-link=$(STAGING_LIB_DIR)
65
66 #
67 # APR_UTIL_BUILD_DIR is the directory in which the build is done.
68 # APR_UTIL_SOURCE_DIR is the directory which holds all the
69 # patches and ipkg control files.
70 # APR_UTIL_IPK_DIR is the directory in which the ipk is built.
71 # APR_UTIL_IPK is the name of the resulting ipk files.
72 #
73 # You should not change any of these variables.
74 #
75 APR_UTIL_BUILD_DIR=$(BUILD_DIR)/apr-util
76 APR_UTIL_SOURCE_DIR=$(SOURCE_DIR)/apr-util
77 APR_UTIL_IPK_DIR=$(BUILD_DIR)/apr-util-$(APR_UTIL_VERSION)-ipk
78 APR_UTIL_IPK=$(BUILD_DIR)/apr-util_$(APR_UTIL_VERSION)-$(APR_UTIL_IPK_VERSION)_$(TARGET_ARCH).ipk
79
80 .PHONY: apr-util-source apr-util-unpack apr-util apr-util-stage apr-util-ipk apr-util-clean apr-util-dirclean apr-util-check
81
82 #
83 # Automatically create a ipkg control file
84 #
85 $(APR_UTIL_IPK_DIR)/CONTROL/control:
86         @install -d $(@D)
87         @rm -f $@
88         @echo "Package: apr-util" >>$@
89         @echo "Architecture: $(TARGET_ARCH)" >>$@
90         @echo "Priority: $(APR_UTIL_PRIORITY)" >>$@
91         @echo "Section: $(APR_UTIL_SECTION)" >>$@
92         @echo "Version: $(APR_UTIL_VERSION)-$(APR_UTIL_IPK_VERSION)" >>$@
93         @echo "Maintainer: $(APR_UTIL_MAINTAINER)" >>$@
94         @echo "Source: $(APR_UTIL_SITE)/$(APR_UTIL_SOURCE)" >>$@
95         @echo "Description: $(APR_UTIL_DESCRIPTION)" >>$@
96         @echo "Depends: $(APR_UTIL_DEPENDS)" >>$@
97         @echo "Suggests: $(APR_UTIL_SUGGESTS)" >>$@
98
99 #
100 # This is the dependency on the source code.  If the source is missing,
101 # then it will be fetched from the site using wget.
102 #
103 $(DL_DIR)/$(APR_UTIL_SOURCE):
104         $(WGET) -P $(@D) $(APR_UTIL_SITE)/$(@F) || \
105         $(WGET) -P $(@D) $(SOURCES_NLO_SITE)/$(@F)
106
107 #
108 # The source code depends on it existing within the download directory.
109 # This target will be called by the top level Makefile to download the
110 # source code's archive (.tar.gz, .bz2, etc.)
111 #
112 apr-util-source: $(DL_DIR)/$(APR_UTIL_SOURCE) $(APR_UTIL_PATCHES)
113
114 #
115 # This target unpacks the source code in the build directory.
116 # If the source archive is not .tar.gz or .tar.bz2, then you will need
117 # to change the commands here.  Patches to the source code are also
118 # applied in this target as required.
119 #
120 # This target also configures the build within the build directory.
121 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
122 # and NOT $(MAKE) below.  Passing it to configure causes configure to
123 # correctly BUILD the Makefile with the right paths, where passing it
124 # to Make causes it to override the default search paths of the compiler.
125 #
126 # If the compilation of the package requires other packages to be staged
127 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
128 #
129 $(APR_UTIL_BUILD_DIR)/.configured: $(DL_DIR)/$(APR_UTIL_SOURCE) $(APR_UTIL_PATCHES) make/apr-util.mk
130         $(MAKE) gdbm-stage libdb-stage sqlite-stage
131         $(MAKE) expat-stage
132         $(MAKE) e2fsprogs-stage
133 ifeq (openldap, $(filter openldap, $(PACKAGES)))
134         $(MAKE) openldap-stage
135 endif
136         $(MAKE) apr-stage
137         rm -rf $(BUILD_DIR)/$(APR_UTIL_DIR) $(@D)
138         $(APR_UTIL_UNZIP) $(DL_DIR)/$(APR_UTIL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
139         mv $(BUILD_DIR)/$(APR_UTIL_DIR) $(@D)
140         cat $(APR_UTIL_PATCHES) |patch -p0 -d$(@D)
141         autoreconf -vif $(@D)
142         (cd $(@D); \
143                 $(TARGET_CONFIGURE_OPTS) \
144                 CPPFLAGS="$(STAGING_CPPFLAGS) $(APR_UTIL_CPPFLAGS)" \
145                 LDFLAGS="$(STAGING_LDFLAGS) $(APR_UTIL_LDFLAGS)" \
146                 ac_cv_file_dbd_apr_dbd_mysql_c=no \
147                 ./configure \
148                 --build=$(GNU_HOST_NAME) \
149                 --host=$(GNU_TARGET_NAME) \
150                 --target=$(GNU_TARGET_NAME) \
151                 --prefix=$(STAGING_DIR)/opt \
152                 --libdir=/opt/lib \
153                 --disable-static \
154                 --enable-layout=GNU \
155                 --with-apr=$(STAGING_DIR)/opt \
156                 --with-gdbm=$(STAGING_DIR)/opt \
157                 --with-expat=$(STAGING_DIR)/opt \
158                 --without-freetds \
159                 --without-mysql \
160                 --without-odbc \
161                 --without-pgsql \
162                 --without-sqlite2 \
163                 --with-sqlite3=$(STAGING_PREFIX) \
164                 $(APR_UTIL_CONFIGURE_TARGET_ARGS) \
165         )
166         mkdir -p $(@D)/build
167         cp $(STAGING_PREFIX)/share/apache2/build-1/apr_rules.mk $(@D)/build/rules.mk
168         touch $@
169
170 apr-util-unpack: $(APR_UTIL_BUILD_DIR)/.configured
171
172 #
173 # This builds the actual binary.  You should change the target to refer
174 # directly to the main binary which is built.
175 #
176 $(APR_UTIL_BUILD_DIR)/.built: $(APR_UTIL_BUILD_DIR)/.configured
177         rm -f $@
178         rm -f $(STAGING_INCLUDE_DIR)/apache2/apu*.h
179         $(MAKE) -C $(@D) HOSTCC=$(HOSTCC)
180         touch $@
181
182 #
183 # You should change the dependency to refer directly to the main binary
184 # which is built.
185 #
186 apr-util: $(APR_UTIL_BUILD_DIR)/.built
187
188 #
189 # If you are building a library, then you need to stage it too.
190 #
191 $(APR_UTIL_BUILD_DIR)/.staged: $(APR_UTIL_BUILD_DIR)/.built
192         rm -f $@
193         $(MAKE) -C $(APR_UTIL_BUILD_DIR) install libdir=$(STAGING_PREFIX)/lib
194         rm -f $(STAGING_PREFIX)/lib/libaprutil.la
195         sed -i -e 's/location=build/location=installed/' $(STAGING_PREFIX)/bin/apu-1-config
196         rm -f $(STAGING_PREFIX)/bin/apu-config
197 #       ln -s apu-1-config $(STAGING_PREFIX)/bin/apu-config
198         touch $@
199
200 apr-util-stage: $(APR_UTIL_BUILD_DIR)/.staged
201
202 #
203 # This builds the IPK file.
204 #
205 # Binaries should be installed into $(APR_UTIL_IPK_DIR)/opt/sbin or $(APR_UTIL_IPK_DIR)/opt/bin
206 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
207 # Libraries and include files should be installed into $(APR_UTIL_IPK_DIR)/opt/{lib,include}
208 # Configuration files should be installed in $(APR_UTIL_IPK_DIR)/opt/etc/apr-util/...
209 # Documentation files should be installed in $(APR_UTIL_IPK_DIR)/opt/doc/apr-util/...
210 # Daemon startup scripts should be installed in $(APR_UTIL_IPK_DIR)/opt/etc/init.d/S??apr-util
211 #
212 # You may need to patch your application to make it use these locations.
213 #
214 $(APR_UTIL_IPK): $(APR_UTIL_BUILD_DIR)/.staged
215         rm -rf $(APR_UTIL_IPK_DIR) $(BUILD_DIR)/apr-util_*_$(TARGET_ARCH).ipk
216         $(MAKE) -C $(APR_UTIL_BUILD_DIR) DESTDIR=$(APR_UTIL_IPK_DIR) libdir=/opt/lib prefix=/delete-me install
217         rm -rf $(APR_UTIL_IPK_DIR)/delete-me
218         rm -f $(APR_UTIL_IPK_DIR)/opt/lib/*.la
219         $(STRIP_COMMAND) $(APR_UTIL_IPK_DIR)/opt/lib/*.so.[0-9]*.[0-9]*.[0-9]*
220         $(STRIP_COMMAND) $(APR_UTIL_IPK_DIR)/opt/lib/apr-util*/*.so
221         $(MAKE) $(APR_UTIL_IPK_DIR)/CONTROL/control
222         cd $(BUILD_DIR); $(IPKG_BUILD) $(APR_UTIL_IPK_DIR)
223
224 #
225 # This is called from the top level makefile to create the IPK file.
226 #
227 apr-util-ipk: $(APR_UTIL_IPK)
228
229 #
230 # This is called from the top level makefile to clean all of the built files.
231 #
232 apr-util-clean:
233         -$(MAKE) -C $(APR_UTIL_BUILD_DIR) clean
234
235 #
236 # This is called from the top level makefile to clean all dynamically created
237 # directories.
238 #
239 apr-util-dirclean:
240         rm -rf $(BUILD_DIR)/$(APR_UTIL_DIR) $(APR_UTIL_BUILD_DIR) $(APR_UTIL_IPK_DIR) $(APR_UTIL_IPK)
241
242 #
243 # Some sanity check for the package.
244 #
245 apr-util-check: $(APR_UTIL_IPK)
246         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $^
Note: See TracBrowser for help on using the browser.