SQLite Forum

AMALGAMATION_LINE_MACROS in configure.ac
Login

AMALGAMATION_LINE_MACROS in configure.ac

(1) By Jan Palus (jpalus) on 2021-11-28 20:59:31 [link] [source]

sqlite 3.37.0 introduced new changes to build process including, but not limited to, AMALGAMATION_LINE_MACROS macro. It is used in Makefile.in, it appears to be handled in generated configure, but I cannot seem to figure how it gets into generated configure script. I suppose it should be somewhere in configure.ac but so far had no luck in finding it. If I need to regenerate configure by rerunning autotools how do I make AMALGAMATION_LINE_MACROS appear there?

(2) By Larry Brasfield (larrybr) on 2021-11-28 23:04:15 in reply to 1 [source]

It's not in configure's --help output, so it can be tricky to trace back how to get it. We thought it would be more useful than turned out to be the case, so it is not a documented feature. (That could change if it does prove truly useful.)

To get #line preprocessor directives into the generated amalgamation, run:

    env amalgamation_line_macros=yes ./configure --enable-all
or whatever configure options you like. Or just preset the same environment variable the same way. Setting it to "no" or not setting it will suppress #line directive generation.

(3) By Jan Palus (jpalus) on 2021-11-28 23:33:41 in reply to 2 [link] [source]

My point is that configure is generated script based on configure.ac, but after regeneration AMALGAMATION_LINE_MACROS handling seems to be lost.

$ grep AMALGAMATION_LINE_MACROS configure
AMALGAMATION_LINE_MACROS
AMALGAMATION_LINE_MACROS=--linemacros=0
  AMALGAMATION_LINE_MACROS=--linemacros=1
  AMALGAMATION_LINE_MACROS=--linemacros=0
$ autoreconf
$ grep AMALGAMATION_LINE_MACROS configure
$

(4) By Jan Palus (jpalus) on 2021-12-03 20:44:16 in reply to 3 [link] [source]

Anyways linking patch that we use in case anyone also needs to regenerate configure and hits build failure due to unsubstituted @AMALGAMATION_LINE_MACROS@ in Makefile.in:

sqlite3-amalgamation_configure.patch

(5) By Larry Brasfield (larrybr) on 2021-12-03 22:16:48 in reply to 4 [link] [source]

Jan,

Do you believe that patch accomplishes something more than this checkin?

If so, I would like to understand what and gain that additional functionality.

BTW, thanks for the prompt and fix on this.

(6) By Jan Palus (jpalus) on 2021-12-04 10:57:07 in reply to 5 [link] [source]

I believe it's exactly the same Larry. All my patch did was to carry new logic in configure to configure.ac. Before creating patch I actually checked commit history but somewhat expected commit message to include "amalgamation" and hence rolled my own :) Great to see it upstream now though. Thanks!