From 14ce3d9fa8700b4c0aa035c86a7e55af905dbf28 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 26 Mar 2021 12:49:35 +0100 Subject: Build: simplify proj.db generation (#2605) - change foreign key check, so that it is enabled outside of the transaction where we insert things, and can make the sqlite3 process fail in case of violations, without the postcheck done in the autoconf build - autoconf and cmake builds: simplification related to the above (which also means that cmake builds now have the fkey check, which was omitted until now) --- data/Makefile.am | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'data/Makefile.am') diff --git a/data/Makefile.am b/data/Makefile.am index b9073bfc..c1d0f8f8 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -127,7 +127,7 @@ EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \ tests/tinshift_crs_implicit.json \ tests/tinshift_simplified_kkj_etrs.json \ tests/tinshift_simplified_n60_n2000.json \ - generate_all_sql_in.cmake sql_filelist.cmake \ + generate_proj_db.cmake sql_filelist.cmake \ $(SQL_ORDERED_LIST) install-data-local: @@ -142,7 +142,6 @@ install-data-local: fi; \ done -# head -c1 not handled on Solaris proj.db: $(DATAPATH)/sql/*.sql @echo "Make proj.db" $(RM) proj.db @@ -161,22 +160,12 @@ proj.db: $(DATAPATH)/sql/*.sql echo "Build of proj.db failed"; \ $(RM) proj.db; \ exit 1; \ - fi; \ - echo "" | head -c1; \ - if [ $$? -eq 0 ] ; then \ - echo "Running foreign_key_check"; \ - if [ $$(echo "pragma foreign_key_check;" | sqlite3 proj.db | head -c1 | wc -c) -ne 0 ]; then \ - echo "Foreign key check failed"; \ - $(RM) proj.db; \ - exit 1; \ - else \ - if test "x$(PROJ_DB_CACHE_DIR)" != "x" -a -x "$$(command -v md5sum)" ; then \ + fi; \ + if test "x$(PROJ_DB_CACHE_DIR)" != "x" -a -x "$$(command -v md5sum)" ; then \ mkdir -p "$(PROJ_DB_CACHE_DIR)"; \ cat $${SQL_EXPANDED_LIST} | md5sum > "$(PROJ_DB_CACHE_DIR)/proj.db.sql.md5"; \ cp proj.db "$(PROJ_DB_CACHE_DIR)"; \ - fi \ - fi \ - fi + fi # For out-of-tree builds, link all file of the source data dir to the generated data # Also link select resource files in a for_tests subdirectory so that we are not -- cgit v1.2.3