title: Am I using libtool correctly?
body: <p>I am running Linux, Ubuntu 10.04 .</p>
  
  <p>It is not the first time I try to use autotools. I did a lot of researches and follow a lot of tutorials : here is what I want to do, what I tried and what issue I am facing.</p>
  
  <p><strong>Goal</strong> :</p>
  
  <ul>
  <li>compile (and then cross-compile, but this will be an other job) my own library coded in C using libtool, autoconf and automake</li>
  </ul>
  
  <p><strong>What I tried and where I am</strong> :</p>
  
  <ul>
  <li><p>The library name is FXPLib, the package name is libfxplib-0.1</p></li>
  <li><p>My project folder is :</p>
  
  <pre><code>Makefile.am (the only one)
  include
  include/fxplib.h (main header)
  include/FXPLib
  include/FXPLib/header1.h (these are public headers)
  include/FXPLib/header2.h
  include/FXPLib/...
  src
  src/sub1/file1.c
  src/sub2/file1.c
  src/sub3 ...
  </code></pre></li>
  <li><p>I ran autoscan, got a configure.ac, edited it as here :</p>
  
  <pre><code>#                                               -*- Autoconf -*-
  # Process this file with autoconf to produce a configure script.
  
  AC_PREREQ([2.65])
  AC_INIT([libfxplib-0.1], [0.1], [&lt;&gt;])
  AC_CONFIG_SRCDIR([src/object_system/FXP_image_s.h])
  AC_CONFIG_HEADERS(config.h)
  
  AC_CONFIG_MACRO_DIR([m4])
  
  AM_INIT_AUTOMAKE
  AM_PROG_LIBTOOL
  
  LT_PREREQ([2.2])
  LT_INIT
  
  # Checks for programs.
  AC_PROG_CC
  AC_PROG_MAKE_SET
  
  # Checks for libraries.
  
  # Checks for header files.
  AC_CHECK_HEADERS([stdlib.h])
  
  # Checks for typedefs, structures, and compiler characteristics.
  AC_HEADER_STDBOOL
  
  # Checks for library functions.
  AC_FUNC_MALLOC
  AC_FUNC_REALLOC
  AC_CHECK_FUNCS([memset])
  
  AC_CONFIG_FILES([Makefile])
  AC_OUTPUT
  </code></pre></li>
  <li><p>I wrote Makefile.am like this :</p>
  
  <pre><code>lib_LTLIBRARIES = libfxplib-0.1.la
  libfxplib_0_1_la_CFLAGS = -I$(srcdir)/include -I$(srcdir)/include/FXPLib `sdl-config --cflags --libs` -lSDL_image
  libfxplib_0_1_la_SOURCES = src/sub1/file1.c \
                             src/sub1/file2.c \
                             src/sub2/file1.h \
                             ...
  nobase_include_HEADERS = include/fxplib.h \
                           include/FXPLib/header1.h \
                           include/FXPLib/header2.h \
                           ...
  ACLOCAL_AMFLAGS = -I m4
  </code></pre></li>
  <li>Then I ran <em>aclocal</em> and <em>autoheader</em> to get files needed by automake</li>
  <li>Then the most important : <em>autoconf</em></li>
  <li>And : <em>automake --add-missing --copy</em></li>
  </ul>
  
  <p>From there, everything is ok. But then I try to compile :</p>
  
  <pre><code>$ ./configure
  </code></pre>
  
  <p>Everything ok too...</p>
  
  <pre><code>$ make
  </code></pre>
  
  <p>and then I get :</p>
  
  <pre><code>...
  src/graphics_engine/FXP_rendering.c:35:25: error: FXP_image_s.h: File not found
  ...
  </code></pre>
  
  <p>where :</p>
  
  <ul>
  <li>"graphics_engine" <em>is equivalent to</em> src/<strong>sub</strong></li>
  <li>"FXP_rendering.c" <em>to</em> src/sub/<strong>file.c</strong></li>
  <li>"FXP_image_s.h" <em>to</em> src/sub2/<strong>header.h</strong></li>
  </ul>
  
  <p>This means : automake can compile .c files in a sub directory, but can't include in these files a private .h file that is in an other sub directory.</p>
  
  <p><strong>My problem is</strong> : How to tell automake to compile every files in every subdirectories as if they were all in the same place ?</p>
  
  <p>I hope I am understandable (and sorry for some problems you could find in my words, cause I am French)</p>
  
  <p>Thank you by advance.</p>