Skip to content
  • Paolo Bonzini's avatar
    a2866660
    configure: propagate --extra-cflags and --extra-ldflags to meson compile tests · a2866660
    Paolo Bonzini authored
    
    
    Meson (intentionally) does not add QEMU_CFLAGS to cc.compiles/cc.links
    tests, as they are supposed to be independent of the specific sets of
    compilation flags used to build the programs.  However, the user can
    still use CFLAGS or the toolchain file's LANG_args/LANG_link_args option
    to specify -I or -L options that apply to cc.compiles/cc.links as well.
    
    This is also the intended use of configure's --extra-cflags,
    --extra-cxxflags and --extra-ldflags options.  For example, if
    one has netmap's header in a nonstandard directory, up to commit
    837b84b1 it used to work fine to do:
    
    .../configure --enable-netmap \
         --extra-cflags=-I/path/to/netmap/sys
    
    but since the test was converted to meson, this does not work anymore.
    
    Pass these options to meson via the toolchain file instead of via
    config-host.mak, since both have the same purpose.
    
    Reported-by: Owen LaGarde
    Reported-by: default avatarThomas Huth <thuth@redhat.com>
    Fixes: 47b30835 ("configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson", 2020-10-06)
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    a2866660
    configure: propagate --extra-cflags and --extra-ldflags to meson compile tests
    Paolo Bonzini authored
    
    
    Meson (intentionally) does not add QEMU_CFLAGS to cc.compiles/cc.links
    tests, as they are supposed to be independent of the specific sets of
    compilation flags used to build the programs.  However, the user can
    still use CFLAGS or the toolchain file's LANG_args/LANG_link_args option
    to specify -I or -L options that apply to cc.compiles/cc.links as well.
    
    This is also the intended use of configure's --extra-cflags,
    --extra-cxxflags and --extra-ldflags options.  For example, if
    one has netmap's header in a nonstandard directory, up to commit
    837b84b1 it used to work fine to do:
    
    .../configure --enable-netmap \
         --extra-cflags=-I/path/to/netmap/sys
    
    but since the test was converted to meson, this does not work anymore.
    
    Pass these options to meson via the toolchain file instead of via
    config-host.mak, since both have the same purpose.
    
    Reported-by: Owen LaGarde
    Reported-by: default avatarThomas Huth <thuth@redhat.com>
    Fixes: 47b30835 ("configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson", 2020-10-06)
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading