summaryrefslogtreecommitdiffstats
path: root/web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch')
-rw-r--r--web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch b/web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch
new file mode 100644
index 0000000..f31f482
--- /dev/null
+++ b/web/attachments/338026-0001-Attempt-at-detecting-64bit-compilation-flags-between.patch
@@ -0,0 +1,91 @@
1From 182964c5f6ca39f42f5225bc76f48a185eda04b8 Mon Sep 17 00:00:00 2001
2From: Thomas Guyot-Sionnest <dermoth@aei.ca>
3Date: Wed, 5 Aug 2009 01:32:02 -0400
4Subject: [PATCH] Attempt at detecting 64bit compilation flags between gcc, old, and new versions of sun cc
5
6Gcc accepts -m64, just as newer version of Suncc.
7Older Suncc required -xarch=v9 (SPARC) or -xarch=amd64 (x86-64) to generate 64bit code.
8---
9 configure.in | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
10 1 files changed, 58 insertions(+), 2 deletions(-)
11
12diff --git a/configure.in b/configure.in
13index 68ac0a0..197b88e 100644
14--- a/configure.in
15+++ b/configure.in
16@@ -577,14 +577,70 @@ elif test "$ac_cv_uname_s" = "SunOS"; then
17 ac_cv_ps_cols=9
18 AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
19 if test `isainfo -b` = 64 ; then
20- PST3CFLAGS="-m64"
21- AC_SUBST(PST3CFLAGS)
22+ pst3_use_64bit=1
23 AC_MSG_NOTICE([using 64bit pst3])
24 else
25 AC_MSG_NOTICE([using 32bit pst3])
26 fi
27 EXTRAS_ROOT="$EXTRAS_ROOT pst3"
28
29+ if test "$pst3_use_64bit" = 1; then
30+ dnl Test if we can actually compile code in 64bit
31+ old_cflags=$CFLAGS
32+ CFLAGS="$CFLAGS -m64"
33+ pst3_64bit_working=0
34+ AC_RUN_IFELSE(
35+ [AC_LANG_PROGRAM([], [
36+return sizeof(void*) == 8 ? 0 : 1;
37+ ])
38+ ],[
39+ PST3CFLAGS="-m64"
40+ AC_SUBST(PST3CFLAGS)
41+ pst3_64bit_working=1
42+ ],[
43+ pst3_64bit_working=0
44+ AC_MSG_NOTICE([compiler do not like -m64])
45+ ])
46+ CFLAGS=$old_cflags
47+ if test "$pst3_64bit_working" = 0; then
48+ old_cflags=$CFLAGS
49+ CFLAGS="$CFLAGS -xarch=v9"
50+ AC_RUN_IFELSE(
51+ [AC_LANG_PROGRAM([], [
52+return sizeof(void*) == 8 ? 0 : 1;
53+ ])
54+ ],[
55+ PST3CFLAGS="-xarch=v9"
56+ AC_SUBST(PST3CFLAGS)
57+ pst3_64bit_working=1
58+ ],[
59+ pst3_64bit_working=0
60+ AC_MSG_NOTICE([compiler do not like -xarch=v9])
61+ ])
62+ CFLAGS=$old_cflags
63+ fi
64+ if test "$pst3_64bit_working" = 0; then
65+ old_cflags=$CFLAGS
66+ CFLAGS="$CFLAGS -xarch=amd64"
67+ AC_RUN_IFELSE(
68+ [AC_LANG_PROGRAM([], [
69+return sizeof(void*) == 8 ? 0 : 1;
70+ ])
71+ ],[
72+ PST3CFLAGS="-xarch=amd64"
73+ AC_SUBST(PST3CFLAGS)
74+ pst3_64bit_working=1
75+ ],[
76+ pst3_64bit_working=0
77+ AC_MSG_NOTICE([compiler do not like -xarch=amd64])
78+ ])
79+ CFLAGS=$old_cflags
80+ fi
81+ if test "$pst3_64bit_working" = 0; then
82+ AC_MSG_ERROR([Don't know how to build a 64-bit object.])
83+ fi
84+ fi
85+
86 dnl Removing this for the moment - Ton
87 dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
88 dnl Limitation that command name is not available
89--
901.5.5
91