gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add isysroot.

PR/18555
        * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add isysroot.
        * config/darwin-c.c (darwin_register_frameworks): Use sysroot.

        testsuite
        * gcc.dg/cpp/isysroot-1.c: New test.
        * gcc.dg/cpp/usr/include/stdio.h: New file.
        * gcc.dg/cpp/isysroot-2.c: New test.
        * gcc.dg/cpp/System/Library/Framework/Carbon.framework/Headers/Carbon.h:
        New file.

From-SVN: r91178
This commit is contained in:
Devang Patel 2004-11-24 09:47:32 -08:00 committed by Devang Patel
parent b0896d72f0
commit 479ec1d1e0
8 changed files with 51 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-11-24 Devang Patel <dpatel@apple.com>
PR/18555
* gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add isysroot.
* config/darwin-c.c (darwin_register_frameworks): Use sysroot.
2004-11-24 Devang Patel <dpatel@apple.com>
* gcc.c (process_command): Supply -v to linker.

View File

@ -468,7 +468,7 @@ darwin_register_objc_includes (const char *sysroot, const char *iprefix,
frameworks had been registered. */
void
darwin_register_frameworks (const char *sysroot ATTRIBUTE_UNUSED,
darwin_register_frameworks (const char *sysroot,
const char *iprefix ATTRIBUTE_UNUSED, int stdinc)
{
if (stdinc)
@ -478,8 +478,13 @@ darwin_register_frameworks (const char *sysroot ATTRIBUTE_UNUSED,
/* Setup default search path for frameworks. */
for (i=0; i<sizeof (framework_defaults)/sizeof(const char *); ++i)
{
char *str;
if (sysroot)
str = concat (sysroot, xstrdup (framework_defaults [i]), NULL);
else
str = xstrdup (framework_defaults[i]);
/* System Framework headers are cxx aware. */
add_system_framework_path (xstrdup (framework_defaults[i]));
add_system_framework_path (str);
}
}

View File

@ -49,6 +49,7 @@ struct spec_function
|| !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
|| !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
|| !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
|| !strcmp (STR, "isysroot") \
|| !strcmp (STR, "-param") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))

View File

@ -1,3 +1,12 @@
2004-11-24 Devang Patel <dpatel@apple.com>
PR/18555
* gcc.dg/cpp/isysroot-1.c: New test.
* gcc.dg/cpp/usr/include/stdio.h: New file.
* gcc.dg/cpp/isysroot-2.c: New test.
* gcc.dg/cpp/System/Library/Framework/Carbon.framework/Headers/Carbon.h:
New file.
2004-11-24 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/8929

View File

@ -0,0 +1,4 @@
/* Used by gcc.dg/cpp/isysroot-2.c to test isysroot. */
void foo()
{
}

View File

@ -0,0 +1,10 @@
/* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" } */
/* { dg-do compile } */
#include <stdio.h>
int main()
{
/* Special stdio.h supplies function foo. */
void (*x)(void) = foo;
return 0;
}

View File

@ -0,0 +1,10 @@
/* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" { target *-*-darwin* } } */
/* { dg-do compile } */
#include <Carbon/Carbon.h>
int main()
{
/* Special Carbon.h supplies function foo. */
void (*x)(void) = foo;
return 0;
}

View File

@ -0,0 +1,4 @@
/* Used by gcc.dg/cpp/isysroot-1.c to test isysroot. */
void foo()
{
}