Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 69417 | Differences between
and this patch

Collapse All | Expand All

(-)./configure.in (-7 / +107 lines)
Lines 1802-1810 Link Here
1802
dnl PHP/MapScript module options
1802
dnl PHP/MapScript module options
1803
dnl ---------------------------------------------------------------------
1803
dnl ---------------------------------------------------------------------
1804
1804
1805
AC_CHECKING(for PHP/MapScript module options)
1805
AC_CHECKING(for PHP4/MapScript module options)
1806
AC_ARG_WITH(php,
1806
AC_ARG_WITH(php4,
1807
[  --with-php=DIR          Specify directory where PHP4's include files are
1807
[  --with-php4=DIR          Specify directory where PHP4's include files are
1808
                          installed (or a pointer to the full source tree)
1809
                          Required in order to compile the PHP/MapScript 
1810
                          module.],,)
1811
1812
AC_CHECKING(for PHP5/MapScript module options)
1813
AC_ARG_WITH(php5,
1814
[  --with-php5=DIR          Specify directory where PHP5's include files are
1808
                          installed (or a pointer to the full source tree)
1815
                          installed (or a pointer to the full source tree)
1809
                          Required in order to compile the PHP/MapScript 
1816
                          Required in order to compile the PHP/MapScript 
1810
                          module.],,)
1817
                          module.],,)
Lines 1815-1822 Link Here
1815
                          link php_mapscript.so.  Try this only if the default
1822
                          link php_mapscript.so.  Try this only if the default
1816
                          internal macro didn't work.],,)
1823
                          internal macro didn't work.],,)
1817
1824
1818
if test -n "$with_php" -a -d "$with_php" ; then
1825
dnl --------------------------------------------------------------------------
1819
  AC_EXPAND_PATH($with_php, PHP_SRC_DIR)
1826
dnl  No php version specific
1827
dnl --------------------------------------------------------------------------
1828
if test -n "$with_php4" -o -n "$with_php5" ; then
1820
  dnl
1829
  dnl
1821
  dnl Checks for shared library linking.
1830
  dnl Checks for shared library linking.
1822
  dnl
1831
  dnl
Lines 1825-1831 Link Here
1825
  dnl (The perl-V macro was the default in 3.6 and before but this was
1834
  dnl (The perl-V macro was the default in 3.6 and before but this was
1826
  dnl  changed in 3.7 to use the internal AC_LD_SHARED macro by default)
1835
  dnl  changed in 3.7 to use the internal AC_LD_SHARED macro by default)
1827
  dnl
1836
  dnl
1828
1829
  if test "$enable_perlv_ld_detect" = "yes" ; then
1837
  if test "$enable_perlv_ld_detect" = "yes" ; then
1830
      AC_MSG_RESULT(Using perl -V macro to figure ld command to link php_mapscript.so)
1838
      AC_MSG_RESULT(Using perl -V macro to figure ld command to link php_mapscript.so)
1831
1839
Lines 1847-1852 Link Here
1847
    PHP_CC="$CC $C_PIC"
1855
    PHP_CC="$CC $C_PIC"
1848
    PHP_LD="$LD_SHARED"
1856
    PHP_LD="$LD_SHARED"
1849
  fi
1857
  fi
1858
fi
1859
1860
if test -n "$with_php4" -a -d "$with_php4" ; then
1861
  AC_EXPAND_PATH($with_php4,PHP_SRC_DIR)
1850
1862
1851
  dnl
1863
  dnl
1852
  dnl Look for PHP3's config.h or PHP4's php_config.h.
1864
  dnl Look for PHP3's config.h or PHP4's php_config.h.
Lines 1936-1941 Link Here
1936
AC_SUBST(MAKE_PHPMS, $MAKE_PHPMS)
1948
AC_SUBST(MAKE_PHPMS, $MAKE_PHPMS)
1937
AC_SUBST(MAKE_PHPMS_CLEAN, $MAKE_PHPMS_CLEAN)
1949
AC_SUBST(MAKE_PHPMS_CLEAN, $MAKE_PHPMS_CLEAN)
1938
1950
1951
if test -n "$with_php5" -a -d "$with_php5" ; then
1952
  AC_EXPAND_PATH($with_php5, PHP5_SRC_DIR)
1953
1954
  dnl
1955
  dnl Look for PHP3's config.h or PHP4's php_config.h.
1956
  dnl We'll need the config file to find info about the PHP configuration
1957
  dnl
1958
  AC_MSG_CHECKING([for location of config.h or php_config.h])
1959
  dnl In PHP3, it was called config.h
1960
  test -f "$PHP5_SRC_DIR/config.h" && PHP5_CONFIG_H="$PHP5_SRC_DIR/config.h"
1961
1962
  dnl In PHP 4.0.1 to 4.0.3, it was php-4.0.x/php_config.h
1963
  test -f "$PHP5_SRC_DIR/php_config.h" && PHP5_CONFIG_H="$PHP5_SRC_DIR/php_config.h"
1964
1965
  dnl Starting with PHP 4.0.4, it's php-4.0.x/main/php_config.h
1966
  test -f "$PHP5_SRC_DIR/main/php_config.h" && PHP5_CONFIG_H="$PHP5_SRC_DIR/main/php_config.h"
1967
1968
  dnl If php was installed, then the headers are under $prefix/include/php/*
1969
  test -f "$PHP5_SRC_DIR/include/php/main/php_config.h" && PHP5_SRC_DIR="$PHP5_SRC_DIR/include/php/" && PHP5_CONFIG_H="$PHP5_SRC_DIR/main/php_config.h"
1970
1971
  if test -n "$PHP5_CONFIG_H" ; then
1972
    AC_MSG_RESULT([$PHP5_CONFIG_H])
1973
  else
1974
    AC_MSG_ERROR([
1975
!!! Could not find config.h or php_config.h in $PHP5_SRC_DIR.          !!!
1976
!!! Has PHP5 been configured yet?                                      !!!])
1977
  fi
1978
1979
  dnl
1980
  dnl Check which PHP5 version we're using.
1981
  dnl
1982
  AC_MSG_CHECKING([whether we have PHP5])
1983
  if test -n "`grep 'ZEND_API' $PHP5_CONFIG_H`"  ; then
1984
    PHP5_VERSION_FLAG="-DPHP4"
1985
  else
1986
    AC_MSG_ERROR([
1987
!!! PHP MapScript now requires PHP 5.0.0 or more recent.              !!!
1988
!!! Support for PHP3 has been dropped after MapServer version 3.5.    !!!])
1989
  fi
1990
  AC_MSG_RESULT([$PHP5_VERSION_FLAG])
1991
1992
  dnl
1993
  dnl Check if PHP was compiled with the bundled regex, and if so then
1994
  dnl use the same version to compile MapServer.
1995
  dnl
1996
  AC_MSG_CHECKING([whether we should use PHP5's regex])
1997
  if test -n "`grep 'define REGEX 1' $PHP5_CONFIG_H`"  ; then
1998
    AC_MSG_RESULT(yes)
1999
2000
    dnl We'll check for regex_extra.h - that might let use build
2001
    dnl without the source using libphp_common.so
2002
    test -f "$PHP5_SRC_DIR/regex/regex_extra.h" && PHP5_NO_SOURCE="1"
2003
        if test -n "$PHP5_NO_SOURCE" ; then
2004
          dnl Found regex_extra.h
2005
          USE_PHP5_REGEX="-DUSE_PHP_REGEX"
2006
          PHP5_REGEX_OBJ=php_regex.o
2007
          AC_MSG_RESULT([        found regex_extra.h - building PHP MapScript with PHP5's bundled regex ])
2008
        else
2009
          AC_MSG_ERROR([
2010
!!! PHP5 uses its bundled regex library but regex/regex_extra.h cannot be !!!
2011
!!! found.                                                               !!!])
2012
	fi
2013
2014
  else
2015
    AC_MSG_RESULT(no)
2016
  fi
2017
2018
  PHP5MS_MAKEFILE=mapscript/php5/Makefile
2019
  MAKE_PHP5MS=php5_mapscript
2020
  MAKE_PHP5MS_CLEAN=php_mapscript_clean
2021
2022
  AC_SUBST(PHP5_VERSION_FLAG, $PHP5_VERSION_FLAG)
2023
  AC_SUBST(PHP5_SRC_DIR, $PHP5_SRC_DIR)
2024
  AC_SUBST(PHP5_REGEX_INC, $PHP5_REGEX_INC)
2025
  AC_SUBST(PHP5_REGEX_OBJ, $PHP5_REGEX_OBJ)
2026
  AC_SUBST(USE_PHP5_REGEX, $USE_PHP5_REGEX)
2027
2028
  AC_MSG_RESULT([        PHP5/MapScript module configured.])
2029
  AC_MSG_RESULT([        $PHP5_VERSION_FLAG, $PHP5_SRC_DIR])
2030
elif test -n "$with_php5" -a "$with_php5" != "no" ; then
2031
  AC_MSG_ERROR([Missing or invalid PHP5 source directory in --with-php5=DIR.])
2032
else
2033
  AC_MSG_RESULT([        PHP5/MapScript module not configured.])
2034
fi
2035
2036
AC_SUBST(MAKE_PHP5MS, $MAKE_PHP5MS)
2037
AC_SUBST(MAKE_PHP5MS_CLEAN, $MAKE_PHP5MS_CLEAN)
2038
1939
2039
1940
dnl ---------------------------------------------------------------------
2040
dnl ---------------------------------------------------------------------
1941
dnl 'apxs' option for PHP built as an Apache module (libphp3.so)
2041
dnl 'apxs' option for PHP built as an Apache module (libphp3.so)
Lines 2052-2056 Link Here
2052
AC_SUBST(ALL_STATIC_LIB, $ALL_STATIC_LIB)
2152
AC_SUBST(ALL_STATIC_LIB, $ALL_STATIC_LIB)
2053
AC_SUBST(RPATHS, [$RPATHS])
2153
AC_SUBST(RPATHS, [$RPATHS])
2054
2154
2055
AC_OUTPUT(Makefile $PHPMS_MAKEFILE mapscript/java/Makefile mapscript/csharp/Makefile)
2155
AC_OUTPUT(Makefile $PHPMS_MAKEFILE $PHP5MS_MAKEFILE mapscript/java/Makefile mapscript/csharp/Makefile)
2056
2156
(-)./Makefile.in (-2 / +10 lines)
Lines 163-168 Link Here
163
#
163
#
164
PHP_REGEX_OBJ=@PHP_REGEX_OBJ@
164
PHP_REGEX_OBJ=@PHP_REGEX_OBJ@
165
PHP_REGEX_INC=@PHP_REGEX_INC@
165
PHP_REGEX_INC=@PHP_REGEX_INC@
166
PHP5_REGEX_OBJ=@PHP5_REGEX_OBJ@
167
PHP5_REGEX_INC=@PHP5_REGEX_INC@
166
168
167
#
169
#
168
# Multithreading support.
170
# Multithreading support.
Lines 238-248 Link Here
238
.cpp.o:
240
.cpp.o:
239
	$(CXX) -c $(CXXFLAGS) $< -o $@
241
	$(CXX) -c $(CXXFLAGS) $< -o $@
240
242
241
all: $(MAKE_GD) libmap.a $(EXTRA_DEFAULT) $(EXE_LIST) @MAKE_PHPMS@ 
243
all: $(MAKE_GD) libmap.a $(EXTRA_DEFAULT) $(EXE_LIST) @MAKE_PHPMS@ @MAKE_PHP5MS@
242
244
243
php3_mapscript:: $(LIBMAP_STATIC)
245
php3_mapscript:: $(LIBMAP_STATIC)
244
	cd mapscript/php3; $(MAKE); cd ../..
246
	cd mapscript/php3; $(MAKE); cd ../..
245
247
248
php5_mapscript:: $(LIBMAP_STATIC)
249
	cd mapscript/php5; $(MAKE); cd ../..
250
246
maplexer.o: maplexer.c map.h mapfile.h
251
maplexer.o: maplexer.c map.h mapfile.h
247
252
248
maplexer.c: maplexer.l
253
maplexer.c: maplexer.l
Lines 319-324 Link Here
319
php3_mapscript_clean::
324
php3_mapscript_clean::
320
	cd mapscript/php3; $(MAKE) clean; cd ../..
325
	cd mapscript/php3; $(MAKE) clean; cd ../..
321
326
327
php5_mapscript_clean::
328
	cd mapscript/php3; $(MAKE) clean; cd ../..
329
322
install:
330
install:
323
	@echo ""
331
	@echo ""
324
	@echo "***** MapServer Installation *****"
332
	@echo "***** MapServer Installation *****"
Lines 339-345 Link Here
339
	(cd $(INST_BIN) && rm $(EXE_LIST) )
347
	(cd $(INST_BIN) && rm $(EXE_LIST) )
340
	(cd $(INST_LIB) && rm $(LIBMAP_SH_VER) $(LIBMAP_SHARED) )
348
	(cd $(INST_LIB) && rm $(LIBMAP_SH_VER) $(LIBMAP_SHARED) )
341
349
342
clean: @MAKE_PHPMS_CLEAN@
350
clean: @MAKE_PHPMS_CLEAN@ @MAKE_PHP5MS_CLEAN@
343
	rm -f $(LIBMAP_STATIC) $(LIBMAP_SHARED) $(LIBMAP_SH_VER) *.o $(EXE_LIST)
351
	rm -f $(LIBMAP_STATIC) $(LIBMAP_SHARED) $(LIBMAP_SH_VER) *.o $(EXE_LIST)
344
352
345
exe-clean:
353
exe-clean:
(-)./mapscript/php5/Makefile.in (-14 / +14 lines)
Lines 35-60 Link Here
35
35
36
CC =     @PHP_CC@
36
CC =     @PHP_CC@
37
LD =     @PHP_LD@
37
LD =     @PHP_LD@
38
CFLAGS = @CFLAGS@ @USE_PHP_REGEX@ -DCOMPILE_DL=1 @PHP_VERSION_FLAG@
38
CFLAGS = @CFLAGS@ @USE_PHP5_REGEX@ -DCOMPILE_DL=1 @PHP5_VERSION_FLAG@
39
RUNPATHS= @RPATHS@
39
RUNPATHS= @RPATHS@
40
40
41
#
41
#
42
# Set PHP_SRC_DIR to point to the root of the PHP source tree
42
# Set PHP_SRC_DIR to point to the root of the PHP source tree
43
#
43
#
44
PHP_SRC_DIR = @PHP_SRC_DIR@
44
PHP_SRC_DIR = @PHP5_SRC_DIR@
45
45
46
PHP_INC = -I$(PHP_SRC_DIR) -I$(PHP_SRC_DIR)/dl -I$(PHP_SRC_DIR)/main \
46
PHP_INC = -I$(PHP_SRC_DIR) -I$(PHP_SRC_DIR)/dl -I$(PHP_SRC_DIR)/main \
47
	  -I$(PHP_SRC_DIR)/Zend -I$(PHP_SRC_DIR)/include \
47
	  -I$(PHP_SRC_DIR)/Zend -I$(PHP_SRC_DIR)/include \
48
	  -I$(PHP_SRC_DIR)/TSRM @APACHE_INC@
48
	  -I$(PHP_SRC_DIR)/TSRM @APACHE_INC@
49
49
50
#
50
#
51
# IMPORTANT NOTE ABOUT REGEX FOR PHP_MAPSCRIPT USERS:
51
# IMPORTANT NOTE ABOUT REGEX FOR PHP5_MAPSCRIPT USERS:
52
#
52
#
53
# In order to compile the PHP_MAPSCRIPT module, we have to make MapServer
53
# In order to compile the PHP5_MAPSCRIPT module, we have to make MapServer
54
# uses the same version of the REGEX library that PHP was compiled with:
54
# uses the same version of the REGEX library that PHP5 was compiled with:
55
#
55
#
56
PHP_REGEX_OBJ=@PHP_REGEX_OBJ@
56
PHP5_REGEX_OBJ=@PHP5_REGEX_OBJ@
57
PHP_REGEX_INC=@PHP_REGEX_INC@
57
PHP5_REGEX_INC=@PHP5_REGEX_INC@
58
58
59
59
60
#
60
#
Lines 75-94 Link Here
75
# The rest of the file should not have to be edited...
75
# The rest of the file should not have to be edited...
76
#
76
#
77
77
78
CFLAGS112 = $(CFLAGS) $(MS_DEFINE) $(MS_INC) $(PHP_INC) $(PHP_REGEX_INC)
78
CFLAGS112 = $(CFLAGS) $(MS_DEFINE) $(MS_INC) $(PHP_INC) $(PHP5_REGEX_INC)
79
79
80
all: php_mapscript.so
80
all: php_mapscript.so
81
81
82
PHPMS_OBJS =  php_mapscript_util.o php_mapscript.o mapscript_i.o $(PHP_REGEX_OBJ)
82
PHP5MS_OBJS =  php_mapscript_util.o php_mapscript.o mapscript_i.o $(PHP5_REGEX_OBJ)
83
83
84
PHPPROJ_OBJS = php_mapscript_util.o php_proj.o $(PHP_REGEX_OBJ)
84
PHP5PROJ_OBJS = php_mapscript_util.o php_proj.o $(PHP5_REGEX_OBJ)
85
85
86
86
87
php_mapscript.so: $(PHPMS_OBJS) ../../libmap.a
87
php_mapscript.so: $(PHP5MS_OBJS) ../../libmap.a
88
	$(LD) -o $@ $(PHPMS_OBJS) $(MS_LIBS)
88
	$(LD) -o $@ $(PHP5MS_OBJS) $(MS_LIBS)
89
89
90
php_proj.so:  $(PHPPROJ_OBJS)
90
php_proj.so:  $(PHP5PROJ_OBJS)
91
	$(LD) -o $@ $(PHPPROJ_OBJS) $(MS_LIBS)
91
	$(LD) -o $@ $(PHP5PROJ_OBJS) $(MS_LIBS)
92
92
93
%.o: %.c php_mapscript_util.h php_mapscript.h
93
%.o: %.c php_mapscript_util.h php_mapscript.h
94
	$(CC) $(CFLAGS112) -c -o $@ $<
94
	$(CC) $(CFLAGS112) -c -o $@ $<

Return to bug 69417