Skip to content

Commit 8a03f30

Browse files
committed
- Add bcmath to the standard UNIX build
- Change a couple of malloc()'s and free()'s to emalloc()'s and efree()'s
1 parent 203d67e commit 8a03f30

File tree

9 files changed

+33
-690
lines changed

9 files changed

+33
-690
lines changed

ext/bcmath/Makefile.in

+5
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
LTLIBRARY_NAME = libbcmath.la
33
LTLIBRARY_SOURCES = bcmath.c number.c
44
LTLIBRARY_SHARED_NAME = bcmath.la
5+
LTLIBRARY_DEPENDENCIES = libbcmath/libbcmath.la
6+
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
7+
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
8+
9+
SUBDIRS = libbcmath
510

611
include $(top_srcdir)/build/dynlib.mk

ext/bcmath/config.m4

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
dnl $Id$
22

3-
PHP_ARG_ENABLE(bcmath,whether to enable bc style precision math functions,
4-
[ --enable-bcmath Compile with bc style precision math functions.
5-
Read README-BCMATH for instructions on how to
6-
get this module installed. ])
3+
PHP_ARG_WITH(bcmath, for bc style precision math functions,
4+
[ --disable-bcmath Compile without bc style precision math functions. ], yes)
75

86
if test "$PHP_BCMATH" != "no"; then
97
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
108
PHP_EXTENSION(bcmath, $ext_shared)
11-
if test ! -f $ext_srcdir/number.c || grep "Dummy File" $ext_srcdir/number.c >/dev/null; then
12-
AC_MSG_ERROR(You do not have the bcmath package. Please read the README.BCMATH file.)
13-
fi
9+
PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile)
10+
LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
11+
LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
1412
fi
1513

1614
dnl ## Local Variables:

ext/bcmath/libbcmath/Makefile.in

+6-355
Original file line numberDiff line numberDiff line change
@@ -1,358 +1,9 @@
1-
# Makefile.in generated automatically by automake 1.4 from Makefile.am
21

3-
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4-
# This Makefile.in is free software; the Free Software Foundation
5-
# gives unlimited permission to copy and/or distribute it,
6-
# with or without modifications, as long as this notice is preserved.
2+
LTLIBRARY_NAME = libbcmath.la
3+
LTLIBRARY_DEPENDENCIES = src/libbcmath.la
4+
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
5+
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
76

8-
# This program is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10-
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11-
# PARTICULAR PURPOSE.
7+
SUBDIRS = src
128

13-
14-
SHELL = @SHELL@
15-
16-
srcdir = @srcdir@
17-
top_srcdir = @top_srcdir@
18-
VPATH = @srcdir@
19-
prefix = @prefix@
20-
exec_prefix = @exec_prefix@
21-
22-
bindir = @bindir@
23-
sbindir = @sbindir@
24-
libexecdir = @libexecdir@
25-
datadir = @datadir@
26-
sysconfdir = @sysconfdir@
27-
sharedstatedir = @sharedstatedir@
28-
localstatedir = @localstatedir@
29-
libdir = @libdir@
30-
infodir = @infodir@
31-
mandir = @mandir@
32-
includedir = @includedir@
33-
oldincludedir = /usr/include
34-
35-
DESTDIR =
36-
37-
pkgdatadir = $(datadir)/@PACKAGE@
38-
pkglibdir = $(libdir)/@PACKAGE@
39-
pkgincludedir = $(includedir)/@PACKAGE@
40-
41-
top_builddir = .
42-
43-
ACLOCAL = @ACLOCAL@
44-
AUTOCONF = @AUTOCONF@
45-
AUTOMAKE = @AUTOMAKE@
46-
AUTOHEADER = @AUTOHEADER@
47-
48-
INSTALL = @INSTALL@
49-
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
50-
INSTALL_DATA = @INSTALL_DATA@
51-
INSTALL_SCRIPT = @INSTALL_SCRIPT@
52-
transform = @program_transform_name@
53-
54-
NORMAL_INSTALL = :
55-
PRE_INSTALL = :
56-
POST_INSTALL = :
57-
NORMAL_UNINSTALL = :
58-
PRE_UNINSTALL = :
59-
POST_UNINSTALL = :
60-
CC = @CC@
61-
MAKEINFO = @MAKEINFO@
62-
PACKAGE = @PACKAGE@
63-
RANLIB = @RANLIB@
64-
VERSION = @VERSION@
65-
66-
SUBDIRS = src doc
67-
68-
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in *~
69-
70-
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
71-
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
72-
CONFIG_HEADER = config.h
73-
CONFIG_CLEAN_FILES =
74-
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING.LIB ChangeLog INSTALL \
75-
Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.h.in \
76-
configure configure.in install-sh missing mkinstalldirs
77-
78-
79-
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
80-
81-
TAR = tar
82-
GZIP_ENV = --best
83-
all: all-redirect
84-
.SUFFIXES:
85-
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
86-
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
87-
88-
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
89-
cd $(top_builddir) \
90-
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
91-
92-
$(ACLOCAL_M4): configure.in
93-
cd $(srcdir) && $(ACLOCAL)
94-
95-
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
96-
$(SHELL) ./config.status --recheck
97-
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
98-
cd $(srcdir) && $(AUTOCONF)
99-
100-
config.h: stamp-h
101-
@if test ! -f $@; then \
102-
rm -f stamp-h; \
103-
$(MAKE) stamp-h; \
104-
else :; fi
105-
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
106-
cd $(top_builddir) \
107-
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
108-
$(SHELL) ./config.status
109-
@echo timestamp > stamp-h 2> /dev/null
110-
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
111-
@if test ! -f $@; then \
112-
rm -f $(srcdir)/stamp-h.in; \
113-
$(MAKE) $(srcdir)/stamp-h.in; \
114-
else :; fi
115-
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
116-
cd $(top_srcdir) && $(AUTOHEADER)
117-
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
118-
119-
mostlyclean-hdr:
120-
121-
clean-hdr:
122-
123-
distclean-hdr:
124-
-rm -f config.h
125-
126-
maintainer-clean-hdr:
127-
128-
# This directory's subdirectories are mostly independent; you can cd
129-
# into them and run `make' without going through this Makefile.
130-
# To change the values of `make' variables: instead of editing Makefiles,
131-
# (1) if the variable is set in `config.status', edit `config.status'
132-
# (which will cause the Makefiles to be regenerated when you run `make');
133-
# (2) otherwise, pass the desired values on the `make' command line.
134-
135-
@SET_MAKE@
136-
137-
all-recursive install-data-recursive install-exec-recursive \
138-
installdirs-recursive install-recursive uninstall-recursive \
139-
check-recursive installcheck-recursive info-recursive dvi-recursive:
140-
@set fnord $(MAKEFLAGS); amf=$$2; \
141-
dot_seen=no; \
142-
target=`echo $@ | sed s/-recursive//`; \
143-
list='$(SUBDIRS)'; for subdir in $$list; do \
144-
echo "Making $$target in $$subdir"; \
145-
if test "$$subdir" = "."; then \
146-
dot_seen=yes; \
147-
local_target="$$target-am"; \
148-
else \
149-
local_target="$$target"; \
150-
fi; \
151-
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
152-
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
153-
done; \
154-
if test "$$dot_seen" = "no"; then \
155-
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
156-
fi; test -z "$$fail"
157-
158-
mostlyclean-recursive clean-recursive distclean-recursive \
159-
maintainer-clean-recursive:
160-
@set fnord $(MAKEFLAGS); amf=$$2; \
161-
dot_seen=no; \
162-
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
163-
rev="$$subdir $$rev"; \
164-
test "$$subdir" = "." && dot_seen=yes; \
165-
done; \
166-
test "$$dot_seen" = "no" && rev=". $$rev"; \
167-
target=`echo $@ | sed s/-recursive//`; \
168-
for subdir in $$rev; do \
169-
echo "Making $$target in $$subdir"; \
170-
if test "$$subdir" = "."; then \
171-
local_target="$$target-am"; \
172-
else \
173-
local_target="$$target"; \
174-
fi; \
175-
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
176-
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
177-
done && test -z "$$fail"
178-
tags-recursive:
179-
list='$(SUBDIRS)'; for subdir in $$list; do \
180-
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
181-
done
182-
183-
tags: TAGS
184-
185-
ID: $(HEADERS) $(SOURCES) $(LISP)
186-
list='$(SOURCES) $(HEADERS)'; \
187-
unique=`for i in $$list; do echo $$i; done | \
188-
awk ' { files[$$0] = 1; } \
189-
END { for (i in files) print i; }'`; \
190-
here=`pwd` && cd $(srcdir) \
191-
&& mkid -f$$here/ID $$unique $(LISP)
192-
193-
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
194-
tags=; \
195-
here=`pwd`; \
196-
list='$(SUBDIRS)'; for subdir in $$list; do \
197-
if test "$$subdir" = .; then :; else \
198-
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
199-
fi; \
200-
done; \
201-
list='$(SOURCES) $(HEADERS)'; \
202-
unique=`for i in $$list; do echo $$i; done | \
203-
awk ' { files[$$0] = 1; } \
204-
END { for (i in files) print i; }'`; \
205-
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
206-
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
207-
208-
mostlyclean-tags:
209-
210-
clean-tags:
211-
212-
distclean-tags:
213-
-rm -f TAGS ID
214-
215-
maintainer-clean-tags:
216-
217-
distdir = $(PACKAGE)-$(VERSION)
218-
top_distdir = $(distdir)
219-
220-
# This target untars the dist file and tries a VPATH configuration. Then
221-
# it guarantees that the distribution is self-contained by making another
222-
# tarfile.
223-
distcheck: dist
224-
-rm -rf $(distdir)
225-
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
226-
mkdir $(distdir)/=build
227-
mkdir $(distdir)/=inst
228-
dc_install_base=`cd $(distdir)/=inst && pwd`; \
229-
cd $(distdir)/=build \
230-
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
231-
&& $(MAKE) $(AM_MAKEFLAGS) \
232-
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
233-
&& $(MAKE) $(AM_MAKEFLAGS) check \
234-
&& $(MAKE) $(AM_MAKEFLAGS) install \
235-
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
236-
&& $(MAKE) $(AM_MAKEFLAGS) dist
237-
-rm -rf $(distdir)
238-
@banner="$(distdir).tar.gz is ready for distribution"; \
239-
dashes=`echo "$$banner" | sed s/./=/g`; \
240-
echo "$$dashes"; \
241-
echo "$$banner"; \
242-
echo "$$dashes"
243-
dist: distdir
244-
-chmod -R a+r $(distdir)
245-
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
246-
-rm -rf $(distdir)
247-
dist-all: distdir
248-
-chmod -R a+r $(distdir)
249-
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
250-
-rm -rf $(distdir)
251-
distdir: $(DISTFILES)
252-
-rm -rf $(distdir)
253-
mkdir $(distdir)
254-
-chmod 777 $(distdir)
255-
@for file in $(DISTFILES); do \
256-
d=$(srcdir); \
257-
if test -d $$d/$$file; then \
258-
cp -pr $$/$$file $(distdir)/$$file; \
259-
else \
260-
test -f $(distdir)/$$file \
261-
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
262-
|| cp -p $$d/$$file $(distdir)/$$file || :; \
263-
fi; \
264-
done
265-
for subdir in $(SUBDIRS); do \
266-
if test "$$subdir" = .; then :; else \
267-
test -d $(distdir)/$$subdir \
268-
|| mkdir $(distdir)/$$subdir \
269-
|| exit 1; \
270-
chmod 777 $(distdir)/$$subdir; \
271-
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
272-
|| exit 1; \
273-
fi; \
274-
done
275-
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
276-
info-am:
277-
info: info-recursive
278-
dvi-am:
279-
dvi: dvi-recursive
280-
check-am: all-am
281-
check: check-recursive
282-
installcheck-am:
283-
installcheck: installcheck-recursive
284-
all-recursive-am: config.h
285-
$(MAKE) $(AM_MAKEFLAGS) all-recursive
286-
287-
install-exec-am:
288-
install-exec: install-exec-recursive
289-
290-
install-data-am:
291-
install-data: install-data-recursive
292-
293-
install-am: all-am
294-
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
295-
install: install-recursive
296-
uninstall-am:
297-
uninstall: uninstall-recursive
298-
all-am: Makefile config.h
299-
all-redirect: all-recursive-am
300-
install-strip:
301-
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
302-
installdirs: installdirs-recursive
303-
installdirs-am:
304-
305-
306-
mostlyclean-generic:
307-
308-
clean-generic:
309-
310-
distclean-generic:
311-
-rm -f Makefile $(CONFIG_CLEAN_FILES)
312-
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
313-
314-
maintainer-clean-generic:
315-
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
316-
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
317-
318-
mostlyclean: mostlyclean-recursive
319-
320-
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
321-
322-
clean: clean-recursive
323-
324-
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
325-
326-
distclean: distclean-recursive
327-
-rm -f config.status
328-
329-
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
330-
maintainer-clean-generic distclean-am
331-
@echo "This command is intended for maintainers to use;"
332-
@echo "it deletes files that may require special tools to rebuild."
333-
334-
maintainer-clean: maintainer-clean-recursive
335-
-rm -f config.status
336-
337-
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
338-
install-data-recursive uninstall-data-recursive install-exec-recursive \
339-
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
340-
all-recursive check-recursive installcheck-recursive info-recursive \
341-
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
342-
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
343-
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
344-
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
345-
install-exec-am install-exec install-data-am install-data install-am \
346-
install uninstall-am uninstall all-redirect all-am all installdirs-am \
347-
installdirs mostlyclean-generic distclean-generic clean-generic \
348-
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
349-
350-
351-
dist-hook:
352-
cp $(srcdir)/doc/bcmath.1 $(distdir)/doc
353-
cp $(srcdir)/src/private.h $(distdir)/src
354-
cp $(srcdir)/FAQ $(distdir)
355-
356-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
357-
# Otherwise a system limit (for SysV at least) may be exceeded.
358-
.NOEXPORT:
9+
include $(top_srcdir)/build/dynlib.mk

0 commit comments

Comments
 (0)