Import www/apache22 version 2.2.23_3
[dports.git] / www / apache22 / Makefile.modules
1 # $FreeBSD: ports/www/apache22/Makefile.modules,v 1.47 2012/11/17 06:02:28 svnexp Exp $
2 #
3 # Note by Clement Laforet: (to generate PLIST_SUB entries for modules)
4 #       gsed 's/^\(.*\)mod\(.*\)\.so/%%\MOD\U\2%%\L\1mod\2\.so/' pkg-plist > tmp
5 #       mv tmp pkg-plist
6 #
7
8 # =============================================
9 # Maintainer note for OPTION handling:
10 # To set additional option use
11 #    PORT_OPTIONS+=
12 # To unset an OPTION, even the OPTION is set in OPTIONSFILE use
13 #    WITHOUT_MODULES+=
14 #  Using OPTIONS_EXCLUDE and OPTIONS_OVERRIDE do not work as expected
15 #  if the OPTION is enabled by the user, therefore we calculate
16 #  them in bsd.apache.mk with help of WITHOUT_MODULES
17 #  The other methode is to set IGNORE's and force the user to adjust OPTIONS
18
19 .if defined(_PREMKINCLUDED)
20
21 # check if APR was build with thread support
22 .if exists(${APR_CONFIG})
23 APR_LIBS!=      ${SH} ${APR_CONFIG} --libs | ${SED} -e 's/-//g'
24 .  if defined(APR_LIBS) && !empty(APR_LIBS)
25 _T=pthread
26 .    for lib in ${APR_LIBS}
27 .       if ${_T:M${lib}}
28 APR_HAS_THREADS=        yes
29 .       endif
30 .    endfor
31 .  endif
32 .endif  # exists APR_CONFIG
33
34 # check if APR-util module exists
35 .if exists(${APU_CONFIG})
36 .  if ${PORT_OPTIONS:MLDAP} || ${PORT_OPTIONS:MAUTHNZ_LDAP}
37 .    if !exists(${APU_LDAP})
38 IGNORE= LDAP and AUTHNZ_LDAP requires APR-util to have LDAP support built in.\
39         Please rebuild APR with LDAP support
40 .    endif
41 .  endif
42
43 .  if ${PORT_OPTIONS:MDBD} || ${PORT_OPTIONS:MAUTHN_DBD}
44 .    if !exists(${APU_DBD_MYSQL}) && !exists(${APU_DBD_PGSQL}) && !exists(${APU_DBD_SQLITE3})
45 IGNORE= AUTHN_DBD and DBD requires APR-util to have DBD support build in.\
46         Please rebuild APR at last with one DBD backend (MYSQL, PGSQL or SQLITE)
47 .    endif
48 .  endif
49 .endif  # exists APU_CONFIG
50
51 # =============================================
52 # MPM's: prefork worker event itk peruser
53 .if ${WITH_MPM} == "prefork"
54 PLIST_SUB+=             WORKER="@comment " EVENT="@comment "
55 .elif ${WITH_MPM} == "worker"
56 PLIST_SUB+=             WORKER=""          EVENT="@comment "
57 .elif ${WITH_MPM} == "event"
58 PLIST_SUB+=             WORKER="@comment " EVENT=""
59 .elif ${WITH_MPM} == "peruser"
60 PLIST_SUB+=             WORKER="@comment " EVENT="@comment "
61 .elif ${WITH_MPM} == "itk"
62 PLIST_SUB+=             WORKER="@comment " EVENT="@comment "
63 EXTRA_PATCHES+=         ${PATCHDIR}/mpm-itk-${MPM_ITK_VERSION}
64 .  if defined (WITH_ITK_PERDIR_REGEX) && defined (WITH_ITK_LIMITS)
65 IGNORE= Use only one patch option not both (WITH_ITK_PERDIR_REGEX or WITH_ITK_LIMITS)
66 .  endif
67 .  if defined (WITH_ITK_PERDIR_REGEX)
68 EXTRA_PATCHES+=         ${PATCHDIR}/mpm-itk-perdir-regex
69 .  endif
70 .  if defined (WITH_ITK_LIMITS)
71 EXTRA_PATCHES+=         ${PATCHDIR}/mpm-itk-limits
72 .  endif
73 .else
74 IGNORE= Unknown MPM: ${WITH_MPM}
75 .endif  # MPM prefork
76
77 .if ${WITH_MPM} != "prefork"
78 PKGNAMESUFFIX=          -${WITH_MPM}-mpm
79 LATEST_LINK=            apache22-${WITH_MPM}-mpm
80 .endif
81
82 .if ${WITH_MPM} == "worker" || ${WITH_MPM} == "event"
83 PORT_OPTIONS+=          CGID
84 .if ${PORT_OPTIONS:MCGI}
85 IGNORE= When using a multi-threaded MPM, the module CGID should be used in place CGI. \
86         Please de-select CGI and select CGID instead. \
87         See http://httpd.apache.org/docs/2.2/mod/mod_cgi.html
88 .endif
89 .if exists(${APR_CONFIG}) && !defined(APR_HAS_THREADS)
90 IGNORE= requires APR threads. Please rebuild APR with THREAD support
91 .  endif
92 .endif
93 # =============================================
94
95 # The next three params are not converted to an option,
96 # they should be used only for special builds.
97 .if defined(WITH_STATIC_SUPPORT)
98 CONFIGURE_ARGS+=        --enable-static-support
99 .endif
100
101 # debug overrides CFLAGS
102 .if defined(WITH_DEBUG)
103 DEBUG_FLAGS?=   -O0 -g -ggdb3
104 CFLAGS=         ${DEBUG_FLAGS}
105 CONFIGURE_ARGS+=        --enable-maintainer-mode
106 WITH_EXCEPTION_HOOK=    yes
107 .endif
108
109 .if defined(WITH_EXCEPTION_HOOK)
110 CONFIGURE_ARGS+=        --enable-exception-hook
111 .endif
112
113 .if ${PORT_OPTIONS:MSSL}
114 CFLAGS+=        -I${OPENSSLINC}
115 LDFLAGS+=       -L${OPENSSLLIB}
116 CONFIGURE_ARGS+=        --with-ssl=${OPENSSLBASE}
117 .endif
118
119 .if ${PORT_OPTIONS:MAUTHNZ_LDAP}
120 CONFIGURE_ARGS+=        --enable-authnz-ldap
121 .endif
122
123 .if ${PORT_OPTIONS:MLDAP}
124 CONFIGURE_ARGS+=        --enable-ldap=shared
125 .endif
126
127 .if ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST}
128 .  if !${APACHE_MODULES:MAUTHN*}
129 IGNORE= AUTH_BASIC and AUTH_DIGEST need at last one AUTHN provider      
130 .  endif        
131 .endif
132
133 .if ${PORT_OPTIONS:MAUTH_BASIC}
134 .  if !${APACHE_MODULES:MAUTHZ*}
135 IGNORE= AUTH_BASIC need at last one AUTHZ provider      
136 .  endif        
137 .endif
138
139 .if defined(APR_HAS_THREADS)
140 CFLAGS+=        ${PTHREAD_CFLAGS}
141 LDFLAGS+=       ${PTHREAD_LIBS}
142 .else
143 .  if exists(${APR_CONFIG}) && ${PORT_OPTIONS:MMEM_CACHE}
144 IGNORE= MEM_CACHE requires APR threads. Please rebuild APR with THREAD support
145 .  endif
146 .endif
147
148 # http://httpd.apache.org/docs/2.2/bind.html
149 .if ${PORT_OPTIONS:MIPV4_MAPPED}
150 CONFIGURE_ARGS+=        --enable-v4-mapped
151 .else
152 CONFIGURE_ARGS+=        --disable-v4-mapped
153 .endif
154
155 CONFIGURE_ARGS+=        --with-mpm=${WITH_MPM}
156
157 .endif  # _PREMKINCLUDED