~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to debian/patches/040_link_external_pcre

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -urN build-tree.old/apache2/acinclude.m4 build-tree/apache2/acinclude.m4
2
 
--- build-tree.old/apache2/acinclude.m4 2005-02-25 00:46:23.000000000 -0700
3
 
+++ build-tree/apache2/acinclude.m4     2005-02-25 00:42:20.000000000 -0700
4
 
@@ -501,6 +501,58 @@
5
 
 ])
6
 
 
7
 
 dnl
8
 
+dnl APACHE_CHECK_PCRE
9
 
+dnl Apache includes it's own version of PCRE; however, if PCRE exists
10
 
+dnl on the build system, we link against that instead of building
11
 
+dnl Apache's own PCRE.
12
 
+dnl
13
 
+AC_DEFUN(APACHE_CHECK_PCRE, [
14
 
+  AC_MSG_CHECKING(for external PCRE library)
15
 
+  ap_pcre_base=""
16
 
+  ap_test_pcre=1
17
 
+  AP_EXTERN_PCRE=0
18
 
+
19
 
+  AC_ARG_WITH([pcre], AS_HELP_STRING([--with-external-pcre],
20
 
+      [use external libpcre (versus apache-supplied pcre)]), [
21
 
+    if test "x$withval" = "xno"; then
22
 
+      ap_test_pcre=0;
23
 
+    elif test "x$withval" != "xyes" -a "x$withval" != "x"; then
24
 
+      ap_pcre_base="$withval"
25
 
+    fi
26
 
+  ])
27
 
+
28
 
+  if test "$ap_test_pcre" != "0"; then
29
 
+    ap_pcre_conf="pcre-config"
30
 
+    if test -f "$ap_pcre_base"; then
31
 
+      ap_pcre_conf="$ap_pcre_base";
32
 
+    elif test -f "$ap_pcre_base/pcre-config"; then
33
 
+      ap_pcre_conf="$ap_pcre_base/pcre-config";
34
 
+    elif test -f "$ap_pcre_base/bin/pcre-config"; then
35
 
+      ap_pcre_conf="$ap_pcre_base/bin/pcre-config";
36
 
+    fi
37
 
+
38
 
+    ap_save_CFLAGS="$CFLAGS"
39
 
+    ap_save_LIBS="$LIBS"
40
 
+    CFLAGS="$CFLAGS `$ap_pcre_conf --cflags 2>/dev/null`"
41
 
+    LIBS="$LIBS `$ap_pcre_conf --libs 2>/dev/null`"
42
 
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pcre.h>]],
43
 
+        [[char *foo = pcre_version();]])], [
44
 
+      AP_EXTERN_PCRE=1
45
 
+    ], [
46
 
+      CFLAGS="$ap_save_CFLAGS"
47
 
+      LIBS="$ap_save_LIBS"
48
 
+    ])
49
 
+  fi
50
 
+
51
 
+  if test "$AP_EXTERN_PCRE" = "1"; then
52
 
+    AC_MSG_RESULT(yes)
53
 
+  else
54
 
+    AC_MSG_RESULT(no)
55
 
+  fi
56
 
+  AC_SUBST(AP_EXTERN_PCRE)
57
 
+])
58
 
+
59
 
+dnl
60
 
 dnl APACHE_EXPORT_ARGUMENTS
61
 
 dnl Export (via APACHE_SUBST) the various path-related variables that
62
 
 dnl apache will use while generating scripts like autoconf and apxs and
63
 
diff -urN build-tree.old/apache2/configure.in build-tree/apache2/configure.in
64
 
--- build-tree.old/apache2/configure.in 2005-02-25 00:46:23.000000000 -0700
65
 
+++ build-tree/apache2/configure.in     2005-02-25 00:46:51.000000000 -0700
66
 
@@ -4,7 +4,7 @@
67
 
 dnl     Use ./buildconf to produce a configure script
68
 
 dnl
69
 
 
70
 
-AC_PREREQ(2.13)
71
 
+AC_PREREQ(2.50)
72
 
 AC_INIT(ABOUT_APACHE)
73
 
 
74
 
 AC_CONFIG_HEADER(include/ap_config_auto.h)
75
 
@@ -114,10 +114,14 @@
76
 
 AC_PROG_CC
77
 
 AC_PROG_CPP
78
 
 
79
 
-echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}"
80
 
-
81
 
-APR_SUBDIR_CONFIG(srclib/pcre,
82
 
-                  [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir])
83
 
+APACHE_CHECK_PCRE
84
 
+if test "$AP_EXTERN_PCRE" = "0"; then
85
 
+  echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}"
86
 
+  APR_SUBDIR_CONFIG(srclib/pcre,
87
 
+      [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir])
88
 
+  AP_BUILD_SRCLIB_DIRS="$AP_BUILD_SRCLIB_DIRS pcre"
89
 
+  AP_CLEAN_SRCLIB_DIRS="pcre $AP_CLEAN_SRCLIB_DIRS"
90
 
+fi
91
 
 
92
 
 echo $ac_n "${nl}Configuring Apache httpd ...${nl}"
93
 
 
94
 
@@ -474,10 +478,6 @@
95
 
 APACHE_HELP_STRING(--with-suexec-umask,umask for suexec'd process),[
96
 
   AC_DEFINE_UNQUOTED(AP_SUEXEC_UMASK, 0$withval, [umask for suexec'd process] ) ] )
97
 
 
98
 
-dnl AP_LIBS specifies the actual libraries. note we have some required libs.
99
 
-AP_LIBS="$abs_builddir/srclib/pcre/libpcre.la $AP_LIBS"
100
 
-APR_ADDTO(CPPFLAGS, [-I$abs_builddir/srclib/pcre])
101
 
-
102
 
 dnl APR should go after the other libs, so the right symbols can be picked up
103
 
 AP_LIBS="$AP_LIBS `$apu_config --link-libtool --libs` `$apr_config --link-libtool --libs`"
104
 
 APACHE_SUBST(AP_LIBS)
105
 
diff -urN build-tree.old/apache2/srclib/Makefile.in build-tree/apache2/srclib/Makefile.in
106
 
--- build-tree.old/apache2/srclib/Makefile.in   2005-02-25 00:46:23.000000000 -0700
107
 
+++ build-tree/apache2/srclib/Makefile.in       2005-02-25 00:42:20.000000000 -0700
108
 
@@ -1,5 +1,5 @@
109
 
 
110
 
-SUBDIRS = pcre
111
 
+SUBDIRS = 
112
 
 BUILD_SUBDIRS = $(AP_BUILD_SRCLIB_DIRS)
113
 
 CLEAN_SUBDIRS = $(AP_CLEAN_SRCLIB_DIRS)
114