Code review comment for ~bhill/epics-base:EPICS-and-CA-version-from-CA-tools

Revision history for this message
Andrew Johnson (anj) wrote :

@Bruce What version of gcc are you using? Since gcc 3.x the -MM flag that we use to generate dependency files has ignored the type of quote mark used. However if you are building for VxWorks 5.5 or earlier it apparently does still matter. Here's a quote from the cpp.info file from VxWorks 5.5.2:

`-MM [-MG]'
     Like `-M' but mention only the files included with `#include
     "FILE"'. System header files included with `#include <FILE>' are
     omitted.

and from a more recent gcc (4.x)

'-MM'
     Like '-M' but do not mention header files that are found in system
     header directories, nor header files that are included, directly or
     indirectly, from such a header.

     This implies that the choice of angle brackets or double quotes in
     an '#include' directive does not in itself determine whether that
     header will appear in '-MM' dependency output. This is a slight
     change in semantics from GCC versions 3.0 and earlier.

I will switch older VxWorks builds to use the mkmf.pl script for dependency generation. It would be too disruptive to try and fix all of our source files at this point, and this it just a 2-line fix (diff against 3.15):

index 875fe81..95f8f7f 100644
--- a/configure/os/CONFIG.Common.vxWorksCommon
+++ b/configure/os/CONFIG.Common.vxWorksCommon
@@ -186,6 +186,12 @@ VXCPPFLAGS = $(filter-out $(OP_SYS_INCLUDE_CPPFLAGS),$(CPPFLAGS))
 PREPROCESS.cpp = $(CPP) $(VXCPPFLAGS) $(INCLUDES) $< > $@

 #--------------------------------------------------
+# Don't use gcc 2.x for dependency generation
+
+HDEPENDS_METHOD_2 = MKMF
+HDEPENDS_METHOD = $(firstword $(HDEPENDS_METHOD_$(VX_GNU_MAJOR_VERSION)) COMP)
+
+#--------------------------------------------------
 # Allow site overrides
 -include $(CONFIG)/os/CONFIG_SITE.Common.vxWorksCommon
 -include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).vxWorksCommon

- Andrew

review: Approve

« Back to merge proposal