summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-07-26 21:50:36 +0000
committerimp <imp@FreeBSD.org>2002-07-26 21:50:36 +0000
commit7701b3e2af91c74c36811e80d688308234bf30fc (patch)
treef6b9311af1ae2ddde7796465aec7b2e63e886c6f /usr.bin
parent6a95ddadef40122e9a842e88a65c0268cbceb8f7 (diff)
downloadFreeBSD-src-7701b3e2af91c74c36811e80d688308234bf30fc.zip
FreeBSD-src-7701b3e2af91c74c36811e80d688308234bf30fc.tar.gz
Back out jmallett's realpath changes. They break a set of makefiles that
we use in sublte ways with relative paths. Until they can be resolved, back out these changes and put a big comment about why using realpath is busted. Approved by: jmallett MFC After: 100 millifortnights
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/main.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 51dab2f..273b5a3 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -923,6 +923,22 @@ ReadMakefile(p, q)
/* if we've chdir'd, rebuild the path name */
if (curdir != objdir && *fname != '/') {
(void)snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname);
+ /*
+ * XXX The realpath stuff breaks relative includes
+ * XXX in some cases. The problem likely is in
+ * XXX parse.c where it does special things in
+ * XXX ParseDoInclude if the file is relateive
+ * XXX or absolute and not a system file. There
+ * XXX it assumes that if the current file that's
+ * XXX being included is absolute, that any files
+ * XXX that it includes shouldn't do the -I path
+ * XXX stuff, which is inconsistant with historical
+ * XXX behavior. However, I can't pentrate the mists
+ * XXX further, so I'm putting this workaround in
+ * XXX here until such time as the underlying bug
+ * XXX can be fixed.
+ */
+#if THIS_BREAKS_THINGS
if (realpath(path, path) != NULL &&
(stream = fopen(path, "r")) != NULL) {
MAKEFILE = fname;
@@ -935,6 +951,18 @@ ReadMakefile(p, q)
if ((stream = fopen(fname, "r")) != NULL)
goto found;
}
+#else
+ if ((stream = fopen(path, "r")) != NULL) {
+ MAKEFILE = fname;
+ fname = path;
+ goto found;
+ }
+ } else {
+ MAKEFILE = fname;
+ if ((stream = fopen(fname, "r")) != NULL)
+ goto found;
+ }
+#endif
/* look in -I and system include directories. */
name = Dir_FindFile(fname, parseIncPath);
if (!name)
OpenPOWER on IntegriCloud