# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
fi
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
exit 0 ;;
exit 0 ;;
exit 0;;
exit 0 ;;
exit 0 ;;
exit 0;;
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
else
fi
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
exit 0 ;;
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
else
fi
fi
exit 0 ;;
exit 0 ;;
# Delta 88k system running SVR3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
exit 0 ;;
exit 0 ;;
*:IRIX*:*:*)
exit 0 ;;
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
exit 0 ;;
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
else
fi
exit 0 ;;
*:AIX:*:4)
else
fi
else
fi
exit 0 ;;
*:AIX:*:*)
exit 0 ;;
exit 0 ;;
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
case "${UNAME_MACHINE}" in
esac
exit 0 ;;
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
i?86:OSF1:*:*)
else
fi
exit 0 ;;
exit 0 ;;
exit 0 ;;
if getsysinfo -f scalar_acc
fi
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
exit 0 ;;
exit 0 ;;
CRAY-2:*:*:*)
exit 0 ;;
F300:UNIX_System_V:*:*)
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
*:FreeBSD:*:*)
exit 0 ;;
*:NetBSD:*:*)
exit 0 ;;
*:OpenBSD:*:*)
exit 0 ;;
i*:CYGWIN*:*)
exit 0 ;;
p*:CYGWIN*:*)
exit 0 ;;
exit 0 ;;
*:GNU:*:*)
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
echo "powerpc-unknown-linux-gnu" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
elif test "${UNAME_MACHINE}" = "sparc" ; then
else
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
# Determine whether the default compiler is a.out or elf
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
printf ("%s-pc-linux-gnu\n", argv[1]);
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
fi ;;
# are messed up and put the nodename in both sysname and nodename.
exit 0 ;;
else
fi
exit 0 ;;
i?86:*:3.2:*)
else
fi
exit 0 ;;
exit 0 ;;
paragon:*:*:*)
exit 0 ;;
else # Add other i860-SVR4 vendors below as they are discovered.
fi
exit 0 ;;
# "miniframe"
exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
exit 0 ;;
*:SINIX-*:*:*)
else
fi
exit 0 ;;
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
exit 0 ;;
exit 0 ;;
else
fi
exit 0 ;;
# says <Richard.M.Bartel@ccMail.Census.GOV>
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
# Apollos put the system type in the environment.
# Convex versions that predate uname can use getsysinfo(1)
then
case `getsysinfo -f cpu_type` in
c1*)
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
fi
exit 0 ;;
c34*)
exit 0 ;;
c38*)
exit 0 ;;
c4*)
exit 0 ;;
esac
fi
#echo '(Unable to guess system type)' 1>&2
exit 1