Comment 60 for bug 457791

Revision history for this message
In , Ehsan Akhgari (ehsan) wrote :

Created an attachment (id=416474)
configure patch

(In reply to comment #50)
> (From update of attachment 414125 [details])
> I think you have at least two problems here, that I can see.
> One--configure.in is made up of M4 macros, which use square brackets [] as
> quoting characters. Thus, you can't use them in your program text as-is,
> they'll be removed. There is a function called 'changequote' that you can use
> to work around this. It's a little convoluted, but you can see an example in
> our configure.in in an mmap test, it's under the heading "See if mmap sees
> writes". (I'd link it, but I'm writing this on a plane.)

I solved this problem in the least controversial fassion: getting rid of the square brackets inside the C source (yes, a malloc and pointer arithmetic)! So, there is no longer any square brackets in the program to worry about. :-)

> 2) You probably need to get SQLITE_CFLAGS into CFLAGS and SQLITE_LIBS into
> LDFLAGS in order to compile and link the test program. You can find numerous
> examples in configure.in of tests that do this. They generally save the old
> values in variables like _SAVE_CFLAGS and _SAVE_LDFLAGS, run the test, then
> restore the old values from those variables.

Done. (I assume you meant integrating SQLITE_LIBS into LIBS, not LDFLAGS, is that correct?)

Also, I added an actual check to make sure that the executed program finishes successfully (using AC_MSG_ERROR).

I think the patch is correct now. Testing this patch with --enable-system-sqlite on my Mac machine now aborts the configure process with an error, which is the expected behavior.