root/trunk/make/apr.mk

Revision 11336, 6.8 kB (checked in by bzhou, 4 weeks ago)

apr: 1.3.9 -> 1.3.12

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 ###########################################################
2 #
3 # apr
4 #
5 ###########################################################
6 #
7 # $Id$
8 #
9 # APR_VERSION, APR_SITE and APR_SOURCE define
10 # the upstream location of the source code for the package.
11 # APR_DIR is the directory which is created when the source
12 # archive is unpacked.
13 # APR_UNZIP is the command used to unzip the source.
14 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
15 #
16 APR_SITE=http://www.apache.org/dist/apr
17 APR_VERSION=1.3.12
18 APR_SOURCE=apr-$(APR_VERSION).tar.bz2
19 APR_DIR=apr-$(APR_VERSION)
20 APR_UNZIP=bzcat
21 APR_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com>
22 APR_DESCRIPTION=Apache Portable Runtime library
23 APR_SECTION=lib
24 APR_PRIORITY=optional
25 APR_DEPENDS=
26
27 #
28 # APR_IPK_VERSION should be incremented when the ipk changes.
29 #
30 APR_IPK_VERSION=1
31
32 #
33 # APR_LOCALES defines which locales get installed
34 #
35 APR_LOCALES=
36
37 #
38 # APR_CONFFILES should be a list of user-editable files
39 #APR_CONFFILES=/opt/etc/apr.conf /opt/etc/init.d/SXXapr
40
41 #
42 # APR_PATCHES should list any patches, in the the order in
43 # which they should be applied to the source code.
44 #
45 #APR_PATCHES=$(APR_SOURCE_DIR)/configure.patch
46
47 #
48 # If the compilation of the package requires additional
49 # compilation or linking flags, then list them here.
50 #
51 APR_CPPFLAGS=-I$(STAGING_INCLUDE_DIR)/apache2
52 APR_LDFLAGS=-lpthread
53
54 #
55 # APR_BUILD_DIR is the directory in which the build is done.
56 # APR_SOURCE_DIR is the directory which holds all the
57 # patches and ipkg control files.
58 # APR_IPK_DIR is the directory in which the ipk is built.
59 # APR_IPK is the name of the resulting ipk files.
60 #
61 # You should not change any of these variables.
62 #
63 APR_BUILD_DIR=$(BUILD_DIR)/apr
64 APR_SOURCE_DIR=$(SOURCE_DIR)/apr
65 APR_IPK_DIR=$(BUILD_DIR)/apr-$(APR_VERSION)-ipk
66 APR_IPK=$(BUILD_DIR)/apr_$(APR_VERSION)-$(APR_IPK_VERSION)_$(TARGET_ARCH).ipk
67
68 .PHONY: apr-source apr-unpack apr apr-stage apr-ipk apr-clean apr-dirclean apr-check
69
70 #
71 # Automatically create a ipkg control file
72 #
73 $(APR_IPK_DIR)/CONTROL/control:
74         @install -d $(@D)
75         @rm -f $@
76         @echo "Package: apr" >>$@
77         @echo "Architecture: $(TARGET_ARCH)" >>$@
78         @echo "Priority: $(APR_PRIORITY)" >>$@
79         @echo "Section: $(APR_SECTION)" >>$@
80         @echo "Version: $(APR_VERSION)-$(APR_IPK_VERSION)" >>$@
81         @echo "Maintainer: $(APR_MAINTAINER)" >>$@
82         @echo "Source: $(APR_SITE)/$(APR_SOURCE)" >>$@
83         @echo "Description: $(APR_DESCRIPTION)" >>$@
84         @echo "Depends: $(APR_DEPENDS)" >>$@
85
86 #
87 # This is the dependency on the source code.  If the source is missing,
88 # then it will be fetched from the site using wget.
89 #
90 $(DL_DIR)/$(APR_SOURCE):
91         $(WGET) -P $(@D) $(APR_SITE)/$(@F) || \
92         $(WGET) -P $(@D) $(SOURCES_NLO_SITE)/$(@F)
93
94 #
95 # The source code depends on it existing within the download directory.
96 # This target will be called by the top level Makefile to download the
97 # source code's archive (.tar.gz, .bz2, etc.)
98 #
99 apr-source: $(DL_DIR)/$(APR_SOURCE) $(APR_PATCHES)
100
101 #
102 # This target unpacks the source code in the build directory.
103 # If the source archive is not .tar.gz or .tar.bz2, then you will need
104 # to change the commands here.  Patches to the source code are also
105 # applied in this target as required.
106 #
107 # This target also configures the build within the build directory.
108 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
109 # and NOT $(MAKE) below.  Passing it to configure causes configure to
110 # correctly BUILD the Makefile with the right paths, where passing it
111 # to Make causes it to override the default search paths of the compiler.
112 #
113 # If the compilation of the package requires other packages to be staged
114 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
115 #
116 $(APR_BUILD_DIR)/.configured: $(DL_DIR)/$(APR_SOURCE) $(APR_PATCHES) make/apr.mk
117         rm -rf $(BUILD_DIR)/$(APR_DIR) $(@D)
118         $(APR_UNZIP) $(DL_DIR)/$(APR_SOURCE) | tar -C $(BUILD_DIR) -xvf -
119         mv $(BUILD_DIR)/$(APR_DIR) $(@D)
120         (cd $(@D); \
121                 $(TARGET_CONFIGURE_OPTS) \
122                 CPPFLAGS="$(STAGING_CPPFLAGS) $(APR_CPPFLAGS)" \
123                 LDFLAGS="$(STAGING_LDFLAGS) $(APR_LDFLAGS)" \
124                 ac_cv_func_setpgrp_void=yes \
125                 ac_cv_sizeof_size_t=4 \
126                 ac_cv_sizeof_ssize_t=4 \
127                 ac_cv_sizeof_off_t=4 \
128                 ac_cv_sizeof_pid_t=4 \
129                 apr_cv_process_shared_works=no \
130                 ac_cv_file__dev_zero=yes \
131                 apr_cv_tcp_nodelay_with_cork=no \
132                 apr_cv_use_lfs64=yes \
133                 ac_cv_sizeof_struct_iovec=8 \
134                 ./configure \
135                 --build=$(GNU_HOST_NAME) \
136                 --host=$(GNU_TARGET_NAME) \
137                 --target=$(GNU_TARGET_NAME) \
138                 --prefix=$(STAGING_DIR)/opt \
139                 --libdir=/opt/lib \
140                 --disable-static \
141                 --enable-layout=GNU \
142                 --enable-lfs \
143                 --with-devrandom=/dev/urandom \
144         )
145         $(PATCH_LIBTOOL) $(@D)/libtool
146         touch $@
147
148 apr-unpack: $(APR_BUILD_DIR)/.configured
149
150 #
151 # This builds the actual binary.  You should change the target to refer
152 # directly to the main binary which is built.
153 #
154 $(APR_BUILD_DIR)/.built: $(APR_BUILD_DIR)/.configured
155         rm -f $@
156         rm -f $(STAGING_INCLUDE_DIR)/apache2/apr*.h
157         $(MAKE) -C $(APR_BUILD_DIR)
158         touch $@
159
160 #
161 # You should change the dependency to refer directly to the main binary
162 # which is built.
163 #
164 apr: $(APR_BUILD_DIR)/.built
165
166 #
167 # If you are building a library, then you need to stage it too.
168 #
169 $(APR_BUILD_DIR)/.staged: $(APR_BUILD_DIR)/.built
170         rm -f $@
171         $(MAKE) -C $(APR_BUILD_DIR) install libdir=$(STAGING_PREFIX)/lib
172         rm -f $(STAGING_PREFIX)/lib/libapr.la
173         sed -i -e 's/location=build/location=installed/' $(STAGING_PREFIX)/bin/apr-1-config
174         touch $@
175
176 apr-stage: $(APR_BUILD_DIR)/.staged
177
178 #
179 # This builds the IPK file.
180 #
181 # Binaries should be installed into $(APR_IPK_DIR)/opt/sbin or $(APR_IPK_DIR)/opt/bin
182 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
183 # Libraries and include files should be installed into $(APR_IPK_DIR)/opt/{lib,include}
184 # Configuration files should be installed in $(APR_IPK_DIR)/opt/etc/apr/...
185 # Documentation files should be installed in $(APR_IPK_DIR)/opt/doc/apr/...
186 # Daemon startup scripts should be installed in $(APR_IPK_DIR)/opt/etc/init.d/S??apr
187 #
188 # You may need to patch your application to make it use these locations.
189 #
190 $(APR_IPK): $(APR_BUILD_DIR)/.staged
191         rm -rf $(APR_IPK_DIR) $(BUILD_DIR)/apr_*_$(TARGET_ARCH).ipk
192         $(MAKE) -C $(APR_BUILD_DIR) DESTDIR=$(APR_IPK_DIR) libdir=/opt/lib prefix=/delete-me install
193         rm -rf $(APR_IPK_DIR)/delete-me
194         rm -f $(APR_IPK_DIR)/opt/lib/*.la
195         $(TARGET_STRIP) $(APR_IPK_DIR)/opt/lib/*.so.[0-9]*.[0-9]*.[0-9]*
196         $(MAKE) $(APR_IPK_DIR)/CONTROL/control
197         cd $(BUILD_DIR); $(IPKG_BUILD) $(APR_IPK_DIR)
198
199 #
200 # This is called from the top level makefile to create the IPK file.
201 #
202 apr-ipk: $(APR_IPK)
203
204 #
205 # This is called from the top level makefile to clean all of the built files.
206 #
207 apr-clean:
208         -$(MAKE) -C $(APR_BUILD_DIR) clean
209
210 #
211 # This is called from the top level makefile to clean all dynamically created
212 # directories.
213 #
214 apr-dirclean:
215         rm -rf $(BUILD_DIR)/$(APR_DIR) $(APR_BUILD_DIR) $(APR_IPK_DIR) $(APR_IPK)
216
217 #
218 # Some sanity check for the package.
219 #
220 apr-check: $(APR_IPK)
221         perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $^
Note: See TracBrowser for help on using the browser.