summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorNarayanan V <v.narayanan@sun.com>2008-06-17 17:57:04 +0530
committerNarayanan V <v.narayanan@sun.com>2008-06-17 17:57:04 +0530
commit72b74d581262c08233db28999e85fb46eb94811a (patch)
treeb0d5eb8e666ebabca0056cca48f0e34cc04d904c /Makefile.am
parent71d26d2ff19f649e70d953b0020378ccdd96278d (diff)
downloadmariadb-git-72b74d581262c08233db28999e85fb46eb94811a.tar.gz
WL#4380
added a rule that use gcc to generate preprocessor output (gcc -E) that can be then compared to a already generated output using the diff utility. Ran make test on the repository to verify changes. Makefile.am: Added a rule for checking that the abi/api has not changed. The following steps are followed in the rule in makefile.am 1) Generate preprocessor output for the files that need to be tested for abi/api changes. use -nostdinc to prevent generation of preprocessor output for system headers. This results in messages in stderr saying that these headers were not found. Redirect the stderr output to /dev/null to prevent seeing these messages. 2) sed the output to remove blank lines and lines that begin with # (The header information is retained to enable easy analysis of abi diffs at a later stage). 3) diff the generated file and the canons (.pp files already in the repository). 4) delete the .out file that is generated. If the diff fails, the generated file is not removed. This will be useful for analysis of ABI differences (e.g. using a visual diff tool). A ABI change that causes a build to fail will always be accompanied by new canons (.out files). The .out files that are not removed will be replaced as the new .pp files. e.g. If include/mysql/plugin.h has an ABI change then this rule would leave a include/mysql/plugin.out file. A developer with a justified API change will then do a mv include/mysql/plugin.out include/mysql/plugin.pp to replace the old canons with the new ones. configure.in: 1) Removed the part of the file that was icheck related. 2) Added an entry for the configure variable DIFF include/mysql.h.pp: The pre-processor output canon file for include/mysql.h include/mysql/plugin.h.pp: The pre-processor output canon file for include/mysql/plugin.h include/mysql_h.ic: since the icheck target has been removed, this file need no longer be present in the repository sql/mysql_priv.h.pp: The pre-processor output canon file for sql/mysql_priv.h
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am57
1 files changed, 57 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 55f54476212..44f82c300cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -231,5 +231,62 @@ test-full-qa:
test-binlog-statement test-ext test-fast-view \
test-fast-cursor test-unit
+#
+# Headers which need to be checked for abi/api compatibility
+#
+
+PREPROCESSOR_C_HEADER=$(top_srcdir)/include/mysql/plugin.h \
+ $(top_srcdir)/sql/mysql_priv.h \
+ $(top_srcdir)/include/mysql.h
+
+#
+# Rule for checking that the abi/api has not changed.
+#
+# The following steps are followed in the rule below
+#
+# 1) Generate preprocessor output for the files that need to
+# be tested for abi/api changes. use -nostdinc to prevent
+# generation of preprocessor output for system headers. This
+# results in messages in stderr saying that these headers
+# were not found. Redirect the stderr output to /dev/null
+# to prevent seeing these messages.
+# 2) sed the output to remove blank lines and lines that begin
+# with # (The header information is retained to enable easy
+# analysis of abi diffs at a later stage).
+# 3) diff the generated file and the canons (.pp files already in
+# the repository).
+# 4) delete the .out file that is generated.
+#
+# If the diff fails, the generated file is not removed. This will
+# be useful for analysis of ABI differences (e.g. using a visual
+# diff tool).
+#
+# A ABI change that causes a build to fail will always be accompanied
+# by new canons (.out files). The .out files that are not removed will
+# be replaced as the new .pp files.
+#
+# e.g. If include/mysql/plugin.h has an ABI change then this rule would
+# leave a include/mysql/plugin.out file.
+#
+# A developer with a justified API change will then do a
+# mv include/mysql/plugin.out include/mysql/plugin.pp
+# to replace the old canons with the new ones.
+#
+
+abi_check: $(PREPROCESSOR_C_HEADER)
+ set -ex; \
+ for file in $(PREPROCESSOR_C_HEADER); do \
+ @CC@ -E -nostdinc -dI \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/include/mysql \
+ -I$(top_srcdir)/sql \
+ $$file 2>/dev/null | \
+ @SED@ -e '/^# /d' \
+ -e '/^[ ]*$$/d' > $$file.out; \
+ @DIFF@ $$file.pp $$file.out; \
+ @RM@ $$file.out; \
+ done
+ touch $@
+
# Don't update the files from bitkeeper
%::SCCS/s.%