configure

changeset 207
27f8a41882a7
parent 206
f5bdca63bbe7
child 208
fedd0f957c31
equal deleted inserted replaced
206:f5bdca63bbe7 207:27f8a41882a7
184 return 0 184 return 0
185 fi 185 fi
186 done 186 done
187 return 1 187 return 1
188 } 188 }
189 isnotplatform()
190 {
191 for p in $PLATFORM
192 do
193 if [ $p = $1 ]; then
194 return 1
195 fi
196 done
197 return 0
198 }
189 199
190 # generate config.mk and config.h 200 # generate config.mk and config.h
191 cat > $TEMP_DIR/config.mk << __EOF__ 201 cat > $TEMP_DIR/config.mk << __EOF__
192 # 202 #
193 # config.mk generated by configure 203 # config.mk generated by configure
250 break 260 break
251 fi 261 fi
252 if ! $PKG_CONFIG libpq ; then 262 if ! $PKG_CONFIG libpq ; then
253 break 263 break
254 fi 264 fi
255 CFLAGS+=" `$PKG_CONFIG --cflags libpq`" 265 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libpq`"
256 LDFLAGS+=" `$PKG_CONFIG --libs libpq`" 266 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libpq`"
257 echo yes 267 echo yes
258 return 0 268 return 0
259 done 269 done
260 270
261 echo no 271 echo no
271 break 281 break
272 fi 282 fi
273 if ! $PKG_CONFIG openssl ; then 283 if ! $PKG_CONFIG openssl ; then
274 break 284 break
275 fi 285 fi
276 CFLAGS+=" `$PKG_CONFIG --cflags openssl`" 286 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags openssl`"
277 LDFLAGS+=" `$PKG_CONFIG --libs openssl`" 287 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs openssl`"
278 echo yes 288 echo yes
279 return 0 289 return 0
280 done 290 done
281 291
282 echo no 292 echo no
292 break 302 break
293 fi 303 fi
294 if ! $PKG_CONFIG libxml-2.0 ; then 304 if ! $PKG_CONFIG libxml-2.0 ; then
295 break 305 break
296 fi 306 fi
297 CFLAGS+=" `$PKG_CONFIG --cflags libxml-2.0`" 307 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libxml-2.0`"
298 LDFLAGS+=" `$PKG_CONFIG --libs libxml-2.0`" 308 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libxml-2.0`"
299 echo yes 309 echo yes
300 return 0 310 return 0
301 done 311 done
302 312
303 echo no 313 echo no
309 # general dependencies 319 # general dependencies
310 CFLAGS= 320 CFLAGS=
311 LDFLAGS= 321 LDFLAGS=
312 while true 322 while true
313 do 323 do
314 if ! isplatform "linux"; then 324 if isnotplatform "linux"; then
315 break 325 break
316 fi 326 fi
317 while true 327 while true
318 do 328 do
319 329
320 CFLAGS+="-DLINUX" 330 CFLAGS="CFLAGS -DLINUX"
321 LDFLAGS+="-lpthread -ldl -lm -lldap" 331 LDFLAGS="LDFLAGS -lpthread -ldl -lm -lldap"
322 cat >> $TEMP_DIR/make.mk << __EOF__ 332 cat >> $TEMP_DIR/make.mk << __EOF__
323 # platform dependend source files 333 # platform dependend source files
324 PLATFORM_DAEMONOBJ = event_linux.o 334 PLATFORM_DAEMONOBJ = event_linux.o
325 335
326 # platform dependend vars 336 # platform dependend vars
335 345
336 break 346 break
337 done 347 done
338 while true 348 while true
339 do 349 do
340 if ! isplatform "bsd"; then 350 if isnotplatform "bsd"; then
341 break 351 break
342 fi 352 fi
343 if isplatform "macos"; then 353 if isplatform "macos"; then
344 break 354 break
345 fi 355 fi
346 while true 356 while true
347 do 357 do
348 358
349 CFLAGS+="-DBSD" 359 CFLAGS="CFLAGS -DBSD"
350 LDFLAGS+="-lpthread -lm -lldap" 360 LDFLAGS="LDFLAGS -lpthread -lm -lldap"
351 cat >> $TEMP_DIR/make.mk << __EOF__ 361 cat >> $TEMP_DIR/make.mk << __EOF__
352 # platform dependend source files 362 # platform dependend source files
353 PLATFORM_DAEMONOBJ = event_bsd.o 363 PLATFORM_DAEMONOBJ = event_bsd.o
354 364
355 # platform dependend vars 365 # platform dependend vars
364 374
365 break 375 break
366 done 376 done
367 while true 377 while true
368 do 378 do
369 if ! isplatform "macos"; then 379 if isnotplatform "macos"; then
370 break 380 break
371 fi 381 fi
372 while true 382 while true
373 do 383 do
374 384
375 CFLAGS+="-DBSD -DOSX" 385 CFLAGS="CFLAGS -DBSD -DOSX"
376 LDFLAGS+="-lpthread -ldl -lm -lldap" 386 LDFLAGS="LDFLAGS -lpthread -ldl -lm -lldap"
377 cat >> $TEMP_DIR/make.mk << __EOF__ 387 cat >> $TEMP_DIR/make.mk << __EOF__
378 # platform dependend source files 388 # platform dependend source files
379 PLATFORM_DAEMONOBJ = event_bsd.o 389 PLATFORM_DAEMONOBJ = event_bsd.o
380 390
381 # platform dependend vars 391 # platform dependend vars
390 400
391 break 401 break
392 done 402 done
393 while true 403 while true
394 do 404 do
395 if ! isplatform "solaris"; then 405 if isnotplatform "solaris"; then
396 break 406 break
397 fi 407 fi
398 while true 408 while true
399 do 409 do
400 410
401 CFLAGS+="-DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" 411 CFLAGS="CFLAGS -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
402 LDFLAGS+="-lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap" 412 LDFLAGS="LDFLAGS -lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap"
403 cat >> $TEMP_DIR/make.mk << __EOF__ 413 cat >> $TEMP_DIR/make.mk << __EOF__
404 # platform dependend source files 414 # platform dependend source files
405 PLATFORM_DAEMONOBJ = event_solaris.o 415 PLATFORM_DAEMONOBJ = event_solaris.o
406 416
407 # platform dependend vars 417 # platform dependend vars
445 LDFLAGS= 455 LDFLAGS=
446 CXXFLAGS= 456 CXXFLAGS=
447 457
448 dependency_libxml2 458 dependency_libxml2
449 if [ $? -ne 0 ]; then 459 if [ $? -ne 0 ]; then
450 DEPENDENCIES_FAILED+="libxml2 " 460 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 "
451 ERROR=1 461 ERROR=1
452 fi 462 fi
453 dependency_openssl 463 dependency_openssl
454 if [ $? -ne 0 ]; then 464 if [ $? -ne 0 ]; then
455 DEPENDENCIES_FAILED+="openssl " 465 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
456 ERROR=1 466 ERROR=1
457 fi 467 fi
458 468
459 469
460 echo >> $TEMP_DIR/config.mk 470 echo >> $TEMP_DIR/config.mk

mercurial