[Midnightbsd-cvs] src: contrib/gcc: Introduce a hack so that __MidnightBSD__ is defined.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Apr 30 23:18:24 EDT 2008
Log Message:
-----------
Introduce a hack so that __MidnightBSD__ is defined. This should help determine we're running code on MidnightBSD w/ the preprocessor.
You'll no longer need sys/param.h per se.
Modified Files:
--------------
src/contrib/gcc:
config.gcc (r1.2 -> r1.3)
version.c (r1.3 -> r1.4)
src/contrib/gcc/config:
freebsd-spec.h (r1.2 -> r1.3)
-------------- next part --------------
Index: version.c
===================================================================
RCS file: /home/cvs/src/contrib/gcc/version.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L contrib/gcc/version.c -L contrib/gcc/version.c -u -r1.3 -r1.4
--- contrib/gcc/version.c
+++ contrib/gcc/version.c
@@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.4.6 [MidnightBSD] 20060305";
+const char version_string[] = "3.4.6 [MidnightBSD] 20080430";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
Index: config.gcc
===================================================================
RCS file: /home/cvs/src/contrib/gcc/config.gcc,v
retrieving revision 1.2
retrieving revision 1.3
diff -L contrib/gcc/config.gcc -L contrib/gcc/config.gcc -u -r1.2 -r1.3
--- contrib/gcc/config.gcc
+++ contrib/gcc/config.gcc
@@ -378,7 +378,7 @@
# the generic ELF configuration of FreeBSD (i.e. it must be
# ordered before that section).
;;
-*-*-freebsd*)
+*-*-freebsd* | *-*-midnightbsd*)
# This is the generic ELF configuration of FreeBSD. Later
# machine-specific sections may refine and add to this
# configuration.
@@ -405,13 +405,15 @@
*-*-freebsd5 | *-*-freebsd[5].*)
tm_defines="${tm_defines} FBSD_MAJOR=5" ;;
*-*-freebsd6 | *-*-freebsd[6].*)
- tm_defines="${tm_defines} FBSD_MAJOR=6" ;;
+ tm_defines="${tm_defines} FBSD_MAJOR=6 MNBSD_MAJOR=1" ;;
*-*-freebsd7 | *-*-freebsd[7].*)
tm_defines="${tm_defines} FBSD_MAJOR=7" ;;
*-*-freebsd8 | *-*-freebsd[8].*)
tm_defines="${tm_defines} FBSD_MAJOR=8" ;;
*-*-freebsd9 | *-*-freebsd[9].*)
tm_defines="${tm_defines} FBSD_MAJOR=9" ;;
+ *-*-midnightbsd0 | *-*-midnightbsd[0].*)
+ tm_defines="${tm_defines} MNBSD_MAJOR=1" ;;
*)
echo 'Please update *-*-freebsd* in gcc/config.gcc'
exit 1
Index: freebsd-spec.h
===================================================================
RCS file: /home/cvs/src/contrib/gcc/config/freebsd-spec.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -L contrib/gcc/config/freebsd-spec.h -L contrib/gcc/config/freebsd-spec.h -u -r1.2 -r1.3
--- contrib/gcc/config/freebsd-spec.h
+++ contrib/gcc/config/freebsd-spec.h
@@ -53,12 +53,14 @@
#define FBSD_TARGET_OS_CPP_BUILTINS() \
do \
{ \
+ builtin_define_with_int_value ("__MidnightBSD__", 0); \
builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \
builtin_define_std ("unix"); \
builtin_define ("__KPRINTF_ATTRIBUTE__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=bsd"); \
builtin_assert ("system=FreeBSD"); \
+ builtin_assert ("system=MidnightBSD"); \
FBSD_NATIVE_TARGET_OS_CPP_BUILTINS(); \
FBSD_TARGET_CPU_CPP_BUILTINS(); \
} \
@@ -144,28 +146,11 @@
%{pg: -lc_p} \
}"
#else
-#include <sys/param.h>
-#if __FreeBSD_version < 500016
-#define FBSD_LIB_SPEC " \
- %{!shared: \
- %{!pg: \
- %{!pthread:-lc} \
- %{pthread:-lc_r}} \
- %{pg: \
- %{!pthread:-lc_p} \
- %{pthread:-lc_r_p}} \
- }"
-#else
#define FBSD_LIB_SPEC " \
%{!shared: \
%{!pg: %{pthread:-lpthread} -lc} \
%{pg: %{pthread:-lpthread_p} -lc_p} \
}"
#endif
-#endif
-#if FBSD_MAJOR < 5
-#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
-#else
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
-#endif
More information about the Midnightbsd-cvs
mailing list