summaryrefslogtreecommitdiff
path: root/usr/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/tools')
-rw-r--r--usr/src/tools/ctf/common/ctf_headers.h13
-rw-r--r--usr/src/tools/ctf/ctfdump/Makefile.com3
-rw-r--r--usr/src/tools/ctf/libctf/Makefile.com5
3 files changed, 19 insertions, 2 deletions
diff --git a/usr/src/tools/ctf/common/ctf_headers.h b/usr/src/tools/ctf/common/ctf_headers.h
index a63690be77..572fb03d4d 100644
--- a/usr/src/tools/ctf/common/ctf_headers.h
+++ b/usr/src/tools/ctf/common/ctf_headers.h
@@ -22,6 +22,7 @@
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Joyent, Inc.
*/
#ifndef _CTF_HEADERS_H
@@ -32,7 +33,7 @@
* the tools need to include the headers installed on the build system,
* rather than those in the ON source tree. However, some of the headers
* required by the tools are part of the ON source tree, but not delivered
- * as part of Solaris. These include the following:
+ * as part of illumos. These include the following:
*
* $(SRC)/lib/libctf/common/libctf.h
* $(SRC)/lib/libctf/common/libctf_impl.h
@@ -62,12 +63,22 @@
* This last -I include is needed in order to prevent a build failure
* when <sys/ctf_api.h> is included via a nested #include rather than
* an explicit path #include.
+ *
+ * We'll also include the local ccompile.h - older build systems often lack
+ * useful definitions like __unused. Finally, we'll also define ARRAY_SIZE:
+ * unfortunately, older systems sysmacros.h only have this defined for the
+ * kernel, and we can't easily pick it up otherwise.
*/
+#include <uts/common/sys/ccompile.h>
#include <uts/common/sys/ctf.h>
#include <uts/common/sys/ctf_api.h>
#include <common/ctf/ctf_impl.h>
#include <lib/libctf/common/libctf.h>
#include <lib/libctf/common/libctf_impl.h>
+#if !defined(ARRAY_SIZE)
+#define ARRAY_SIZE(x) (sizeof (x) / sizeof (x[0]))
+#endif
+
#endif /* _CTF_HEADERS_H */
diff --git a/usr/src/tools/ctf/ctfdump/Makefile.com b/usr/src/tools/ctf/ctfdump/Makefile.com
index 3e1414ea59..66e7a170c4 100644
--- a/usr/src/tools/ctf/ctfdump/Makefile.com
+++ b/usr/src/tools/ctf/ctfdump/Makefile.com
@@ -8,12 +8,15 @@
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
+# Copyright 2018 Joyent, Inc.
PROG = ctfdump
SRCS = ctfdump.c
include ../../Makefile.ctf
+CSTD = $(CSTD_GNU99)
+C99LMODE = -Xc99=%all
CFLAGS += $(CCVERBOSE)
LDLIBS += -lctf
diff --git a/usr/src/tools/ctf/libctf/Makefile.com b/usr/src/tools/ctf/libctf/Makefile.com
index 0444b975d5..d932042f54 100644
--- a/usr/src/tools/ctf/libctf/Makefile.com
+++ b/usr/src/tools/ctf/libctf/Makefile.com
@@ -10,7 +10,7 @@
#
#
-# Copyright (c) 2015, Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
include $(SRC)/lib/libctf/Makefile.shared.com
@@ -24,6 +24,9 @@ LDLIBS += \
-L$(ROOTONBLDLIBMACH) \
'-R$$ORIGIN/../../lib/$(MACH)' \
+CSTD = $(CSTD_GNU99)
+C99LMODE = -Xc99=%all
+
CPPFLAGS += -I$(SRC)/lib/libctf/common/ \
-I$(SRC)/lib/libdwarf/common/ \
-I$(SRC)/lib/mergeq \