Skip to content

Commit a10c393

Browse files
committed
fix for SQL*PLUS meson build failed
1 parent ad6fbca commit a10c393

4 files changed

Lines changed: 24 additions & 2 deletions

File tree

src/bin/psql/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ OBJS = \
4444
startup.o \
4545
stringutils.o \
4646
tab-complete.o \
47+
psqlplusscan.o \
4748
variables.o
4849

4950

@@ -52,6 +53,13 @@ all: psql
5253
psql: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
5354
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
5455

56+
# See notes in src/backend/parser/Makefile about the following two rules
57+
psqlplusparse.h: psqlplusparse.c
58+
touch $@
59+
psqlplusparse.c: BISONFLAGS += -d
60+
# Force these dependencies to be known even without dependency info built:
61+
psqlplusparse.o psqlplusscan.o: psqlplusparse.h
62+
5563
help.o: sql_help.h
5664

5765
# ReqID:SRS-CMD-PSQL

src/bin/psql/meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ ora_psqlscanslash = custom_target('ora_psqlscanslash',
3232
generated_sources += ora_psqlscanslash
3333
psql_sources += ora_psqlscanslash
3434

35+
psqlplusscan = custom_target('psqlplusscan',
36+
input: 'psqlplusscan.l',
37+
output: 'psqlplusscan.c',
38+
command: [flex_cmd, '--no-backup', '--fix-warnings', '--', '-Cfe', '-p', '-p'])
39+
generated_sources += psqlplusscan
40+
psql_sources += psqlplusscan
41+
psqlplusparse = custom_target('psqlplusparse',
42+
input: 'psqlplusparse.y',
43+
kwargs: bison_kw,
44+
)
45+
generated_sources += psqlplusparse.to_list()
46+
psql_sources += psqlplusparse
47+
3548
sql_help = custom_target('psql_help',
3649
output: ['sql_help.c', 'sql_help.h'],
3750
depfile: 'sql_help.dep',

src/bin/psql/psqlplusparse.y

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,3 @@ merge_print_list(print_list *list1, print_list *list2)
542542
/* ... and the yylval macro, which flex will have its own definition for */
543543
#undef yylval
544544

545-
#include "psqlplusscan.c"

src/bin/psql/psqlplusscan.l

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
*-------------------------------------------------------------------------
1818
*/
1919

20+
#include "postgres_fe.h"
2021
#include "common/string.h"
2122
#include "fe_utils/psqlscan_int.h"
2223
#include "libpq-fe.h"
2324
#include "psqlplus.h"
25+
#include "psqlplusparse.h"
2426

2527
/* LCOV_EXCL_START */
2628

@@ -573,4 +575,4 @@ litbufdup(char *prefix, yyscan_t yyscanner)
573575
memcpy(new + plen, state->literalbuf, llen);
574576
new[llen + plen] = '\0';
575577
return new;
576-
}
578+
}

0 commit comments

Comments
 (0)