Add rp-pppoe package
[openwrt.git] / package / php4 / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=php
6 PKG_VERSION:=4.3.11
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=fbc67d240812136a9842bc1f2a217b7a
9 PKG_SOURCE_URL:=http://fr.php.net/distributions/
10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
11 PKG_CAT:=bzcat
12
13 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
14 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
15
16 include $(TOPDIR)/package/rules.mk
17
18 define PKG_mod_template
19
20 $$(IPKG_$(1)):
21 install -d -m0755 $$(IDIR_$(1))/usr/lib/php
22 install -m0755 $(PKG_BUILD_DIR)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
23 $(RSTRIP) $$(IDIR_$(1))
24 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
25
26 endef
27
28 PKG_CONFIGURE_OPTS:= \
29 --enable-shared \
30 --disable-static \
31 --disable-ctype \
32 --disable-dom \
33 --disable-ipv6 \
34 --enable-magic-quotes \
35 --enable-memory-limit \
36 --disable-overload \
37 --disable-short-tags \
38 --disable-tokenizer \
39 --enable-ftp=shared \
40 --enable-session=shared \
41 --enable-sockets=shared \
42 --enable-xml=shared \
43 --with-config-file-path=/etc \
44 --without-gettext \
45 --without-pear \
46 --with-zlib="$(STAGING_DIR)/usr" \
47
48 ifneq ($(BR2_PACKAGE_PHP4_MOD_GD),)
49 PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
50 --enable-gd-native-ttf \
51 --with-png-dir="$(STAGING_DIR)/usr" \
52 --with-zlib-dir="$(STAGING_DIR)/usr"
53 else
54 PKG_CONFIGURE_OPTS+= --without-gd
55 endif
56 ifneq ($(BR2_PACKAGE_PHP4_MOD_LDAP),)
57 PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr"
58 else
59 PKG_CONFIGURE_OPTS+= --without-ldap
60 endif
61 ifneq ($(BR2_PACKAGE_PHP4_MOD_MYSQL),)
62 PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
63 else
64 PKG_CONFIGURE_OPTS+= --without-mysql
65 endif
66 ifneq ($(BR2_PACKAGE_PHP4_MOD_OPENSSL),)
67 PKG_CONFIGURE_OPTS+= --with-openssl=shared,"$(STAGING_DIR)/usr"
68 else
69 PKG_CONFIGURE_OPTS+= --without-openssl
70 endif
71 ifneq ($(BR2_PACKAGE_PHP4_MOD_PCRE),)
72 PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
73 else
74 PKG_CONFIGURE_OPTS+= --without-pcre-regex
75 endif
76 ifneq ($(BR2_PACKAGE_PHP4_MOD_PGSQL),)
77 PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
78 else
79 PKG_CONFIGURE_OPTS+= --without-pgsql
80 endif
81 ifneq ($(BR2_PACKAGE_PHP4_MOD_SQLITE),)
82 PKG_CONFIGURE_OPTS+= --with-sqlite=shared,"$(STAGING_DIR)/usr"
83 else
84 PKG_CONFIGURE_OPTS+= --without-sqlite
85 endif
86
87 $(eval $(call PKG_template,PHP4_CLI,php4-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
88 $(eval $(call PKG_template,PHP4_CGI,php4-cgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
89 $(eval $(call PKG_template,PHP4_FASTCGI,php4-fastcgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
90
91 $(eval $(call PKG_template,PHP4_MOD_FTP,php4-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
92 $(eval $(call PKG_template,PHP4_MOD_GD,php4-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
93 $(eval $(call PKG_template,PHP4_MOD_LDAP,php4-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
94 $(eval $(call PKG_template,PHP4_MOD_MYSQL,php4-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
95 $(eval $(call PKG_template,PHP4_MOD_OPENSSL,php4-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
96 $(eval $(call PKG_template,PHP4_MOD_PCRE,php4-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
97 $(eval $(call PKG_template,PHP4_MOD_PGSQL,php4-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
98 $(eval $(call PKG_template,PHP4_MOD_SESSION,php4-mod-session,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
99 $(eval $(call PKG_template,PHP4_MOD_SOCKETS,php4-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
100 $(eval $(call PKG_template,PHP4_MOD_SQLITE,php4-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
101 $(eval $(call PKG_template,PHP4_MOD_XML,php4-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
102
103 $(eval $(call PKG_mod_template,PHP4_MOD_FTP,ftp))
104 $(eval $(call PKG_mod_template,PHP4_MOD_GD,gd))
105 $(eval $(call PKG_mod_template,PHP4_MOD_LDAP,ldap))
106 $(eval $(call PKG_mod_template,PHP4_MOD_MYSQL,mysql))
107 $(eval $(call PKG_mod_template,PHP4_MOD_OPENSSL,openssl))
108 $(eval $(call PKG_mod_template,PHP4_MOD_PCRE,pcre))
109 $(eval $(call PKG_mod_template,PHP4_MOD_PGSQL,pgsql))
110 $(eval $(call PKG_mod_template,PHP4_MOD_SESSION,session))
111 $(eval $(call PKG_mod_template,PHP4_MOD_SOCKETS,sockets))
112 $(eval $(call PKG_mod_template,PHP4_MOD_SQLITE,sqlite))
113 $(eval $(call PKG_mod_template,PHP4_MOD_XML,xml))
114
115
116 $(PKG_BUILD_DIR)/.configured:
117 touch $@
118
119 $(PKG_BUILD_DIR)/.built:
120 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
121 $(TARGET_CONFIGURE_OPTS) \
122 CFLAGS="$(TARGET_CFLAGS)" \
123 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
124 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
125 ./configure \
126 --target=$(GNU_TARGET_NAME) \
127 --host=$(GNU_TARGET_NAME) \
128 --build=$(GNU_HOST_NAME) \
129 --program-prefix="" \
130 --program-suffix="" \
131 --prefix=/usr \
132 --exec-prefix=/usr \
133 --bindir=/usr/sbin \
134 --datadir=/usr/share \
135 --includedir=/usr/include \
136 --infodir=/usr/share/info \
137 --libdir=/usr/lib \
138 --libexecdir=/usr/lib \
139 --localstatedir=/var \
140 --mandir=/usr/share/man \
141 --sbindir=/usr/sbin \
142 --sysconfdir=/etc \
143 $(DISABLE_LARGEFILE) \
144 $(DISABLE_NLS) \
145 $(PKG_CONFIGURE_OPTS) \
146 --enable-cli \
147 --disable-cgi \
148 --disable-fastcgi \
149 --enable-force-cgi-redirect \
150 --enable-discard-path \
151 );
152 $(MAKE) -C $(PKG_BUILD_DIR)
153 mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli
154 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
155 $(TARGET_CONFIGURE_OPTS) \
156 CFLAGS="$(TARGET_CFLAGS)" \
157 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
158 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
159 ./configure \
160 --target=$(GNU_TARGET_NAME) \
161 --host=$(GNU_TARGET_NAME) \
162 --build=$(GNU_HOST_NAME) \
163 --program-prefix="" \
164 --program-suffix="" \
165 --prefix=/usr \
166 --exec-prefix=/usr \
167 --bindir=/usr/sbin \
168 --datadir=/usr/share \
169 --includedir=/usr/include \
170 --infodir=/usr/share/info \
171 --libdir=/usr/lib \
172 --libexecdir=/usr/lib \
173 --localstatedir=/var \
174 --mandir=/usr/share/man \
175 --sbindir=/usr/sbin \
176 --sysconfdir=/etc \
177 $(DISABLE_LARGEFILE) \
178 $(DISABLE_NLS) \
179 $(PKG_CONFIGURE_OPTS) \
180 --disable-cli \
181 --enable-cgi \
182 --disable-fastcgi \
183 --enable-force-cgi-redirect \
184 --enable-discard-path \
185 );
186 $(MAKE) -C $(PKG_BUILD_DIR)
187 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-cgi
188 $(MAKE) -C $(PKG_BUILD_DIR) clean
189 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
190 $(TARGET_CONFIGURE_OPTS) \
191 CFLAGS="$(TARGET_CFLAGS)" \
192 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
193 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
194 ./configure \
195 --target=$(GNU_TARGET_NAME) \
196 --host=$(GNU_TARGET_NAME) \
197 --build=$(GNU_HOST_NAME) \
198 --program-prefix="" \
199 --program-suffix="" \
200 --prefix=/usr \
201 --exec-prefix=/usr \
202 --bindir=/usr/sbin \
203 --datadir=/usr/share \
204 --includedir=/usr/include \
205 --infodir=/usr/share/info \
206 --libdir=/usr/lib \
207 --libexecdir=/usr/lib \
208 --localstatedir=/var \
209 --mandir=/usr/share/man \
210 --sbindir=/usr/sbin \
211 --sysconfdir=/etc \
212 $(DISABLE_LARGEFILE) \
213 $(DISABLE_NLS) \
214 $(PKG_CONFIGURE_OPTS) \
215 --disable-cli \
216 --enable-cgi \
217 --enable-fastcgi \
218 --enable-force-cgi-redirect \
219 --enable-discard-path \
220 );
221 $(MAKE) -C $(PKG_BUILD_DIR)
222 mv $(PKG_BUILD_DIR)/sapi/cgi/php $(PKG_BUILD_DIR)/php-fastcgi
223 touch $@
224
225 $(IPKG_PHP4_CLI):
226 install -m0755 -d $(IDIR_PHP4_CLI)/etc
227 install -m0644 ./files/php.ini $(IDIR_PHP4_CLI)/etc/
228 install -m0755 -d $(IDIR_PHP4_CLI)/usr/sbin
229 cp -fpR $(PKG_BUILD_DIR)/php-cli $(IDIR_PHP4_CLI)/usr/sbin/php
230 $(RSTRIP) $(IDIR_PHP4_CLI)
231 $(IPKG_BUILD) $(IDIR_PHP4_CLI) $(PACKAGE_DIR)
232
233 $(IPKG_PHP4_CGI):
234 install -m0755 -d $(IDIR_PHP4_CGI)/etc
235 install -m0644 ./files/php.ini $(IDIR_PHP4_CGI)/etc/
236 install -m0755 -d $(IDIR_PHP4_CGI)/usr/sbin
237 cp -fpR $(PKG_BUILD_DIR)/php-cgi $(IDIR_PHP4_CGI)/usr/sbin/php
238 $(RSTRIP) $(IDIR_PHP4_CGI)
239 $(IPKG_BUILD) $(IDIR_PHP4_CGI) $(PACKAGE_DIR)
240
241 $(IPKG_PHP4_FASTCGI):
242 install -m0755 -d $(IDIR_PHP4_FASTCGI)/etc
243 install -m0644 ./files/php.ini $(IDIR_PHP4_FASTCGI)/etc/
244 install -m0755 -d $(IDIR_PHP4_FASTCGI)/etc/init.d
245 install -m0755 ./files/php.init $(IDIR_PHP4_FASTCGI)/etc/init.d/php
246 install -m0755 -d $(IDIR_PHP4_FASTCGI)/usr/sbin
247 cp -fpR $(PKG_BUILD_DIR)/php-fastcgi $(IDIR_PHP4_FASTCGI)/usr/sbin/php
248 $(RSTRIP) $(IDIR_PHP4_FASTCGI)
249 $(IPKG_BUILD) $(IDIR_PHP4_FASTCGI) $(PACKAGE_DIR)
250
This page took 0.062135 seconds and 5 git commands to generate.