Skip to content

Commit

Permalink
* Get Apache to work. POST doesn't work yet.
Browse files Browse the repository at this point in the history
* There are now -I directives for the absolute path of php4, php4/libzend and the builddir for
  the Apache module, so we can #include any php/Zend header.
* Rename config.h to php_config.h
  • Loading branch information
zsuraski committed May 11, 1999
1 parent 957616c commit 0b77132
Show file tree
Hide file tree
Showing 30 changed files with 102 additions and 80 deletions.
8 changes: 4 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ clean: clean-recursive
distclean: clean distclean-recursive
-rm -f *-parser.[ch] *-scanner.c *.output
-rm -f config.status config.cache config.log
-rm -f Makefile Makefile.depend config.h build-defs.h
-rm -f Makefile Makefile.depend php_config.h build-defs.h
-rm -f libphp3.module stamp-h
-rm -f regex/*.o regex/*.a regex/*.ih
-rm -f doc/checkdoc doc/funcparse doc/version.ent
Expand All @@ -144,8 +144,8 @@ regression check: $(BINNAME)
config.status: configure
./config.status --recheck

build-defs.h config.h: stamp-h
stamp-h: config.h.in config.status
build-defs.h php_config.h: stamp-h
stamp-h: php_config.h.in config.status
CONFIG_FILES='build-defs.h stamp-h' ./config.status

Makefile: Makefile.in config.status
Expand All @@ -158,7 +158,7 @@ Makefile: Makefile.in config.status
configure: @MAINT@ configure.in aclocal.m4
cd $(srcdir) && autoconf

config.h.in: @MAINT@ stamp-h.in
php_config.h.in: @MAINT@ stamp-h.in
stamp-h.in: configure.in aclocal.m4 acconfig.h
cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in

Expand Down
10 changes: 7 additions & 3 deletions configure.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ else
fi
AC_SUBST(PHP_VERSION)

AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(php_config.h)
AM_MAINTAINER_MODE

dnl We want this one before the checks, so the checks can modify CFLAGS.
Expand Down Expand Up @@ -348,8 +348,12 @@ AC_ARG_WITH(apxs,
])
APACHE_INSTALL_FILES="$srcdir/mod_php3.* $srcdir/php_version.h libphp3.module $srcdir/SAPI.h"
APACHE_INSTALL_FILES="$srcdir/mod_php3.* libphp3.module"
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
AC_SUBST(abs_srcdir)
AC_SUBST(abs_builddir)
AC_MSG_CHECKING(for Apache module support via DSO through APACI)
AC_ARG_WITH(shared-apache,
Expand Down Expand Up @@ -876,7 +880,7 @@ chmod +x scripts/mkextlib
echo "creating internal_functions.c"
extensions=\`grep '^s.@EXT_SUBDIRS@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
mv -f internal_functions.c internal_functions.c.old 2>/dev/null
sh $srcdir/genif.sh $srcdir/internal_functions.c.in \$srcdir \$extensions > internal_functions.c
sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c
if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then
echo "internal_functions.c is unchanged"
mv internal_functions.c.old internal_functions.c
Expand Down
1 change: 1 addition & 0 deletions ext/ereg/ereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
#include "php_regex.h"
#include "reg.h"

unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
Expand Down
14 changes: 14 additions & 0 deletions ext/ereg/php_regex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _PHP_REGEX_H
#define _PHP_REGEX_H

#if REGEX
#include "regex/regex.h"
#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */
#define _RX_H 1 /* Try defining these for Linux to */
#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */
#define _H_REGEX 1 /* This one is for AIX */
#else
#include <regex.h>
#endif

#endif /* _PHP_REGEX_H */
2 changes: 1 addition & 1 deletion ext/gd/gdcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if (WIN32|WINNT)
#define HAVE_LIBTTF 1
#else
#include "config.h"
#include "php_config.h"
#endif
#if HAVE_LIBTTF

Expand Down
2 changes: 1 addition & 1 deletion ext/gd/gdttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#if WIN32|WINNT
#include "config.w32.h"
#else
#include "config.h"
#include "php_config.h"
#endif
#if HAVE_LIBTTF
#include <stdio.h>
Expand Down
5 changes: 4 additions & 1 deletion ext/hyperwave/dlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* -----------------
*
* $Log$
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
* PHP 4.0
*
Expand Down Expand Up @@ -48,7 +51,7 @@
****************************************************************************/

#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif

#if HYPERWAVE
Expand Down
2 changes: 1 addition & 1 deletion ext/hyperwave/hg_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#if WIN32|WINNT
#include "win95nt.h"
#else
#include "config.h"
#include "php_config.h"
#endif

#if HYPERWAVE
Expand Down
2 changes: 1 addition & 1 deletion ext/hyperwave/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <stdlib.h>

#if !(WIN32|WINNT)
#include "config.h"
#include "php_config.h"
#endif
#include "php.h"
#include "ext/standard/head.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/interbase/interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/* TODO: A lot... */

#include "config.h"
#include "php_config.h"
#include "php.h"
#include "php3_interbase.h"

Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#if HAVE_UODBC

# if !(WIN32|WINNT)
# include "config.h"
# include "php_config.h"
# include "build-defs.h"
# endif

Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <stdlib.h>

#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif
#include "php.h"
#include "php3_pgsql.h"
Expand Down
1 change: 1 addition & 0 deletions ext/standard/browscap.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "php.h"
#include "php3_browscap.h"
#include "php_ini.h"
#include "php_regex.h"

#include "zend_globals.h"

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/post.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void php3_treat_data(int arg, char *str)
{
char *res = NULL, *var, *val;
pval *array_ptr;
int free_buffer;
int free_buffer=0;
ELS_FETCH();
PLS_FETCH();
SLS_FETCH();
Expand Down
1 change: 1 addition & 0 deletions ext/standard/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
#include "php_regex.h"
#include "reg.h"

unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <ctype.h>
#include <sys/types.h>

/* php.h includes the correct regex.h */
#include "php.h"
#include "php_regex.h"

#include "url.h"
#ifdef _OSD_POSIX
Expand Down
2 changes: 1 addition & 1 deletion ext/sybase/sybase-ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif
#include "php.h"
#include "php3_sybase-ct.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/sybase/sybase.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif
#include "php.h"
#include "php3_sybase.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/sysvsem/sysvsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/

#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif

#if HAVE_SYSVSEM
Expand Down
2 changes: 1 addition & 1 deletion ext/sysvshm/sysvshm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/

#ifndef MSVC5
#include "config.h"
#include "php_config.h"
#endif


Expand Down
4 changes: 2 additions & 2 deletions genif.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

# $Id: genif.sh,v 1.4 1999-05-08 22:00:02 sas Exp $
# $Id: genif.sh,v 1.5 1999-05-11 00:01:41 zeev Exp $
# replacement for genif.pl

infile="$1"
Expand All @@ -20,7 +20,7 @@ for ext in ${1+"$@"} ; do
module_ptrs=" phpext_${ext}_ptr,\\\n$module_ptrs"
for pre in php3 php php4 zend; do
hdrfile="ext/$ext/${pre}_${ext}.h"
if test -f $hdrfile ; then
if test -f "$srcdir/$hdrfile" ; then
includes="#include \"$hdrfile\"\\\n$includes"
fi
done
Expand Down
4 changes: 2 additions & 2 deletions libphp3.module.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ ConfigStart
RULE_WANTHSREGEX=@HSREGEX@
LIBS="@PHP_LIBS@ @EXTRA_LIBS@ @LIBS@ @RDYNAMIC_LFLAGS@ $LIBS"
RULE_HIDE=yes
ConfigEnd

CFLAGS="$CFLAGS -I@abs_srcdir@ -I@abs_srcdir@/libzend -I@abs_builddir@"
ConfigEnd
2 changes: 1 addition & 1 deletion main/alloca.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */

#include <config.h>
#include "php_config.h"

#if !HAVE_ALLOCA

Expand Down
5 changes: 2 additions & 3 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ int _php3_hash_environment(PLS_D ELS_DC)
case 'g':
case 'G':
if (!_gpc_flags[2]) {
printf("Parsing GET data: '%s'\n", SG(request_info).query_string);
php3_treat_data(PARSE_GET, NULL); /* GET Data */
_gpc_flags[2]=1;
}
Expand Down Expand Up @@ -1188,7 +1189,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
/* some systems are missing these from their header files */

#if APACHE
PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode)
PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode SLS_DC)
{
zend_file_handle file_handle;
#ifdef ZTS
Expand All @@ -1201,8 +1202,6 @@ PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mo
#endif
SLS_FETCH();

SG(server_context) = r;

if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
return FAILURE;
}
Expand Down
12 changes: 1 addition & 11 deletions main/php.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ extern unsigned char second_arg_allow_ref[];
# define PHPAPI __declspec(dllimport)
# endif
#else
#include "config.h"
#include "php_config.h"
#define PHPAPI
#define THREAD_LS
#endif
Expand Down Expand Up @@ -151,16 +151,6 @@ typedef zval pval;
#define pval_copy_constructor zval_copy_ctor
#define pval_destructor zval_dtor

#if REGEX
#include "regex/regex.h"
#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */
#define _RX_H 1 /* Try defining these for Linux to */
#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */
#define _H_REGEX 1 /* This one is for AIX */
#else
#include <regex.h>
#endif

#if STDC_HEADERS
# include <string.h>
#else
Expand Down
14 changes: 14 additions & 0 deletions main/php_regex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _PHP_REGEX_H
#define _PHP_REGEX_H

#if REGEX
#include "regex/regex.h"
#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */
#define _RX_H 1 /* Try defining these for Linux to */
#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */
#define _H_REGEX 1 /* This one is for AIX */
#else
#include <regex.h>
#endif

#endif /* _PHP_REGEX_H */
2 changes: 1 addition & 1 deletion main/snprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* <[email protected]> for xinetd.
*/

#include "config.h"
#include "php_config.h"

#if !defined(APACHE) || (!APACHE)
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
Expand Down
Loading

0 comments on commit 0b77132

Please sign in to comment.