Hi, in a project of mine, I ship versions of getopt and getopt_long for backwards compatibility with older systems. I test for the existence of these functions in the OS with Autoconf, and if I don't find them I define:
if test "x$have_getopt_h" != "xyes" -o "x$have_getopt" != "xyes"; then AC_MSG_RESULT([Using our own version instead.]) CPPFLAGS="$CPPFLAGS -Ilibgetopt" AC_LIBOBJ(libgetopt/getopt) AC_LIBOBJ(libgetopt/getopt1) fi Now my problem is that Automake will add the files libgetopt/getopt.o libgetopt/getopt1.o to the list of dependencies, but these paths aren't right, because the compiled objects will be placed in ./getopt.o ./getopt1.o ..., not in the libgetopt directory. Thus, compilation fails because the linker won't find the files. Is there any simple way to fix this? Preferably one that does not involve moving my files in the repository? Peter