Lines 83-108
Link Here
|
83 |
end |
83 |
end |
84 |
|
84 |
|
85 |
|
85 |
|
86 |
##### boost::thread static library |
|
|
87 |
|
88 |
subdir 'ext/boost/src' do |
89 |
file 'libboost_thread.a' => Dir['*.cpp'] + Dir['pthread/*.cpp'] do |
90 |
flags = "#{OPTIMIZATION_FLAGS} -fPIC -I../.. #{THREADING_FLAGS} -DNDEBUG #{MULTI_ARCH_FLAGS}" |
91 |
compile_cxx "*.cpp", flags |
92 |
# NOTE: 'compile_cxx "pthread/*.cpp", flags' doesn't work on some systems, |
93 |
# so we do this instead. |
94 |
Dir['pthread/*.cpp'].each do |file| |
95 |
compile_cxx file, flags |
96 |
end |
97 |
create_static_library "libboost_thread.a", "*.o" |
98 |
end |
99 |
|
100 |
task :clean do |
101 |
sh "rm -f libboost_thread.a *.o" |
102 |
end |
103 |
end |
104 |
|
105 |
|
106 |
##### Apache module |
86 |
##### Apache module |
107 |
|
87 |
|
108 |
class APACHE2 |
88 |
class APACHE2 |
Lines 127-133
Link Here
|
127 |
task :apache2 => ['mod_passenger.so', 'ApplicationPoolServerExecutable', :native_support] |
107 |
task :apache2 => ['mod_passenger.so', 'ApplicationPoolServerExecutable', :native_support] |
128 |
|
108 |
|
129 |
file 'mod_passenger.so' => [ |
109 |
file 'mod_passenger.so' => [ |
130 |
'../boost/src/libboost_thread.a', |
|
|
131 |
'mod_passenger.o' |
110 |
'mod_passenger.o' |
132 |
] + APACHE2::OBJECTS.keys do |
111 |
] + APACHE2::OBJECTS.keys do |
133 |
# apxs totally sucks. We couldn't get it working correctly |
112 |
# apxs totally sucks. We couldn't get it working correctly |
Lines 137-150
Link Here
|
137 |
# |
116 |
# |
138 |
# Oh, and libtool sucks too. Do we even need it anymore in 2008? |
117 |
# Oh, and libtool sucks too. Do we even need it anymore in 2008? |
139 |
linkflags = "#{LDFLAGS} #{MULTI_ARCH_FLAGS}" |
118 |
linkflags = "#{LDFLAGS} #{MULTI_ARCH_FLAGS}" |
140 |
linkflags << " -lstdc++ -lpthread ../boost/src/libboost_thread.a #{APR_LIBS}" |
119 |
linkflags << " -lstdc++ -lpthread -lboost_thread #{APR_LIBS}" |
141 |
create_shared_library 'mod_passenger.so', |
120 |
create_shared_library 'mod_passenger.so', |
142 |
APACHE2::OBJECTS.keys.join(' ') << ' mod_passenger.o', |
121 |
APACHE2::OBJECTS.keys.join(' ') << ' mod_passenger.o', |
143 |
linkflags |
122 |
linkflags |
144 |
end |
123 |
end |
145 |
|
124 |
|
146 |
file 'ApplicationPoolServerExecutable' => [ |
125 |
file 'ApplicationPoolServerExecutable' => [ |
147 |
'../boost/src/libboost_thread.a', |
|
|
148 |
'ApplicationPoolServerExecutable.cpp', |
126 |
'ApplicationPoolServerExecutable.cpp', |
149 |
'ApplicationPool.h', |
127 |
'ApplicationPool.h', |
150 |
'StandardApplicationPool.h', |
128 |
'StandardApplicationPool.h', |
Lines 156-162
Link Here
|
156 |
] do |
134 |
] do |
157 |
create_executable "ApplicationPoolServerExecutable", |
135 |
create_executable "ApplicationPoolServerExecutable", |
158 |
'ApplicationPoolServerExecutable.cpp System.o Utils.o Logging.o', |
136 |
'ApplicationPoolServerExecutable.cpp System.o Utils.o Logging.o', |
159 |
"-I.. #{CXXFLAGS} #{LDFLAGS} ../boost/src/libboost_thread.a -lpthread" |
137 |
"-I.. #{CXXFLAGS} #{LDFLAGS} -lboost_thread -lpthread" |
160 |
end |
138 |
end |
161 |
|
139 |
|
162 |
file 'mod_passenger.o' => ['mod_passenger.c'] do |
140 |
file 'mod_passenger.o' => ['mod_passenger.c'] do |
Lines 259-266
Link Here
|
259 |
end |
237 |
end |
260 |
|
238 |
|
261 |
file 'Apache2ModuleTests' => TEST::AP2_OBJECTS.keys + |
239 |
file 'Apache2ModuleTests' => TEST::AP2_OBJECTS.keys + |
262 |
['../ext/boost/src/libboost_thread.a', |
240 |
['../ext/apache2/System.o', |
263 |
'../ext/apache2/System.o', |
|
|
264 |
'../ext/apache2/Utils.o', |
241 |
'../ext/apache2/Utils.o', |
265 |
'../ext/apache2/Logging.o'] do |
242 |
'../ext/apache2/Logging.o'] do |
266 |
objects = TEST::AP2_OBJECTS.keys.join(' ') << |
243 |
objects = TEST::AP2_OBJECTS.keys.join(' ') << |
Lines 269-275
Link Here
|
269 |
" ../ext/apache2/Logging.o" |
246 |
" ../ext/apache2/Logging.o" |
270 |
create_executable "Apache2ModuleTests", objects, |
247 |
create_executable "Apache2ModuleTests", objects, |
271 |
"#{LDFLAGS} #{APR_LIBS} #{MULTI_ARCH_FLAGS} " << |
248 |
"#{LDFLAGS} #{APR_LIBS} #{MULTI_ARCH_FLAGS} " << |
272 |
"../ext/boost/src/libboost_thread.a -lpthread" |
249 |
"-lboost_thread -lpthread" |
273 |
end |
250 |
end |
274 |
|
251 |
|
275 |
TEST::AP2_OBJECTS.each_pair do |target, sources| |
252 |
TEST::AP2_OBJECTS.each_pair do |target, sources| |
Lines 301-312
Link Here
|
301 |
subdir 'benchmark' do |
278 |
subdir 'benchmark' do |
302 |
file 'DummyRequestHandler' => ['DummyRequestHandler.cpp', |
279 |
file 'DummyRequestHandler' => ['DummyRequestHandler.cpp', |
303 |
'../ext/apache2/MessageChannel.h', |
280 |
'../ext/apache2/MessageChannel.h', |
304 |
'../ext/apache2/System.o', |
281 |
'../ext/apache2/System.o'] do |
305 |
'../ext/boost/src/libboost_thread.a'] do |
|
|
306 |
create_executable "DummyRequestHandler", "DummyRequestHandler.cpp", |
282 |
create_executable "DummyRequestHandler", "DummyRequestHandler.cpp", |
307 |
"-I../ext -I../ext/apache2 #{CXXFLAGS} #{LDFLAGS} " << |
283 |
"-I../ext -I../ext/apache2 #{CXXFLAGS} #{LDFLAGS} " << |
308 |
"../ext/apache2/System.o " << |
284 |
"../ext/apache2/System.o " << |
309 |
"../ext/boost/src/libboost_thread.a -lpthread" |
285 |
"-lboost_thread -lpthread" |
310 |
end |
286 |
end |
311 |
|
287 |
|
312 |
file 'ApplicationPool' => ['ApplicationPool.cpp', |
288 |
file 'ApplicationPool' => ['ApplicationPool.cpp', |
Lines 315-327
Link Here
|
315 |
'../ext/apache2/System.o', |
291 |
'../ext/apache2/System.o', |
316 |
'../ext/apache2/Logging.o', |
292 |
'../ext/apache2/Logging.o', |
317 |
'../ext/apache2/Utils.o', |
293 |
'../ext/apache2/Utils.o', |
318 |
'../ext/boost/src/libboost_thread.a', |
|
|
319 |
:native_support] do |
294 |
:native_support] do |
320 |
create_executable "ApplicationPool", "ApplicationPool.cpp", |
295 |
create_executable "ApplicationPool", "ApplicationPool.cpp", |
321 |
"-I../ext -I../ext/apache2 #{CXXFLAGS} #{LDFLAGS} " << |
296 |
"-I../ext -I../ext/apache2 #{CXXFLAGS} #{LDFLAGS} " << |
322 |
"../ext/apache2/System.o ../ext/apache2/Logging.o " << |
297 |
"../ext/apache2/System.o ../ext/apache2/Logging.o " << |
323 |
"../ext/apache2/Utils.o " << |
298 |
"../ext/apache2/Utils.o " << |
324 |
"../ext/boost/src/libboost_thread.a -lpthread" |
299 |
"-lboost_thread -lpthread" |
325 |
end |
300 |
end |
326 |
|
301 |
|
327 |
task :clean do |
302 |
task :clean do |
Lines 421-428
Link Here
|
421 |
'man/*', |
396 |
'man/*', |
422 |
'debian/*', |
397 |
'debian/*', |
423 |
'ext/apache2/*.{cpp,h,c,TXT}', |
398 |
'ext/apache2/*.{cpp,h,c,TXT}', |
424 |
'ext/boost/*.{hpp,TXT}', |
|
|
425 |
'ext/boost/**/*.{hpp,cpp,pl,inl,ipp}', |
426 |
'ext/passenger/*.{c,rb}', |
399 |
'ext/passenger/*.{c,rb}', |
427 |
'benchmark/*.{cpp,rb}', |
400 |
'benchmark/*.{cpp,rb}', |
428 |
'misc/*', |
401 |
'misc/*', |