c-common.c (preprocessing_trad_p): Define.
[platform/upstream/gcc.git] / gcc / config / pa / pa-hpux10.h
1 /* Definitions of target machine for GNU compiler, for HP PA-RISC
2    Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4    Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 #undef TARGET_OS_CPP_BUILTINS
24 #define TARGET_OS_CPP_BUILTINS()                                \
25   do                                                            \
26     {                                                           \
27         builtin_assert ("system=hpux");                         \
28         builtin_assert ("system=unix");                         \
29         builtin_define ("__hp9000s800");                        \
30         builtin_define ("__hp9000s800__");                      \
31         builtin_define ("__hpux");                              \
32         builtin_define ("__hpux__");                            \
33         builtin_define ("__unix");                              \
34         builtin_define ("__unix__");                            \
35         if (c_language == clk_cplusplus)                        \
36           {                                                     \
37             builtin_define ("_HPUX_SOURCE");                    \
38             builtin_define ("_INCLUDE_LONGLONG");               \
39           }                                                     \
40         else if (!flag_iso)                                     \
41           {                                                     \
42             builtin_define ("_HPUX_SOURCE");                    \
43             if (preprocessing_trad_p ())                        \
44               {                                                 \
45                 builtin_define ("hp9000s800");                  \
46                 builtin_define ("hppa");                        \
47                 builtin_define ("hpux");                        \
48                 builtin_define ("unix");                        \
49                 builtin_define ("__CLASSIC_C__");               \
50                 builtin_define ("_PWB");                        \
51                 builtin_define ("PWB");                         \
52               }                                                 \
53             else                                                \
54               builtin_define ("__STDC_EXT__");                  \
55           }                                                     \
56         if (TARGET_SIO)                                         \
57           builtin_define ("_SIO");                              \
58         else                                                    \
59           {                                                     \
60             builtin_define ("__hp9000s700");                    \
61             builtin_define ("__hp9000s700__");                  \
62             builtin_define ("_WSIO");                           \
63           }                                                     \
64     }                                                           \
65   while (0)
66
67 #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
68
69 /* We can debug dynamically linked executables on hpux9; we also want
70    dereferencing of a NULL pointer to cause a SEGV.  */
71 #undef LINK_SPEC
72 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) &  MASK_PA_11)
73 #define LINK_SPEC \
74   "%{!mpa-risc-1-0:%{!shared:-L/lib/pa1.1 -L/usr/lib/pa1.1 }} -z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
75 #else
76 #define LINK_SPEC \
77   "-z %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
78 #endif
79
80 /* Like the default, except no -lg.  */
81 #undef LIB_SPEC
82 #define LIB_SPEC \
83   "%{!shared:\
84      %{!p:%{!pg:\
85        %{!threads:-lc}\
86        %{threads:-lcma -lc_r}}}\
87      %{p: -L/lib/libp/ -lc}\
88      %{pg: -L/lib/libp/ -lc}}"
89
90 #undef THREAD_MODEL_SPEC
91 #define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
92
93 /* Under hpux10, the normal location of the `ld' and `as' programs is the
94    /usr/ccs/bin directory.  */
95
96 #ifndef CROSS_COMPILE
97 #undef MD_EXEC_PREFIX
98 #define MD_EXEC_PREFIX "/usr/ccs/bin/"
99 #endif
100
101 /* Under hpux10, the normal location of the various *crt*.o files is
102    the /usr/ccs/lib directory.  However, the profiling files are in
103    /opt/langtools/lib.  */
104
105 #ifndef CROSS_COMPILE
106 #undef MD_STARTFILE_PREFIX
107 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
108 #define MD_STARTFILE_PREFIX_1 "/opt/langtools/lib/"
109 #endif
110
111 /* hpux10 has the new HP assembler.  It's still lousy, but it's a whole lot
112    better than the assembler shipped with older versions of hpux.  */
113 #undef NEW_HP_ASSEMBLER
114 #define NEW_HP_ASSEMBLER 1