source: freewrt/package/php5/Makefile@ bccc703

freewrt_1_0 freewrt_2_0
Last change on this file since bccc703 was c8b93bd, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

major package Makefile cleanup. remove mostly-clean, add licence header, always use RSTRIP varibale for stripping, rename some init scripts, indent

git-svn-id: svn://www.freewrt.org/trunk/freewrt@600 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 9.3 KB
Line 
1# $FreeWRT$
2#-
3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
5# or at http://www.freewrt.org/licence for details.
6
7include $(TOPDIR)/rules.mk
8
9PKG_NAME:= php
10PKG_VERSION:= 5.0.5
11PKG_RELEASE:= 1
12PKG_MD5SUM:= b5d4ca75bbb11ee5b830fa67213d9f7f
13
14PKG_SOURCE_URL:= http://fr.php.net/distributions/
15PKG_SOURCE:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
16
17include $(TOPDIR)/mk/package.mk
18
19define PKG_mod_template
20
21$$(IPKG_$(1)):
22 install -d -m0755 $$(IDIR_$(1))/usr/lib/php
23 install -m0755 $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
24 $(RSTRIP) $$(IDIR_$(1))
25 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
26
27endef
28
29PKG_CONFIGURE_OPTS:= \
30 --enable-shared \
31 --disable-static \
32 --disable-rpath \
33 --disable-debug \
34 --without-pear \
35 --disable-spl \
36 \
37 --with-config-file-path=/etc \
38 --disable-ipv6 \
39 --enable-magic-quotes \
40 --enable-memory-limit \
41 --disable-short-tags \
42 \
43 --disable-ctype \
44 --disable-dom \
45 --enable-ftp=shared \
46 --without-gettext \
47 --without-iconv \
48 --disable-libxml \
49 --without-libxml-dir \
50 --disable-mbstring \
51 --disable-mbregex \
52 --with-openssl=shared,"$(STAGING_DIR)/usr" \
53 --with-kerberos=no \
54 --with-openssl-dir="$(STAGING_DIR)/usr" \
55 --enable-session=shared \
56 --disable-simplexml \
57 --disable-soap \
58 --enable-sockets=shared \
59 --disable-tokenizer \
60 --with-zlib="$(STAGING_DIR)/usr" \
61 --with-zlib-dir="$(STAGING_DIR)/usr" \
62
63ifneq ($(FWRT_PACKAGE_PHP5_MOD_CURL),)
64PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr"
65else
66PKG_CONFIGURE_OPTS+= --without-curl
67endif
68ifneq ($(FWRT_PACKAGE_PHP5_MOD_GD),)
69PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
70 --without-freetype-dir \
71 --with-jpeg-dir="$(STAGING_DIR)/usr" \
72 --with-png-dir="$(STAGING_DIR)/usr" \
73 --without-xpm-dir \
74 --without-ttf \
75 --without-t1lib \
76 --enable-gd-native-ttf \
77 --disable-gd-jis-conv
78else
79PKG_CONFIGURE_OPTS+= --without-gd
80endif
81ifneq ($(FWRT_PACKAGE_PHP5_MOD_GMP),)
82PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
83else
84PKG_CONFIGURE_OPTS+= --without-gmp
85endif
86ifneq ($(FWRT_PACKAGE_PHP5_MOD_LDAP),)
87PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
88 --with-ldap-sasl="$(STAGING_DIR)/usr"
89else
90PKG_CONFIGURE_OPTS+= --without-ldap
91endif
92ifneq ($(FWRT_PACKAGE_PHP5_MOD_MYSQL),)
93PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
94else
95PKG_CONFIGURE_OPTS+= --without-mysql
96endif
97ifneq ($(FWRT_PACKAGE_PHP5_MOD_PCRE),)
98PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
99else
100PKG_CONFIGURE_OPTS+= --without-pcre-regex
101endif
102ifneq ($(FWRT_PACKAGE_PHP5_MOD_PGSQL),)
103PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
104else
105PKG_CONFIGURE_OPTS+= --without-pgsql
106endif
107ifneq ($(FWRT_PACKAGE_PHP5_MOD_SQLITE),)
108PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
109else
110PKG_CONFIGURE_OPTS+= --without-sqlite
111endif
112ifneq ($(FWRT_PACKAGE_PHP5_MOD_XML),)
113PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
114 --with-libexpat-dir="$(STAGING_DIR)/usr"
115else
116PKG_CONFIGURE_OPTS+= --disable-xml
117endif
118
119$(eval $(call PKG_template,PHP5_CLI,php5-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
120$(eval $(call PKG_template,PHP5_CGI,php5-cgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
121$(eval $(call PKG_template,PHP5_FASTCGI,php5-fastcgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
122
123$(eval $(call PKG_template,PHP5_MOD_CURL,php5-mod-curl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
124$(eval $(call PKG_template,PHP5_MOD_FTP,php5-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
125$(eval $(call PKG_template,PHP5_MOD_GD,php5-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
126$(eval $(call PKG_template,PHP5_MOD_GMP,php5-mod-gmp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
127$(eval $(call PKG_template,PHP5_MOD_LDAP,php5-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
128$(eval $(call PKG_template,PHP5_MOD_MYSQL,php5-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
129$(eval $(call PKG_template,PHP5_MOD_OPENSSL,php5-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
130$(eval $(call PKG_template,PHP5_MOD_PCRE,php5-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
131$(eval $(call PKG_template,PHP5_MOD_PGSQL,php5-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
132$(eval $(call PKG_template,PHP5_MOD_SESSION,php5-mod-session,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
133$(eval $(call PKG_template,PHP5_MOD_SOCKETS,php5-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
134$(eval $(call PKG_template,PHP5_MOD_SQLITE,php5-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
135$(eval $(call PKG_template,PHP5_MOD_XML,php5-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
136
137$(eval $(call PKG_mod_template,PHP5_MOD_CURL,curl))
138$(eval $(call PKG_mod_template,PHP5_MOD_FTP,ftp))
139$(eval $(call PKG_mod_template,PHP5_MOD_GD,gd))
140$(eval $(call PKG_mod_template,PHP5_MOD_GMP,gmp))
141$(eval $(call PKG_mod_template,PHP5_MOD_LDAP,ldap))
142$(eval $(call PKG_mod_template,PHP5_MOD_MYSQL,mysql))
143$(eval $(call PKG_mod_template,PHP5_MOD_OPENSSL,openssl))
144$(eval $(call PKG_mod_template,PHP5_MOD_PCRE,pcre))
145$(eval $(call PKG_mod_template,PHP5_MOD_PGSQL,pgsql))
146$(eval $(call PKG_mod_template,PHP5_MOD_SESSION,session))
147$(eval $(call PKG_mod_template,PHP5_MOD_SOCKETS,sockets))
148$(eval $(call PKG_mod_template,PHP5_MOD_SQLITE,sqlite))
149$(eval $(call PKG_mod_template,PHP5_MOD_XML,xml))
150
151
152$(WRKBUILD)/.configured:
153 touch $@
154
155$(WRKBUILD)/.built:
156 (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
157 $(TARGET_CONFIGURE_OPTS) \
158 CFLAGS="$(TARGET_CFLAGS)" \
159 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
160 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
161 LIBS="-lcrypto -lssl" \
162 php_cv_cc_rpath="no" \
163 ./configure \
164 --target=$(GNU_TARGET_NAME) \
165 --host=$(GNU_TARGET_NAME) \
166 --build=$(GNU_HOST_NAME) \
167 --program-prefix="" \
168 --program-suffix="" \
169 --prefix=/usr \
170 --exec-prefix=/usr \
171 --bindir=/usr/bin \
172 --datadir=/usr/share \
173 --includedir=/usr/include \
174 --infodir=/usr/share/info \
175 --libdir=/usr/lib \
176 --libexecdir=/usr/lib \
177 --localstatedir=/var \
178 --mandir=/usr/share/man \
179 --sbindir=/usr/sbin \
180 --sysconfdir=/etc \
181 --enable-largefile \
182 --disable-nls \
183 $(PKG_CONFIGURE_OPTS) \
184 --enable-cli \
185 --disable-cgi \
186 --disable-fastcgi \
187 --enable-force-cgi-redirect \
188 --enable-discard-path \
189 );
190 $(MAKE) -C $(WRKBUILD)
191 mv $(WRKBUILD)/sapi/cli/php $(WRKBUILD)/php-cli
192 (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
193 $(TARGET_CONFIGURE_OPTS) \
194 CFLAGS="$(TARGET_CFLAGS)" \
195 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
196 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
197 LIBS="-lcrypto -lssl" \
198 php_cv_cc_rpath="no" \
199 ./configure \
200 --target=$(GNU_TARGET_NAME) \
201 --host=$(GNU_TARGET_NAME) \
202 --build=$(GNU_HOST_NAME) \
203 --program-prefix="" \
204 --program-suffix="" \
205 --prefix=/usr \
206 --exec-prefix=/usr \
207 --bindir=/usr/bin \
208 --datadir=/usr/share \
209 --includedir=/usr/include \
210 --infodir=/usr/share/info \
211 --libdir=/usr/lib \
212 --libexecdir=/usr/lib \
213 --localstatedir=/var \
214 --mandir=/usr/share/man \
215 --sbindir=/usr/sbin \
216 --sysconfdir=/etc \
217 --enable-largefile \
218 --disable-nls \
219 $(PKG_CONFIGURE_OPTS) \
220 --disable-cli \
221 --enable-cgi \
222 --disable-fastcgi \
223 --enable-force-cgi-redirect \
224 --enable-discard-path \
225 );
226 $(MAKE) -C $(WRKBUILD)
227 mv $(WRKBUILD)/sapi/cgi/php $(WRKBUILD)/php-cgi
228 $(MAKE) -C $(WRKBUILD) clean
229 (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
230 $(TARGET_CONFIGURE_OPTS) \
231 CFLAGS="$(TARGET_CFLAGS)" \
232 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
233 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
234 LIBS="-lcrypto -lssl" \
235 php_cv_cc_rpath="no" \
236 ./configure \
237 --target=$(GNU_TARGET_NAME) \
238 --host=$(GNU_TARGET_NAME) \
239 --build=$(GNU_HOST_NAME) \
240 --program-prefix="" \
241 --program-suffix="" \
242 --prefix=/usr \
243 --exec-prefix=/usr \
244 --bindir=/usr/sbin \
245 --datadir=/usr/share \
246 --includedir=/usr/include \
247 --infodir=/usr/share/info \
248 --libdir=/usr/lib \
249 --libexecdir=/usr/lib \
250 --localstatedir=/var \
251 --mandir=/usr/share/man \
252 --sbindir=/usr/sbin \
253 --sysconfdir=/etc \
254 --enable-largefile \
255 --disable-nls \
256 $(PKG_CONFIGURE_OPTS) \
257 --disable-cli \
258 --enable-cgi \
259 --enable-fastcgi \
260 --enable-force-cgi-redirect \
261 --enable-discard-path \
262 );
263 $(MAKE) -C $(WRKBUILD)
264 mv $(WRKBUILD)/sapi/cgi/php $(WRKBUILD)/php-fastcgi
265 touch $@
266
267$(IPKG_PHP5_CLI):
268 install -m0755 -d $(IDIR_PHP5_CLI)/etc
269 install -m0644 ./files/php.ini $(IDIR_PHP5_CLI)/etc/
270 install -m0755 -d $(IDIR_PHP5_CLI)/usr/bin
271 $(CP) $(WRKBUILD)/php-cli $(IDIR_PHP5_CLI)/usr/bin/php
272 $(RSTRIP) $(IDIR_PHP5_CLI)
273 $(IPKG_BUILD) $(IDIR_PHP5_CLI) $(PACKAGE_DIR)
274
275$(IPKG_PHP5_CGI):
276 install -m0755 -d $(IDIR_PHP5_CGI)/etc
277 install -m0644 ./files/php.ini $(IDIR_PHP5_CGI)/etc/
278 install -m0755 -d $(IDIR_PHP5_CGI)/usr/bin
279 $(CP) $(WRKBUILD)/php-cgi $(IDIR_PHP5_CGI)/usr/bin/php
280 $(RSTRIP) $(IDIR_PHP5_CGI)
281 $(IPKG_BUILD) $(IDIR_PHP5_CGI) $(PACKAGE_DIR)
282
283$(IPKG_PHP5_FASTCGI):
284 install -m0755 -d $(IDIR_PHP5_FASTCGI)/etc
285 install -m0644 ./files/php.ini $(IDIR_PHP5_FASTCGI)/etc/
286 install -m0755 -d $(IDIR_PHP5_FASTCGI)/etc/init.d
287 install -m0755 ./files/php.init $(IDIR_PHP5_FASTCGI)/etc/init.d/php
288 install -m0755 -d $(IDIR_PHP5_FASTCGI)/usr/sbin
289 $(CP) $(WRKBUILD)/php-fastcgi $(IDIR_PHP5_FASTCGI)/usr/sbin/php
290 $(RSTRIP) $(IDIR_PHP5_FASTCGI)
291 $(IPKG_BUILD) $(IDIR_PHP5_FASTCGI) $(PACKAGE_DIR)
Note: See TracBrowser for help on using the repository browser.