Solved GNU autotools on FreeBSD

This is probably more of a general question, but I'm trying to assist a developer in porting his application to FreeBSD. His application uses GNU's autotools to do the initial configuration. I'm not sure about the exact reason, but he wants to ensure that the program is built using GNU's assembler from binutils instead of the LLVM/Clang assembler even if Clang is doing the compilation. But when the configure script runs, it finds and uses /usr/bin/as which is the ancient 2.17.50 version in the base system instead of the recent 2.33.1 version from ports located at /usr/local/bin/as. As a result of the old version, compilation fails. Is there some way I can modify the configure script so that it automatically detects whether it's being configured on Linux or FreeBSD and then, if it detects FreeBSD, it will use the binutils from ports instead of the one in the base system without the user having to tinker with additional command line arguments, modifying files, etc.? I was planning to look into this during my free time this weekend, but I'd appreciate it if anyone knows how or can point me in the right direction.

I realize that once the software is ported to FreeBSD, the ports system can handle a lot of this kind of stuff, but right now we need to make sure that manual configuration and compilation works smoothly.
 
Okay. I solved my issue. Basically autoconf was finding /usr/bin/as because it was first in the search path. I just had to edit the search path so that it searched /usr/local/bin before /usr/bin, and then I had to ensure it called as by an absolute path name (/usr/local/bin/as) instead of just as. So my change was:

-AC_CHECK_PROGS([AS], [i386-elf-as as])
+AC_PATH_PROGS([AS], [i386-elf-as as], [], [/usr/local/bin$PATH_SEPARATOR$PATH])

in the configure.ac file.
 
Back
Top