summaryrefslogtreecommitdiffstats
path: root/rubbos/app/tomcat-connectors-1.2.32-src/support/jk_ws.m4
blob: de7a70faccdff65380db15963841227342baa048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
dnl
dnl Licensed to the Apache Software Foundation (ASF) under one or more
dnl contributor license agreements.  See the NOTICE file distributed with
dnl this work for additional information regarding copyright ownership.
dnl The ASF licenses this file to You under the Apache License, Version 2.0
dnl (the "License"); you may not use this file except in compliance with
dnl the License.  You may obtain a copy of the License at
dnl
dnl     http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl

dnl --------------------------------------------------------------------------
dnl Author Henri Gomez <hgomez@apache.org>
dnl
dnl Inspired by Pier works on webapp m4 macros :)
dnl 
dnl Version $Id: jk_ws.m4 466585 2006-10-21 22:16:34Z markt $
dnl --------------------------------------------------------------------------

dnl --------------------------------------------------------------------------
dnl JK_WS_DIR
dnl   Set the WebServer source dir.
dnl   $1 => Webserver name
dnl   $2 => Webserver vars prefix name
dnl   $3 => File which should be present
dnl   $4 => Server specific source directory 
dnl --------------------------------------------------------------------------
AC_DEFUN(
  [JK_WS_DIR],
  [
    tempval=""
    AC_ARG_WITH(
      [$1],
      [  --with-$1=DIR           Location of $1 source dir ],
      [
        case "${withval}" in
          ""|"yes"|"YES"|"true"|"TRUE")
          AC_MSG_ERROR(valid $1 source dir location required)
          ;;
          "no"|"NO"|"false"|"FALSE")
          AC_MSG_ERROR(Don't use with/without $1 if you don't have $1)
          ;;
          *)
          tempval="${withval}"

          if ${TEST} ! -d ${tempval} ; then
            AC_MSG_ERROR(Not a directory: ${tempval})
          fi

          if ${TEST} ! -f ${tempval}/$3; then
            AC_MSG_ERROR(can't locate ${tempval}/$3)
          fi

          if ${TEST} ! -z "$tempval" ; then
            $2_BUILD="true"
            $2_CFLAGS="-I ${tempval}/include"
            $2_DIR=${tempval}
            $2_HOME="${tempval}"
            $2_LIBDIR=""
	    if ${TEST} -d ${withval}/include ; then
	      $2_INCL="-I${tempval}/include"
              $2_INCDIR="${tempval}/include"
	    fi
	    if ${TEST} -d ${withval}/src/include ; then
	      # read osdir from the existing apache.
	      osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 's:^OSDIR=.*/os:os:'`
	      if ${TEST} -z "${osdir}" ; then
	        osdir=os/unix
	      fi
	      $2_INCL="-I${tempval}/src/include -I${withval}/src/${osdir}"
              $2_INCDIR="${tempval}/src/include"
	    fi
	    if ${TEST} -d ${tempval}/srclib/apr ; then
	      # Apache 2 contains apr.
	      if ${TEST} ! -f ${tempval}/srclib/apr/config.status ; then
                AC_MSG_ERROR(configure Apache2 before mod_jk2)
	      fi
	      osdir=`${GREP} @OSDIR@ ${tempval}/srclib/apr/config.status | sed 's:s,@OSDIR@,::' | sed 's:,;t t::'`
	      $2_INCL="-I${tempval}/include -I${withval}/os/${osdir}"
	      $2_LIBEXEC=`${GREP} "^exp_libexecdir =" ${tempval}/build/config_vars.mk | sed 's:exp_libexecdir = ::'`
	      LIBTOOL=${tempval}/srclib/apr/libtool
	      APR_INCDIR=-I${tempval}/srclib/apr/include
	      APR_CFLAGS=`${tempval}/srclib/apr/apr-config --cflags`
	      APR_UTIL_INCDIR=-I${tempval}/srclib/apr-util/include
	      APR_LIBDIR_LA=`${tempval}/srclib/apr/apr-config --apr-la-file`
              $2_LIBDIR=${tempval}/lib

	      AC_SUBST(APR_INCDIR)
	      AC_SUBST(APR_CFLAGS)
	      AC_SUBST(APR_INCDIR)
	      AC_SUBST(APR_UTIL_INCDIR)
	    fi
            $2_LDFLAGS=""
	    WEBSERVERS="${WEBSERVERS} $4"

	    AC_SUBST($2_BUILD)
	    AC_SUBST($2_CFLAGS)
	    AC_SUBST($2_DIR)
	    AC_SUBST($2_HOME)
	    AC_SUBST($2_INCL)
	    AC_SUBST($2_INCDIR)
	    AC_SUBST($2_LDFLAGS)
	    AC_SUBST($2_LIBDIR)

          fi
          ;;
        esac
      ])

      if ${TEST} -z "$tempval" ; then
        AC_MSG_RESULT(not provided)
      else	
        AC_MSG_RESULT(${tempval})
      fi

      unset tempval
  ])


dnl --------------------------------------------------------------------------
dnl JK_WS_INCDIR
dnl   Set the WebServer include dir.
dnl   $1 => Webserver name
dnl   $2 => Webserver vars prefix name
dnl   $3 => File which should be present
dnl --------------------------------------------------------------------------
AC_DEFUN(
  [JK_WS_INCDIR],
  [
    tempval=""
    AC_ARG_WITH(
      [$1-include],
      [  --with-$1-include=DIR   Location of $1 include dir ],
      [  
        case "${withval}" in
          ""|"yes"|"YES"|"true"|"TRUE")
          ;;
          "no"|"NO"|"false"|"FALSE")
          AC_MSG_ERROR(valid $1 include dir location required)
          ;;
          *)
          tempval="${withval}"
          if ${TEST} ! -d ${tempval} ; then
            AC_MSG_ERROR(Not a directory: ${tempval})
          fi

          if ${TEST} ! -f ${tempval}/$3; then
            AC_MSG_ERROR(can't locate ${tempval}/$3)
          fi

          if ${TEST} ! -z "$tempval" ; then
            $2_BUILD=""
            $2_CFLAGS="-I${tempval}"
            $2_CLEAN=""
            $2_DIR=""
            $2_INCDIR=${tempval}
            AC_MSG_RESULT($2_INCDIR)
	    
	    AC_SUBST($2_BUILD)
	    AC_SUBST($2_CFLAGS)
	    AC_SUBST($2_CLEAN)
	    AC_SUBST($2_DIR)
	    AC_SUBST($2_INCDIR)
          fi
          ;;
        esac
      ])

      unset tempval
  ])


dnl --------------------------------------------------------------------------
dnl JK_WS_LIBDIR
dnl   Set the WebServer library dir.
dnl   $1 => Webserver name
dnl   $2 => Webserver vars prefix name
dnl --------------------------------------------------------------------------
AC_DEFUN(
  [JK_WS_LIBDIR],
  [
    tempval=""
    AC_ARG_WITH(
      [$1-lib],
      [  --with-$1-lib=DIR       Location of $1 lib dir ],
      [
        case "${withval}" in
          ""|"yes"|"YES"|"true"|"TRUE")
          ;;
          "no"|"NO"|"false"|"FALSE")
          AC_MSG_ERROR(valid $1 lib directory location required)
          ;;
        *)
          tempval="${withval}"

          if ${TEST} ! -d ${tempval} ; then
            AC_MSG_ERROR(Not a directory: ${tempval})
          fi

          if ${TEST} ! -z "$tempval" ; then
            $2_BUILD=""
            $2_CLEAN=""
            $2_DIR=""
            $2_LIBDIR=${tempval}
            $2_LDFLAGS=""
            AC_MSG_RESULT($2_LIBDIR)

	    AC_SUBST($2_BUILD)
	    AC_SUBST($2_CLEAN)
	    AC_SUBST($2_DIR)
	    AC_SUBST($2_LIBDIR)
	    AC_SUBST($2_LDFLAGS)
          fi

          ;;
          esac
      ])

      unset tempval
  ])

dnl vi:set sts=2 sw=2 autoindent: