[pcre-dev] [PATCH] Miscellaneous fixes from Solaris 2.6

Top Page
Delete this message
Author: Daniel Richard G
Date:  
To: pcre-dev
Subject: [pcre-dev] [PATCH] Miscellaneous fixes from Solaris 2.6
I recently attempted to build PCRE SVN trunk on Solaris 2.6 (on 32-bit
SPARC) to try out Zoltán's new JIT support for that platform. While that
is still in progress, there are a few minor issues that came up in
building PCRE on this older system, that are addressed in the attached
patch. These are as follows:

pcre_internal.h: Header macros need to be checked as e.g.

     #if defined HAVE_STDINT_H


rather than

     #if HAVE_STDINT_H


or else -Wundef gives you "HAVE_STDINT_H is not defined" warnings.

Makefile.am: The "?=" assignment is a GNU Make extension, not compatible
with classic Unix make(1) programs. (Indeed, make(1) gave a confusing
error on this system until I removed those assignments.)

The "coverage-clean" target is invoked by "make clean". The former does
not check that LCOV is set to a value before invoking it.

Also, older versions of find(1) do not support the -delete predicate.


--Daniel


--
Daniel Richard G. || danielg@??? || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/Index: pcre_internal.h
===================================================================
--- pcre_internal.h    (revision 1159)
+++ pcre_internal.h    (working copy)
@@ -221,9 +221,9 @@
 have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set
 by "configure". */
 
-#if HAVE_STDINT_H
+#if defined HAVE_STDINT_H
 #include <stdint.h>
-#elif HAVE_INTTYPES_H
+#elif defined HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 
Index: Makefile.am
===================================================================
--- Makefile.am    (revision 1159)
+++ Makefile.am    (working copy)
@@ -735,11 +741,11 @@
 
 # gcov/lcov code coverage reporting
 
-GCOV_NAME ?= $(PACKAGE)-$(VERSION)
-GCOV_OUTPUT_FILE ?= $(GCOV_NAME)-coverage.info
-GCOV_OUTPUT_DIR ?= $(GCOV_NAME)-coverage
-GCOV_LCOV_FLAGS ?=
-GCOV_GENHTML_FLAGS ?=
+GCOV_NAME = $(PACKAGE)-$(VERSION)
+GCOV_OUTPUT_FILE = $(GCOV_NAME)-coverage.info
+GCOV_OUTPUT_DIR = $(GCOV_NAME)-coverage
+GCOV_LCOV_FLAGS =
+GCOV_GENHTML_FLAGS =
 
 gcov_quiet = $(gcov_quiet_$(V))
 gcov_quiet_ = $(gcov_quiet_$(AM_DEFAULT_VERBOSITY))
@@ -775,11 +781,11 @@
     @echo "Code coverage report written to file://$(abs_builddir)/$(GCOV_OUTPUT_DIR)/index.html"
 
 coverage-clean:
-    -$(LCOV) $(gcov_quiet) --zerocounters --directory $(top_builddir)
+    -test -z "$(LCOV)" || $(LCOV) $(gcov_quiet) --zerocounters --directory $(top_builddir)
     -rm -f "$(GCOV_OUTPUT_FILE)"
     -rm -f "$(GCOV_OUTPUT_FILE).tmp"
     -rm -rf "$(GCOV_NAME)"
-    -find $(top_builddir) -name '*.gcda' -o -name "*.gcov" -delete
+    -find $(top_builddir) -name '*.gcda' -o -name '*.gcov' -exec rm -f {} ';'
 
 coverage: coverage-check coverage-report
 clean-local: coverage-clean