aboutsummaryrefslogtreecommitdiffstats
path: root/www/apache22/Makefile.modules
blob: c642233ff1952cc408c2533c019b8f152ff810b2 (plain) (blame)
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
# $FreeBSD$
#
# Note by Clement Laforet: (to generate PLIST_SUB entries for modules)
#   gsed 's/^\(.*\)mod\(.*\)\.so/%%\MOD\U\2%%\L\1mod\2\.so/' pkg-plist > tmp
#   mv tmp pkg-plist
#

# =============================================
# Maintainer note for OPTION handling:
# To set additional option use
#    PORT_OPTIONS+=
# To unset an OPTION, even the OPTION is set in OPTIONSFILE use
#    WITHOUT_MODULES+=
#  Using OPTIONS_EXCLUDE and OPTIONS_OVERRIDE do not work as expected
#  if the OPTION is enabled by the user, therefore we calculate
#  them in bsd.apache.mk with help of WITHOUT_MODULES
#  The other methode is to set IGNORE's and force the user to adjust OPTIONS

.if defined(_PREMKINCLUDED)

# check if APR was build with thread support
.if exists(${APR_CONFIG})
APR_LIBS!=  ${SH} ${APR_CONFIG} --libs | ${SED} -e 's/-//g'
.  if defined(APR_LIBS) && !empty(APR_LIBS)
_T=pthread
.    for lib in ${APR_LIBS}
.   if ${_T:M${lib}}
APR_HAS_THREADS=    yes
.   endif
.    endfor
.  endif
.endif  # exists APR_CONFIG

# check if APR-util module exists
.if exists(${APU_CONFIG})
.  if ${PORT_OPTIONS:MLDAP} || ${PORT_OPTIONS:MAUTHNZ_LDAP}
.    if !exists(${APU_LDAP})
IGNORE= LDAP and AUTHNZ_LDAP requires APR-util to have LDAP support built in.\
    Please rebuild APR with LDAP support
.    endif
.  endif

.  if ${PORT_OPTIONS:MDBD} || ${PORT_OPTIONS:MAUTHN_DBD}
.    if !exists(${APU_DBD_MYSQL}) && !exists(${APU_DBD_PGSQL}) && !exists(${APU_DBD_SQLITE3})
IGNORE= AUTHN_DBD and DBD requires APR-util to have DBD support build in.\
    Please rebuild APR at last with one DBD backend
.    endif
.  endif
.endif  # exists APU_CONFIG

# =============================================
# MPM's: prefork worker event itk peruser
.if ${WITH_MPM} == "prefork"
PLIST_SUB+=     WORKER="@comment " EVENT="@comment "
.elif ${WITH_MPM} == "worker"
PLIST_SUB+=     WORKER=""          EVENT="@comment "
.elif ${WITH_MPM} == "event"
PLIST_SUB+=     WORKER="@comment " EVENT=""
.elif ${WITH_MPM} == "peruser"
PLIST_SUB+=     WORKER="@comment " EVENT="@comment "
.elif ${WITH_MPM} == "itk"
PLIST_SUB+=     WORKER="@comment " EVENT="@comment "
EXTRA_PATCHES+=     ${PATCHDIR}/mpm-itk-${MPM_ITK_VERSION}
.  if defined (WITH_ITK_PERDIR_REGEX) && defined (WITH_ITK_LIMITS)
IGNORE= Use only one patch option not both (WITH_ITK_PERDIR_REGEX or WITH_ITK_LIMITS)
.  endif
.  if defined (WITH_ITK_PERDIR_REGEX)
EXTRA_PATCHES+=     ${PATCHDIR}/mpm-itk-perdir-regex
.  endif
.  if defined (WITH_ITK_LIMITS)
EXTRA_PATCHES+=     ${PATCHDIR}/mpm-itk-limits
.  endif
.else
IGNORE= Unknown MPM: ${WITH_MPM}
.endif  # MPM prefork

.if ${WITH_MPM} != "prefork"
PKGNAMESUFFIX=      -${WITH_MPM}-mpm
LATEST_LINK=        apache22-${WITH_MPM}-mpm
.endif

.if ${WITH_MPM} == "worker" || ${WITH_MPM} == "event"
PORT_OPTIONS+=      CGID
.if ${PORT_OPTIONS:MCGI}
IGNORE= does not build with CGI. Please de-select CGI and select CGID instead
.endif
.if exists(${APR_CONFIG}) && !defined(APR_HAS_THREADS)
IGNORE= requires APR threads. Please rebuild APR with THREAD support
.  endif
.endif
# =============================================

# The next three params are not converted to an option,
# they should be used only for special builds.
.if defined(WITH_STATIC_SUPPORT)
CONFIGURE_ARGS+=    --enable-static-support
.endif

# debug overrides CFLAGS
.if defined(WITH_DEBUG)
DEBUG_FLAGS?=   -O0 -g -ggdb3
CFLAGS=     ${DEBUG_FLAGS}
CONFIGURE_ARGS+=    --enable-maintainer-mode
WITH_EXCEPTION_HOOK=    yes
.endif

.if defined(WITH_EXCEPTION_HOOK)
CONFIGURE_ARGS+=    --enable-exception-hook
.endif

.if ${PORT_OPTIONS:MSSL}
CFLAGS+=    -I${OPENSSLINC}
LDFLAGS+=   -L${OPENSSLLIB}
CONFIGURE_ARGS+=    --with-ssl=${OPENSSLBASE}
.endif

.if ${PORT_OPTIONS:MAUTHNZ_LDAP}
CONFIGURE_ARGS+=    --enable-authnz-ldap
.endif

.if ${PORT_OPTIONS:MLDAP}
CONFIGURE_ARGS+=    --enable-ldap=shared
.endif

.if ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST}
.  if !${APACHE_MODULES:MAUTHN*}
IGNORE= AUTH_BASIC and AUTH_DIGEST need at last one AUTHN provider  
.  endif    
.endif

.if ${PORT_OPTIONS:MAUTH_BASIC}
.  if !${APACHE_MODULES:MAUTHZ*}
IGNORE= AUTH_BASIC need at last one AUTHZ provider  
.  endif    
.endif

.if defined(APR_HAS_THREADS)
CFLAGS+=    ${PTHREAD_CFLAGS}
LDFLAGS+=   ${PTHREAD_LIBS}
.else
.  if exists(${APR_CONFIG}) && ${PORT_OPTIONS:MMEM_CACHE}
IGNORE= MEM_CACHE requires APR threads. Please rebuild APR with THREAD support
.  endif
.endif

.if empty(PORT_OPTIONS:MIPV6)
CONFIGURE_ARGS+=    --disable-ipv6
.else
CATEGORIES+=        ipv6
EXTRA_PATCHES+=     ${PATCHDIR}/extra-patch-server__config.c
.  if ${PORT_OPTIONS:MIPV6_V6ONLY}
CONFIGURE_ARGS+=    --disable-v4-mapped
.  else
CONFIGURE_ARGS+=    --enable-v4-mapped
.  endif
.endif

CONFIGURE_ARGS+=    --with-mpm=${WITH_MPM}

.endif  # _PREMKINCLUDED