source: to-imperative/trunk/config.guess @ 1233

Last change on this file since 1233 was 299, checked in by pooh, 18 years ago
  • First stage of CVS tree reorganization completed.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1#!/bin/sh
2
3config_guess=1
4
5if [ -z "$config_functions" ]; then
6  . ./config.functions
7fi
8
9if [ -z "$CC" ] ; then CC="gcc" ; fi
10if [ -z "$CXX" ] ; then CXX="g++" ; fi
11
12ARCH=unknown
13MACHINE=unknown
14OSNAME=unknown
15OSVERSION=unknown
16
17uname_machine=`(uname -m) 2>/dev/null` || uname_machine=unknown
18uname_release=`(uname -r) 2>/dev/null` || uname_machine=unknown
19uname_system=`(uname -s) 2>/dev/null` || uname_machine=unknown
20uname_version=`(uname -v) 2>/dev/null` || uname_machine=unknown
21uname_string="${uname_machine}:${uname_system}:${uname_release}:${uname_version}"
22
23echo "Checking for machine type..."
24
25machine_not_supported ()
26{
27  echo "***"
28  echo "*** Fatal error - machine type is not supported yet [${uname_string}]"
29  echo "***"
30  exit 1
31}
32
33case ${uname_string} in
34
35*:AIX:*:4)
36  cpu_id=`/usr/sbin/lsdev -C -c processor -S available |\
37    head -1 | awk '{ print $1 }'`
38  cpu_name=`/usr/sbin/lsattr -EHl ${cpu_id} |\
39    tail -1 | awk '{ print $2 }'`
40  case $cpu_name in
41  PowerPC*)
42    ARCH=powerpc
43    MACHINE=ppc604
44    ;;
45  *)
46    machine_not_supported
47    ;;
48  esac
49  OSNAME=AIX
50  OSVERSION=4.${uname_release}
51  PICFLAGS=
52  PTHREAD_CFLAGS="-mthreads"
53  PTHREAD_LDFLAGS="-mthreads"
54  SOEXT="a"
55  AREXT="a"
56  CLIBTYPE_DEFAULT=shared
57  CXXLIBTYPE_DEFAULT=static
58  cfgname=aix-${OSVERSION}
59  ;;
60i?86:Linux:*)
61  ARCH=ia32
62  MACHINE=`uname -m`
63  OSNAME=Linux
64  OSVERSION=`uname -r`
65  cat <<EOF >cfgtest.c
66    #include <stdio.h>
67    #include <stdlib.h>
68     
69    int main()
70    {
71      printf("%d\n",__GNU_LIBRARY__);
72    }
73EOF
74  $CC -o cfgtest cfgtest.c >/dev/null 2>&1
75  tmp=`./cfgtest 2>>/dev/null`
76  rm -f cfgtest cfgtest.c
77  if [ $tmp -lt 6 ]; then
78    echo "***"
79    echo "*** Fatal error - libc too old"
80    echo "***"
81    exit 1
82  else
83    cat <<EOF >cfgtest.c
84      #include <stdio.h>
85      #include <stdlib.h>
86       
87      int main()
88      {
89        printf("%d.%d\n",__GLIBC__,__GLIBC_MINOR__);
90      }
91EOF
92    $CC -o cfgtest cfgtest.c >/dev/null 2>&1
93    glibcversion=`./cfgtest 2>>/dev/null`
94    rm -f cfgtest cfgtest.c
95  fi
96  PICFLAGS="-fPIC"
97  PTHREAD_CFLAGS="-D_REENTRANT"
98  PTHREAD_LDFLAGS="-lpthread"
99  SOEXT="so"
100  AREXT="a"
101  SONAME_FLAGS="-Wl,-soname -Wl,@soname"
102  CLIBTYPE_DEFAULT=shared
103  CXXLIBTYPE_DEFAULT=shared
104  cfgname=ia32-linux-glibc${glibcversion}
105  ;;
106*)
107  machine_not_supported
108  ;;
109esac
110
111echo "  arch=${ARCH}"
112echo "  machine=${MACHINE}"
113echo "  os=${OSNAME}-${OSVERSION}"
114if [ "${OSNAME}" = "Linux" ]; then
115  echo "  glibc=${glibcversion}"
116fi
117
118if [ -z "${OFLAGS}" ]; then OFLAGS="-O2" ; fi
119if [ -z "${WFLAGS}" ]; then WFLAGS="-W -Wall" ; fi
120if [ -z "${DFLAGS}" ]; then DFLAGS="-g -DDEBUG" ; fi
121
Note: See TracBrowser for help on using the repository browser.