Changeset 18373


Ignore:
Timestamp:
08/13/14 11:34:30 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added some info about the OS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/m4/issm_options.m4

    r18334 r18373  
    99        dnl ISSM's internal options
    1010        dnl Build info{{{
     11       
     12        dnl build date
    1113        AC_PATH_PROGS(DATE, date)
    1214        AC_MSG_CHECKING(for build date)
    13         dnl system checks require uname
    1415        if test "$DATE" ; then
    1516                PACKAGE_DATE=`date`
     
    1920        AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE,"$PACKAGE_DATE", Build date)
    2021        AC_MSG_RESULT($PACKAGE_DATE)
     22
     23        dnl user name
     24        AC_MSG_CHECKING([user name])
     25        if test -n "$USER"
     26        then
     27                user_name="$USER"
     28        else
     29                if test -n "$LOGNAME"
     30                then
     31                        user_name="$LOGNAME"
     32                else
     33                   user_name=`(whoami) 2>/dev/null` || user_name=unknown
     34                fi
     35        fi
     36        AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", Build user name)
     37        AC_MSG_RESULT($user_name)
     38
     39        AC_MSG_CHECKING([host full OS name and version])
     40        dnl normalize some host OS names
     41        case ${host_os} in
     42          dnl linux is linux is linux, regardless of RMS.
     43          linux-gnu* | lignux* )        host_os=linux ;;
     44        esac
     45        AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", Host full OS name and version)
     46        AC_MSG_RESULT($host_os)
     47
     48  AC_MSG_CHECKING([host cpu])
     49  AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu",Host cpu)
     50  AC_MSG_RESULT($host_cpu)
     51
     52  AC_MSG_CHECKING([vendor])
     53  AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor",Host vendor)
     54  AC_MSG_RESULT($host_vendor)
     55
     56  AC_MSG_CHECKING([host OS name])
     57  host_os_name=`echo $host_os | sed 's/\..*//g'`
     58  dnl normalize some OS names
     59  case ${host_os_name} in
     60        dnl linux is linux is linux, regardless of RMS.
     61        linux-gnu* | lignux* )  host_os_name=linux ;;
     62  esac
     63  AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", Host OS name)
     64  AC_MSG_RESULT($host_os_name)
     65
     66        dnl parse out the OS version of the host
     67  AC_MSG_CHECKING([host OS version])
     68  host_os_version=`echo $host_os | sed 's/^[[^0-9]]*//g'`
     69  if test -z "$host_os_version"
     70  then
     71        host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
     72  fi
     73  AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", Host OS version)
     74  AC_MSG_RESULT($host_os_version)
     75
     76
     77        dnl figure out host architecture (different than CPU)
     78  AC_MSG_CHECKING([host OS architecture])
     79  host_arch=`(uname -m) 2>/dev/null` || host_arch=unknown
     80  dnl normalize some names
     81  case ${host_arch} in
     82        sun4* ) host_arch=sun4 ;;
     83        sun3x ) host_arch=sun3 ;;
     84        sun )   host_arch=`(arch) 2>/dev/null` || host_arch=unknown ;;
     85        i?86 )  host_arch=i386 ;; # all x86 should show up as i386
     86  esac
     87  AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch",Host Archictecture)
     88  AC_MSG_RESULT($host_arch)
     89
    2190        dnl }}}
    2291        dnl Debugging {{{
Note: See TracChangeset for help on using the changeset viewer.