From ef631c871d79b3a43ad8678323df6b70e35b79d6 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 4 Apr 2002 09:04:07 -0500 Subject: [PATCH] BUG: add system command back into script --- Templates/cxxconfigure | 31 +++++++++++++++++++++++++++---- Templates/cxxconfigure.in | 22 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Templates/cxxconfigure b/Templates/cxxconfigure index d71e1f392..b56135cc1 100755 --- a/Templates/cxxconfigure +++ b/Templates/cxxconfigure @@ -674,6 +674,29 @@ else fi +# Step 1: set the variable "system" to hold the name and version number +# for the system. This can usually be done via the "uname" command, but +# there are a few systems, like Next, where this doesn't work. + +echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 +echo "configure:683: checking system version (for dynamic loading)" >&5 +if test -f /usr/lib/NextStep/software_version; then + system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` +else + system=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + echo "$ac_t""unknown (can't find uname command)" 1>&6 + system=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + system=MP-RAS-`awk '{print $3}' /etc/.relid'` + fi + echo "$ac_t""$system" 1>&6 + fi +fi # restore the flags specified by the user and get rid of any flags # found by autoconf (we do not want -02 -g by default) @@ -741,7 +764,7 @@ fi # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6 -echo "configure:745: checking ansi standard C++ stream headers " >&5 +echo "configure:768: checking ansi standard C++ stream headers " >&5 rm -rf conftest.* cat > conftest.cc < @@ -758,7 +781,7 @@ fi # check to see if stl is in the std namespace if test $ac_cv_prog_gxx = no; then echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6 -echo "configure:762: checking ansi standard namespace support " >&5 +echo "configure:785: checking ansi standard namespace support " >&5 rm -rf conftest.* cat > conftest.cc < @@ -776,7 +799,7 @@ fi # check to see if for scoping is supported if test $ac_cv_prog_gxx = no; then echo $ac_n "checking ansi for scope support ""... $ac_c" 1>&6 -echo "configure:780: checking ansi for scope support " >&5 +echo "configure:803: checking ansi for scope support " >&5 rm -rf conftest.* cat > conftest.cc <&6 -echo "configure:801: checking for $ac_word" >&5 +echo "configure:824: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR_TMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/Templates/cxxconfigure.in b/Templates/cxxconfigure.in index 4529e0da0..d1a891ed1 100644 --- a/Templates/cxxconfigure.in +++ b/Templates/cxxconfigure.in @@ -11,6 +11,28 @@ save_CXXFLAGS=$CXXFLAGS AC_PROG_CXX +# Step 1: set the variable "system" to hold the name and version number +# for the system. This can usually be done via the "uname" command, but +# there are a few systems, like Next, where this doesn't work. + +AC_MSG_CHECKING([system version (for dynamic loading)]) +if test -f /usr/lib/NextStep/software_version; then + system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` +else + system=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_RESULT([unknown (can't find uname command)]) + system=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + system=MP-RAS-`awk '{print $3}' /etc/.relid'` + fi + AC_MSG_RESULT($system) + fi +fi # restore the flags specified by the user and get rid of any flags # found by autoconf (we do not want -02 -g by default)