This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile-fcgid.win
216 lines (188 loc) · 5.93 KB
/
Makefile-fcgid.win
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
#
# NMAKE Makefile for Microsoft Windows
#
# Targets are:
# _apacher - build Apache in Release mode
# _apached - build Apache in Debug mode
# installr - build and install a Release build
# installd - build and install a Debug build
# clean - remove (most) generated files
#
# The following install defaults may be customized;
#
# Option Default
# INSTDIR /Apache22
#
# For example;
#
# nmake -f Makefile-fcgid.win INSTDIR="d:/Program Files/Apache" installr
#
# Be aware that certain awk's will not accept backslashed names,
# so the server root should be given in forward slashes (quoted),
# preferably with the drive designation!
!IF "$(INSTDIR)" == ""
INSTDIR=\Apache22
!ENDIF
!IF EXIST("modules\fcgid\mod_fcgid.vcproj") \
&& ([devenv /help > NUL 2>&1] == 0) \
&& !defined(USEMAK) && !defined(USEDSW)
USESLN=1
USEMAK=0
USEDSW=0
!ELSEIF EXIST("modules\fcgid\mod_fcgid.mak") && !defined(USEDSW)
USESLN=0
USEMAK=1
USEDSW=0
!ELSE
USESLN=0
USEMAK=0
USEDSW=1
!ENDIF
!IF ("$(CTARGET)" == "") && ($(USESLN) == 1)
CTARGET=/build
!ENDIF
!IF "$(APACHE2_HOME)" == ""
APACHE2_HOME=$(INSTDIR)
!ENDIF
!IF EXIST("$(APACHE2_HOME)\lib\libapr-2.lib")
APACHE2_APRSFX=-2
!ELSEIF EXIST("$(APACHE2_HOME)\lib\libapr-1.lib")
APACHE2_APRSFX=-1
!ELSEIF EXIST("$(APACHE2_HOME)\lib\libapr.lib")
APACHE2_APRSFX=
!ELSE
!MESSAGE Point INSTDIR at the directory containing an already installed httpd
!MESSAGE including build support directories of lib and include. It must
!MESSAGE include apr and apr-util. mod_fcgid cannot build without these files!
!ENDIF
!IF "$(LONG)" == ""
!MESSAGE
!MESSAGE INSTDIR = $(INSTDIR)
!MESSAGE APACHE2_HOME = $(APACHE2_HOME)
!MESSAGE
!MESSAGE To change these options use 'nmake -f Makefile-fcgid.win [option=value]'
!MESSAGE Example: nmake -f Makefile-fcgid.win
!MESSAGE
!ENDIF
!IFNDEF MAKEOPT
# Only default the behavior if MAKEOPT= is omitted
!IFDEF _NMAKE_VER
# Microsoft NMake options
MAKEOPT=-nologo
!ELSEIF "$(MAKE)" == "make"
# Borland make options? Not really supported (yet)
MAKEOPT=-s -N
!ENDIF
!ENDIF
_buildr:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=R LONG=Release _build
_buildd:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=D LONG=Debug _build
installr:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=R LONG=Release _build _install
installd:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=D LONG=Debug _build _install
clean: _cleanr _cleand
-if exist Browse\. rd /s Browse < << > nul
y
<<
!IF $(USEMAK) == 1
_cleanr:
$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=R LONG=Release CTARGET=CLEAN _build
_cleand:
$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=D LONG=Debug CTARGET=CLEAN _build
_build:
echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
cd modules\fcgid
$(MAKE) $(MAKEOPT) -f mod_fcgid.mak CFG="mod_fcgid - Win32 $(LONG)" RECURSE=0 $(CTARGET)
cd ..\..
!ELSEIF $(USESLN) == 1
_cleanr:
$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=R LONG=Release CTARGET="/clean" _build
_cleand:
$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=D LONG=Debug CTARGET="/clean" _build
_build:
echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
devenv mod_fcgid.sln /useenv $(CTARGET) $(LONG) /project mod_fcgid
!ELSE
_cleanr:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=R LONG=Release CTARGET="/CLEAN" _build
_cleand:
@$(MAKE) $(MAKEOPT) -f Makefile-fcgid.win \
INSTDIR="$(INSTDIR)" APACHE2_HOME="$(APACHE2_HOME)" \
SHORT=D LONG=Debug CTARGET="/CLEAN" _build
_build:
@echo Building Win32 $(LONG) targets ($(SHORT) suffixes)
@msdev mod_fcgid.dsw /USEENV /MAKE "mod_fcgid - Win32 $(LONG)" $(CTARGET)
!ENDIF
httpd_conffile=$(INSTDIR)\conf\httpd.conf
httpd_origconffile=$(INSTDIR)\conf\original\httpd.conf
_install:
echo Y >.y
echo A >.A
-mkdir "$(INSTDIR)"
-mkdir "$(INSTDIR)\conf"
-mkdir "$(INSTDIR)\conf\original"
!IFDEF HAVE_HTTPD_FCGID_CONF
-mkdir "$(INSTDIR)\conf\extra"
-mkdir "$(INSTDIR)\conf\original\extra"
!ENDIF
!IFDEF HAVE_MOD_FCGID_H
-mkdir "$(INSTDIR)\include"
!ENDIF
-mkdir "$(INSTDIR)\manual"
-mkdir "$(INSTDIR)\modules"
copy CHANGES-FCGID "$(INSTDIR)\CHANGES-FCGID.txt" <.y
copy LICENSE-FCGID "$(INSTDIR)\LICENSE-FCGID.txt" <.y
copy NOTICE-FCGID "$(INSTDIR)\NOTICE-FCGID.txt" <.y
copy README-FCGID "$(INSTDIR)\README-FCGID.txt" <.y
copy modules\fcgid\$(LONG)\mod_fcgid.so "$(INSTDIR)\modules" <.y
copy modules\fcgid\$(LONG)\mod_fcgid.pdb "$(INSTDIR)\modules" <.y
xcopy docs\manual "$(INSTDIR)\manual" /s /d < .a
!IFDEF HAVE_MOD_FCGID_H
copy include\mod_fcgid.h "$(INSTDIR)\include" < .y > nul
!ENDIF
for %f in ("$(httpd_origconffile)" "$(httpd_conffile)") do \
if exist "%f" ( \
awk -f build/addloadexample.awk -v MODULE=fcgid -v DSO=.so \
!IFDEF HAVE_HTTPD_FCGID_CONF
-v EXAMPLECONF=conf/extra/httpd-fcgid.conf \
!ENDIF
-v LIBPATH=modules "%f" > "%f.new" && \
move "%f" "%f.bak" && move "%f.new" "%f" \
)
!IFDEF HAVE_HTTPD_FCGID_CONF
copy docs\conf\extra\httpd-fcgid.conf "$(INSTDIR)\conf\original\extra\httpd-fcgid.conf" <.y
awk -f << docs\conf\extra\httpd-fcgid.conf > "$(INSTDIR)\conf\original\extra\httpd-fcgid.conf"
/^\#@@LoadFcgidModules@@/ { next; }
{ sub(/@exp_runtimedir@/, "logs");
sub(/@exp_sysconfdir@/, "conf");
sub(/@rel_sysconfdir@/, "conf");
sub(/@rel_logfiledir@/, "logs");
print $0;
}
<<
if not exist "$(INSTDIR)\conf\extra\httpd-fcgid.conf" \
copy "$(INSTDIR)\conf\original\extra\httpd-fcgid.conf" \
"$(INSTDIR)\conf\extra\httpd-fcgid.conf" <.y
!ENDIF
del .y
del .a