grinsfem/grins — pull request #127 by pbauman (2014-06-16 16:08:05+00:00)
Title: Subdir objects

This PR enables the automake subdir_objects option. Main impetus is squashing the warning emitted by automake (as of 1.13? 1.14?) about possible future incompatibilities. The real PITA with this was dealing with the header-stamping perl script. You cannot do something like `$(top_srcdir/src/file)` when declaring `SOURCES` to automake and using subdir_objects, it must be `file`. But, to have the header stamping work for VPATH builds, we need something like `$(top_srcdir)`. My original solution (after talking with @dmcdougall and @RhysU) was some make foo that used `$(shell)`. However, `$(shell)` is a GNU make extension and automake gives a warning about this. So, instead of turning off that warning (-Wno-portability), I followed some advice in (this)[http://lists.gnu.org/archive/html/automake/2008-08/msg00032.html] thread and moved building of the file list to configure.ac. The catch there is that the search variables that supposedly supposed to be available (e.g. `$ac_top_srcdir`) are not. Googling revealed that calling the `_AC_SRCDIRS(.)` macro will define what we need. However, the intent seems that that macro is not supposed to be "public" and I worry about it changing in the future. So, I've tried to leave comments in about alternative hacking I did that worked in case it does change from underneath us in the future. I also left my GNU make version in comments in case we need to fall back to it someday.