summaryrefslogtreecommitdiffstats
path: root/pki/base/tps/m4/apache.m4
blob: dba7716caa83bcf47df0dd08ec61d0720c4f45e6 (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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
dnl BEGIN COPYRIGHT BLOCK
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation;
dnl version 2.1 of the License.
dnl 
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl Lesser General Public License for more details.
dnl 
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA  02110-1301  USA 
dnl 
dnl Copyright (C) 2007 Red Hat, Inc.
dnl All rights reserved.
dnl END COPYRIGHT BLOCK

AC_CHECKING(for Apache)

# check for --with-apache
AC_MSG_CHECKING(for --with-apache)
AC_ARG_WITH(apache, [  --with-apache=PATH        Apache directory],
[
  if test -e "$withval"/include/httpd/httpd.h -a -d "$withval"/lib -a -d "$withval"/sbin
  then
    AC_MSG_RESULT([using $withval])
    APACHEDIR=$withval
    apache_inc="-I$APACHEDIR/include -I$APACHEDIR/include/httpd"
    case $host in
      *-*-linux*)
        if test -n "$USE_64"
        then
          apache_lib="-L$APACHEDIR/lib64"
          apache_libdir="$APACHEDIR/lib64"
          db_lib="-L$APACHEDIR/lib64"
          db_libdir="$APACHEDIR/lib64"
        else
          apache_lib="-L$APACHEDIR/lib"
          apache_libdir="$APACHEDIR/lib"
          db_lib="-L$APACHEDIR/lib"
          db_libdir="$APACHEDIR/lib"
        fi
        apache_bindir="$APACHEDIR/sbin"
        ;;
      sparc-sun-solaris*)
        if test -n "$USE_64"
        then
          apache_lib="-L$APACHEDIR/lib/sparcv9"
          apache_libdir="$APACHEDIR/lib/sparcv9"
          db_lib="-L$APACHEDIR/lib/sparcv9"
          db_libdir="$APACHEDIR/lib/sparcv9"
          apache_bindir="$APACHEDIR/sbin/sparcv9"
        else
          apache_lib="-L$APACHEDIR/lib"
          apache_libdir="$APACHEDIR/lib"
          db_lib="-L$APACHEDIR/lib"
          db_libdir="$APACHEDIR/lib"
          apache_bindir="$APACHEDIR/sbin"
        fi
        ;;
      *)
        AC_MSG_ERROR([unconfigured platform $host])
        ;;
    esac
  else
    echo
    AC_MSG_ERROR([$withval not found])
  fi
],
AC_MSG_RESULT(no))

# check for --with-apache-inc
AC_MSG_CHECKING(for --with-apache-inc)
AC_ARG_WITH(apache-inc, [  --with-apache-inc=PATH        Apache include file directory],
[
  if test -e "$withval"/httpd.h
  then
    AC_MSG_RESULT([using $withval])
    apache_inc="-I$withval/.. -I$withval"
  else
    echo
    AC_MSG_ERROR([$withval not found])
  fi
],
AC_MSG_RESULT(no))

# check for --with-apache-lib
AC_MSG_CHECKING(for --with-apache-lib)
AC_ARG_WITH(apache-lib, [  --with-apache-lib=PATH        Apache library directory],
[
  if test -d "$withval"
  then
    AC_MSG_RESULT([using $withval])
    apache_lib="-L$withval"
    apache_libdir="$withval"
    db_lib="-L$withval"
    db_libdir="$withval"
  else
    echo
    AC_MSG_ERROR([$withval not found])
  fi
],
AC_MSG_RESULT(no))

# check for --with-apache-bin
AC_MSG_CHECKING(for --with-apache-bin)
AC_ARG_WITH(apache-bin, [  --with-apache-bin=PATH        Apache executables directory],
[
  if test -d "$withval"
  then
    AC_MSG_RESULT([using $withval])
    apache_bindir="$withval"
  else
    echo
    AC_MSG_ERROR([$withval not found])
  fi
],
AC_MSG_RESULT(no))

# check for Apache in well-known locations
# e. g. - on certain platforms, check for the presence
#         of a "Fortitude"-enabled web-server first
AC_MSG_CHECKING(for Apache in well-known locations)
case $host in
  *-*-linux*)
    if test -f /usr/include/httpd/httpd.h
    then
      apache_inc="-I/usr/include -I/usr/include/httpd"
    else
      AC_MSG_ERROR([/usr/include/httpd/httpd.h not found])
    fi
    if test -n "$USE_64"
    then
      if test -e /usr/lib64/libaprutil-0.so
      then
        apache_lib="-L/usr/lib64"
        apache_libdir="/usr/lib64"
        db_lib="-L/usr/lib64"
        db_libdir="/usr/lib64"
        apr_libutil_version="aprutil-0"
      elif test -e /usr/lib64/libaprutil-1.so
      then
        apache_lib="-L/usr/lib64"
        apache_libdir="/usr/lib64"
        db_lib="-L/usr/lib64"
        db_libdir="/usr/lib64"
        apr_libutil_version="aprutil-1"
      else
        AC_MSG_ERROR([libaprutil not found])
      fi
    else
      if test -e /usr/lib/libaprutil-0.so
      then
        apache_lib="-L/usr/lib"
        apache_libdir="/usr/lib"
        db_lib="-L/usr/lib"
        db_libdir="/usr/lib"
        apr_libutil_version="aprutil-0"
      elif test -e /usr/lib/libaprutil-1.so
      then
        apache_lib="-L/usr/lib"
        apache_libdir="/usr/lib"
        db_lib="-L/usr/lib"
        db_libdir="/usr/lib"
        apr_libutil_version="aprutil-1"
      else
        AC_MSG_ERROR([libaprutil not found])
      fi
    fi
    if test -x /usr/sbin/httpd
    then
      apache_bindir="/usr/sbin"
    else
      AC_MSG_ERROR([/usr/sbin/httpd not found])
    fi
    AC_MSG_RESULT([using system Apache in /usr])
    ;;
  sparc-sun-solaris*)
    if test -d /opt/fortitude
    then
      if test -f /opt/fortitude/include/httpd/httpd.h
      then
        apache_inc="-I/opt/fortitude/include -I/opt/fortitude/include/httpd"
      else
        AC_MSG_ERROR([/opt/fortitude/include/httpd/httpd.h not found])
      fi
      if test -n "$USE_64"
      then
        #############################################################
        ###  NOTE:  The 64-bit Fortitude "sparcv9" libraries and  ###
        ###         programs are now under "/opt/fortitude/lib"   ###
        ###         and "/opt/fortitude/sbin" rather than         ###
        ###         "/opt/fortitude/lib/sparcv9" and              ###
        ###         "/opt/fortitude/sbin/sparcv9"!!!              ###
        ###                                                       ###
        ###         The exception to this are the -ldb and the    ###
        ###         -ldb_cxx libraries which are still located    ###
        ###         under the "/opt/fortitude/lib/sparcv9"        ###
        ###         directory.                                    ###
        ###                                                       ###
        ###         To help guard against any future movement     ###
        ###         of any of these libraries and/or programs,    ###
        ###         this m4 file will first check under the       ###
        ###         "sparcv9" directory, and then the directory   ###
        ###         immediately above the "sparcv9" directory.    ###
        #############################################################
        if test -e /opt/fortitude/lib/sparcv9/libaprutil-0.so
        then
          apache_lib="-L/opt/fortitude/lib/sparcv9"
          apache_libdir="/opt/fortitude/lib/sparcv9"
          apr_libutil_version="aprutil-0"
        else
          if test -e /opt/fortitude/lib/libaprutil-0.so
          then
            apache_lib="-L/opt/fortitude/lib"
            apache_libdir="/opt/fortitude/lib"
            apr_libutil_version="aprutil-0"
          else
            AC_MSG_ERROR([Fortitude-enabled libaprutil-0.so not found])
          fi
        fi
        if test -e /opt/fortitude/lib/sparcv9/libdb-4.2.so
        then
          db_lib="-L/opt/fortitude/lib/sparcv9"
          db_libdir="/opt/fortitude/lib/sparcv9"
        else
          if test -e /opt/fortitude/lib/libdb-4.2.so
          then
            db_lib="-L/opt/fortitude/lib"
            db_libdir="/opt/fortitude/lib"
          else
            AC_MSG_ERROR([Fortitude-enabled libdb-4.2.so not found])
          fi
        fi
        if test -x /opt/fortitude/sbin/sparcv9/httpd
        then
          apache_bindir="/opt/fortitude/sbin/sparcv9"
        else
          if test -x /opt/fortitude/sbin/httpd
          then
            apache_bindir="/opt/fortitude/sbin"
          else
            AC_MSG_ERROR([Fortitude-enabled httpd not found])
          fi
        fi
      else
        if test -e /opt/fortitude/lib/libaprutil-0.so
        then
          apache_lib="-L/opt/fortitude/lib"
          apache_libdir="/opt/fortitude/lib"
          apr_libutil_version="aprutil-0"
        else
          AC_MSG_ERROR([/opt/fortitude/lib/libaprutil-0.so not found])
        fi
        if test -e /opt/fortitude/lib/libdb-4.2.so
        then
          db_lib="-L/opt/fortitude/lib"
          db_libdir="/opt/fortitude/lib"
        else
          AC_MSG_ERROR([/opt/fortitude/lib/libdb-4.2.so not found])
        fi
        if test -x /opt/fortitude/sbin/httpd
        then
          apache_bindir="/opt/fortitude/sbin"
        else
          AC_MSG_ERROR([/opt/fortitude/sbin/httpd not found])
        fi
      fi
      AC_MSG_RESULT([using Fortitude-enabled Apache in /opt/fortitude])
    else
      if test -f /usr/local/include/httpd/httpd.h
      then
        apache_inc="-I/usr/local/include -I/usr/local/include/httpd"
      else
        AC_MSG_ERROR([/usr/local/include/httpd/httpd.h not found])
      fi
      if test -n "$USE_64"
      then
        if test -e /usr/local/lib/sparcv9/libaprutil-0.so
        then
          apache_lib="-L/usr/local/lib/sparcv9"
          apache_libdir="/usr/local/lib/sparcv9"
          db_lib="-L/usr/local/lib/sparcv9"
          db_libdir="/usr/local/lib/sparcv9"
          apr_libutil_version="aprutil-0"
        else
          AC_MSG_ERROR([/usr/local/lib/sparcv9/libaprutil-0.so not found])
        fi
        if test -x /usr/local/sbin/sparcv9/httpd
        then
          apache_bindir="/usr/local/sbin/sparcv9"
        else
          AC_MSG_ERROR([/usr/local/sbin/sparcv9/httpd not found])
        fi
      else
        if test -e /usr/local/lib/libaprutil-0.so
        then
          apache_lib="-L/usr/local/lib"
          apache_libdir="/usr/local/lib"
          db_lib="-L/usr/local/lib"
          db_libdir="/usr/local/lib"
          apr_libutil_version="aprutil-0"
        else
          AC_MSG_ERROR([/usr/local/lib/libaprutil-0.so not found])
        fi
        if test -x /usr/local/sbin/httpd
        then
          apache_bindir="/usr/local/sbin"
        else
          AC_MSG_ERROR([/usr/local/sbin/httpd not found])
        fi
      fi
    fi
    AC_MSG_RESULT([using system Apache in /usr/local])
    ;;
  *)
    AC_MSG_ERROR([unconfigured platform $host])
    ;;
esac

# if Apache has not been found, print an error and exit
if test -z "$apache_inc"
then
  AC_MSG_ERROR([Apache include file directory not found, specify with --with-apache.])
fi
if test -z "$apache_lib" -o -z "$apache_libdir" -o -z "$db_lib" -o -z "db_libdir" -o -z "$apr_libutil_version"
then
  AC_MSG_ERROR([Apache library directory not found, specify with --with-apache.])
fi
if test -z "$apache_bindir"
then
  AC_MSG_ERROR([Apache executables directory not found, specify with --with-apache.])
fi