diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 65 |
1 files changed, 62 insertions, 3 deletions
diff --git a/configure.in b/configure.in index d02d7f85..61d0e951 100644 --- a/configure.in +++ b/configure.in | |||
@@ -585,14 +585,73 @@ elif test "$ac_cv_uname_s" = "SunOS"; then | |||
585 | ac_cv_ps_cols=9 | 585 | ac_cv_ps_cols=9 |
586 | AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris]) | 586 | AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris]) |
587 | if test `isainfo -b` = 64 ; then | 587 | if test `isainfo -b` = 64 ; then |
588 | PST3CFLAGS="-m64" | 588 | pst3_use_64bit=1 |
589 | AC_SUBST(PST3CFLAGS) | 589 | AC_MSG_NOTICE([using 64bit pst3]) |
590 | AC_MSG_NOTICE([using 64bit pst3]) | ||
591 | else | 590 | else |
592 | AC_MSG_NOTICE([using 32bit pst3]) | 591 | AC_MSG_NOTICE([using 32bit pst3]) |
593 | fi | 592 | fi |
594 | EXTRAS_ROOT="$EXTRAS_ROOT pst3" | 593 | EXTRAS_ROOT="$EXTRAS_ROOT pst3" |
595 | 594 | ||
595 | if test "$pst3_use_64bit" = 1; then | ||
596 | dnl Test if we can actually compile code in 64bit | ||
597 | old_cflags=$CFLAGS | ||
598 | CFLAGS="$CFLAGS -m64" | ||
599 | pst3_64bit_working=0 | ||
600 | AC_RUN_IFELSE( | ||
601 | [AC_LANG_PROGRAM([], [ | ||
602 | return sizeof(void*) == 8 ? 0 : 1; | ||
603 | ]) | ||
604 | ],[ | ||
605 | PST3CFLAGS="-m64" | ||
606 | AC_SUBST(PST3CFLAGS) | ||
607 | pst3_64bit_working=1 | ||
608 | AC_MSG_NOTICE([using -m64 for 64bit code]) | ||
609 | ],[ | ||
610 | pst3_64bit_working=0 | ||
611 | AC_MSG_NOTICE([compiler do not like -m64]) | ||
612 | ]) | ||
613 | CFLAGS=$old_cflags | ||
614 | if test "$pst3_64bit_working" = 0; then | ||
615 | old_cflags=$CFLAGS | ||
616 | CFLAGS="$CFLAGS -xarch=v9" | ||
617 | AC_RUN_IFELSE( | ||
618 | [AC_LANG_PROGRAM([], [ | ||
619 | return sizeof(void*) == 8 ? 0 : 1; | ||
620 | ]) | ||
621 | ],[ | ||
622 | PST3CFLAGS="-xarch=v9" | ||
623 | AC_SUBST(PST3CFLAGS) | ||
624 | pst3_64bit_working=1 | ||
625 | AC_MSG_NOTICE([using -xarch=v9 for 64bit code]) | ||
626 | ],[ | ||
627 | pst3_64bit_working=0 | ||
628 | AC_MSG_NOTICE([compiler do not like -xarch=v9]) | ||
629 | ]) | ||
630 | CFLAGS=$old_cflags | ||
631 | fi | ||
632 | if test "$pst3_64bit_working" = 0; then | ||
633 | old_cflags=$CFLAGS | ||
634 | CFLAGS="$CFLAGS -xarch=amd64" | ||
635 | AC_RUN_IFELSE( | ||
636 | [AC_LANG_PROGRAM([], [ | ||
637 | return sizeof(void*) == 8 ? 0 : 1; | ||
638 | ]) | ||
639 | ],[ | ||
640 | PST3CFLAGS="-xarch=amd64" | ||
641 | AC_SUBST(PST3CFLAGS) | ||
642 | pst3_64bit_working=1 | ||
643 | AC_MSG_NOTICE([using -xarch=amd64 for 64bit code]) | ||
644 | ],[ | ||
645 | pst3_64bit_working=0 | ||
646 | AC_MSG_NOTICE([compiler do not like -xarch=amd64]) | ||
647 | ]) | ||
648 | CFLAGS=$old_cflags | ||
649 | fi | ||
650 | if test "$pst3_64bit_working" = 0; then | ||
651 | AC_MSG_ERROR([I don't know how to build a 64-bit object!]) | ||
652 | fi | ||
653 | fi | ||
654 | |||
596 | dnl Removing this for the moment - Ton | 655 | dnl Removing this for the moment - Ton |
597 | dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation | 656 | dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation |
598 | dnl Limitation that command name is not available | 657 | dnl Limitation that command name is not available |