OSDN Git Service

* config.gcc (*-*-netbsdelf*): Set up generic parameters.
[pf3gnuchains/gcc-fork.git] / gcc / config / netbsd.h
1 /* NETBSD_NATIVE is defined when gcc is integrated into the NetBSD
2    source tree so it can be configured appropriately without using
3    the GNU configure/build mechanism. */
4
5 #ifdef NETBSD_NATIVE
6
7 /* Look for the include files in the system-defined places.  */
8
9 #undef GPLUSPLUS_INCLUDE_DIR
10 #define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
11
12 #undef GCC_INCLUDE_DIR
13 #define GCC_INCLUDE_DIR "/usr/include"
14
15 #undef INCLUDE_DEFAULTS
16 #define INCLUDE_DEFAULTS                        \
17   {                                             \
18     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },     \
19     { GCC_INCLUDE_DIR, "GCC", 0, 0 },           \
20     { 0, 0, 0, 0 }                              \
21   }
22
23 /* Under NetBSD, the normal location of the compiler back ends is the
24    /usr/libexec directory.  */
25
26 #undef STANDARD_EXEC_PREFIX
27 #define STANDARD_EXEC_PREFIX            "/usr/libexec/"
28
29 /* Under NetBSD, the normal location of the various *crt*.o files is the
30    /usr/lib directory.  */
31
32 #undef STANDARD_STARTFILE_PREFIX
33 #define STANDARD_STARTFILE_PREFIX       "/usr/lib/"
34
35 #endif /* NETBSD_NATIVE */
36
37
38 /* Provide a CPP_SPEC appropriate for NetBSD.  Currently we just deal with
39    the GCC option `-posix'.  */
40
41 #undef CPP_SPEC
42 #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
43
44
45 /* Provide a LIB_SPEC appropriate for NetBSD.  Just select the appropriate
46    libc, depending on whether we're doing profiling; if `-posix' is specified,
47    link against the appropriate libposix first.  Don't include libc when
48    linking a shared library.  */
49
50 #undef LIB_SPEC
51 #define LIB_SPEC                \
52   "%{posix:                     \
53      %{!p:                      \
54        %{!pg:-lposix}}          \
55      %{p:-lposix_p}             \
56      %{pg:-lposix_p}}           \
57    %{!shared:                   \
58      %{!symbolic:               \
59        %{!p:                    \
60          %{!pg:-lc}}            \
61        %{p:-lc_p}               \
62        %{pg:-lc_p}}}"
63
64 /* Provide a LIBGCC_SPEC appropriate for NetBSD.  We also want to exclude
65    libgcc with -symbolic.  */
66
67 #undef LIBGCC_SPEC
68 #ifdef NETBSD_NATIVE
69 #define LIBGCC_SPEC             \
70   "%{!symbolic:                 \
71      %{!shared:                 \
72        %{!p:                    \
73          %{!pg: -lgcc}}}                \
74      %{shared: -lgcc_pic}       \
75      %{p: -lgcc_p}              \
76      %{pg: -lgcc_p}}"
77 #else
78 #define LIBGCC_SPEC "%{!shared:%{!symbolic: -lgcc}}"
79 #endif
80
81 /* When building shared libraries, the initialization and finalization 
82    functions for the library are .init and .fini respectively.  */
83
84 #define COLLECT_SHARED_INIT_FUNC(STREAM,FUNC)                           \
85   do {                                                                  \
86     fprintf ((STREAM), "void __init() __asm__ (\".init\");");           \
87     fprintf ((STREAM), "void __init() {\n\t%s();\n}\n", (FUNC));        \
88   } while (0)
89
90 #define COLLECT_SHARED_FINI_FUNC(STREAM,FUNC)                           \
91   do {                                                                  \
92     fprintf ((STREAM), "void __fini() __asm__ (\".fini\");");           \
93     fprintf ((STREAM), "void __fini() {\n\t%s();\n}\n", (FUNC));        \
94   } while (0)
95
96 /* Allow #sccs in preprocessor.  */
97
98 #undef SCCS_DIRECTIVE
99 #define SCCS_DIRECTIVE
100
101 #undef TARGET_HAS_F_SETLKW
102 #define TARGET_HAS_F_SETLKW
103
104 /* Implicit library calls should use memcpy, not bcopy, etc.  */
105
106 #undef TARGET_MEM_FUNCTIONS
107 #define TARGET_MEM_FUNCTIONS 1
108
109 /* Handle #pragma weak and #pragma pack.  */
110
111 #define HANDLE_SYSV_PRAGMA