Merge pull request #276 from mdbtools/no-sql

Don't build/install mdb-sql if SQL is not supported
This commit is contained in:
Evan Miller 2021-08-04 14:12:20 -04:00 committed by GitHub
commit 1b147b8d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 13 deletions

View File

@ -4,15 +4,21 @@ PRODUCT = MDBTools
dist_man_MANS =
if ENABLE_MAN
dist_man_MANS += mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \
dist_man_MANS += mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 \
mdb-array.1 mdb-header.1 mdb-hexdump.1 mdb-parsecsv.1 mdb-prop.1 mdb-import.1 \
mdb-count.1 mdb-json.1 mdb-queries.1
if SQL
dist_man_MANS += mdb-sql.1
endif
endif
CLEANFILES = ${dist_man_MANS}
EXTRA_DIST = mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.txt \
EXTRA_DIST = mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt \
mdb-array.txt mdb-header.txt mdb-hexdump.txt mdb-parsecsv.txt mdb-prop.txt mdb-import.txt \
mdb-count.txt mdb-json.txt mdb-queries.txt \
txt2man
if SQL
EXTRA_DIST += mdb-sql.txt
endif
.txt.1:
$(TXT2MAN) -t $* -r "$(PRODUCT) $(VERSION)" -s 1 -v "Executable programs or shell commands" $(srcdir)/$< > $@

View File

@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = bash-completion
bin_PROGRAMS = mdb-export mdb-array mdb-schema mdb-tables mdb-parsecsv mdb-header mdb-sql mdb-ver mdb-prop mdb-count mdb-queries mdb-json
bin_PROGRAMS = mdb-export mdb-array mdb-schema mdb-tables mdb-parsecsv mdb-header mdb-ver mdb-prop mdb-count mdb-queries mdb-json
noinst_PROGRAMS = mdb-import prtable prcat prdata prkkd prdump prole updrow prindex
noinst_HEADERS = base64.h
LIBS = $(GLIB_LIBS) @LIBS@
@ -8,5 +8,6 @@ DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
AM_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) -Wsign-compare
LDADD = ../libmdb/libmdb.la
if SQL
bin_PROGRAMS += mdb-sql
mdb_sql_LDADD = ../libmdb/libmdb.la ../sql/libmdbsql.la $(LIBREADLINE)
endif

View File

@ -51,8 +51,6 @@ extern void clear_history ();
void dump_results(FILE *out, MdbSQL *sql, char *delimiter);
void dump_results_pp(FILE *out, MdbSQL *sql);
#if SQL
int headers = 1;
int footers = 1;
int pretty_print = 1;
@ -516,11 +514,3 @@ main(int argc, char **argv)
return 0;
}
#else
int main(int argc, char **argv)
{
fprintf(stderr,"You must configure using --enable-sql to get SQL support\n");
return -1;
}
#endif