about summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc-4.4/no-sys-dirs.patch
blob: 4d843891a03c28fda6a3178f0adf8632a4b0a743 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
--- gcc-4.3.1-orig/gcc/cppdefault.c	2007-07-26 10:37:01.000000000 +0200
+++ gcc-4.3.1/gcc/cppdefault.c	2008-06-25 17:48:23.000000000 +0200
@@ -41,6 +41,10 @@
 # undef CROSS_INCLUDE_DIR
 #endif
 
+#undef LOCAL_INCLUDE_DIR
+#undef SYSTEM_INCLUDE_DIR
+#undef STANDARD_INCLUDE_DIR
+
 const struct default_include cpp_include_defaults[]
 #ifdef INCLUDE_DEFAULTS
 = INCLUDE_DEFAULTS;
diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
--- gcc-4.3.1-orig/gcc/gcc.c	2008-03-02 23:55:19.000000000 +0100
+++ gcc-4.3.1/gcc/gcc.c	2008-06-25 17:52:53.000000000 +0200
@@ -1478,10 +1478,10 @@
 /* Default prefixes to attach to command names.  */
 
 #ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_1 ""
 #endif
 #ifndef STANDARD_STARTFILE_PREFIX_2
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 ""
 #endif
 
 #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
@@ -1515,8 +1515,8 @@
 /* For native compilers, these are well-known paths containing
    components that may be provided by the system.  For cross
    compilers, these paths are not used.  */
-static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
-static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
+static const char *const standard_exec_prefix_1 = "/no-such-path/";
+static const char *const standard_exec_prefix_2 = "/no-such-path/";
 static const char *md_exec_prefix = MD_EXEC_PREFIX;
 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
diff -ru gcc-4.3.1-orig/gcc/Makefile.in gcc-4.3.1/gcc/Makefile.in
--- gcc-4.3.1-orig/gcc/Makefile.in	2008-05-11 20:54:15.000000000 +0200
+++ gcc-4.3.1/gcc/Makefile.in	2008-06-25 17:48:23.000000000 +0200
@@ -378,7 +378,11 @@
 MD5_H	    = $(srcdir)/../include/md5.h
 
 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
+# `fixinc' from fixing header files in /usr/include.  However,
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
+# it to some dummy directory.
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
 CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
 
@@ -3277,7 +3281,7 @@
   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
+  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
   -DPREFIX=\"$(prefix)/\" \
diff -ru gcc-4.3.1-orig/libgomp/configure gcc-4.3.1/libgomp/configure
--- gcc-4.3.1-orig/libgomp/configure	2008-01-24 17:23:13.000000000 +0100
+++ gcc-4.3.1/libgomp/configure	2008-06-26 11:23:49.000000000 +0200
@@ -21493,6 +21493,11 @@
 # A language specific compiler.
 CC=$lt_compiler
 
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
+# to Glibc gets lost.  Here we forcibly add it to any invocation.
+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
+
 # Is the compiler the GNU compiler?
 with_gcc=$GCC
 
Only in gcc-4.3.1/libgomp: configure~
diff -ru gcc-4.3.1-orig/libmudflap/configure gcc-4.3.1/libmudflap/configure
--- gcc-4.3.1-orig/libmudflap/configure	2008-01-24 17:30:08.000000000 +0100
+++ gcc-4.3.1/libmudflap/configure	2008-06-26 11:23:11.000000000 +0200
@@ -14229,6 +14229,11 @@
 # A language specific compiler.
 CC=$lt_compiler
 
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
+# to Glibc gets lost.  Here we forcibly add it to any invocation.
+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
+
 # Is the compiler the GNU compiler?
 with_gcc=$GCC
 
Only in gcc-4.3.1/libmudflap: configure~
diff -ru gcc-4.3.1-orig/libssp/configure gcc-4.3.1/libssp/configure
--- gcc-4.3.1-orig/libssp/configure	2008-01-24 17:33:29.000000000 +0100
+++ gcc-4.3.1/libssp/configure	2008-06-26 11:23:25.000000000 +0200
@@ -12142,6 +12142,11 @@
 # A language specific compiler.
 CC=$lt_compiler
 
+# Ugly hack to get libmudflap (and possibly other libraries) to build.
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
+# to Glibc gets lost.  Here we forcibly add it to any invocation.
+CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
+
 # Is the compiler the GNU compiler?
 with_gcc=$GCC
 
Only in gcc-4.3.1/libssp: configure~
diff -ru gcc-4.3.1-orig/Makefile.in gcc-4.3.1/Makefile.in
--- gcc-4.3.1-orig/Makefile.in	2007-12-13 10:30:49.000000000 +0100
+++ gcc-4.3.1/Makefile.in	2008-06-25 17:48:23.000000000 +0200
@@ -405,6 +405,14 @@
 @host_makefile_frag@
 ###
 
+CFLAGS += $(NIX_EXTRA_CFLAGS)
+CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS)
+CXXFLAGS += $(NIX_EXTRA_CFLAGS)
+LDFLAGS += $(NIX_EXTRA_LDFLAGS)
+LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS)
+BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
+BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
+
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that prorgams built for the target machine work.
 TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)