Browse Source

[3929] pass input file path into mk_cfgrpt.sh

Added required input config report file parameter to
mk_cfgrpt.sh rather than having hard-coded by configure.

This allows cfgrpt/Makefile to pass in the pathname of
the report file it used in its "config_report.cc", as
the input report file.  In other words, we garuantee that
the file we used for change is the same file we generate
the source from.
Thomas Markwalder 10 years ago
parent
commit
c2c8a9087c
4 changed files with 8 additions and 8 deletions
  1. 0 2
      configure.ac
  2. 5 2
      src/lib/cfgrpt/Makefile.am
  3. 0 1
      tools/.gitignore
  4. 3 3
      tools/mk_cfgrpt.sh.in

+ 0 - 2
configure.ac

@@ -1495,7 +1495,6 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  src/lib/util/threads/tests/Makefile
                  src/lib/util/unittests/Makefile
                  tools/path_replacer.sh
-                 tools/mk_cfgrpt.sh
 ])
 
  AC_CONFIG_COMMANDS([permissions], [
@@ -1514,7 +1513,6 @@ AC_CONFIG_FILES([compatcheck/Makefile
            chmod +x src/lib/util/python/gen_wiredata.py
            chmod +x src/lib/util/tests/process_spawn_app.sh
            chmod +x tools/path_replacer.sh
-           chmod +x tools/mk_cfgrpt.sh
 ])
 
 AC_OUTPUT

+ 5 - 2
src/lib/cfgrpt/Makefile.am

@@ -13,6 +13,9 @@ noinst_LTLIBRARIES = libcfgrpt.la
 nodist_libcfgrpt_la_SOURCES = config_report.cc
 libcfgrpt_la_SOURCES = config_report.h cfgrpt.cc
 
+# set pathname to the input configuration report
+report_file = $(abs_top_builddir)/config.report
+
 # Generate config_report.cc
-config_report.cc: $(abs_top_builddir)/config.report
-	$(abs_top_builddir)/tools/mk_cfgrpt.sh $(abs_top_builddir)/src/lib/cfgrpt/config_report.cc
+config_report.cc: $(report_file)
+	${SHELL} $(top_srcdir)/tools/mk_cfgrpt.sh $(report_file) $(top_builddir)/src/lib/cfgrpt/config_report.cc

+ 0 - 1
tools/.gitignore

@@ -1,2 +1 @@
 /path_replacer.sh
-/mk_cfgrpt.sh

+ 3 - 3
tools/mk_cfgrpt.sh.in

@@ -17,8 +17,8 @@
 # Called by configure
 #
 
-dest="$1"
-report_file="@abs_top_builddir@/config.report"
+report_file="$1"
+dest="$2"
 
 if [ -z ${report_file} ]
 then
@@ -36,7 +36,7 @@ fi
 
 # Header
 cat >> $dest << END
-// config_report.cc. Generated from config.report by tools/mk_cfgrpt_header.sh
+// config_report.cc. Generated from config.report by tools/mk_cfgrpt.sh
 
 namespace isc {
 namespace detail {