Search code examples
ubuntudockerconfigureautoconf

autoconf configure warning: /usr/bin/file: No such file or directory


When I use my configure in a ubuntu OS (16), there seems to be no problem. I have installed the autoconf tool and dependencies.

When I run the same configure file in a ubuntu (16 or latest) The problems is that I did not install any autotools. I am getting the following error message.

./configure: line 7022: /usr/bin/file: No such file or directory

This is harmless to the build process. I just want to understand what's going on. The configure file:

7022     case `/usr/bin/file conftest.o` in
7023       *32-bit*)

It looks that my docker does not have /usr/bin/file. Which ubuntu packages contain the file utility. The problem with finding any useful information about '/usr/bin/file' is that file is such a common term, it is not easy to find more info. On my system with the file utility, I can get the following info from the man page of file:

AVAILABILITY
     You can obtain the original author's latest version by anonymous FTP on ftp.astron.com in the direc‐
     tory /pub/file/file-X.YZ.tar.gz.

My question: is 'file' a very basic utility or it is recently added to the autotolls package? Should I install it?


Solution

  • The GNU Build System restricts the features that configure is supposed to use for maximum compatibility, including how to write shell code and which utilities are available for use, and features you can expect out of those utilities.

    file is not in that list, and should be tested for with AC_PATH_PROG (or something like that) and so is really a bug in the package. Even if the test in configure absolutely requires file to work getting an AC_MSG_ERROR saying "Install the file program" would be preferable to decoding the error message.

    So to answer your questions:

    is 'file' a very basic utility or it is recently added to the autotolls package?

    No, file is not part of autotools, but it's a pretty common utility to be installed. Basic might not be the best adjective to describe file.

    Should I install it?

    Your configure script relies on it, so I guess you have to.

    But it's usage is kind of silly: Most of the time you can determine the architecture from the host triplet. Also, objdump is one of the standard compiler tools (objdump -f conftest.o will display similar info). At least it's going to be installed.