Skip to content

Commit f2f8d38

Browse files
author
Sascha Schumann
committed
Integration of -ng changes. Changes:
- added support for externally built modules, - improved support for in-tree shared modules, - fixed diversion bugs, - configure displays some informative messages, - faster static build (libtool isn't used anymore for compiling non-PIC objects), - dependencies comparable to automake's without requiring GNU make or GCC, - working make clean for non-GNU makes.
1 parent 6bf3529 commit f2f8d38

File tree

169 files changed

+2627
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+2627
-719
lines changed

Makefile.am

-41
This file was deleted.

Makefile.in

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
DEPTH = .
3+
topsrcdir = @topsrcdir@
4+
srcdir = @srcdir@
5+
VPATH = @srcdir@
6+
7+
ZEND_DIR = $(srcdir)/Zend
8+
SUBDIRS = Zend ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
9+
10+
LTLIBRARY_NAME = libphp4.la
11+
12+
LTLIBRARY_SOURCES = \
13+
main.c internal_functions.c snprintf.c php_sprintf.c \
14+
configuration-parser.c configuration-scanner.c request_info.c \
15+
safe_mode.c fopen-wrappers.c php_realpath.c alloca.c \
16+
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c strlcpy.c \
17+
strlcat.c mergesort.c reentrancy.c
18+
19+
LTLIBRARY_DEPENDENCIES = \
20+
Zend/libZend.la \
21+
sapi/$(PHP_SAPI)/libsapi.la \
22+
$(REGEX_LIB) \
23+
$(EXT_LTLIBS) \
24+
$(TSRM_LIB)
25+
26+
LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
27+
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
28+
29+
PROGRAM_NAME = $(PHP_PROGRAM)
30+
PROGRAM_SOURCES = stub.c
31+
PROGRAM_LDADD = libphp4.la
32+
PROGRAM_LDFLAGS = -export-dynamic
33+
PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
34+
35+
targets = $(LTLIBRARY_NAME) $(PROGRAM_NAME)
36+
37+
install_targets = install-local install-modules
38+
39+
include $(topsrcdir)/build/rules.mk
40+
include $(topsrcdir)/build/library.mk
41+
include $(topsrcdir)/build/program.mk
42+
43+
install-local:
44+
@$(LIBTOOL) --silent --mode=install install libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
45+
-@$(mkinstalldirs) $(bindir)
46+
$(INSTALL_IT)
47+
48+
configuration-parser.h configuration-parser.c: configuration-parser.y
49+
$(YACC) -p cfg -v -d $< -o configuration-parser.c
50+
51+
configuration-scanner.c: configuration-scanner.l
52+
$(LEX) -Pcfg -o$@ -i $<
53+
54+
.NOEXPORT:

acinclude.m4

+152-24
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,126 @@ dnl $Id$
22
dnl
33
dnl This file contains local autoconf functions.
44

5+
AC_DEFUN(PHP_SUBST,[
6+
PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
7+
AC_SUBST($1)
8+
])
9+
10+
AC_DEFUN(PHP_FAST_OUTPUT,[
11+
PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1"
12+
])
13+
14+
AC_DEFUN(PHP_MKDIR_P_CHECK,[
15+
AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
16+
test -d conftestdir && rm -rf conftestdir
17+
mkdir -p conftestdir/somedir >/dev/null 2>&1
18+
if test -d conftestdir/somedir; then
19+
ac_cv_mkdir_p=yes
20+
else
21+
ac_cv_mkdir_p=no
22+
fi
23+
rm -rf conftestdir
24+
])
25+
])
26+
27+
AC_DEFUN(PHP_FAST_GENERATE,[
28+
PHP_MKDIR_P_CHECK
29+
echo creating config_vars.mk
30+
> config_vars.mk
31+
for i in $PHP_VAR_SUBST; do
32+
eval echo "$i = \$$i" >> config_vars.mk
33+
done
34+
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $PHP_FAST_OUTPUT_FILES
35+
])
36+
37+
AC_DEFUN(PHP_TM_GMTOFF,[
38+
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
39+
[AC_TRY_COMPILE([#include <sys/types.h>
40+
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
41+
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
42+
43+
if test "$ac_cv_struct_tm_gmtoff" = yes; then
44+
AC_DEFINE(HAVE_TM_GMTOFF)
45+
fi
46+
])
47+
48+
dnl PHP_CONFIGURE_PART(MESSAGE)
49+
dnl Idea borrowed from mm
50+
AC_DEFUN(PHP_CONFIGURE_PART,[
51+
AC_MSG_RESULT()
52+
AC_MSG_RESULT(${T_MD}$1${T_ME})
53+
])
54+
55+
AC_DEFUN(PHP_PROG_SENDMAIL,[
56+
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib)
57+
if test -n "$PROG_SENDMAIL"; then
58+
AC_DEFINE(HAVE_SENDMAIL)
59+
fi
60+
])
61+
62+
AC_DEFUN(PHP_RUNPATH_SWITCH,[
63+
dnl check for -R, etc. switch
64+
AC_MSG_CHECKING(if compiler supports -R)
65+
AC_CACHE_VAL(php_cv_cc_dashr,[
66+
SAVE_LIBS="${LIBS}"
67+
LIBS="-R /usr/lib ${LIBS}"
68+
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
69+
LIBS="${SAVE_LIBS}"])
70+
AC_MSG_RESULT($php_cv_cc_dashr)
71+
if test $php_cv_cc_dashr = "yes"; then
72+
ld_runpath_switch="-R"
73+
else
74+
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
75+
AC_CACHE_VAL(php_cv_cc_rpath,[
76+
SAVE_LIBS="${LIBS}"
77+
LIBS="-Wl,-rpath,/usr/lib ${LIBS}"
78+
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
79+
LIBS="${SAVE_LIBS}"])
80+
AC_MSG_RESULT($php_cv_cc_rpath)
81+
if test $php_cv_cc_rpath = "yes"; then
82+
ld_runpath_switch="-Wl,-rpath,"
83+
else
84+
dnl something innocuous
85+
ld_runpath_switch="-L"
86+
fi
87+
fi
88+
])
89+
90+
AC_DEFUN(PHP_STRUCT_FLOCK,[
91+
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
92+
AC_TRY_COMPILE([
93+
#include <unistd.h>
94+
#include <fcntl.h>
95+
],
96+
[struct flock x;],
97+
[
98+
ac_cv_struct_flock=yes
99+
],[
100+
ac_cv_struct_flock=no
101+
])
102+
)
103+
if test "$ac_cv_struct_flock" = "yes" ; then
104+
AC_DEFINE(HAVE_STRUCT_FLOCK, 1)
105+
fi
106+
])
107+
108+
AC_DEFUN(PHP_SOCKLEN_T,[
109+
AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
110+
AC_TRY_COMPILE([
111+
#include <sys/types.h>
112+
#include <sys/socket.h>
113+
],[
114+
socklen_t x;
115+
],[
116+
ac_cv_socklen_t=yes
117+
],[
118+
ac_cv_socklen_t=no
119+
]))
120+
if test "$ac_cv_socklen_t" = "no"; then
121+
AC_DEFINE(socklen_t, unsigned int)
122+
fi
123+
])
124+
5125
dnl
6126
dnl PHP_SET_SYM_FILE(path)
7127
dnl
@@ -176,7 +296,7 @@ if test "$REGEX_TYPE" = "php"; then
176296
REGEX_DIR=regex
177297
AC_DEFINE(HSREGEX)
178298
AC_DEFINE(REGEX,1)
179-
PHP_OUTPUT(regex/Makefile)
299+
PHP_FAST_OUTPUT(regex/Makefile)
180300
elif test "$REGEX_TYPE" = "system"; then
181301
AC_DEFINE(REGEX,0)
182302
elif test "$REGEX_TYPE" = "apache"; then
@@ -186,9 +306,9 @@ fi
186306
AC_MSG_CHECKING(which regex library to use)
187307
AC_MSG_RESULT($REGEX_TYPE)
188308
189-
AC_SUBST(REGEX_DIR)
190-
AC_SUBST(REGEX_LIB)
191-
AC_SUBST(HSREGEX)
309+
PHP_SUBST(REGEX_DIR)
310+
PHP_SUBST(REGEX_LIB)
311+
PHP_SUBST(HSREGEX)
192312
])
193313

194314
dnl
@@ -209,17 +329,20 @@ dnl
209329
dnl Check for broken sprintf()
210330
dnl
211331
AC_DEFUN(AC_BROKEN_SPRINTF,[
212-
AC_MSG_CHECKING([for broken sprintf])
213-
AC_TRY_RUN([main() { char buf[20]; exit (sprintf(buf,"testing 123")!=11); }],[
214-
AC_DEFINE(BROKEN_SPRINTF,0)
215-
AC_MSG_RESULT(ok)
216-
],[
217-
AC_DEFINE(BROKEN_SPRINTF,1)
218-
AC_MSG_RESULT(broken)
219-
],[
220-
AC_DEFINE(BROKEN_SPRINTF,0)
221-
AC_MSG_RESULT(cannot check, guessing ok)
332+
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
333+
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
334+
ac_cv_broken_sprintf=no
335+
],[
336+
ac_cv_broken_sprintf=yes
337+
],[
338+
ac_cv_broken_sprintf=no
339+
])
222340
])
341+
if test "$ac_cv_broken_sprintf" = "yes"; then
342+
AC_DEFINE(BROKEN_SPRINTF, 1)
343+
else
344+
AC_DEFINE(BROKEN_SPRINTF, 0)
345+
fi
223346
])
224347

225348
dnl
@@ -234,24 +357,24 @@ dnl
234357
AC_DEFUN(PHP_EXTENSION,[
235358
if test -d "$cwd/$srcdir/ext/$1" ; then
236359
EXT_SUBDIRS="$EXT_SUBDIRS $1"
237-
if test "$2" != "shared" -a "$2" != "yes"; then
238-
_extlib="libphpext_$1.a"
239-
EXT_LTLIBS="$EXT_LTLIBS ext/$1/libphpext_$1.la"
360+
if test "$2" != "shared" && test "$2" != "yes" && test -z "$php_always_shared"; then
361+
_extlib="lib$1.a"
362+
EXT_LTLIBS="$EXT_LTLIBS ext/$1/lib$1.la"
240363
EXT_LIBS="$EXT_LIBS $1/$_extlib"
241364
EXT_STATIC="$EXT_STATIC $1"
242365
else
243-
AC_DEFINE_UNQUOTED(COMPILE_DL_`echo $1|tr a-z A-Z`, 1, Whether to build $1 as dynamic module)
366+
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z,A-Z), 1, Whether to build $1 as dynamic module)
244367
EXT_SHARED="$EXT_SHARED $1"
245368
fi
246-
PHP_OUTPUT(ext/$1/Makefile)
369+
PHP_FAST_OUTPUT(ext/$1/Makefile)
247370
fi
248371
])
249372

250-
AC_SUBST(EXT_SUBDIRS)
251-
AC_SUBST(EXT_STATIC)
252-
AC_SUBST(EXT_SHARED)
253-
AC_SUBST(EXT_LIBS)
254-
AC_SUBST(EXT_LTLIBS)
373+
PHP_SUBST(EXT_SUBDIRS)
374+
PHP_SUBST(EXT_STATIC)
375+
PHP_SUBST(EXT_SHARED)
376+
PHP_SUBST(EXT_LIBS)
377+
PHP_SUBST(EXT_LTLIBS)
255378

256379
dnl
257380
dnl Solaris requires main code to be position independent in order
@@ -298,6 +421,9 @@ AC_DEFUN(PHP_WITH_SHARED,[
298421
shared=no
299422
;;
300423
esac
424+
if test -n "$php_always_shared"; then
425+
shared=yes
426+
fi
301427
])
302428

303429
dnl The problem is that the default compilation flags in Solaris 2.6 won't
@@ -354,9 +480,11 @@ AC_DEFUN(AC_SOCKADDR_SA_LEN,[
354480
])
355481
])
356482

483+
357484
dnl ## PHP_AC_OUTPUT(file)
358485
dnl ## adds "file" to the list of files generated by AC_OUTPUT
359486
dnl ## This macro can be used several times.
360487
AC_DEFUN(PHP_OUTPUT,[
361488
PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"
362489
])
490+

build.mk

-49
This file was deleted.

0 commit comments

Comments
 (0)