Skip to content
  • Simon McVittie's avatar
    build: Check that the compiler and --host are consistent · 8bf9b114
    Simon McVittie authored
    
    
    libcapsule's use with biarch containers like the Steam Runtime will
    frequently make it necessary to compile it for both x86_64 and i386.
    
    On recent Debian-derived OSs this is OK, because the toolchain is
    provided as a complete set of cross-compiler-style prefixed tools like
    i686-linux-gnu-gcc; but some OSs, like Arch Linux and very old versions
    of Debian, rely on 'gcc -m32' for their biarch support. This makes it
    very easy to do
    
        ./configure --build=x86_64-linux-gnu --host=i686-linux-gnu
    
    and accidentally produce x86_64 binaries, because there is no
    i686-linux-gnu-gcc. Give the user a hint towards the correct invocation
    in this case, which is:
    
        ./configure --build=x86_64-linux-gnu --host=i686-linux-gnu CC='gcc -m32'
    
    I've implemented this as a reusable macro, in case we want to add it to
    other projects that are likely to be cross-compiled by inexperienced
    cross-compiler users.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
    8bf9b114