From 9b2d02a0d2850daeba066f970c95a82cc618a248 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 23 Apr 2004 17:56:08 +0000 Subject: [PATCH] darwin7.h: New file. 2004-04-23 Andrew Pinski * config/darwin7.h: New file. * config.gcc (*-*-darwin*): Add darwin7.h if the version is greater than 6. * config/darwin.h (TARGET_C99_FUNCTIONS): Define. (MATH_LIBRARY): Wrap in ifdefs. From-SVN: r81100 --- gcc/ChangeLog | 8 ++++++++ gcc/config.gcc | 4 ++++ gcc/config/darwin.h | 11 +++++++++-- gcc/config/darwin7.h | 28 ++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gcc/config/darwin7.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e544a23210a..720bb0ad1f2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-04-23 Andrew Pinski + + * config/darwin7.h: New file. + * config.gcc (*-*-darwin*): Add darwin7.h if the + version is greater than 6. + * config/darwin.h (TARGET_C99_FUNCTIONS): Define. + (MATH_LIBRARY): Wrap in ifdefs. + 2004-04-23 Daniel Jacobowitz * config/arm/arm.c (arm_output_epilogue): Reverse the order of diff --git a/gcc/config.gcc b/gcc/config.gcc index 3ab87d9aa6f..bf980027e7d 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -331,6 +331,10 @@ esac # Common parts for widely ported systems. case ${target} in *-*-darwin*) + case ${target} in + *-darwin[0-6]*) ;; + *) tm_file="${tm_file} darwin7.h" ;; + esac tm_file="${tm_file} darwin.h" tm_p_file="${tm_p_file} darwin-protos.h" tmake_file="t-darwin t-slibgcc-darwin" diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index b4d8b555e68..28b58a5e179 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -41,9 +41,11 @@ Boston, MA 02111-1307, USA. */ /* Suppress g++ attempt to link in the math library automatically. (Some Darwin versions have a libm, but they seem to cause problems - for C++ executables.) */ - + for C++ executables.) This needs to be -lmx for Darwin 7.0 and + above. */ +#ifndef MATH_LIBRARY #define MATH_LIBRARY "" +#endif /* We have atexit. */ @@ -908,4 +910,9 @@ void add_framework_path (char *); #define TARGET_HAS_F_SETLKW +/* Darwin before 7.0 does not have C99 functions. */ +#ifndef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS 0 +#endif + #endif /* CONFIG_DARWIN_H */ diff --git a/gcc/config/darwin7.h b/gcc/config/darwin7.h new file mode 100644 index 00000000000..0b215c2f6ab --- /dev/null +++ b/gcc/config/darwin7.h @@ -0,0 +1,28 @@ +/* Target definitions for Darwin 7.0 and above (Mac OS X) systems. + Copyright (C) 2004 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Darwin 7.0 and above have C99 functions. */ +#define TARGET_C99_FUNCTIONS 1 + +/* But for some reason they are located in libmx so have it + be included when asked for and automatically when linking + with gfortran and g++. */ +#define MATH_LIBRARY "-lmx"