altomaltes / cross / slibtool

Forked from cross/slibtool 2 years ago
Clone

fee4c3 build system: configure: added config_support()

Authored and Committed by midipix 8 years ago
1 file changed. 22 lines added. 0 lines removed.
    build system: configure: added config_support()
    
    * test supported features as needed.
    - shared library support.
    
        
file modified
+22 -0
configure CHANGED
@@ -405,6 +405,27 @@ config_copy()
405
405
}
406
406
407
407
408
+ config_support()
409
+ {
410
+ [ "$mb_disable_shared" = 'yes' ] && return 0
411
+
412
+ mbt_cc=`make .display-cc`
413
+ mbt_cflags=`make .display-cflags`
414
+ mbt_source='int foo(int x){return ++x;}'
415
+ mbt_result='no'
416
+
417
+ rm -f a.out
418
+ echo "$mbt_source" | "$mbt_cc" -shared -o a.out -xc -
419
+ stat a.out >/dev/null 2>&1 && mbt_result='yes'
420
+ rm -f a.out
421
+
422
+ if [ "$mbt_result" = 'no' ]; then
423
+ mb_disable_shared='yes'
424
+ config_copy
425
+ fi
426
+ }
427
+
428
+
408
429
config_host()
409
430
{
410
431
make -s host.tag && return 0
@@ -536,6 +557,7 @@ cross_defaults
536
557
# four: config
537
558
config_flags
538
559
config_copy
560
+ config_support
539
561
config_host
540
562
config_status
541
563