title: configure.ac: Library and headers not usable and not present
body: <p>I have implemented a logging library in C (which I've named liblogger), and used Autotools to compile and install it. As far as I can see, the installation is correctly done, since the headers and the library itself (which I currently bundle into a static library) are installed into the appropriate directories (/usr/local/include/liblogger/ for the headers and /usr/local/lib for the .a).</p>
  <p>Now I am trying to link another tool with that library (compiled and built also using Autotools). To check for the logging library presence, I have followed what is said <a href="https://stackoverflow.com/questions/2751541/autoconf-including-a-static-library-newbie">here</a> to create the configure.ac file. But the resulting configure script says:</p>
  <blockquote>
  <p>checking /usr/local/include/liblogger/logger.h usability... no</p>
  <p>checking /usr/local/include/liblogger/logger.h presence... no</p>
  <p>checking for /usr/local/include/liblogger/logger.h... no</p>
  <p>checking for log_init in -l/usr/local/lib/liblogger.a... no</p>
  </blockquote>
  <p>even though the named files <strong>DO</strong> exist.</p>
  <p>The part of the configure.ac file where I check for the header and the library is as follows:</p>
  <pre><code>LIBLOGGER=/usr/local/lib
  HEADERLOGGER=/usr/local/include/liblogger
  
  AC_CHECK_HEADER([${HEADERLOGGER}/logger.h],
      [AC_DEFINE([HAVE_LOGGER_H], [1], [found logger.h])
      CFLAGS=&quot;$CFLAGS -I${HEADERLOGGER}&quot;])
  
  AC_CHECK_LIB([${LIBLOGGER}/liblogger.a],
      log_init, [found liblogger.a], [], [])
  
  AC_SUBST(LIBLOGGER)
  </code></pre>
  <p>Actually, if I try with:</p>
  <pre><code>AC_CHECK_FILE(
     [${HEADERLOGGER}/logger.h],
     [AC_MSG_NOTICE([Found logger.h])],
     [AC_MSG_NOTICE([Didn't find logger.h])]
     )
  </code></pre>
  <p>it <strong>does</strong> find the file.</p>
  <p>Thanks.</p>