summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2012-02-10 05:05:42 +0000
committerkientzle <kientzle@FreeBSD.org>2012-02-10 05:05:42 +0000
commitd521f4b4a13ec7bca94568b2f28e4213bf33511d (patch)
tree8044bdd2399f662980c3ecbe64ddf9d249a27f79
parent9591ab6a1a36706433ee688192acb501b50ba960 (diff)
downloadFreeBSD-src-d521f4b4a13ec7bca94568b2f28e4213bf33511d.zip
FreeBSD-src-d521f4b4a13ec7bca94568b2f28e4213bf33511d.tar.gz
Implement -print-file-name=include (which is undocumented
but used by some Linux boot loaders). This option prints out the directory holding the include files needed by a freestanding program. The default implementation of this doesn't work on FreeBSD because of the different include file layout. But it's easy to implement: just return /usr/include (or the cross-compiling equivalent). Reviewed by: kan MFC after: 1 week
-rw-r--r--contrib/gcc/gcc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c
index ddf2f49..e88dc53 100644
--- a/contrib/gcc/gcc.c
+++ b/contrib/gcc/gcc.c
@@ -2696,6 +2696,17 @@ find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
return xstrdup (DEFAULT_LINKER);
#endif
+#ifdef FREEBSD_NATIVE
+ if (! strcmp(name, "include"))
+ {
+#ifdef CROSS_INCLUDE_DIR
+ return xstrdup(CROSS_INCLUDE_DIR);
+#else
+ return xstrdup(STANDARD_INCLUDE_DIR);
+#endif
+ }
+#endif
+
/* Determine the filename to execute (special case for absolute paths). */
if (IS_ABSOLUTE_PATH (name))
OpenPOWER on IntegriCloud