Changeset 1395

Show
Ignore:
Timestamp:
10/29/08 15:54:17 (12 years ago)
Author:
arnonym
Message:

Forward-port the changes to the configure-checks to fix #69 (r1389 - r1393).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/SConstruct

    r1353 r1395  
    164164def CompilerCheck( context ): 
    165165        context.Message( "Checking for a working C-compiler " ) 
    166         ret = context.TryLink( """ 
     166        ret = context.TryRun( """ 
    167167#include <stdlib.h> 
    168168 
     
    170170        printf( "Hello World!" ); 
    171171        return 0; 
    172 }""", '.c' ) 
     172}""", '.c' )[0] 
    173173        context.Result( ret ) 
    174174        if ret == 0: 
    175175                return False; 
    176176        context.Message( "Checking for a working C++-compiler " ) 
    177         ret = context.TryLink( """ 
     177        ret = context.TryRun( """ 
    178178#include <iostream> 
    179179 
     
    181181        std::cout << "Hello World!" << std::endl; 
    182182        return 0; 
    183 }""", ".cpp" ) 
     183}""", ".cpp" )[0] 
    184184        context.Result( ret ) 
    185185        return ret 
     
    206206 
    207207if not env.GetOption('clean'): 
    208 #       # 
    209 #       # Check if the environment can actually compile c-files by checking for a 
    210 #       # header shipped with gcc. 
    211 #       # 
    212 #       if not conf.CheckHeader( "stdio.h", language="C" ): 
    213 #               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." 
    214 #               Exit( 1 ) 
    215 #       # 
    216 #       # ... and do the same with a c++-header. Because some distributions have 
    217 #       # distinct packages for gcc and g++. 
    218 #       # 
    219 #       if not conf.CheckHeader( "iostream", language="C++" ): 
    220 #               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." 
    221 #               Exit( 1 ) 
    222  
    223208        # 
    224         # Seems as if the above tests don't really work. This one should do the trick!? 
     209        # Check for working gcc and g++ compilers and their environment. 
    225210        # 
    226211        if not conf.CompilerCheck(): 
    227                 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)." 
     212                print "\nIt 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++." 
     213                Exit( 1 ) 
     214 
     215        # Check for pkg-config before using pkg-config to check for other dependencies. 
     216        if not conf.CheckForPKGConfig(): 
     217                print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions." 
    228218                Exit( 1 ) 
    229219 
     
    236226        allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' ) 
    237227         
    238         allpresent &= conf.CheckForPKGConfig(); 
    239  
    240228        pkgs = { 
    241229                'libraw1394' : '1.3.0', 
     
    643631    env.NoCache( "tags", "TAGS" ) 
    644632 
     633# Another convinience target 
     634if env.GetOption( "clean" ): 
     635        env.Execute( "rm cache/objects -Rf" ) 
     636