[Box Backup-dev] Makefile.extra?

James O'Gorman boxbackup-dev@fluffy.co.uk
Sun, 26 Feb 2006 20:35:21 +0000


Martin Ebourne wrote:
> On Sun, 2006-02-26 at 18:05 +0000, James O'Gorman wrote:
>> It wasn't in BoxConfig.h. Adding these lines into configure.ac does it, 
>> but is this OK, and should these stay in configure.ac or in the 
>> infrastructure/m4 directory?
>>
>> AC_PROG_PATH([PERL], [perl], [no])
>> if test "x$PERL" != "xno"; then
>>    AC_SUBST([PERL])
>>    AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$PERL"], [Location of the 
>> perl executable])
>> fi
> 
> Yes, that looks fine. Sorry, should have said AC_DEFINE_UNQUOTED, not
> AC_SUBST. In fact, I think AC_DEFINE_UNQUOTED will AC_SUBST for you so
> that may not be needed.

OK, I'll try that, thanks. Actually, I think the manual did say that 
AC_PROG_PATH would run AC_SUBST as well, but I prefer to do things 
explicitly until I'm absolutely sure. I'll give it a go though.

> Do you really not want to define it if perl is not available? Would it
> not be better to error on no perl? If you don't error you need to
> usefully handle the case where it does not exist, which seems unlikely.

Yes, I did think of that afterwards, so added

else
   AC_MSG_ERROR([[perl executable was not found]])
fi

> In configure.ac is fine. I split things out into inf/m4 when they become
> a bit on the large/complex side, to keep configure.ac small and easy to
> read. This is very modular so could be split, but then it's also only a
> few lines, so it doesn't gain much.

Ah, OK, that makes sense.

Cheers,

James