diff options
author | Mike Stump <mrs@apple.com> | 2005-04-15 01:55:58 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2005-04-15 01:55:58 +0000 |
commit | a68bdb0b8d55eada5a23b2dde0b77d4c6667d999 (patch) | |
tree | 65754a9c82efd86ffa2890be19a131dc4dd60fc9 /gcc/config | |
parent | 417ac4e6c704d8a7477e4c04dc7887314fd593d4 (diff) | |
download | gcc-a68bdb0b8d55eada5a23b2dde0b77d4c6667d999.zip gcc-a68bdb0b8d55eada5a23b2dde0b77d4c6667d999.tar.gz gcc-a68bdb0b8d55eada5a23b2dde0b77d4c6667d999.tar.bz2 |
darwin-c.c (framework_construct_pathname): We must find all headers of a framework in the first instance of it found in...
* config/darwin-c.c (framework_construct_pathname): We must
find all headers of a framework in the first instance of it
found in the seach path.
* gcc.dg/Foundation.framework/empty: New.
* gcc.dg/framework-2.c: New.
From-SVN: r98162
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/darwin-c.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index feb26f1..58366f7 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -270,6 +270,26 @@ framework_construct_pathname (const char *fname, cpp_dir *dir) strncpy (&frname[frname_len], ".framework/", strlen (".framework/")); frname_len += strlen (".framework/"); + if (fast_dir == 0) + { + frname[frname_len-1] = 0; + if (stat (frname, &st) == 0) + { + /* As soon as we find the first instance of the framework, + we stop and never use any later instance of that + framework. */ + add_framework (fname, fname_len, dir); + } + else + { + /* If we can't find the parent directory, no point looking + further. */ + free (frname); + return 0; + } + frname[frname_len-1] = '/'; + } + /* Append framework_header_dirs and header file name */ for (i = 0; framework_header_dirs[i].dirName; i++) { @@ -280,11 +300,7 @@ framework_construct_pathname (const char *fname, cpp_dir *dir) &fname[fname_len]); if (stat (frname, &st) == 0) - { - if (fast_dir == 0) - add_framework (fname, fname_len, dir); - return frname; - } + return frname; } free (frname); |