66:dc758dcd4645 | 67:e43d30273f74 |
---|---|
194 | 194 |
195 # | 195 # |
196 # DEPENDENCIES | 196 # DEPENDENCIES |
197 # | 197 # |
198 | 198 |
199 # check languages | |
200 lang_c= | |
201 lang_cpp= | |
202 if detect_c_compiler ; then | |
203 lang_c=1 | |
204 fi | |
205 if detect_cpp_compiler ; then | |
206 lang_cpp=1 | |
207 fi | |
208 | |
199 # create buffer for make variables required by dependencies | 209 # create buffer for make variables required by dependencies |
200 echo > "$TEMP_DIR/make.mk" | 210 echo > "$TEMP_DIR/make.mk" |
201 | 211 |
202 test_pkg_config() | 212 test_pkg_config() |
203 { | 213 { |
210 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : | 220 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then : |
211 else return 1 ; fi | 221 else return 1 ; fi |
212 return 0 | 222 return 0 |
213 } | 223 } |
214 | 224 |
225 dependency_error_cpp() | |
226 { | |
227 printf "checking for cpp... " | |
228 # dependency cpp | |
229 while true | |
230 do | |
231 if [ -z "$lang_cpp" ] ; then | |
232 break | |
233 fi | |
234 echo yes | |
235 return 1 | |
236 done | |
237 | |
238 echo no | |
239 return 0 | |
240 } | |
215 dependency_error_libpq() | 241 dependency_error_libpq() |
216 { | 242 { |
217 printf "checking for libpq... " | 243 printf "checking for libpq... " |
218 # dependency libpq | 244 # dependency libpq |
219 while true | 245 while true |
238 { | 264 { |
239 printf "checking for openssl... " | 265 printf "checking for openssl... " |
240 # dependency openssl | 266 # dependency openssl |
241 while true | 267 while true |
242 do | 268 do |
269 if [ -z "$lang_c" ] ; then | |
270 break | |
271 fi | |
243 if [ -z "$PKG_CONFIG" ]; then | 272 if [ -z "$PKG_CONFIG" ]; then |
244 break | 273 break |
245 fi | 274 fi |
246 if test_pkg_config "openssl" "" "" "" ; then | 275 if test_pkg_config "openssl" "" "" "" ; then |
247 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" | 276 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`" |
291 done | 320 done |
292 | 321 |
293 # dependency libxml2 | 322 # dependency libxml2 |
294 while true | 323 while true |
295 do | 324 do |
325 if [ -z "$lang_c" ] ; then | |
326 break | |
327 fi | |
296 if [ -z "$PKG_CONFIG" ]; then | 328 if [ -z "$PKG_CONFIG" ]; then |
297 break | 329 break |
298 fi | 330 fi |
299 if test_pkg_config "libxml-2.0" "" "" "" ; then | 331 if test_pkg_config "libxml-2.0" "" "" "" ; then |
300 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" | 332 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`" |
307 done | 339 done |
308 | 340 |
309 echo no | 341 echo no |
310 return 0 | 342 return 0 |
311 } | 343 } |
344 | |
345 | |
346 | |
312 | 347 |
313 # start collecting dependency information | 348 # start collecting dependency information |
314 echo > "$TEMP_DIR/flags.mk" | 349 echo > "$TEMP_DIR/flags.mk" |
315 | 350 |
316 DEPENDENCIES_FAILED= | 351 DEPENDENCIES_FAILED= |
321 TEMP_LDFLAGS= | 356 TEMP_LDFLAGS= |
322 while true | 357 while true |
323 do | 358 do |
324 while true | 359 while true |
325 do | 360 do |
326 if detect_cpp_compiler ; then | 361 if [ -z "$lang_c" ] ; then |
327 : | |
328 else | |
329 ERROR=1 | 362 ERROR=1 |
330 break | 363 break |
331 fi | 364 fi |
332 | 365 |
333 break | 366 break |
366 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " | 399 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
367 ERROR=1 | 400 ERROR=1 |
368 fi | 401 fi |
369 if dependency_error_openssl; then | 402 if dependency_error_openssl; then |
370 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " | 403 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl " |
404 ERROR=1 | |
405 fi | |
406 if dependency_error_libpq; then | |
407 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " | |
371 ERROR=1 | 408 ERROR=1 |
372 fi | 409 fi |
373 | 410 |
374 # Features | 411 # Features |
375 if [ -n "$FEATURE_PG" ]; then | 412 if [ -n "$FEATURE_PG" ]; then |
381 else | 418 else |
382 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " | 419 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq " |
383 ERROR=1 | 420 ERROR=1 |
384 fi | 421 fi |
385 fi | 422 fi |
423 # check dependency | |
424 if dependency_error_cpp ; then | |
425 # "auto" features can fail and are just disabled in this case | |
426 if [ "$FEATURE_PG" = "auto" ]; then | |
427 unset FEATURE_PG | |
428 else | |
429 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED cpp " | |
430 ERROR=1 | |
431 fi | |
432 fi | |
386 fi | 433 fi |
387 | 434 |
388 | 435 |
389 if [ -n "${TEMP_CFLAGS}" ]; then | 436 if [ -n "${TEMP_CFLAGS}" ]; then |
390 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" | 437 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |