Skip to content
  • Thomas Haller's avatar
    build: avoid AC_CHECK_FILE() due to problems with cross-compilation · 81e5b262
    Thomas Haller authored
    AC_CHECK_FILE() does not work for cross compilation. Autoconf
    documentation says:
    
      Be aware that, like most Autoconf macros, they test a feature of the
      host machine, and therefore, they die when cross-compiling. [1]
    
    Test for the existance of the file directly. Of course, when cross
    compiling, it's not at all clear that the host machine will run the same
    distribution. And thus detecting --enable-ifcfg-rh based on the build
    machine is likely wrong. Note, that we already did
    
        AS_IF([test -z "$hostname_persist" -a -f /etc/SuSE-release], hostname_persist=suse)
    
    which has the same problem.
    
    At least, build no longer fails, and the user can inspect the ./configure
    summary and see which features were misdetected.
    
    [1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Files.html
    81e5b262