~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to configure

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-02-05 08:09:05 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120205080905-9ej05rmkibowsm7j
Tags: 3.5.5-1
* New upstream version.
* Rewrite debian/copyright, using DEP-5 and updating for 2012.
* Update manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        echo >> "$TMPLOG"
69
69
        cat "$TMPC" >> "$TMPLOG"
70
70
        echo >> "$TMPLOG"
71
 
        echo "$CXX $TMPC -o $TMPO$EXEEXT $@" >> "$TMPLOG"
 
71
        echo "$CXX $TMPC $LDFLAGS -o $TMPO$EXEEXT $@" >> "$TMPLOG"
72
72
        rm -f "$TMPO$EXEEXT"
73
 
        ( $CXX "$TMPC" -o "$TMPO$EXEEXT" "$@" ) >> "$TMPLOG" 2>&1
 
73
        ( $CXX "$TMPC" $LDFLAGS -o "$TMPO$EXEEXT" "$@" ) >> "$TMPLOG" 2>&1
74
74
        TMP="$?"
75
75
        echo >> "$TMPLOG"
76
76
        return "$TMP"
77
77
}
78
78
 
 
79
cc_check_define() {
 
80
cat > $TMPC << EOF
 
81
int main(void) {
 
82
        #ifndef $1
 
83
        syntax error
 
84
        #endif
 
85
        return 0;
 
86
}
 
87
EOF
 
88
        cc_check -c
 
89
        return $?
 
90
}
 
91
 
79
92
echocheck () {
80
93
        echo_n "Checking for $@... "
81
94
}
99
112
 
100
113
if test -n "$_host"; then
101
114
        # In cross-compiling mode, we cannot run the result
102
 
        eval "$1 -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
 
115
        eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
103
116
else
104
 
        eval "$1 -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
 
117
        eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
105
118
fi
106
119
}
107
120
 
 
121
# Add a line of data to config.mk.
 
122
add_line_to_config_mk() {
 
123
        _config_mk_data="$_config_mk_data"'
 
124
'"$1"
 
125
}
 
126
 
 
127
 
108
128
#
109
129
# Determine sdl-config
110
130
#
376
396
 
377
397
echocheck "compiler version"
378
398
 
379
 
cxx_name=`( $cc -v ) 2>&1 | tail -n 1 | cut -d ' ' -f 1`
380
 
cxx_version=`( $CXX -dumpversion ) 2>&1`
381
 
if test "$?" -gt 0; then
382
 
        cxx_version="not found"
 
399
have_gcc=no
 
400
cc_check_define __GNUC__ && have_gcc=yes
 
401
 
 
402
if test "$have_gcc" = yes; then
 
403
        cxx_name=`( $cc -v ) 2>&1 | tail -n 1 | cut -d ' ' -f 1`
 
404
        cxx_version=`( $CXX -dumpversion ) 2>&1`
 
405
        if test "$?" -gt 0; then
 
406
                cxx_version="not found"
 
407
        fi
 
408
 
 
409
        case $cxx_version in
 
410
                2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*)
 
411
                        _cxx_major=`echo $cxx_version | cut -d '.' -f 1`
 
412
                        _cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
 
413
                        cxx_version="$cxx_version, ok"
 
414
                        cxx_verc_fail=no
 
415
                        ;;
 
416
                # whacky beos version strings
 
417
                2.9-beos-991026*|2.9-beos-000224*)      
 
418
                        _cxx_major=2
 
419
                        _cxx_minor=95
 
420
                        cxx_version="$cxx_version, ok"
 
421
                        cxx_verc_fail=no
 
422
                        ;;
 
423
                3_4)
 
424
                        _cxx_major=3
 
425
                        _mxx_minor=4
 
426
                        ;;
 
427
                'not found')
 
428
                        cxx_verc_fail=yes
 
429
                        ;;
 
430
                *)
 
431
                        cxx_version="$cxx_version, bad"
 
432
                        cxx_verc_fail=yes
 
433
                        ;;
 
434
        esac
 
435
        if test "$_cxx_major" -ge "3" ; then
 
436
                CXXFLAGS="$CXXFLAGS"
 
437
                _make_def_HAVE_GCC3='HAVE_GCC3 = 1'
 
438
                add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
 
439
        fi;
 
440
        _make_def_HAVE_GCC='HAVE_GCC = 1'
 
441
        echo "$cxx_version"
 
442
else
 
443
        cxx_version=`( $CXX -version ) 2>&1`
 
444
        if test "$?" -eq 0; then
 
445
                cxx_version="`echo "${cxx_version}" | sed -ne 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/gp'`"
 
446
                if test -z "${cxx_version}"; then
 
447
                        cxx_version="not found"
 
448
                        cxx_verc_fail=yes
 
449
                fi
 
450
                echo non-gcc compiler version ${cxx_version}
 
451
        else
 
452
                cxx_version="not found"
 
453
                cxx_verc_fail=yes
 
454
                echo found non-gcc compiler version ${cxx_version}
 
455
        fi
 
456
 
 
457
        CXXFLAGS="$CXXFLAGS"
 
458
        case $_host_os in
 
459
                irix*)
 
460
                        case $cxx_version in
 
461
                                7.4.4*)
 
462
                                        # We just assume this is SGI MIPSpro
 
463
                                        _cxx_major=7
 
464
                                        _cxx_minor=4
 
465
                                        cxx_verc_fail=no
 
466
                                        add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MDupdate "$(*D)/$(DEPDIR)/$(*F).d"'
 
467
                                        add_line_to_config_mk '-include Makedepend'
 
468
                                        ;;
 
469
                                *)
 
470
                                        cxx_version="$cxx_version, bad"
 
471
                                        cxx_verc_fail=yes
 
472
                                        ;;
 
473
                        esac
 
474
                ;;
 
475
                *)
 
476
                        cxx_version="$cxx_version, bad"
 
477
                        cxx_verc_fail=yes
 
478
                ;;
 
479
        esac
 
480
 
383
481
fi
384
482
 
385
 
case $cxx_version in
386
 
        2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*)
387
 
                _cxx_major=`echo $cxx_version | cut -d '.' -f 1`
388
 
                _cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
389
 
                cxx_version="$cxx_version, ok"
390
 
                cxx_verc_fail=no
391
 
                ;;
392
 
        # whacky beos version strings
393
 
        2.9-beos-991026*|2.9-beos-000224*)      
394
 
                _cxx_major=2
395
 
                _cxx_minor=95
396
 
                cxx_version="$cxx_version, ok"
397
 
                cxx_verc_fail=no
398
 
                ;;
399
 
        3_4)
400
 
                _cxx_major=3
401
 
                _mxx_minor=4
402
 
                ;;
403
 
        'not found')
404
 
                cxx_verc_fail=yes
405
 
                ;;
406
 
        *)
407
 
                cxx_version="$cxx_version, bad"
408
 
                cxx_verc_fail=yes
409
 
                ;;
410
 
esac
411
 
 
412
 
echo "$cxx_version"
413
483
 
414
484
if test "$cxx_verc_fail" = yes ; then
415
485
        echo
416
486
        echo "The version of your compiler is not supported at this time"
417
487
        echo "Please ensure you are using GCC 2.95.x or GCC 3.x"
418
 
        exit 1  
 
488
        #exit 1 
419
489
fi
420
490
 
421
491
#
422
492
# Do CXXFLAGS now we know the compiler version
423
493
#
424
494
 
425
 
if test "$_cxx_major" -ge "3" ; then
426
 
        CXXFLAGS="$CXXFLAGS"
427
 
        _make_def_HAVE_GCC3='HAVE_GCC3 = 1'
428
 
fi;
429
 
 
430
495
if test -n "$_host"; then
431
496
        # Cross-compiling mode - add your target here if needed
432
497
        case "$_host" in
821
886
DATADIR := $_datadir
822
887
PROFILE := $_build_profile
823
888
 
 
889
$_make_def_HAVE_GCC
824
890
$_make_def_HAVE_GCC3
825
891
 
826
892
INCLUDES += $INCLUDES
827
893
OBJS += $OBJS
828
894
DEFINES += $DEFINES
829
895
LDFLAGS += $LDFLAGS
 
896
$_config_mk_data
830
897
EOF
831
898
 
832
899
# This should be taken care of elsewhere, but I'm not sure where