Changeset 1389

Show
Ignore:
Timestamp:
10/29/08 14:20:22 (12 years ago)
Author:
arnonym
Message:

This should be the nail on #69's coffin.

Somehow the compile doesn't fail when there is no compiler found... Trying to execute the generated app and failing seems to do the trick.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/SConstruct

    r1371 r1389  
    160160def CompilerCheck( context ): 
    161161        context.Message( "Checking for a working C-compiler " ) 
    162         ret = context.TryLink( """ 
     162        ret = context.TryRun( """ 
    163163#include <stdlib.h> 
    164164 
     
    166166        printf( "Hello World!" ); 
    167167        return 0; 
    168 }""", '.c' ) 
     168}""", '.c' )[0] 
    169169        context.Result( ret ) 
    170170        if ret == 0: 
    171171                return False; 
    172172        context.Message( "Checking for a working C++-compiler " ) 
    173         ret = context.TryLink( """ 
     173        ret = context.TryRun( """ 
    174174#include <iostream> 
    175175 
     
    177177        std::cout << "Hello World!" << std::endl; 
    178178        return 0; 
    179 }""", ".cpp" ) 
     179}""", ".cpp" )[0] 
    180180        context.Result( ret ) 
    181181        return ret 
     
    202202 
    203203if not env.GetOption('clean'): 
    204 #       # 
    205 #       # Check if the environment can actually compile c-files by checking for a 
    206 #       # header shipped with gcc. 
    207 #       # 
    208 #       if not conf.CheckHeader( "stdio.h", language="C" ): 
    209 #               print "It seems as if stdio.h is missing. This probably means that your build environment is broken, please make sure you have a working c-compiler and libstdc installed and usable." 
    210 #               Exit( 1 ) 
    211 #       # 
    212 #       # ... and do the same with a c++-header. Because some distributions have 
    213 #       # distinct packages for gcc and g++. 
    214 #       # 
    215 #       if not conf.CheckHeader( "iostream", language="C++" ): 
    216 #               print "It seems as if iostream is missing. This probably means that your build environment is broken, please make sure you have a working c++-compiler installed and usable." 
    217 #               Exit( 1 ) 
    218  
    219204        # 
    220         # Seems as if the above tests don't really work. This one should do the trick!? 
     205        # Check for working gcc and g++ compilers and their environment. 
    221206        # 
    222207        if not conf.CompilerCheck(): 
    223                 print "It seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages (Hint: on *ubuntu you need both gcc- and g++-packages installed)." 
     208                print "It seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++." 
    224209                Exit( 1 ) 
    225210