├── .lvimrc ├── .travis.yml ├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile.am ├── NEWS ├── README.md ├── bootstrap ├── config.guess ├── config.sub ├── configure.ac ├── debian ├── changelog ├── control ├── copyright ├── gitlab-ci.yml ├── rules ├── sdate.lintian-overrides ├── source │ └── format └── tests │ ├── control │ └── sdate ├── doc ├── Makefile.am └── sdate.1 ├── libsdate.c ├── localtime.c ├── scripts ├── Makefile.am ├── instdebug └── sdate.in ├── simple.c ├── stamp-h.in ├── test ├── day ├── enum └── enum.sh ├── wrapawk └── wrapfunc.inp /.lvimrc: -------------------------------------------------------------------------------- 1 | set ts=8 sw=2 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # run the testsuite on travis-ci.com 2 | --- 3 | language: C 4 | dist: bionic 5 | sudo: required 6 | arch: 7 | - amd64 8 | - ppc64le 9 | 10 | script: 11 | - autoreconf --install 12 | - mkdir build 13 | - cd build 14 | - ../configure 15 | - make 16 | - sudo make install 17 | - cd .. 18 | - debian/tests/sdate 19 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Christoph Berg 2 | 3 | fakeroot authors: 4 | joost witteveen 5 | Clint Adams 6 | Timo Savola 7 | Manual page partly (mostly) written by JHM Dassen 8 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | sdate is (C) 1993 Christoph Berg 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | On Debian systems, the complete text of the GNU General Public License 9 | can be found in `/usr/share/common-licenses/GPL'. 10 | 11 | sdate is based on fakeroot. fakeroot COPYING file: 12 | 13 | -----------8<----------- 14 | 15 | I suppose 'libtricks' will take the quest of finding border-cases for the GPL 16 | yet one more (small) step forward. Does every dynamically linked executable 17 | fall under the GPL once someone said `LD_PRELOAD=libtricks.so.0.0 executable'? 18 | That seems to be a rather strange interpretation of the GPL. 19 | The way I (as author of libtricks) see it: 20 | - you're free to link any program with this library and run it. 21 | - Only when you give away or sell copies of a program that is 22 | _set up_ to use this library (or needs it), that program will be 23 | considered a ``work based on the library'', and thus fall under GPL. 24 | 25 | 26 | I've considered using LGPL, but I decided against that because 27 | - I still don't quite understand it's terms. 28 | - I actually don't want a program that really needs this 29 | library to be distributed with any other licence than (L)GPL. 30 | 31 | joost witteveen. 32 | 33 | 34 | For the tekst of the GPL, see /usr/doc/copyright/GPL of any debian system. 35 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/df7cb/sdate/61d98241dc47fcfb84f3297666ca3a93ba5ed3ec/ChangeLog -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS=-I m4 2 | AUTOMAKE_OPTIONS=foreign 3 | SUBDIRS=scripts doc 4 | 5 | lib_LTLIBRARIES=libsdate.la 6 | libsdate_la_SOURCES=libsdate.c wrapdef.h wrapstruct.h 7 | libsdate_la_LDFLAGS=-version-info 0:1:0 8 | libsdate_la_DEPENDENCIES=wrapdef.h wrapstruct.h 9 | 10 | localtime_SOURCES=localtime.c 11 | simple_SOURCES=simple.c 12 | noinst_PROGRAMS=localtime simple 13 | 14 | CLEANFILES=wrapdef.h wrapstruct.h wrapped.h wraptmpf.h 15 | 16 | EXTRA_DIST=wrapawk wrapfunc.inp \ 17 | debian/rules debian/changelog debian/control \ 18 | message.h \ 19 | DEBUG BUGS 20 | 21 | wrapped.h wrapdef.h wrapstruct.h wraptmpf.h:wrapawk wrapfunc.inp 22 | awk -f $(srcdir)/wrapawk < $(srcdir)/wrapfunc.inp 23 | 24 | libsdate.lo:libsdate.c wrapdef.h wrapstruct.h wraptmpf.h 25 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/df7cb/sdate/61d98241dc47fcfb84f3297666ca3a93ba5ed3ec/NEWS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | sdate - never ending September date 2 | ----------------------------------- 3 | 4 | ``` 5 | $ sdate 6 | Thu Sep 9718 09:13:41 CEST 1993 7 | ``` 8 | 9 | This program wraps the libc localtime() and gmtime() functions to output the 10 | eternal September 1993 date. The epoch month is configurable (new in version 11 | 0.3). 12 | 13 | sdate works like fakeroot (on which its code is based) by setting LD_PRELOAD to 14 | a wrapper library. 15 | 16 | http://www.catb.org/~esr/jargon/html/S/September-that-never-ended.html 17 | 18 | [![Build Status](https://travis-ci.org/df7cb/sdate.svg?branch=master)](https://travis-ci.org/df7cb/sdate) 19 | 20 | # Other Epochs 21 | 22 | Also supported is the never ending COVID 19 date: 23 | 24 | ``` 25 | $ sdate --covid 19 26 | Thu Mar 96 20:01:20 CEST 2020 27 | ``` 28 | 29 | Other epochs can be selected using `-e` or `--epoch`: 30 | 31 | ``` 32 | $ sdate -e 1977-03 33 | Do 15802. Mär 20:02:34 CEST 1977 34 | ``` 35 | 36 | # Programs compatible with sdate 37 | 38 | Mutt: works. It will send out septemberfied Date: headers. Depends if you like 39 | that. 40 | 41 | ![Mutt](https://www.df7cb.de/projects/sdate/mutt.png) 42 | 43 | xclock: works. 44 | 45 | ![xclock](https://www.df7cb.de/projects/sdate/xclock.png) 46 | 47 | GNU date: works somewhat. date does not fully rely on strftime but does some of 48 | the work on its own (for whatever reason) and chokes sometimes. 49 | 50 | Please tell me your experiences with sdate so I can add the programs to this 51 | list. 52 | 53 | # Links 54 | 55 | * https://www.df7cb.de/projects/sdate/ 56 | * https://github.com/df7cb/sdate 57 | * https://travis-ci.org/github/df7cb/sdate 58 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | autoreconf -i 6 | ./configure "$@" 7 | -------------------------------------------------------------------------------- /config.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Attempt to guess a canonical system name. 3 | # Copyright 1992-2018 Free Software Foundation, Inc. 4 | 5 | timestamp='2018-02-24' 6 | 7 | # This file is free software; you can redistribute it and/or modify it 8 | # under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, but 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, see . 19 | # 20 | # As a special exception to the GNU General Public License, if you 21 | # distribute this file as part of a program that contains a 22 | # configuration script generated by Autoconf, you may include it under 23 | # the same distribution terms that you use for the rest of that 24 | # program. This Exception is an additional permission under section 7 25 | # of the GNU General Public License, version 3 ("GPLv3"). 26 | # 27 | # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 28 | # 29 | # You can get the latest version of this script from: 30 | # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess 31 | # 32 | # Please send patches to . 33 | 34 | 35 | me=`echo "$0" | sed -e 's,.*/,,'` 36 | 37 | usage="\ 38 | Usage: $0 [OPTION] 39 | 40 | Output the configuration name of the system \`$me' is run on. 41 | 42 | Options: 43 | -h, --help print this help, then exit 44 | -t, --time-stamp print date of last modification, then exit 45 | -v, --version print version number, then exit 46 | 47 | Report bugs and patches to ." 48 | 49 | version="\ 50 | GNU config.guess ($timestamp) 51 | 52 | Originally written by Per Bothner. 53 | Copyright 1992-2018 Free Software Foundation, Inc. 54 | 55 | This is free software; see the source for copying conditions. There is NO 56 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 57 | 58 | help=" 59 | Try \`$me --help' for more information." 60 | 61 | # Parse command line 62 | while test $# -gt 0 ; do 63 | case $1 in 64 | --time-stamp | --time* | -t ) 65 | echo "$timestamp" ; exit ;; 66 | --version | -v ) 67 | echo "$version" ; exit ;; 68 | --help | --h* | -h ) 69 | echo "$usage"; exit ;; 70 | -- ) # Stop option processing 71 | shift; break ;; 72 | - ) # Use stdin as input. 73 | break ;; 74 | -* ) 75 | echo "$me: invalid option $1$help" >&2 76 | exit 1 ;; 77 | * ) 78 | break ;; 79 | esac 80 | done 81 | 82 | if test $# != 0; then 83 | echo "$me: too many arguments$help" >&2 84 | exit 1 85 | fi 86 | 87 | trap 'exit 1' 1 2 15 88 | 89 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a 90 | # compiler to aid in system detection is discouraged as it requires 91 | # temporary files to be created and, as you can see below, it is a 92 | # headache to deal with in a portable fashion. 93 | 94 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 95 | # use `HOST_CC' if defined, but it is deprecated. 96 | 97 | # Portable tmp directory creation inspired by the Autoconf team. 98 | 99 | set_cc_for_build=' 100 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 101 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 102 | : ${TMPDIR=/tmp} ; 103 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 104 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 105 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 106 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 107 | dummy=$tmp/dummy ; 108 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 109 | case $CC_FOR_BUILD,$HOST_CC,$CC in 110 | ,,) echo "int x;" > "$dummy.c" ; 111 | for c in cc gcc c89 c99 ; do 112 | if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 113 | CC_FOR_BUILD="$c"; break ; 114 | fi ; 115 | done ; 116 | if test x"$CC_FOR_BUILD" = x ; then 117 | CC_FOR_BUILD=no_compiler_found ; 118 | fi 119 | ;; 120 | ,,*) CC_FOR_BUILD=$CC ;; 121 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; 122 | esac ; set_cc_for_build= ;' 123 | 124 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 125 | # (ghazi@noc.rutgers.edu 1994-08-24) 126 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 127 | PATH=$PATH:/.attbin ; export PATH 128 | fi 129 | 130 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 131 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 132 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 133 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 134 | 135 | case "$UNAME_SYSTEM" in 136 | Linux|GNU|GNU/*) 137 | # If the system lacks a compiler, then just pick glibc. 138 | # We could probably try harder. 139 | LIBC=gnu 140 | 141 | eval "$set_cc_for_build" 142 | cat <<-EOF > "$dummy.c" 143 | #include 144 | #if defined(__UCLIBC__) 145 | LIBC=uclibc 146 | #elif defined(__dietlibc__) 147 | LIBC=dietlibc 148 | #else 149 | LIBC=gnu 150 | #endif 151 | EOF 152 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" 153 | 154 | # If ldd exists, use it to detect musl libc. 155 | if command -v ldd >/dev/null && \ 156 | ldd --version 2>&1 | grep -q ^musl 157 | then 158 | LIBC=musl 159 | fi 160 | ;; 161 | esac 162 | 163 | # Note: order is significant - the case branches are not exclusive. 164 | 165 | case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in 166 | *:NetBSD:*:*) 167 | # NetBSD (nbsd) targets should (where applicable) match one or 168 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 169 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 170 | # switched to ELF, *-*-netbsd* would select the old 171 | # object file format. This provides both forward 172 | # compatibility and a consistent mechanism for selecting the 173 | # object file format. 174 | # 175 | # Note: NetBSD doesn't particularly care about the vendor 176 | # portion of the name. We always set it to "unknown". 177 | sysctl="sysctl -n hw.machine_arch" 178 | UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 179 | "/sbin/$sysctl" 2>/dev/null || \ 180 | "/usr/sbin/$sysctl" 2>/dev/null || \ 181 | echo unknown)` 182 | case "$UNAME_MACHINE_ARCH" in 183 | armeb) machine=armeb-unknown ;; 184 | arm*) machine=arm-unknown ;; 185 | sh3el) machine=shl-unknown ;; 186 | sh3eb) machine=sh-unknown ;; 187 | sh5el) machine=sh5le-unknown ;; 188 | earmv*) 189 | arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 190 | endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 191 | machine="${arch}${endian}"-unknown 192 | ;; 193 | *) machine="$UNAME_MACHINE_ARCH"-unknown ;; 194 | esac 195 | # The Operating System including object format, if it has switched 196 | # to ELF recently (or will in the future) and ABI. 197 | case "$UNAME_MACHINE_ARCH" in 198 | earm*) 199 | os=netbsdelf 200 | ;; 201 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) 202 | eval "$set_cc_for_build" 203 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 204 | | grep -q __ELF__ 205 | then 206 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 207 | # Return netbsd for either. FIX? 208 | os=netbsd 209 | else 210 | os=netbsdelf 211 | fi 212 | ;; 213 | *) 214 | os=netbsd 215 | ;; 216 | esac 217 | # Determine ABI tags. 218 | case "$UNAME_MACHINE_ARCH" in 219 | earm*) 220 | expr='s/^earmv[0-9]/-eabi/;s/eb$//' 221 | abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 222 | ;; 223 | esac 224 | # The OS release 225 | # Debian GNU/NetBSD machines have a different userland, and 226 | # thus, need a distinct triplet. However, they do not need 227 | # kernel version information, so it can be replaced with a 228 | # suitable tag, in the style of linux-gnu. 229 | case "$UNAME_VERSION" in 230 | Debian*) 231 | release='-gnu' 232 | ;; 233 | *) 234 | release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 235 | ;; 236 | esac 237 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 238 | # contains redundant information, the shorter form: 239 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 240 | echo "$machine-${os}${release}${abi}" 241 | exit ;; 242 | *:Bitrig:*:*) 243 | UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 244 | echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" 245 | exit ;; 246 | *:OpenBSD:*:*) 247 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 248 | echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" 249 | exit ;; 250 | *:LibertyBSD:*:*) 251 | UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 252 | echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" 253 | exit ;; 254 | *:MidnightBSD:*:*) 255 | echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" 256 | exit ;; 257 | *:ekkoBSD:*:*) 258 | echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" 259 | exit ;; 260 | *:SolidBSD:*:*) 261 | echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" 262 | exit ;; 263 | macppc:MirBSD:*:*) 264 | echo powerpc-unknown-mirbsd"$UNAME_RELEASE" 265 | exit ;; 266 | *:MirBSD:*:*) 267 | echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" 268 | exit ;; 269 | *:Sortix:*:*) 270 | echo "$UNAME_MACHINE"-unknown-sortix 271 | exit ;; 272 | *:Redox:*:*) 273 | echo "$UNAME_MACHINE"-unknown-redox 274 | exit ;; 275 | mips:OSF1:*.*) 276 | echo mips-dec-osf1 277 | exit ;; 278 | alpha:OSF1:*:*) 279 | case $UNAME_RELEASE in 280 | *4.0) 281 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 282 | ;; 283 | *5.*) 284 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 285 | ;; 286 | esac 287 | # According to Compaq, /usr/sbin/psrinfo has been available on 288 | # OSF/1 and Tru64 systems produced since 1995. I hope that 289 | # covers most systems running today. This code pipes the CPU 290 | # types through head -n 1, so we only detect the type of CPU 0. 291 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 292 | case "$ALPHA_CPU_TYPE" in 293 | "EV4 (21064)") 294 | UNAME_MACHINE=alpha ;; 295 | "EV4.5 (21064)") 296 | UNAME_MACHINE=alpha ;; 297 | "LCA4 (21066/21068)") 298 | UNAME_MACHINE=alpha ;; 299 | "EV5 (21164)") 300 | UNAME_MACHINE=alphaev5 ;; 301 | "EV5.6 (21164A)") 302 | UNAME_MACHINE=alphaev56 ;; 303 | "EV5.6 (21164PC)") 304 | UNAME_MACHINE=alphapca56 ;; 305 | "EV5.7 (21164PC)") 306 | UNAME_MACHINE=alphapca57 ;; 307 | "EV6 (21264)") 308 | UNAME_MACHINE=alphaev6 ;; 309 | "EV6.7 (21264A)") 310 | UNAME_MACHINE=alphaev67 ;; 311 | "EV6.8CB (21264C)") 312 | UNAME_MACHINE=alphaev68 ;; 313 | "EV6.8AL (21264B)") 314 | UNAME_MACHINE=alphaev68 ;; 315 | "EV6.8CX (21264D)") 316 | UNAME_MACHINE=alphaev68 ;; 317 | "EV6.9A (21264/EV69A)") 318 | UNAME_MACHINE=alphaev69 ;; 319 | "EV7 (21364)") 320 | UNAME_MACHINE=alphaev7 ;; 321 | "EV7.9 (21364A)") 322 | UNAME_MACHINE=alphaev79 ;; 323 | esac 324 | # A Pn.n version is a patched version. 325 | # A Vn.n version is a released version. 326 | # A Tn.n version is a released field test version. 327 | # A Xn.n version is an unreleased experimental baselevel. 328 | # 1.2 uses "1.2" for uname -r. 329 | echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" 330 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 331 | exitcode=$? 332 | trap '' 0 333 | exit $exitcode ;; 334 | Amiga*:UNIX_System_V:4.0:*) 335 | echo m68k-unknown-sysv4 336 | exit ;; 337 | *:[Aa]miga[Oo][Ss]:*:*) 338 | echo "$UNAME_MACHINE"-unknown-amigaos 339 | exit ;; 340 | *:[Mm]orph[Oo][Ss]:*:*) 341 | echo "$UNAME_MACHINE"-unknown-morphos 342 | exit ;; 343 | *:OS/390:*:*) 344 | echo i370-ibm-openedition 345 | exit ;; 346 | *:z/VM:*:*) 347 | echo s390-ibm-zvmoe 348 | exit ;; 349 | *:OS400:*:*) 350 | echo powerpc-ibm-os400 351 | exit ;; 352 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 353 | echo arm-acorn-riscix"$UNAME_RELEASE" 354 | exit ;; 355 | arm*:riscos:*:*|arm*:RISCOS:*:*) 356 | echo arm-unknown-riscos 357 | exit ;; 358 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 359 | echo hppa1.1-hitachi-hiuxmpp 360 | exit ;; 361 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 362 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 363 | if test "`(/bin/universe) 2>/dev/null`" = att ; then 364 | echo pyramid-pyramid-sysv3 365 | else 366 | echo pyramid-pyramid-bsd 367 | fi 368 | exit ;; 369 | NILE*:*:*:dcosx) 370 | echo pyramid-pyramid-svr4 371 | exit ;; 372 | DRS?6000:unix:4.0:6*) 373 | echo sparc-icl-nx6 374 | exit ;; 375 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 376 | case `/usr/bin/uname -p` in 377 | sparc) echo sparc-icl-nx7; exit ;; 378 | esac ;; 379 | s390x:SunOS:*:*) 380 | echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" 381 | exit ;; 382 | sun4H:SunOS:5.*:*) 383 | echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" 384 | exit ;; 385 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 386 | echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" 387 | exit ;; 388 | i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 389 | echo i386-pc-auroraux"$UNAME_RELEASE" 390 | exit ;; 391 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 392 | eval "$set_cc_for_build" 393 | SUN_ARCH=i386 394 | # If there is a compiler, see if it is configured for 64-bit objects. 395 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 396 | # This test works for both compilers. 397 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then 398 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 399 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 400 | grep IS_64BIT_ARCH >/dev/null 401 | then 402 | SUN_ARCH=x86_64 403 | fi 404 | fi 405 | echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" 406 | exit ;; 407 | sun4*:SunOS:6*:*) 408 | # According to config.sub, this is the proper way to canonicalize 409 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but 410 | # it's likely to be more like Solaris than SunOS4. 411 | echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" 412 | exit ;; 413 | sun4*:SunOS:*:*) 414 | case "`/usr/bin/arch -k`" in 415 | Series*|S4*) 416 | UNAME_RELEASE=`uname -v` 417 | ;; 418 | esac 419 | # Japanese Language versions have a version number like `4.1.3-JL'. 420 | echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" 421 | exit ;; 422 | sun3*:SunOS:*:*) 423 | echo m68k-sun-sunos"$UNAME_RELEASE" 424 | exit ;; 425 | sun*:*:4.2BSD:*) 426 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 427 | test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 428 | case "`/bin/arch`" in 429 | sun3) 430 | echo m68k-sun-sunos"$UNAME_RELEASE" 431 | ;; 432 | sun4) 433 | echo sparc-sun-sunos"$UNAME_RELEASE" 434 | ;; 435 | esac 436 | exit ;; 437 | aushp:SunOS:*:*) 438 | echo sparc-auspex-sunos"$UNAME_RELEASE" 439 | exit ;; 440 | # The situation for MiNT is a little confusing. The machine name 441 | # can be virtually everything (everything which is not 442 | # "atarist" or "atariste" at least should have a processor 443 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 444 | # to the lowercase version "mint" (or "freemint"). Finally 445 | # the system name "TOS" denotes a system which is actually not 446 | # MiNT. But MiNT is downward compatible to TOS, so this should 447 | # be no problem. 448 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 449 | echo m68k-atari-mint"$UNAME_RELEASE" 450 | exit ;; 451 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 452 | echo m68k-atari-mint"$UNAME_RELEASE" 453 | exit ;; 454 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 455 | echo m68k-atari-mint"$UNAME_RELEASE" 456 | exit ;; 457 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 458 | echo m68k-milan-mint"$UNAME_RELEASE" 459 | exit ;; 460 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 461 | echo m68k-hades-mint"$UNAME_RELEASE" 462 | exit ;; 463 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 464 | echo m68k-unknown-mint"$UNAME_RELEASE" 465 | exit ;; 466 | m68k:machten:*:*) 467 | echo m68k-apple-machten"$UNAME_RELEASE" 468 | exit ;; 469 | powerpc:machten:*:*) 470 | echo powerpc-apple-machten"$UNAME_RELEASE" 471 | exit ;; 472 | RISC*:Mach:*:*) 473 | echo mips-dec-mach_bsd4.3 474 | exit ;; 475 | RISC*:ULTRIX:*:*) 476 | echo mips-dec-ultrix"$UNAME_RELEASE" 477 | exit ;; 478 | VAX*:ULTRIX*:*:*) 479 | echo vax-dec-ultrix"$UNAME_RELEASE" 480 | exit ;; 481 | 2020:CLIX:*:* | 2430:CLIX:*:*) 482 | echo clipper-intergraph-clix"$UNAME_RELEASE" 483 | exit ;; 484 | mips:*:*:UMIPS | mips:*:*:RISCos) 485 | eval "$set_cc_for_build" 486 | sed 's/^ //' << EOF > "$dummy.c" 487 | #ifdef __cplusplus 488 | #include /* for printf() prototype */ 489 | int main (int argc, char *argv[]) { 490 | #else 491 | int main (argc, argv) int argc; char *argv[]; { 492 | #endif 493 | #if defined (host_mips) && defined (MIPSEB) 494 | #if defined (SYSTYPE_SYSV) 495 | printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 496 | #endif 497 | #if defined (SYSTYPE_SVR4) 498 | printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 499 | #endif 500 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 501 | printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 502 | #endif 503 | #endif 504 | exit (-1); 505 | } 506 | EOF 507 | $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 508 | dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 509 | SYSTEM_NAME=`"$dummy" "$dummyarg"` && 510 | { echo "$SYSTEM_NAME"; exit; } 511 | echo mips-mips-riscos"$UNAME_RELEASE" 512 | exit ;; 513 | Motorola:PowerMAX_OS:*:*) 514 | echo powerpc-motorola-powermax 515 | exit ;; 516 | Motorola:*:4.3:PL8-*) 517 | echo powerpc-harris-powermax 518 | exit ;; 519 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 520 | echo powerpc-harris-powermax 521 | exit ;; 522 | Night_Hawk:Power_UNIX:*:*) 523 | echo powerpc-harris-powerunix 524 | exit ;; 525 | m88k:CX/UX:7*:*) 526 | echo m88k-harris-cxux7 527 | exit ;; 528 | m88k:*:4*:R4*) 529 | echo m88k-motorola-sysv4 530 | exit ;; 531 | m88k:*:3*:R3*) 532 | echo m88k-motorola-sysv3 533 | exit ;; 534 | AViiON:dgux:*:*) 535 | # DG/UX returns AViiON for all architectures 536 | UNAME_PROCESSOR=`/usr/bin/uname -p` 537 | if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] 538 | then 539 | if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ 540 | [ "$TARGET_BINARY_INTERFACE"x = x ] 541 | then 542 | echo m88k-dg-dgux"$UNAME_RELEASE" 543 | else 544 | echo m88k-dg-dguxbcs"$UNAME_RELEASE" 545 | fi 546 | else 547 | echo i586-dg-dgux"$UNAME_RELEASE" 548 | fi 549 | exit ;; 550 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) 551 | echo m88k-dolphin-sysv3 552 | exit ;; 553 | M88*:*:R3*:*) 554 | # Delta 88k system running SVR3 555 | echo m88k-motorola-sysv3 556 | exit ;; 557 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 558 | echo m88k-tektronix-sysv3 559 | exit ;; 560 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 561 | echo m68k-tektronix-bsd 562 | exit ;; 563 | *:IRIX*:*:*) 564 | echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" 565 | exit ;; 566 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 567 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 568 | exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 569 | i*86:AIX:*:*) 570 | echo i386-ibm-aix 571 | exit ;; 572 | ia64:AIX:*:*) 573 | if [ -x /usr/bin/oslevel ] ; then 574 | IBM_REV=`/usr/bin/oslevel` 575 | else 576 | IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" 577 | fi 578 | echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" 579 | exit ;; 580 | *:AIX:2:3) 581 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 582 | eval "$set_cc_for_build" 583 | sed 's/^ //' << EOF > "$dummy.c" 584 | #include 585 | 586 | main() 587 | { 588 | if (!__power_pc()) 589 | exit(1); 590 | puts("powerpc-ibm-aix3.2.5"); 591 | exit(0); 592 | } 593 | EOF 594 | if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 595 | then 596 | echo "$SYSTEM_NAME" 597 | else 598 | echo rs6000-ibm-aix3.2.5 599 | fi 600 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 601 | echo rs6000-ibm-aix3.2.4 602 | else 603 | echo rs6000-ibm-aix3.2 604 | fi 605 | exit ;; 606 | *:AIX:*:[4567]) 607 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 608 | if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 609 | IBM_ARCH=rs6000 610 | else 611 | IBM_ARCH=powerpc 612 | fi 613 | if [ -x /usr/bin/lslpp ] ; then 614 | IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | 615 | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 616 | else 617 | IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" 618 | fi 619 | echo "$IBM_ARCH"-ibm-aix"$IBM_REV" 620 | exit ;; 621 | *:AIX:*:*) 622 | echo rs6000-ibm-aix 623 | exit ;; 624 | ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 625 | echo romp-ibm-bsd4.4 626 | exit ;; 627 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 628 | echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to 629 | exit ;; # report: romp-ibm BSD 4.3 630 | *:BOSX:*:*) 631 | echo rs6000-bull-bosx 632 | exit ;; 633 | DPX/2?00:B.O.S.:*:*) 634 | echo m68k-bull-sysv3 635 | exit ;; 636 | 9000/[34]??:4.3bsd:1.*:*) 637 | echo m68k-hp-bsd 638 | exit ;; 639 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 640 | echo m68k-hp-bsd4.4 641 | exit ;; 642 | 9000/[34678]??:HP-UX:*:*) 643 | HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` 644 | case "$UNAME_MACHINE" in 645 | 9000/31?) HP_ARCH=m68000 ;; 646 | 9000/[34]??) HP_ARCH=m68k ;; 647 | 9000/[678][0-9][0-9]) 648 | if [ -x /usr/bin/getconf ]; then 649 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 650 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 651 | case "$sc_cpu_version" in 652 | 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 653 | 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 654 | 532) # CPU_PA_RISC2_0 655 | case "$sc_kernel_bits" in 656 | 32) HP_ARCH=hppa2.0n ;; 657 | 64) HP_ARCH=hppa2.0w ;; 658 | '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 659 | esac ;; 660 | esac 661 | fi 662 | if [ "$HP_ARCH" = "" ]; then 663 | eval "$set_cc_for_build" 664 | sed 's/^ //' << EOF > "$dummy.c" 665 | 666 | #define _HPUX_SOURCE 667 | #include 668 | #include 669 | 670 | int main () 671 | { 672 | #if defined(_SC_KERNEL_BITS) 673 | long bits = sysconf(_SC_KERNEL_BITS); 674 | #endif 675 | long cpu = sysconf (_SC_CPU_VERSION); 676 | 677 | switch (cpu) 678 | { 679 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 680 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 681 | case CPU_PA_RISC2_0: 682 | #if defined(_SC_KERNEL_BITS) 683 | switch (bits) 684 | { 685 | case 64: puts ("hppa2.0w"); break; 686 | case 32: puts ("hppa2.0n"); break; 687 | default: puts ("hppa2.0"); break; 688 | } break; 689 | #else /* !defined(_SC_KERNEL_BITS) */ 690 | puts ("hppa2.0"); break; 691 | #endif 692 | default: puts ("hppa1.0"); break; 693 | } 694 | exit (0); 695 | } 696 | EOF 697 | (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 698 | test -z "$HP_ARCH" && HP_ARCH=hppa 699 | fi ;; 700 | esac 701 | if [ "$HP_ARCH" = hppa2.0w ] 702 | then 703 | eval "$set_cc_for_build" 704 | 705 | # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 706 | # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 707 | # generating 64-bit code. GNU and HP use different nomenclature: 708 | # 709 | # $ CC_FOR_BUILD=cc ./config.guess 710 | # => hppa2.0w-hp-hpux11.23 711 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 712 | # => hppa64-hp-hpux11.23 713 | 714 | if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 715 | grep -q __LP64__ 716 | then 717 | HP_ARCH=hppa2.0w 718 | else 719 | HP_ARCH=hppa64 720 | fi 721 | fi 722 | echo "$HP_ARCH"-hp-hpux"$HPUX_REV" 723 | exit ;; 724 | ia64:HP-UX:*:*) 725 | HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` 726 | echo ia64-hp-hpux"$HPUX_REV" 727 | exit ;; 728 | 3050*:HI-UX:*:*) 729 | eval "$set_cc_for_build" 730 | sed 's/^ //' << EOF > "$dummy.c" 731 | #include 732 | int 733 | main () 734 | { 735 | long cpu = sysconf (_SC_CPU_VERSION); 736 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns 737 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 738 | results, however. */ 739 | if (CPU_IS_PA_RISC (cpu)) 740 | { 741 | switch (cpu) 742 | { 743 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 744 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 745 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 746 | default: puts ("hppa-hitachi-hiuxwe2"); break; 747 | } 748 | } 749 | else if (CPU_IS_HP_MC68K (cpu)) 750 | puts ("m68k-hitachi-hiuxwe2"); 751 | else puts ("unknown-hitachi-hiuxwe2"); 752 | exit (0); 753 | } 754 | EOF 755 | $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 756 | { echo "$SYSTEM_NAME"; exit; } 757 | echo unknown-hitachi-hiuxwe2 758 | exit ;; 759 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 760 | echo hppa1.1-hp-bsd 761 | exit ;; 762 | 9000/8??:4.3bsd:*:*) 763 | echo hppa1.0-hp-bsd 764 | exit ;; 765 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 766 | echo hppa1.0-hp-mpeix 767 | exit ;; 768 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 769 | echo hppa1.1-hp-osf 770 | exit ;; 771 | hp8??:OSF1:*:*) 772 | echo hppa1.0-hp-osf 773 | exit ;; 774 | i*86:OSF1:*:*) 775 | if [ -x /usr/sbin/sysversion ] ; then 776 | echo "$UNAME_MACHINE"-unknown-osf1mk 777 | else 778 | echo "$UNAME_MACHINE"-unknown-osf1 779 | fi 780 | exit ;; 781 | parisc*:Lites*:*:*) 782 | echo hppa1.1-hp-lites 783 | exit ;; 784 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 785 | echo c1-convex-bsd 786 | exit ;; 787 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 788 | if getsysinfo -f scalar_acc 789 | then echo c32-convex-bsd 790 | else echo c2-convex-bsd 791 | fi 792 | exit ;; 793 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 794 | echo c34-convex-bsd 795 | exit ;; 796 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 797 | echo c38-convex-bsd 798 | exit ;; 799 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 800 | echo c4-convex-bsd 801 | exit ;; 802 | CRAY*Y-MP:*:*:*) 803 | echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' 804 | exit ;; 805 | CRAY*[A-Z]90:*:*:*) 806 | echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 807 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 808 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 809 | -e 's/\.[^.]*$/.X/' 810 | exit ;; 811 | CRAY*TS:*:*:*) 812 | echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' 813 | exit ;; 814 | CRAY*T3E:*:*:*) 815 | echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' 816 | exit ;; 817 | CRAY*SV1:*:*:*) 818 | echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' 819 | exit ;; 820 | *:UNICOS/mp:*:*) 821 | echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' 822 | exit ;; 823 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 824 | FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 825 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 826 | FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 827 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 828 | exit ;; 829 | 5000:UNIX_System_V:4.*:*) 830 | FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 831 | FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 832 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 833 | exit ;; 834 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 835 | echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" 836 | exit ;; 837 | sparc*:BSD/OS:*:*) 838 | echo sparc-unknown-bsdi"$UNAME_RELEASE" 839 | exit ;; 840 | *:BSD/OS:*:*) 841 | echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" 842 | exit ;; 843 | *:FreeBSD:*:*) 844 | UNAME_PROCESSOR=`/usr/bin/uname -p` 845 | case "$UNAME_PROCESSOR" in 846 | amd64) 847 | UNAME_PROCESSOR=x86_64 ;; 848 | i386) 849 | UNAME_PROCESSOR=i586 ;; 850 | esac 851 | echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" 852 | exit ;; 853 | i*:CYGWIN*:*) 854 | echo "$UNAME_MACHINE"-pc-cygwin 855 | exit ;; 856 | *:MINGW64*:*) 857 | echo "$UNAME_MACHINE"-pc-mingw64 858 | exit ;; 859 | *:MINGW*:*) 860 | echo "$UNAME_MACHINE"-pc-mingw32 861 | exit ;; 862 | *:MSYS*:*) 863 | echo "$UNAME_MACHINE"-pc-msys 864 | exit ;; 865 | i*:PW*:*) 866 | echo "$UNAME_MACHINE"-pc-pw32 867 | exit ;; 868 | *:Interix*:*) 869 | case "$UNAME_MACHINE" in 870 | x86) 871 | echo i586-pc-interix"$UNAME_RELEASE" 872 | exit ;; 873 | authenticamd | genuineintel | EM64T) 874 | echo x86_64-unknown-interix"$UNAME_RELEASE" 875 | exit ;; 876 | IA64) 877 | echo ia64-unknown-interix"$UNAME_RELEASE" 878 | exit ;; 879 | esac ;; 880 | i*:UWIN*:*) 881 | echo "$UNAME_MACHINE"-pc-uwin 882 | exit ;; 883 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 884 | echo x86_64-unknown-cygwin 885 | exit ;; 886 | prep*:SunOS:5.*:*) 887 | echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" 888 | exit ;; 889 | *:GNU:*:*) 890 | # the GNU system 891 | echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" 892 | exit ;; 893 | *:GNU/*:*:*) 894 | # other systems with GNU libc and userland 895 | echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" 896 | exit ;; 897 | i*86:Minix:*:*) 898 | echo "$UNAME_MACHINE"-pc-minix 899 | exit ;; 900 | aarch64:Linux:*:*) 901 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 902 | exit ;; 903 | aarch64_be:Linux:*:*) 904 | UNAME_MACHINE=aarch64_be 905 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 906 | exit ;; 907 | alpha:Linux:*:*) 908 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 909 | EV5) UNAME_MACHINE=alphaev5 ;; 910 | EV56) UNAME_MACHINE=alphaev56 ;; 911 | PCA56) UNAME_MACHINE=alphapca56 ;; 912 | PCA57) UNAME_MACHINE=alphapca56 ;; 913 | EV6) UNAME_MACHINE=alphaev6 ;; 914 | EV67) UNAME_MACHINE=alphaev67 ;; 915 | EV68*) UNAME_MACHINE=alphaev68 ;; 916 | esac 917 | objdump --private-headers /bin/sh | grep -q ld.so.1 918 | if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 919 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 920 | exit ;; 921 | arc:Linux:*:* | arceb:Linux:*:*) 922 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 923 | exit ;; 924 | arm*:Linux:*:*) 925 | eval "$set_cc_for_build" 926 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 927 | | grep -q __ARM_EABI__ 928 | then 929 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 930 | else 931 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 932 | | grep -q __ARM_PCS_VFP 933 | then 934 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi 935 | else 936 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf 937 | fi 938 | fi 939 | exit ;; 940 | avr32*:Linux:*:*) 941 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 942 | exit ;; 943 | cris:Linux:*:*) 944 | echo "$UNAME_MACHINE"-axis-linux-"$LIBC" 945 | exit ;; 946 | crisv32:Linux:*:*) 947 | echo "$UNAME_MACHINE"-axis-linux-"$LIBC" 948 | exit ;; 949 | e2k:Linux:*:*) 950 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 951 | exit ;; 952 | frv:Linux:*:*) 953 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 954 | exit ;; 955 | hexagon:Linux:*:*) 956 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 957 | exit ;; 958 | i*86:Linux:*:*) 959 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC" 960 | exit ;; 961 | ia64:Linux:*:*) 962 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 963 | exit ;; 964 | k1om:Linux:*:*) 965 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 966 | exit ;; 967 | m32r*:Linux:*:*) 968 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 969 | exit ;; 970 | m68*:Linux:*:*) 971 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 972 | exit ;; 973 | mips:Linux:*:* | mips64:Linux:*:*) 974 | eval "$set_cc_for_build" 975 | sed 's/^ //' << EOF > "$dummy.c" 976 | #undef CPU 977 | #undef ${UNAME_MACHINE} 978 | #undef ${UNAME_MACHINE}el 979 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 980 | CPU=${UNAME_MACHINE}el 981 | #else 982 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 983 | CPU=${UNAME_MACHINE} 984 | #else 985 | CPU= 986 | #endif 987 | #endif 988 | EOF 989 | eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" 990 | test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } 991 | ;; 992 | mips64el:Linux:*:*) 993 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 994 | exit ;; 995 | openrisc*:Linux:*:*) 996 | echo or1k-unknown-linux-"$LIBC" 997 | exit ;; 998 | or32:Linux:*:* | or1k*:Linux:*:*) 999 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1000 | exit ;; 1001 | padre:Linux:*:*) 1002 | echo sparc-unknown-linux-"$LIBC" 1003 | exit ;; 1004 | parisc64:Linux:*:* | hppa64:Linux:*:*) 1005 | echo hppa64-unknown-linux-"$LIBC" 1006 | exit ;; 1007 | parisc:Linux:*:* | hppa:Linux:*:*) 1008 | # Look for CPU level 1009 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1010 | PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; 1011 | PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; 1012 | *) echo hppa-unknown-linux-"$LIBC" ;; 1013 | esac 1014 | exit ;; 1015 | ppc64:Linux:*:*) 1016 | echo powerpc64-unknown-linux-"$LIBC" 1017 | exit ;; 1018 | ppc:Linux:*:*) 1019 | echo powerpc-unknown-linux-"$LIBC" 1020 | exit ;; 1021 | ppc64le:Linux:*:*) 1022 | echo powerpc64le-unknown-linux-"$LIBC" 1023 | exit ;; 1024 | ppcle:Linux:*:*) 1025 | echo powerpcle-unknown-linux-"$LIBC" 1026 | exit ;; 1027 | riscv32:Linux:*:* | riscv64:Linux:*:*) 1028 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1029 | exit ;; 1030 | s390:Linux:*:* | s390x:Linux:*:*) 1031 | echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" 1032 | exit ;; 1033 | sh64*:Linux:*:*) 1034 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1035 | exit ;; 1036 | sh*:Linux:*:*) 1037 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1038 | exit ;; 1039 | sparc:Linux:*:* | sparc64:Linux:*:*) 1040 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1041 | exit ;; 1042 | tile*:Linux:*:*) 1043 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1044 | exit ;; 1045 | vax:Linux:*:*) 1046 | echo "$UNAME_MACHINE"-dec-linux-"$LIBC" 1047 | exit ;; 1048 | x86_64:Linux:*:*) 1049 | if objdump -f /bin/sh | grep -q elf32-x86-64; then 1050 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 1051 | else 1052 | echo "$UNAME_MACHINE"-pc-linux-"$LIBC" 1053 | fi 1054 | exit ;; 1055 | xtensa*:Linux:*:*) 1056 | echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 1057 | exit ;; 1058 | i*86:DYNIX/ptx:4*:*) 1059 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1060 | # earlier versions are messed up and put the nodename in both 1061 | # sysname and nodename. 1062 | echo i386-sequent-sysv4 1063 | exit ;; 1064 | i*86:UNIX_SV:4.2MP:2.*) 1065 | # Unixware is an offshoot of SVR4, but it has its own version 1066 | # number series starting with 2... 1067 | # I am not positive that other SVR4 systems won't match this, 1068 | # I just have to hope. -- rms. 1069 | # Use sysv4.2uw... so that sysv4* matches it. 1070 | echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" 1071 | exit ;; 1072 | i*86:OS/2:*:*) 1073 | # If we were able to find `uname', then EMX Unix compatibility 1074 | # is probably installed. 1075 | echo "$UNAME_MACHINE"-pc-os2-emx 1076 | exit ;; 1077 | i*86:XTS-300:*:STOP) 1078 | echo "$UNAME_MACHINE"-unknown-stop 1079 | exit ;; 1080 | i*86:atheos:*:*) 1081 | echo "$UNAME_MACHINE"-unknown-atheos 1082 | exit ;; 1083 | i*86:syllable:*:*) 1084 | echo "$UNAME_MACHINE"-pc-syllable 1085 | exit ;; 1086 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1087 | echo i386-unknown-lynxos"$UNAME_RELEASE" 1088 | exit ;; 1089 | i*86:*DOS:*:*) 1090 | echo "$UNAME_MACHINE"-pc-msdosdjgpp 1091 | exit ;; 1092 | i*86:*:4.*:*) 1093 | UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 1094 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1095 | echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" 1096 | else 1097 | echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" 1098 | fi 1099 | exit ;; 1100 | i*86:*:5:[678]*) 1101 | # UnixWare 7.x, OpenUNIX and OpenServer 6. 1102 | case `/bin/uname -X | grep "^Machine"` in 1103 | *486*) UNAME_MACHINE=i486 ;; 1104 | *Pentium) UNAME_MACHINE=i586 ;; 1105 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1106 | esac 1107 | echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" 1108 | exit ;; 1109 | i*86:*:3.2:*) 1110 | if test -f /usr/options/cb.name; then 1111 | UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then 1114 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1115 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1116 | (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1117 | && UNAME_MACHINE=i586 1118 | (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1119 | && UNAME_MACHINE=i686 1120 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1121 | && UNAME_MACHINE=i686 1122 | echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" 1123 | else 1124 | echo "$UNAME_MACHINE"-pc-sysv32 1125 | fi 1126 | exit ;; 1127 | pc:*:*:*) 1128 | # Left here for compatibility: 1129 | # uname -m prints for DJGPP always 'pc', but it prints nothing about 1130 | # the processor, so we play safe by assuming i586. 1131 | # Note: whatever this is, it MUST be the same as what config.sub 1132 | # prints for the "djgpp" host, or else GDB configure will decide that 1133 | # this is a cross-build. 1134 | echo i586-pc-msdosdjgpp 1135 | exit ;; 1136 | Intel:Mach:3*:*) 1137 | echo i386-pc-mach3 1138 | exit ;; 1139 | paragon:*:*:*) 1140 | echo i860-intel-osf1 1141 | exit ;; 1142 | i860:*:4.*:*) # i860-SVR4 1143 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1144 | echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 1145 | else # Add other i860-SVR4 vendors below as they are discovered. 1146 | echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 1147 | fi 1148 | exit ;; 1149 | mini*:CTIX:SYS*5:*) 1150 | # "miniframe" 1151 | echo m68010-convergent-sysv 1152 | exit ;; 1153 | mc68k:UNIX:SYSTEM5:3.51m) 1154 | echo m68k-convergent-sysv 1155 | exit ;; 1156 | M680?0:D-NIX:5.3:*) 1157 | echo m68k-diab-dnix 1158 | exit ;; 1159 | M68*:*:R3V[5678]*:*) 1160 | test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1161 | 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 1162 | OS_REL='' 1163 | test -r /etc/.relid \ 1164 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1165 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1166 | && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 1167 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1168 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 1169 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1170 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1171 | && { echo i486-ncr-sysv4; exit; } ;; 1172 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1173 | OS_REL='.3' 1174 | test -r /etc/.relid \ 1175 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1176 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1177 | && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 1178 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1179 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 1180 | /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1181 | && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 1182 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1183 | echo m68k-unknown-lynxos"$UNAME_RELEASE" 1184 | exit ;; 1185 | mc68030:UNIX_System_V:4.*:*) 1186 | echo m68k-atari-sysv4 1187 | exit ;; 1188 | TSUNAMI:LynxOS:2.*:*) 1189 | echo sparc-unknown-lynxos"$UNAME_RELEASE" 1190 | exit ;; 1191 | rs6000:LynxOS:2.*:*) 1192 | echo rs6000-unknown-lynxos"$UNAME_RELEASE" 1193 | exit ;; 1194 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1195 | echo powerpc-unknown-lynxos"$UNAME_RELEASE" 1196 | exit ;; 1197 | SM[BE]S:UNIX_SV:*:*) 1198 | echo mips-dde-sysv"$UNAME_RELEASE" 1199 | exit ;; 1200 | RM*:ReliantUNIX-*:*:*) 1201 | echo mips-sni-sysv4 1202 | exit ;; 1203 | RM*:SINIX-*:*:*) 1204 | echo mips-sni-sysv4 1205 | exit ;; 1206 | *:SINIX-*:*:*) 1207 | if uname -p 2>/dev/null >/dev/null ; then 1208 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1209 | echo "$UNAME_MACHINE"-sni-sysv4 1210 | else 1211 | echo ns32k-sni-sysv 1212 | fi 1213 | exit ;; 1214 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1215 | # says 1216 | echo i586-unisys-sysv4 1217 | exit ;; 1218 | *:UNIX_System_V:4*:FTX*) 1219 | # From Gerald Hewes . 1220 | # How about differentiating between stratus architectures? -djm 1221 | echo hppa1.1-stratus-sysv4 1222 | exit ;; 1223 | *:*:*:FTX*) 1224 | # From seanf@swdc.stratus.com. 1225 | echo i860-stratus-sysv4 1226 | exit ;; 1227 | i*86:VOS:*:*) 1228 | # From Paul.Green@stratus.com. 1229 | echo "$UNAME_MACHINE"-stratus-vos 1230 | exit ;; 1231 | *:VOS:*:*) 1232 | # From Paul.Green@stratus.com. 1233 | echo hppa1.1-stratus-vos 1234 | exit ;; 1235 | mc68*:A/UX:*:*) 1236 | echo m68k-apple-aux"$UNAME_RELEASE" 1237 | exit ;; 1238 | news*:NEWS-OS:6*:*) 1239 | echo mips-sony-newsos6 1240 | exit ;; 1241 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1242 | if [ -d /usr/nec ]; then 1243 | echo mips-nec-sysv"$UNAME_RELEASE" 1244 | else 1245 | echo mips-unknown-sysv"$UNAME_RELEASE" 1246 | fi 1247 | exit ;; 1248 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1249 | echo powerpc-be-beos 1250 | exit ;; 1251 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1252 | echo powerpc-apple-beos 1253 | exit ;; 1254 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1255 | echo i586-pc-beos 1256 | exit ;; 1257 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1258 | echo i586-pc-haiku 1259 | exit ;; 1260 | x86_64:Haiku:*:*) 1261 | echo x86_64-unknown-haiku 1262 | exit ;; 1263 | SX-4:SUPER-UX:*:*) 1264 | echo sx4-nec-superux"$UNAME_RELEASE" 1265 | exit ;; 1266 | SX-5:SUPER-UX:*:*) 1267 | echo sx5-nec-superux"$UNAME_RELEASE" 1268 | exit ;; 1269 | SX-6:SUPER-UX:*:*) 1270 | echo sx6-nec-superux"$UNAME_RELEASE" 1271 | exit ;; 1272 | SX-7:SUPER-UX:*:*) 1273 | echo sx7-nec-superux"$UNAME_RELEASE" 1274 | exit ;; 1275 | SX-8:SUPER-UX:*:*) 1276 | echo sx8-nec-superux"$UNAME_RELEASE" 1277 | exit ;; 1278 | SX-8R:SUPER-UX:*:*) 1279 | echo sx8r-nec-superux"$UNAME_RELEASE" 1280 | exit ;; 1281 | SX-ACE:SUPER-UX:*:*) 1282 | echo sxace-nec-superux"$UNAME_RELEASE" 1283 | exit ;; 1284 | Power*:Rhapsody:*:*) 1285 | echo powerpc-apple-rhapsody"$UNAME_RELEASE" 1286 | exit ;; 1287 | *:Rhapsody:*:*) 1288 | echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" 1289 | exit ;; 1290 | *:Darwin:*:*) 1291 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1292 | eval "$set_cc_for_build" 1293 | if test "$UNAME_PROCESSOR" = unknown ; then 1294 | UNAME_PROCESSOR=powerpc 1295 | fi 1296 | if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then 1297 | if [ "$CC_FOR_BUILD" != no_compiler_found ]; then 1298 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1299 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1300 | grep IS_64BIT_ARCH >/dev/null 1301 | then 1302 | case $UNAME_PROCESSOR in 1303 | i386) UNAME_PROCESSOR=x86_64 ;; 1304 | powerpc) UNAME_PROCESSOR=powerpc64 ;; 1305 | esac 1306 | fi 1307 | # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1308 | if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1309 | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1310 | grep IS_PPC >/dev/null 1311 | then 1312 | UNAME_PROCESSOR=powerpc 1313 | fi 1314 | fi 1315 | elif test "$UNAME_PROCESSOR" = i386 ; then 1316 | # Avoid executing cc on OS X 10.9, as it ships with a stub 1317 | # that puts up a graphical alert prompting to install 1318 | # developer tools. Any system running Mac OS X 10.7 or 1319 | # later (Darwin 11 and later) is required to have a 64-bit 1320 | # processor. This is not true of the ARM version of Darwin 1321 | # that Apple uses in portable devices. 1322 | UNAME_PROCESSOR=x86_64 1323 | fi 1324 | echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" 1325 | exit ;; 1326 | *:procnto*:*:* | *:QNX:[0123456789]*:*) 1327 | UNAME_PROCESSOR=`uname -p` 1328 | if test "$UNAME_PROCESSOR" = x86; then 1329 | UNAME_PROCESSOR=i386 1330 | UNAME_MACHINE=pc 1331 | fi 1332 | echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" 1333 | exit ;; 1334 | *:QNX:*:4*) 1335 | echo i386-pc-qnx 1336 | exit ;; 1337 | NEO-*:NONSTOP_KERNEL:*:*) 1338 | echo neo-tandem-nsk"$UNAME_RELEASE" 1339 | exit ;; 1340 | NSE-*:NONSTOP_KERNEL:*:*) 1341 | echo nse-tandem-nsk"$UNAME_RELEASE" 1342 | exit ;; 1343 | NSR-*:NONSTOP_KERNEL:*:*) 1344 | echo nsr-tandem-nsk"$UNAME_RELEASE" 1345 | exit ;; 1346 | NSV-*:NONSTOP_KERNEL:*:*) 1347 | echo nsv-tandem-nsk"$UNAME_RELEASE" 1348 | exit ;; 1349 | NSX-*:NONSTOP_KERNEL:*:*) 1350 | echo nsx-tandem-nsk"$UNAME_RELEASE" 1351 | exit ;; 1352 | *:NonStop-UX:*:*) 1353 | echo mips-compaq-nonstopux 1354 | exit ;; 1355 | BS2000:POSIX*:*:*) 1356 | echo bs2000-siemens-sysv 1357 | exit ;; 1358 | DS/*:UNIX_System_V:*:*) 1359 | echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" 1360 | exit ;; 1361 | *:Plan9:*:*) 1362 | # "uname -m" is not consistent, so use $cputype instead. 386 1363 | # is converted to i386 for consistency with other x86 1364 | # operating systems. 1365 | if test "$cputype" = 386; then 1366 | UNAME_MACHINE=i386 1367 | else 1368 | UNAME_MACHINE="$cputype" 1369 | fi 1370 | echo "$UNAME_MACHINE"-unknown-plan9 1371 | exit ;; 1372 | *:TOPS-10:*:*) 1373 | echo pdp10-unknown-tops10 1374 | exit ;; 1375 | *:TENEX:*:*) 1376 | echo pdp10-unknown-tenex 1377 | exit ;; 1378 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1379 | echo pdp10-dec-tops20 1380 | exit ;; 1381 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1382 | echo pdp10-xkl-tops20 1383 | exit ;; 1384 | *:TOPS-20:*:*) 1385 | echo pdp10-unknown-tops20 1386 | exit ;; 1387 | *:ITS:*:*) 1388 | echo pdp10-unknown-its 1389 | exit ;; 1390 | SEI:*:*:SEIUX) 1391 | echo mips-sei-seiux"$UNAME_RELEASE" 1392 | exit ;; 1393 | *:DragonFly:*:*) 1394 | echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" 1395 | exit ;; 1396 | *:*VMS:*:*) 1397 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1398 | case "$UNAME_MACHINE" in 1399 | A*) echo alpha-dec-vms ; exit ;; 1400 | I*) echo ia64-dec-vms ; exit ;; 1401 | V*) echo vax-dec-vms ; exit ;; 1402 | esac ;; 1403 | *:XENIX:*:SysV) 1404 | echo i386-pc-xenix 1405 | exit ;; 1406 | i*86:skyos:*:*) 1407 | echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" 1408 | exit ;; 1409 | i*86:rdos:*:*) 1410 | echo "$UNAME_MACHINE"-pc-rdos 1411 | exit ;; 1412 | i*86:AROS:*:*) 1413 | echo "$UNAME_MACHINE"-pc-aros 1414 | exit ;; 1415 | x86_64:VMkernel:*:*) 1416 | echo "$UNAME_MACHINE"-unknown-esx 1417 | exit ;; 1418 | amd64:Isilon\ OneFS:*:*) 1419 | echo x86_64-unknown-onefs 1420 | exit ;; 1421 | esac 1422 | 1423 | echo "$0: unable to guess system type" >&2 1424 | 1425 | case "$UNAME_MACHINE:$UNAME_SYSTEM" in 1426 | mips:Linux | mips64:Linux) 1427 | # If we got here on MIPS GNU/Linux, output extra information. 1428 | cat >&2 <&2 </dev/null || echo unknown` 1453 | uname -r = `(uname -r) 2>/dev/null || echo unknown` 1454 | uname -s = `(uname -s) 2>/dev/null || echo unknown` 1455 | uname -v = `(uname -v) 2>/dev/null || echo unknown` 1456 | 1457 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1458 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1459 | 1460 | hostinfo = `(hostinfo) 2>/dev/null` 1461 | /bin/universe = `(/bin/universe) 2>/dev/null` 1462 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1463 | /bin/arch = `(/bin/arch) 2>/dev/null` 1464 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1465 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1466 | 1467 | UNAME_MACHINE = "$UNAME_MACHINE" 1468 | UNAME_RELEASE = "$UNAME_RELEASE" 1469 | UNAME_SYSTEM = "$UNAME_SYSTEM" 1470 | UNAME_VERSION = "$UNAME_VERSION" 1471 | EOF 1472 | 1473 | exit 1 1474 | 1475 | # Local variables: 1476 | # eval: (add-hook 'write-file-functions 'time-stamp) 1477 | # time-stamp-start: "timestamp='" 1478 | # time-stamp-format: "%:y-%02m-%02d" 1479 | # time-stamp-end: "'" 1480 | # End: 1481 | -------------------------------------------------------------------------------- /config.sub: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Configuration validation subroutine script. 3 | # Copyright 1992-2018 Free Software Foundation, Inc. 4 | 5 | timestamp='2018-02-22' 6 | 7 | # This file is free software; you can redistribute it and/or modify it 8 | # under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, but 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, see . 19 | # 20 | # As a special exception to the GNU General Public License, if you 21 | # distribute this file as part of a program that contains a 22 | # configuration script generated by Autoconf, you may include it under 23 | # the same distribution terms that you use for the rest of that 24 | # program. This Exception is an additional permission under section 7 25 | # of the GNU General Public License, version 3 ("GPLv3"). 26 | 27 | 28 | # Please send patches to . 29 | # 30 | # Configuration subroutine to validate and canonicalize a configuration type. 31 | # Supply the specified configuration type as an argument. 32 | # If it is invalid, we print an error message on stderr and exit with code 1. 33 | # Otherwise, we print the canonical config type on stdout and succeed. 34 | 35 | # You can get the latest version of this script from: 36 | # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub 37 | 38 | # This file is supposed to be the same for all GNU packages 39 | # and recognize all the CPU types, system types and aliases 40 | # that are meaningful with *any* GNU software. 41 | # Each package is responsible for reporting which valid configurations 42 | # it does not support. The user should be able to distinguish 43 | # a failure to support a valid configuration from a meaningless 44 | # configuration. 45 | 46 | # The goal of this file is to map all the various variations of a given 47 | # machine specification into a single specification in the form: 48 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 49 | # or in some cases, the newer four-part form: 50 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 51 | # It is wrong to echo any other type of specification. 52 | 53 | me=`echo "$0" | sed -e 's,.*/,,'` 54 | 55 | usage="\ 56 | Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS 57 | 58 | Canonicalize a configuration name. 59 | 60 | Options: 61 | -h, --help print this help, then exit 62 | -t, --time-stamp print date of last modification, then exit 63 | -v, --version print version number, then exit 64 | 65 | Report bugs and patches to ." 66 | 67 | version="\ 68 | GNU config.sub ($timestamp) 69 | 70 | Copyright 1992-2018 Free Software Foundation, Inc. 71 | 72 | This is free software; see the source for copying conditions. There is NO 73 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 74 | 75 | help=" 76 | Try \`$me --help' for more information." 77 | 78 | # Parse command line 79 | while test $# -gt 0 ; do 80 | case $1 in 81 | --time-stamp | --time* | -t ) 82 | echo "$timestamp" ; exit ;; 83 | --version | -v ) 84 | echo "$version" ; exit ;; 85 | --help | --h* | -h ) 86 | echo "$usage"; exit ;; 87 | -- ) # Stop option processing 88 | shift; break ;; 89 | - ) # Use stdin as input. 90 | break ;; 91 | -* ) 92 | echo "$me: invalid option $1$help" 93 | exit 1 ;; 94 | 95 | *local*) 96 | # First pass through any local machine types. 97 | echo "$1" 98 | exit ;; 99 | 100 | * ) 101 | break ;; 102 | esac 103 | done 104 | 105 | case $# in 106 | 0) echo "$me: missing argument$help" >&2 107 | exit 1;; 108 | 1) ;; 109 | *) echo "$me: too many arguments$help" >&2 110 | exit 1;; 111 | esac 112 | 113 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). 114 | # Here we must recognize all the valid KERNEL-OS combinations. 115 | maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` 116 | case $maybe_os in 117 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ 118 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ 119 | knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ 120 | kopensolaris*-gnu* | cloudabi*-eabi* | \ 121 | storm-chaos* | os2-emx* | rtmk-nova*) 122 | os=-$maybe_os 123 | basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` 124 | ;; 125 | android-linux) 126 | os=-linux-android 127 | basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown 128 | ;; 129 | *) 130 | basic_machine=`echo "$1" | sed 's/-[^-]*$//'` 131 | if [ "$basic_machine" != "$1" ] 132 | then os=`echo "$1" | sed 's/.*-/-/'` 133 | else os=; fi 134 | ;; 135 | esac 136 | 137 | ### Let's recognize common machines as not being operating systems so 138 | ### that things like config.sub decstation-3100 work. We also 139 | ### recognize some manufacturers as not being operating systems, so we 140 | ### can provide default operating systems below. 141 | case $os in 142 | -sun*os*) 143 | # Prevent following clause from handling this invalid input. 144 | ;; 145 | -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ 146 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ 147 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ 148 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 149 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 150 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 151 | -apple | -axis | -knuth | -cray | -microblaze*) 152 | os= 153 | basic_machine=$1 154 | ;; 155 | -bluegene*) 156 | os=-cnk 157 | ;; 158 | -sim | -cisco | -oki | -wec | -winbond) 159 | os= 160 | basic_machine=$1 161 | ;; 162 | -scout) 163 | ;; 164 | -wrs) 165 | os=-vxworks 166 | basic_machine=$1 167 | ;; 168 | -chorusos*) 169 | os=-chorusos 170 | basic_machine=$1 171 | ;; 172 | -chorusrdb) 173 | os=-chorusrdb 174 | basic_machine=$1 175 | ;; 176 | -hiux*) 177 | os=-hiuxwe2 178 | ;; 179 | -sco6) 180 | os=-sco5v6 181 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 182 | ;; 183 | -sco5) 184 | os=-sco3.2v5 185 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 186 | ;; 187 | -sco4) 188 | os=-sco3.2v4 189 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 190 | ;; 191 | -sco3.2.[4-9]*) 192 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 193 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 194 | ;; 195 | -sco3.2v[4-9]*) 196 | # Don't forget version if it is 3.2v4 or newer. 197 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 198 | ;; 199 | -sco5v6*) 200 | # Don't forget version if it is 3.2v4 or newer. 201 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 202 | ;; 203 | -sco*) 204 | os=-sco3.2v2 205 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 206 | ;; 207 | -udk*) 208 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 209 | ;; 210 | -isc) 211 | os=-isc2.2 212 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 213 | ;; 214 | -clix*) 215 | basic_machine=clipper-intergraph 216 | ;; 217 | -isc*) 218 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` 219 | ;; 220 | -lynx*178) 221 | os=-lynxos178 222 | ;; 223 | -lynx*5) 224 | os=-lynxos5 225 | ;; 226 | -lynx*) 227 | os=-lynxos 228 | ;; 229 | -ptx*) 230 | basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` 231 | ;; 232 | -psos*) 233 | os=-psos 234 | ;; 235 | -mint | -mint[0-9]*) 236 | basic_machine=m68k-atari 237 | os=-mint 238 | ;; 239 | esac 240 | 241 | # Decode aliases for certain CPU-COMPANY combinations. 242 | case $basic_machine in 243 | # Recognize the basic CPU types without company name. 244 | # Some are omitted here because they have special meanings below. 245 | 1750a | 580 \ 246 | | a29k \ 247 | | aarch64 | aarch64_be \ 248 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ 249 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ 250 | | am33_2.0 \ 251 | | arc | arceb \ 252 | | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ 253 | | avr | avr32 \ 254 | | ba \ 255 | | be32 | be64 \ 256 | | bfin \ 257 | | c4x | c8051 | clipper \ 258 | | d10v | d30v | dlx | dsp16xx \ 259 | | e2k | epiphany \ 260 | | fido | fr30 | frv | ft32 \ 261 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 262 | | hexagon \ 263 | | i370 | i860 | i960 | ia16 | ia64 \ 264 | | ip2k | iq2000 \ 265 | | k1om \ 266 | | le32 | le64 \ 267 | | lm32 \ 268 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ 269 | | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ 270 | | mips | mipsbe | mipseb | mipsel | mipsle \ 271 | | mips16 \ 272 | | mips64 | mips64el \ 273 | | mips64octeon | mips64octeonel \ 274 | | mips64orion | mips64orionel \ 275 | | mips64r5900 | mips64r5900el \ 276 | | mips64vr | mips64vrel \ 277 | | mips64vr4100 | mips64vr4100el \ 278 | | mips64vr4300 | mips64vr4300el \ 279 | | mips64vr5000 | mips64vr5000el \ 280 | | mips64vr5900 | mips64vr5900el \ 281 | | mipsisa32 | mipsisa32el \ 282 | | mipsisa32r2 | mipsisa32r2el \ 283 | | mipsisa32r6 | mipsisa32r6el \ 284 | | mipsisa64 | mipsisa64el \ 285 | | mipsisa64r2 | mipsisa64r2el \ 286 | | mipsisa64r6 | mipsisa64r6el \ 287 | | mipsisa64sb1 | mipsisa64sb1el \ 288 | | mipsisa64sr71k | mipsisa64sr71kel \ 289 | | mipsr5900 | mipsr5900el \ 290 | | mipstx39 | mipstx39el \ 291 | | mn10200 | mn10300 \ 292 | | moxie \ 293 | | mt \ 294 | | msp430 \ 295 | | nds32 | nds32le | nds32be \ 296 | | nios | nios2 | nios2eb | nios2el \ 297 | | ns16k | ns32k \ 298 | | open8 | or1k | or1knd | or32 \ 299 | | pdp10 | pj | pjl \ 300 | | powerpc | powerpc64 | powerpc64le | powerpcle \ 301 | | pru \ 302 | | pyramid \ 303 | | riscv32 | riscv64 \ 304 | | rl78 | rx \ 305 | | score \ 306 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ 307 | | sh64 | sh64le \ 308 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ 309 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ 310 | | spu \ 311 | | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ 312 | | ubicom32 \ 313 | | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ 314 | | visium \ 315 | | wasm32 \ 316 | | x86 | xc16x | xstormy16 | xtensa \ 317 | | z8k | z80) 318 | basic_machine=$basic_machine-unknown 319 | ;; 320 | c54x) 321 | basic_machine=tic54x-unknown 322 | ;; 323 | c55x) 324 | basic_machine=tic55x-unknown 325 | ;; 326 | c6x) 327 | basic_machine=tic6x-unknown 328 | ;; 329 | leon|leon[3-9]) 330 | basic_machine=sparc-$basic_machine 331 | ;; 332 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) 333 | basic_machine=$basic_machine-unknown 334 | os=-none 335 | ;; 336 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) 337 | ;; 338 | ms1) 339 | basic_machine=mt-unknown 340 | ;; 341 | 342 | strongarm | thumb | xscale) 343 | basic_machine=arm-unknown 344 | ;; 345 | xgate) 346 | basic_machine=$basic_machine-unknown 347 | os=-none 348 | ;; 349 | xscaleeb) 350 | basic_machine=armeb-unknown 351 | ;; 352 | 353 | xscaleel) 354 | basic_machine=armel-unknown 355 | ;; 356 | 357 | # We use `pc' rather than `unknown' 358 | # because (1) that's what they normally are, and 359 | # (2) the word "unknown" tends to confuse beginning users. 360 | i*86 | x86_64) 361 | basic_machine=$basic_machine-pc 362 | ;; 363 | # Object if more than one company name word. 364 | *-*-*) 365 | echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 366 | exit 1 367 | ;; 368 | # Recognize the basic CPU types with company name. 369 | 580-* \ 370 | | a29k-* \ 371 | | aarch64-* | aarch64_be-* \ 372 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 373 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ 374 | | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ 375 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 376 | | avr-* | avr32-* \ 377 | | ba-* \ 378 | | be32-* | be64-* \ 379 | | bfin-* | bs2000-* \ 380 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ 381 | | c8051-* | clipper-* | craynv-* | cydra-* \ 382 | | d10v-* | d30v-* | dlx-* \ 383 | | e2k-* | elxsi-* \ 384 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ 385 | | h8300-* | h8500-* \ 386 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ 387 | | hexagon-* \ 388 | | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ 389 | | ip2k-* | iq2000-* \ 390 | | k1om-* \ 391 | | le32-* | le64-* \ 392 | | lm32-* \ 393 | | m32c-* | m32r-* | m32rle-* \ 394 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ 395 | | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ 396 | | microblaze-* | microblazeel-* \ 397 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 398 | | mips16-* \ 399 | | mips64-* | mips64el-* \ 400 | | mips64octeon-* | mips64octeonel-* \ 401 | | mips64orion-* | mips64orionel-* \ 402 | | mips64r5900-* | mips64r5900el-* \ 403 | | mips64vr-* | mips64vrel-* \ 404 | | mips64vr4100-* | mips64vr4100el-* \ 405 | | mips64vr4300-* | mips64vr4300el-* \ 406 | | mips64vr5000-* | mips64vr5000el-* \ 407 | | mips64vr5900-* | mips64vr5900el-* \ 408 | | mipsisa32-* | mipsisa32el-* \ 409 | | mipsisa32r2-* | mipsisa32r2el-* \ 410 | | mipsisa32r6-* | mipsisa32r6el-* \ 411 | | mipsisa64-* | mipsisa64el-* \ 412 | | mipsisa64r2-* | mipsisa64r2el-* \ 413 | | mipsisa64r6-* | mipsisa64r6el-* \ 414 | | mipsisa64sb1-* | mipsisa64sb1el-* \ 415 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ 416 | | mipsr5900-* | mipsr5900el-* \ 417 | | mipstx39-* | mipstx39el-* \ 418 | | mmix-* \ 419 | | mt-* \ 420 | | msp430-* \ 421 | | nds32-* | nds32le-* | nds32be-* \ 422 | | nios-* | nios2-* | nios2eb-* | nios2el-* \ 423 | | none-* | np1-* | ns16k-* | ns32k-* \ 424 | | open8-* \ 425 | | or1k*-* \ 426 | | orion-* \ 427 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ 428 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ 429 | | pru-* \ 430 | | pyramid-* \ 431 | | riscv32-* | riscv64-* \ 432 | | rl78-* | romp-* | rs6000-* | rx-* \ 433 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ 434 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ 435 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ 436 | | sparclite-* \ 437 | | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ 438 | | tahoe-* \ 439 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ 440 | | tile*-* \ 441 | | tron-* \ 442 | | ubicom32-* \ 443 | | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ 444 | | vax-* \ 445 | | visium-* \ 446 | | wasm32-* \ 447 | | we32k-* \ 448 | | x86-* | x86_64-* | xc16x-* | xps100-* \ 449 | | xstormy16-* | xtensa*-* \ 450 | | ymp-* \ 451 | | z8k-* | z80-*) 452 | ;; 453 | # Recognize the basic CPU types without company name, with glob match. 454 | xtensa*) 455 | basic_machine=$basic_machine-unknown 456 | ;; 457 | # Recognize the various machine names and aliases which stand 458 | # for a CPU type and a company and sometimes even an OS. 459 | 386bsd) 460 | basic_machine=i386-pc 461 | os=-bsd 462 | ;; 463 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 464 | basic_machine=m68000-att 465 | ;; 466 | 3b*) 467 | basic_machine=we32k-att 468 | ;; 469 | a29khif) 470 | basic_machine=a29k-amd 471 | os=-udi 472 | ;; 473 | abacus) 474 | basic_machine=abacus-unknown 475 | ;; 476 | adobe68k) 477 | basic_machine=m68010-adobe 478 | os=-scout 479 | ;; 480 | alliant | fx80) 481 | basic_machine=fx80-alliant 482 | ;; 483 | altos | altos3068) 484 | basic_machine=m68k-altos 485 | ;; 486 | am29k) 487 | basic_machine=a29k-none 488 | os=-bsd 489 | ;; 490 | amd64) 491 | basic_machine=x86_64-pc 492 | ;; 493 | amd64-*) 494 | basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` 495 | ;; 496 | amdahl) 497 | basic_machine=580-amdahl 498 | os=-sysv 499 | ;; 500 | amiga | amiga-*) 501 | basic_machine=m68k-unknown 502 | ;; 503 | amigaos | amigados) 504 | basic_machine=m68k-unknown 505 | os=-amigaos 506 | ;; 507 | amigaunix | amix) 508 | basic_machine=m68k-unknown 509 | os=-sysv4 510 | ;; 511 | apollo68) 512 | basic_machine=m68k-apollo 513 | os=-sysv 514 | ;; 515 | apollo68bsd) 516 | basic_machine=m68k-apollo 517 | os=-bsd 518 | ;; 519 | aros) 520 | basic_machine=i386-pc 521 | os=-aros 522 | ;; 523 | asmjs) 524 | basic_machine=asmjs-unknown 525 | ;; 526 | aux) 527 | basic_machine=m68k-apple 528 | os=-aux 529 | ;; 530 | balance) 531 | basic_machine=ns32k-sequent 532 | os=-dynix 533 | ;; 534 | blackfin) 535 | basic_machine=bfin-unknown 536 | os=-linux 537 | ;; 538 | blackfin-*) 539 | basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` 540 | os=-linux 541 | ;; 542 | bluegene*) 543 | basic_machine=powerpc-ibm 544 | os=-cnk 545 | ;; 546 | c54x-*) 547 | basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` 548 | ;; 549 | c55x-*) 550 | basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` 551 | ;; 552 | c6x-*) 553 | basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` 554 | ;; 555 | c90) 556 | basic_machine=c90-cray 557 | os=-unicos 558 | ;; 559 | cegcc) 560 | basic_machine=arm-unknown 561 | os=-cegcc 562 | ;; 563 | convex-c1) 564 | basic_machine=c1-convex 565 | os=-bsd 566 | ;; 567 | convex-c2) 568 | basic_machine=c2-convex 569 | os=-bsd 570 | ;; 571 | convex-c32) 572 | basic_machine=c32-convex 573 | os=-bsd 574 | ;; 575 | convex-c34) 576 | basic_machine=c34-convex 577 | os=-bsd 578 | ;; 579 | convex-c38) 580 | basic_machine=c38-convex 581 | os=-bsd 582 | ;; 583 | cray | j90) 584 | basic_machine=j90-cray 585 | os=-unicos 586 | ;; 587 | craynv) 588 | basic_machine=craynv-cray 589 | os=-unicosmp 590 | ;; 591 | cr16 | cr16-*) 592 | basic_machine=cr16-unknown 593 | os=-elf 594 | ;; 595 | crds | unos) 596 | basic_machine=m68k-crds 597 | ;; 598 | crisv32 | crisv32-* | etraxfs*) 599 | basic_machine=crisv32-axis 600 | ;; 601 | cris | cris-* | etrax*) 602 | basic_machine=cris-axis 603 | ;; 604 | crx) 605 | basic_machine=crx-unknown 606 | os=-elf 607 | ;; 608 | da30 | da30-*) 609 | basic_machine=m68k-da30 610 | ;; 611 | decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) 612 | basic_machine=mips-dec 613 | ;; 614 | decsystem10* | dec10*) 615 | basic_machine=pdp10-dec 616 | os=-tops10 617 | ;; 618 | decsystem20* | dec20*) 619 | basic_machine=pdp10-dec 620 | os=-tops20 621 | ;; 622 | delta | 3300 | motorola-3300 | motorola-delta \ 623 | | 3300-motorola | delta-motorola) 624 | basic_machine=m68k-motorola 625 | ;; 626 | delta88) 627 | basic_machine=m88k-motorola 628 | os=-sysv3 629 | ;; 630 | dicos) 631 | basic_machine=i686-pc 632 | os=-dicos 633 | ;; 634 | djgpp) 635 | basic_machine=i586-pc 636 | os=-msdosdjgpp 637 | ;; 638 | dpx20 | dpx20-*) 639 | basic_machine=rs6000-bull 640 | os=-bosx 641 | ;; 642 | dpx2*) 643 | basic_machine=m68k-bull 644 | os=-sysv3 645 | ;; 646 | e500v[12]) 647 | basic_machine=powerpc-unknown 648 | os=$os"spe" 649 | ;; 650 | e500v[12]-*) 651 | basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` 652 | os=$os"spe" 653 | ;; 654 | ebmon29k) 655 | basic_machine=a29k-amd 656 | os=-ebmon 657 | ;; 658 | elxsi) 659 | basic_machine=elxsi-elxsi 660 | os=-bsd 661 | ;; 662 | encore | umax | mmax) 663 | basic_machine=ns32k-encore 664 | ;; 665 | es1800 | OSE68k | ose68k | ose | OSE) 666 | basic_machine=m68k-ericsson 667 | os=-ose 668 | ;; 669 | fx2800) 670 | basic_machine=i860-alliant 671 | ;; 672 | genix) 673 | basic_machine=ns32k-ns 674 | ;; 675 | gmicro) 676 | basic_machine=tron-gmicro 677 | os=-sysv 678 | ;; 679 | go32) 680 | basic_machine=i386-pc 681 | os=-go32 682 | ;; 683 | h3050r* | hiux*) 684 | basic_machine=hppa1.1-hitachi 685 | os=-hiuxwe2 686 | ;; 687 | h8300hms) 688 | basic_machine=h8300-hitachi 689 | os=-hms 690 | ;; 691 | h8300xray) 692 | basic_machine=h8300-hitachi 693 | os=-xray 694 | ;; 695 | h8500hms) 696 | basic_machine=h8500-hitachi 697 | os=-hms 698 | ;; 699 | harris) 700 | basic_machine=m88k-harris 701 | os=-sysv3 702 | ;; 703 | hp300-*) 704 | basic_machine=m68k-hp 705 | ;; 706 | hp300bsd) 707 | basic_machine=m68k-hp 708 | os=-bsd 709 | ;; 710 | hp300hpux) 711 | basic_machine=m68k-hp 712 | os=-hpux 713 | ;; 714 | hp3k9[0-9][0-9] | hp9[0-9][0-9]) 715 | basic_machine=hppa1.0-hp 716 | ;; 717 | hp9k2[0-9][0-9] | hp9k31[0-9]) 718 | basic_machine=m68000-hp 719 | ;; 720 | hp9k3[2-9][0-9]) 721 | basic_machine=m68k-hp 722 | ;; 723 | hp9k6[0-9][0-9] | hp6[0-9][0-9]) 724 | basic_machine=hppa1.0-hp 725 | ;; 726 | hp9k7[0-79][0-9] | hp7[0-79][0-9]) 727 | basic_machine=hppa1.1-hp 728 | ;; 729 | hp9k78[0-9] | hp78[0-9]) 730 | # FIXME: really hppa2.0-hp 731 | basic_machine=hppa1.1-hp 732 | ;; 733 | hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 734 | # FIXME: really hppa2.0-hp 735 | basic_machine=hppa1.1-hp 736 | ;; 737 | hp9k8[0-9][13679] | hp8[0-9][13679]) 738 | basic_machine=hppa1.1-hp 739 | ;; 740 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) 741 | basic_machine=hppa1.0-hp 742 | ;; 743 | hppaosf) 744 | basic_machine=hppa1.1-hp 745 | os=-osf 746 | ;; 747 | hppro) 748 | basic_machine=hppa1.1-hp 749 | os=-proelf 750 | ;; 751 | i370-ibm* | ibm*) 752 | basic_machine=i370-ibm 753 | ;; 754 | i*86v32) 755 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 756 | os=-sysv32 757 | ;; 758 | i*86v4*) 759 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 760 | os=-sysv4 761 | ;; 762 | i*86v) 763 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 764 | os=-sysv 765 | ;; 766 | i*86sol2) 767 | basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` 768 | os=-solaris2 769 | ;; 770 | i386mach) 771 | basic_machine=i386-mach 772 | os=-mach 773 | ;; 774 | vsta) 775 | basic_machine=i386-unknown 776 | os=-vsta 777 | ;; 778 | iris | iris4d) 779 | basic_machine=mips-sgi 780 | case $os in 781 | -irix*) 782 | ;; 783 | *) 784 | os=-irix4 785 | ;; 786 | esac 787 | ;; 788 | isi68 | isi) 789 | basic_machine=m68k-isi 790 | os=-sysv 791 | ;; 792 | leon-*|leon[3-9]-*) 793 | basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` 794 | ;; 795 | m68knommu) 796 | basic_machine=m68k-unknown 797 | os=-linux 798 | ;; 799 | m68knommu-*) 800 | basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` 801 | os=-linux 802 | ;; 803 | magnum | m3230) 804 | basic_machine=mips-mips 805 | os=-sysv 806 | ;; 807 | merlin) 808 | basic_machine=ns32k-utek 809 | os=-sysv 810 | ;; 811 | microblaze*) 812 | basic_machine=microblaze-xilinx 813 | ;; 814 | mingw64) 815 | basic_machine=x86_64-pc 816 | os=-mingw64 817 | ;; 818 | mingw32) 819 | basic_machine=i686-pc 820 | os=-mingw32 821 | ;; 822 | mingw32ce) 823 | basic_machine=arm-unknown 824 | os=-mingw32ce 825 | ;; 826 | miniframe) 827 | basic_machine=m68000-convergent 828 | ;; 829 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) 830 | basic_machine=m68k-atari 831 | os=-mint 832 | ;; 833 | mips3*-*) 834 | basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` 835 | ;; 836 | mips3*) 837 | basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown 838 | ;; 839 | monitor) 840 | basic_machine=m68k-rom68k 841 | os=-coff 842 | ;; 843 | morphos) 844 | basic_machine=powerpc-unknown 845 | os=-morphos 846 | ;; 847 | moxiebox) 848 | basic_machine=moxie-unknown 849 | os=-moxiebox 850 | ;; 851 | msdos) 852 | basic_machine=i386-pc 853 | os=-msdos 854 | ;; 855 | ms1-*) 856 | basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` 857 | ;; 858 | msys) 859 | basic_machine=i686-pc 860 | os=-msys 861 | ;; 862 | mvs) 863 | basic_machine=i370-ibm 864 | os=-mvs 865 | ;; 866 | nacl) 867 | basic_machine=le32-unknown 868 | os=-nacl 869 | ;; 870 | ncr3000) 871 | basic_machine=i486-ncr 872 | os=-sysv4 873 | ;; 874 | netbsd386) 875 | basic_machine=i386-unknown 876 | os=-netbsd 877 | ;; 878 | netwinder) 879 | basic_machine=armv4l-rebel 880 | os=-linux 881 | ;; 882 | news | news700 | news800 | news900) 883 | basic_machine=m68k-sony 884 | os=-newsos 885 | ;; 886 | news1000) 887 | basic_machine=m68030-sony 888 | os=-newsos 889 | ;; 890 | news-3600 | risc-news) 891 | basic_machine=mips-sony 892 | os=-newsos 893 | ;; 894 | necv70) 895 | basic_machine=v70-nec 896 | os=-sysv 897 | ;; 898 | next | m*-next) 899 | basic_machine=m68k-next 900 | case $os in 901 | -nextstep* ) 902 | ;; 903 | -ns2*) 904 | os=-nextstep2 905 | ;; 906 | *) 907 | os=-nextstep3 908 | ;; 909 | esac 910 | ;; 911 | nh3000) 912 | basic_machine=m68k-harris 913 | os=-cxux 914 | ;; 915 | nh[45]000) 916 | basic_machine=m88k-harris 917 | os=-cxux 918 | ;; 919 | nindy960) 920 | basic_machine=i960-intel 921 | os=-nindy 922 | ;; 923 | mon960) 924 | basic_machine=i960-intel 925 | os=-mon960 926 | ;; 927 | nonstopux) 928 | basic_machine=mips-compaq 929 | os=-nonstopux 930 | ;; 931 | np1) 932 | basic_machine=np1-gould 933 | ;; 934 | neo-tandem) 935 | basic_machine=neo-tandem 936 | ;; 937 | nse-tandem) 938 | basic_machine=nse-tandem 939 | ;; 940 | nsr-tandem) 941 | basic_machine=nsr-tandem 942 | ;; 943 | nsv-tandem) 944 | basic_machine=nsv-tandem 945 | ;; 946 | nsx-tandem) 947 | basic_machine=nsx-tandem 948 | ;; 949 | op50n-* | op60c-*) 950 | basic_machine=hppa1.1-oki 951 | os=-proelf 952 | ;; 953 | openrisc | openrisc-*) 954 | basic_machine=or32-unknown 955 | ;; 956 | os400) 957 | basic_machine=powerpc-ibm 958 | os=-os400 959 | ;; 960 | OSE68000 | ose68000) 961 | basic_machine=m68000-ericsson 962 | os=-ose 963 | ;; 964 | os68k) 965 | basic_machine=m68k-none 966 | os=-os68k 967 | ;; 968 | pa-hitachi) 969 | basic_machine=hppa1.1-hitachi 970 | os=-hiuxwe2 971 | ;; 972 | paragon) 973 | basic_machine=i860-intel 974 | os=-osf 975 | ;; 976 | parisc) 977 | basic_machine=hppa-unknown 978 | os=-linux 979 | ;; 980 | parisc-*) 981 | basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` 982 | os=-linux 983 | ;; 984 | pbd) 985 | basic_machine=sparc-tti 986 | ;; 987 | pbb) 988 | basic_machine=m68k-tti 989 | ;; 990 | pc532 | pc532-*) 991 | basic_machine=ns32k-pc532 992 | ;; 993 | pc98) 994 | basic_machine=i386-pc 995 | ;; 996 | pc98-*) 997 | basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` 998 | ;; 999 | pentium | p5 | k5 | k6 | nexgen | viac3) 1000 | basic_machine=i586-pc 1001 | ;; 1002 | pentiumpro | p6 | 6x86 | athlon | athlon_*) 1003 | basic_machine=i686-pc 1004 | ;; 1005 | pentiumii | pentium2 | pentiumiii | pentium3) 1006 | basic_machine=i686-pc 1007 | ;; 1008 | pentium4) 1009 | basic_machine=i786-pc 1010 | ;; 1011 | pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 1012 | basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1013 | ;; 1014 | pentiumpro-* | p6-* | 6x86-* | athlon-*) 1015 | basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1016 | ;; 1017 | pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 1018 | basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1019 | ;; 1020 | pentium4-*) 1021 | basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1022 | ;; 1023 | pn) 1024 | basic_machine=pn-gould 1025 | ;; 1026 | power) basic_machine=power-ibm 1027 | ;; 1028 | ppc | ppcbe) basic_machine=powerpc-unknown 1029 | ;; 1030 | ppc-* | ppcbe-*) 1031 | basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1032 | ;; 1033 | ppcle | powerpclittle) 1034 | basic_machine=powerpcle-unknown 1035 | ;; 1036 | ppcle-* | powerpclittle-*) 1037 | basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1038 | ;; 1039 | ppc64) basic_machine=powerpc64-unknown 1040 | ;; 1041 | ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1042 | ;; 1043 | ppc64le | powerpc64little) 1044 | basic_machine=powerpc64le-unknown 1045 | ;; 1046 | ppc64le-* | powerpc64little-*) 1047 | basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1048 | ;; 1049 | ps2) 1050 | basic_machine=i386-ibm 1051 | ;; 1052 | pw32) 1053 | basic_machine=i586-unknown 1054 | os=-pw32 1055 | ;; 1056 | rdos | rdos64) 1057 | basic_machine=x86_64-pc 1058 | os=-rdos 1059 | ;; 1060 | rdos32) 1061 | basic_machine=i386-pc 1062 | os=-rdos 1063 | ;; 1064 | rom68k) 1065 | basic_machine=m68k-rom68k 1066 | os=-coff 1067 | ;; 1068 | rm[46]00) 1069 | basic_machine=mips-siemens 1070 | ;; 1071 | rtpc | rtpc-*) 1072 | basic_machine=romp-ibm 1073 | ;; 1074 | s390 | s390-*) 1075 | basic_machine=s390-ibm 1076 | ;; 1077 | s390x | s390x-*) 1078 | basic_machine=s390x-ibm 1079 | ;; 1080 | sa29200) 1081 | basic_machine=a29k-amd 1082 | os=-udi 1083 | ;; 1084 | sb1) 1085 | basic_machine=mipsisa64sb1-unknown 1086 | ;; 1087 | sb1el) 1088 | basic_machine=mipsisa64sb1el-unknown 1089 | ;; 1090 | sde) 1091 | basic_machine=mipsisa32-sde 1092 | os=-elf 1093 | ;; 1094 | sei) 1095 | basic_machine=mips-sei 1096 | os=-seiux 1097 | ;; 1098 | sequent) 1099 | basic_machine=i386-sequent 1100 | ;; 1101 | sh5el) 1102 | basic_machine=sh5le-unknown 1103 | ;; 1104 | simso-wrs) 1105 | basic_machine=sparclite-wrs 1106 | os=-vxworks 1107 | ;; 1108 | sps7) 1109 | basic_machine=m68k-bull 1110 | os=-sysv2 1111 | ;; 1112 | spur) 1113 | basic_machine=spur-unknown 1114 | ;; 1115 | st2000) 1116 | basic_machine=m68k-tandem 1117 | ;; 1118 | stratus) 1119 | basic_machine=i860-stratus 1120 | os=-sysv4 1121 | ;; 1122 | strongarm-* | thumb-*) 1123 | basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` 1124 | ;; 1125 | sun2) 1126 | basic_machine=m68000-sun 1127 | ;; 1128 | sun2os3) 1129 | basic_machine=m68000-sun 1130 | os=-sunos3 1131 | ;; 1132 | sun2os4) 1133 | basic_machine=m68000-sun 1134 | os=-sunos4 1135 | ;; 1136 | sun3os3) 1137 | basic_machine=m68k-sun 1138 | os=-sunos3 1139 | ;; 1140 | sun3os4) 1141 | basic_machine=m68k-sun 1142 | os=-sunos4 1143 | ;; 1144 | sun4os3) 1145 | basic_machine=sparc-sun 1146 | os=-sunos3 1147 | ;; 1148 | sun4os4) 1149 | basic_machine=sparc-sun 1150 | os=-sunos4 1151 | ;; 1152 | sun4sol2) 1153 | basic_machine=sparc-sun 1154 | os=-solaris2 1155 | ;; 1156 | sun3 | sun3-*) 1157 | basic_machine=m68k-sun 1158 | ;; 1159 | sun4) 1160 | basic_machine=sparc-sun 1161 | ;; 1162 | sun386 | sun386i | roadrunner) 1163 | basic_machine=i386-sun 1164 | ;; 1165 | sv1) 1166 | basic_machine=sv1-cray 1167 | os=-unicos 1168 | ;; 1169 | symmetry) 1170 | basic_machine=i386-sequent 1171 | os=-dynix 1172 | ;; 1173 | t3e) 1174 | basic_machine=alphaev5-cray 1175 | os=-unicos 1176 | ;; 1177 | t90) 1178 | basic_machine=t90-cray 1179 | os=-unicos 1180 | ;; 1181 | tile*) 1182 | basic_machine=$basic_machine-unknown 1183 | os=-linux-gnu 1184 | ;; 1185 | tx39) 1186 | basic_machine=mipstx39-unknown 1187 | ;; 1188 | tx39el) 1189 | basic_machine=mipstx39el-unknown 1190 | ;; 1191 | toad1) 1192 | basic_machine=pdp10-xkl 1193 | os=-tops20 1194 | ;; 1195 | tower | tower-32) 1196 | basic_machine=m68k-ncr 1197 | ;; 1198 | tpf) 1199 | basic_machine=s390x-ibm 1200 | os=-tpf 1201 | ;; 1202 | udi29k) 1203 | basic_machine=a29k-amd 1204 | os=-udi 1205 | ;; 1206 | ultra3) 1207 | basic_machine=a29k-nyu 1208 | os=-sym1 1209 | ;; 1210 | v810 | necv810) 1211 | basic_machine=v810-nec 1212 | os=-none 1213 | ;; 1214 | vaxv) 1215 | basic_machine=vax-dec 1216 | os=-sysv 1217 | ;; 1218 | vms) 1219 | basic_machine=vax-dec 1220 | os=-vms 1221 | ;; 1222 | vpp*|vx|vx-*) 1223 | basic_machine=f301-fujitsu 1224 | ;; 1225 | vxworks960) 1226 | basic_machine=i960-wrs 1227 | os=-vxworks 1228 | ;; 1229 | vxworks68) 1230 | basic_machine=m68k-wrs 1231 | os=-vxworks 1232 | ;; 1233 | vxworks29k) 1234 | basic_machine=a29k-wrs 1235 | os=-vxworks 1236 | ;; 1237 | w65*) 1238 | basic_machine=w65-wdc 1239 | os=-none 1240 | ;; 1241 | w89k-*) 1242 | basic_machine=hppa1.1-winbond 1243 | os=-proelf 1244 | ;; 1245 | x64) 1246 | basic_machine=x86_64-pc 1247 | ;; 1248 | xbox) 1249 | basic_machine=i686-pc 1250 | os=-mingw32 1251 | ;; 1252 | xps | xps100) 1253 | basic_machine=xps100-honeywell 1254 | ;; 1255 | xscale-* | xscalee[bl]-*) 1256 | basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` 1257 | ;; 1258 | ymp) 1259 | basic_machine=ymp-cray 1260 | os=-unicos 1261 | ;; 1262 | none) 1263 | basic_machine=none-none 1264 | os=-none 1265 | ;; 1266 | 1267 | # Here we handle the default manufacturer of certain CPU types. It is in 1268 | # some cases the only manufacturer, in others, it is the most popular. 1269 | w89k) 1270 | basic_machine=hppa1.1-winbond 1271 | ;; 1272 | op50n) 1273 | basic_machine=hppa1.1-oki 1274 | ;; 1275 | op60c) 1276 | basic_machine=hppa1.1-oki 1277 | ;; 1278 | romp) 1279 | basic_machine=romp-ibm 1280 | ;; 1281 | mmix) 1282 | basic_machine=mmix-knuth 1283 | ;; 1284 | rs6000) 1285 | basic_machine=rs6000-ibm 1286 | ;; 1287 | vax) 1288 | basic_machine=vax-dec 1289 | ;; 1290 | pdp11) 1291 | basic_machine=pdp11-dec 1292 | ;; 1293 | we32k) 1294 | basic_machine=we32k-att 1295 | ;; 1296 | sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) 1297 | basic_machine=sh-unknown 1298 | ;; 1299 | cydra) 1300 | basic_machine=cydra-cydrome 1301 | ;; 1302 | orion) 1303 | basic_machine=orion-highlevel 1304 | ;; 1305 | orion105) 1306 | basic_machine=clipper-highlevel 1307 | ;; 1308 | mac | mpw | mac-mpw) 1309 | basic_machine=m68k-apple 1310 | ;; 1311 | pmac | pmac-mpw) 1312 | basic_machine=powerpc-apple 1313 | ;; 1314 | *-unknown) 1315 | # Make sure to match an already-canonicalized machine name. 1316 | ;; 1317 | *) 1318 | echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 1319 | exit 1 1320 | ;; 1321 | esac 1322 | 1323 | # Here we canonicalize certain aliases for manufacturers. 1324 | case $basic_machine in 1325 | *-digital*) 1326 | basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` 1327 | ;; 1328 | *-commodore*) 1329 | basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` 1330 | ;; 1331 | *) 1332 | ;; 1333 | esac 1334 | 1335 | # Decode manufacturer-specific aliases for certain operating systems. 1336 | 1337 | if [ x"$os" != x"" ] 1338 | then 1339 | case $os in 1340 | # First match some system type aliases that might get confused 1341 | # with valid system types. 1342 | # -solaris* is a basic system type, with this one exception. 1343 | -auroraux) 1344 | os=-auroraux 1345 | ;; 1346 | -solaris1 | -solaris1.*) 1347 | os=`echo $os | sed -e 's|solaris1|sunos4|'` 1348 | ;; 1349 | -solaris) 1350 | os=-solaris2 1351 | ;; 1352 | -unixware*) 1353 | os=-sysv4.2uw 1354 | ;; 1355 | -gnu/linux*) 1356 | os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` 1357 | ;; 1358 | # es1800 is here to avoid being matched by es* (a different OS) 1359 | -es1800*) 1360 | os=-ose 1361 | ;; 1362 | # Now accept the basic system types. 1363 | # The portable systems comes first. 1364 | # Each alternative MUST end in a * to match a version number. 1365 | # -sysv* is not here because it comes later, after sysvr4. 1366 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 1367 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 1368 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 1369 | | -sym* | -kopensolaris* | -plan9* \ 1370 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1371 | | -aos* | -aros* | -cloudabi* | -sortix* \ 1372 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 1373 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1374 | | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ 1375 | | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ 1376 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 1377 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 1378 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 1379 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ 1380 | | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ 1381 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1382 | | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ 1383 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 1384 | | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ 1385 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ 1386 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 1387 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ 1388 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ 1389 | | -morphos* | -superux* | -rtmk* | -windiss* \ 1390 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 1391 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ 1392 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ 1393 | | -midnightbsd*) 1394 | # Remember, each alternative MUST END IN *, to match a version number. 1395 | ;; 1396 | -qnx*) 1397 | case $basic_machine in 1398 | x86-* | i*86-*) 1399 | ;; 1400 | *) 1401 | os=-nto$os 1402 | ;; 1403 | esac 1404 | ;; 1405 | -nto-qnx*) 1406 | ;; 1407 | -nto*) 1408 | os=`echo $os | sed -e 's|nto|nto-qnx|'` 1409 | ;; 1410 | -sim | -xray | -os68k* | -v88r* \ 1411 | | -windows* | -osx | -abug | -netware* | -os9* \ 1412 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) 1413 | ;; 1414 | -mac*) 1415 | os=`echo "$os" | sed -e 's|mac|macos|'` 1416 | ;; 1417 | -linux-dietlibc) 1418 | os=-linux-dietlibc 1419 | ;; 1420 | -linux*) 1421 | os=`echo $os | sed -e 's|linux|linux-gnu|'` 1422 | ;; 1423 | -sunos5*) 1424 | os=`echo "$os" | sed -e 's|sunos5|solaris2|'` 1425 | ;; 1426 | -sunos6*) 1427 | os=`echo "$os" | sed -e 's|sunos6|solaris3|'` 1428 | ;; 1429 | -opened*) 1430 | os=-openedition 1431 | ;; 1432 | -os400*) 1433 | os=-os400 1434 | ;; 1435 | -wince*) 1436 | os=-wince 1437 | ;; 1438 | -utek*) 1439 | os=-bsd 1440 | ;; 1441 | -dynix*) 1442 | os=-bsd 1443 | ;; 1444 | -acis*) 1445 | os=-aos 1446 | ;; 1447 | -atheos*) 1448 | os=-atheos 1449 | ;; 1450 | -syllable*) 1451 | os=-syllable 1452 | ;; 1453 | -386bsd) 1454 | os=-bsd 1455 | ;; 1456 | -ctix* | -uts*) 1457 | os=-sysv 1458 | ;; 1459 | -nova*) 1460 | os=-rtmk-nova 1461 | ;; 1462 | -ns2) 1463 | os=-nextstep2 1464 | ;; 1465 | -nsk*) 1466 | os=-nsk 1467 | ;; 1468 | # Preserve the version number of sinix5. 1469 | -sinix5.*) 1470 | os=`echo $os | sed -e 's|sinix|sysv|'` 1471 | ;; 1472 | -sinix*) 1473 | os=-sysv4 1474 | ;; 1475 | -tpf*) 1476 | os=-tpf 1477 | ;; 1478 | -triton*) 1479 | os=-sysv3 1480 | ;; 1481 | -oss*) 1482 | os=-sysv3 1483 | ;; 1484 | -svr4*) 1485 | os=-sysv4 1486 | ;; 1487 | -svr3) 1488 | os=-sysv3 1489 | ;; 1490 | -sysvr4) 1491 | os=-sysv4 1492 | ;; 1493 | # This must come after -sysvr4. 1494 | -sysv*) 1495 | ;; 1496 | -ose*) 1497 | os=-ose 1498 | ;; 1499 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1500 | os=-mint 1501 | ;; 1502 | -zvmoe) 1503 | os=-zvmoe 1504 | ;; 1505 | -dicos*) 1506 | os=-dicos 1507 | ;; 1508 | -pikeos*) 1509 | # Until real need of OS specific support for 1510 | # particular features comes up, bare metal 1511 | # configurations are quite functional. 1512 | case $basic_machine in 1513 | arm*) 1514 | os=-eabi 1515 | ;; 1516 | *) 1517 | os=-elf 1518 | ;; 1519 | esac 1520 | ;; 1521 | -nacl*) 1522 | ;; 1523 | -ios) 1524 | ;; 1525 | -none) 1526 | ;; 1527 | *) 1528 | # Get rid of the `-' at the beginning of $os. 1529 | os=`echo $os | sed 's/[^-]*-//'` 1530 | echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 1531 | exit 1 1532 | ;; 1533 | esac 1534 | else 1535 | 1536 | # Here we handle the default operating systems that come with various machines. 1537 | # The value should be what the vendor currently ships out the door with their 1538 | # machine or put another way, the most popular os provided with the machine. 1539 | 1540 | # Note that if you're going to try to match "-MANUFACTURER" here (say, 1541 | # "-sun"), then you have to tell the case statement up towards the top 1542 | # that MANUFACTURER isn't an operating system. Otherwise, code above 1543 | # will signal an error saying that MANUFACTURER isn't an operating 1544 | # system, and we'll never get to this point. 1545 | 1546 | case $basic_machine in 1547 | score-*) 1548 | os=-elf 1549 | ;; 1550 | spu-*) 1551 | os=-elf 1552 | ;; 1553 | *-acorn) 1554 | os=-riscix1.2 1555 | ;; 1556 | arm*-rebel) 1557 | os=-linux 1558 | ;; 1559 | arm*-semi) 1560 | os=-aout 1561 | ;; 1562 | c4x-* | tic4x-*) 1563 | os=-coff 1564 | ;; 1565 | c8051-*) 1566 | os=-elf 1567 | ;; 1568 | hexagon-*) 1569 | os=-elf 1570 | ;; 1571 | tic54x-*) 1572 | os=-coff 1573 | ;; 1574 | tic55x-*) 1575 | os=-coff 1576 | ;; 1577 | tic6x-*) 1578 | os=-coff 1579 | ;; 1580 | # This must come before the *-dec entry. 1581 | pdp10-*) 1582 | os=-tops20 1583 | ;; 1584 | pdp11-*) 1585 | os=-none 1586 | ;; 1587 | *-dec | vax-*) 1588 | os=-ultrix4.2 1589 | ;; 1590 | m68*-apollo) 1591 | os=-domain 1592 | ;; 1593 | i386-sun) 1594 | os=-sunos4.0.2 1595 | ;; 1596 | m68000-sun) 1597 | os=-sunos3 1598 | ;; 1599 | m68*-cisco) 1600 | os=-aout 1601 | ;; 1602 | mep-*) 1603 | os=-elf 1604 | ;; 1605 | mips*-cisco) 1606 | os=-elf 1607 | ;; 1608 | mips*-*) 1609 | os=-elf 1610 | ;; 1611 | or32-*) 1612 | os=-coff 1613 | ;; 1614 | *-tti) # must be before sparc entry or we get the wrong os. 1615 | os=-sysv3 1616 | ;; 1617 | sparc-* | *-sun) 1618 | os=-sunos4.1.1 1619 | ;; 1620 | pru-*) 1621 | os=-elf 1622 | ;; 1623 | *-be) 1624 | os=-beos 1625 | ;; 1626 | *-ibm) 1627 | os=-aix 1628 | ;; 1629 | *-knuth) 1630 | os=-mmixware 1631 | ;; 1632 | *-wec) 1633 | os=-proelf 1634 | ;; 1635 | *-winbond) 1636 | os=-proelf 1637 | ;; 1638 | *-oki) 1639 | os=-proelf 1640 | ;; 1641 | *-hp) 1642 | os=-hpux 1643 | ;; 1644 | *-hitachi) 1645 | os=-hiux 1646 | ;; 1647 | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1648 | os=-sysv 1649 | ;; 1650 | *-cbm) 1651 | os=-amigaos 1652 | ;; 1653 | *-dg) 1654 | os=-dgux 1655 | ;; 1656 | *-dolphin) 1657 | os=-sysv3 1658 | ;; 1659 | m68k-ccur) 1660 | os=-rtu 1661 | ;; 1662 | m88k-omron*) 1663 | os=-luna 1664 | ;; 1665 | *-next) 1666 | os=-nextstep 1667 | ;; 1668 | *-sequent) 1669 | os=-ptx 1670 | ;; 1671 | *-crds) 1672 | os=-unos 1673 | ;; 1674 | *-ns) 1675 | os=-genix 1676 | ;; 1677 | i370-*) 1678 | os=-mvs 1679 | ;; 1680 | *-gould) 1681 | os=-sysv 1682 | ;; 1683 | *-highlevel) 1684 | os=-bsd 1685 | ;; 1686 | *-encore) 1687 | os=-bsd 1688 | ;; 1689 | *-sgi) 1690 | os=-irix 1691 | ;; 1692 | *-siemens) 1693 | os=-sysv4 1694 | ;; 1695 | *-masscomp) 1696 | os=-rtu 1697 | ;; 1698 | f30[01]-fujitsu | f700-fujitsu) 1699 | os=-uxpv 1700 | ;; 1701 | *-rom68k) 1702 | os=-coff 1703 | ;; 1704 | *-*bug) 1705 | os=-coff 1706 | ;; 1707 | *-apple) 1708 | os=-macos 1709 | ;; 1710 | *-atari*) 1711 | os=-mint 1712 | ;; 1713 | *) 1714 | os=-none 1715 | ;; 1716 | esac 1717 | fi 1718 | 1719 | # Here we handle the case where we know the os, and the CPU type, but not the 1720 | # manufacturer. We pick the logical manufacturer. 1721 | vendor=unknown 1722 | case $basic_machine in 1723 | *-unknown) 1724 | case $os in 1725 | -riscix*) 1726 | vendor=acorn 1727 | ;; 1728 | -sunos*) 1729 | vendor=sun 1730 | ;; 1731 | -cnk*|-aix*) 1732 | vendor=ibm 1733 | ;; 1734 | -beos*) 1735 | vendor=be 1736 | ;; 1737 | -hpux*) 1738 | vendor=hp 1739 | ;; 1740 | -mpeix*) 1741 | vendor=hp 1742 | ;; 1743 | -hiux*) 1744 | vendor=hitachi 1745 | ;; 1746 | -unos*) 1747 | vendor=crds 1748 | ;; 1749 | -dgux*) 1750 | vendor=dg 1751 | ;; 1752 | -luna*) 1753 | vendor=omron 1754 | ;; 1755 | -genix*) 1756 | vendor=ns 1757 | ;; 1758 | -mvs* | -opened*) 1759 | vendor=ibm 1760 | ;; 1761 | -os400*) 1762 | vendor=ibm 1763 | ;; 1764 | -ptx*) 1765 | vendor=sequent 1766 | ;; 1767 | -tpf*) 1768 | vendor=ibm 1769 | ;; 1770 | -vxsim* | -vxworks* | -windiss*) 1771 | vendor=wrs 1772 | ;; 1773 | -aux*) 1774 | vendor=apple 1775 | ;; 1776 | -hms*) 1777 | vendor=hitachi 1778 | ;; 1779 | -mpw* | -macos*) 1780 | vendor=apple 1781 | ;; 1782 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1783 | vendor=atari 1784 | ;; 1785 | -vos*) 1786 | vendor=stratus 1787 | ;; 1788 | esac 1789 | basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` 1790 | ;; 1791 | esac 1792 | 1793 | echo "$basic_machine$os" 1794 | exit 1795 | 1796 | # Local variables: 1797 | # eval: (add-hook 'write-file-functions 'time-stamp) 1798 | # time-stamp-start: "timestamp='" 1799 | # time-stamp-format: "%:y-%02m-%02d" 1800 | # time-stamp-end: "'" 1801 | # End: 1802 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT([sdate],[0.7],[cb@df7cb.de],[sdate]) 3 | AC_PREREQ(2.59) 4 | AC_CANONICAL_TARGET 5 | AM_INIT_AUTOMAKE 6 | #AM_MAINTAINER_MODE 7 | AC_CONFIG_MACRO_DIR([m4]) 8 | AC_CONFIG_HEADERS([config.h]) 9 | AC_PROG_MAKE_SET 10 | AM_PROG_LIBTOOL 11 | AC_PROG_CC 12 | 13 | dnl Checks for programs. 14 | 15 | dnl Checks for libraries. 16 | dnl Replace `main' with a function in -ldl: 17 | AC_CHECK_LIB(dl, dlopen) 18 | 19 | dnl Checks for header files. 20 | AC_HEADER_DIRENT 21 | AC_HEADER_STDC 22 | AC_CHECK_HEADERS(fcntl.h unistd.h features.h sys/feature_tests.h pthread.h stdint.h inttypes.h grp.h endian.h sys/sysmacros.h sys/socket.h) 23 | 24 | dnl Checks for typedefs, structures, and compiler characteristics. 25 | AC_C_CONST 26 | AC_CHECK_TYPE(mode_t, int) 27 | AC_CHECK_TYPE(off_t, long) 28 | AC_CHECK_TYPE(size_t, unsigned) 29 | 30 | dnl This should really be done intelligently. 31 | 32 | case $target_cpu:$target_os in 33 | (alpha*:linux*) 34 | (ia64*:linux*) 35 | libcpath="/lib/libc.so.6.1" 36 | ;; 37 | (*:linux*) 38 | libcpath="/lib/libc.so.6" 39 | ;; 40 | (*:k*bsd*-gnu) 41 | libcpath="/lib/libc.so.0.1" 42 | ;; 43 | (*:freebsd*) 44 | libcpath="/usr/lib/libc.so.4" 45 | ;; 46 | (*:netbsd*) 47 | libcpath="/usr/lib/libc.so.12" 48 | ;; 49 | (*:openbsd*) 50 | libcpath="/usr/lib/libc.so.25.2" 51 | ;; 52 | (*:hpux*) 53 | libcpath="/usr/lib/hpux32/libc.so.1" 54 | ;; 55 | (*:osf*) 56 | libcpath="/shlib/libc.so" 57 | ;; 58 | (*:solaris*) 59 | libcpath="/lib/libc.so.1" 60 | ;; 61 | (*) 62 | AC_MSG_WARN([don't know where libc is for $target_os on 63 | $target_cpu, setting to /lib/libc.so]) 64 | libcpath="/lib/libc.so" 65 | ;; 66 | esac 67 | 68 | AC_DEFINE_UNQUOTED([LIBCPATH], "$libcpath", [path to libc shared object]) 69 | 70 | AC_CONFIG_FILES([Makefile scripts/Makefile doc/Makefile]) 71 | AC_OUTPUT 72 | 73 | dnl Local variables: 74 | dnl mode: m4 75 | dnl End: 76 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | sdate (0.8) UNRELEASED; urgency=medium 2 | 3 | * Trim trailing whitespace. 4 | * Bump debhelper from old 12 to 13. 5 | * Update standards version to 4.5.1, no changes needed. 6 | 7 | -- Debian Janitor Tue, 21 Sep 2021 04:57:42 -0000 8 | 9 | sdate (0.7) unstable; urgency=medium 10 | 11 | * Support COVID 19 date. 12 | 13 | -- Christoph Berg Thu, 04 Jun 2020 20:34:14 +0200 14 | 15 | sdate (0.6) unstable; urgency=medium 16 | 17 | * Use DH 12 and strip down rules to the minimum. 18 | * Enable all hardening features. 19 | * Add debian/gitlab-ci.yml. 20 | * Test sdate -e. 21 | 22 | -- Christoph Berg Thu, 09 Apr 2020 14:58:15 +0200 23 | 24 | sdate (0.5) unstable; urgency=medium 25 | 26 | * Source format 3.0 (native). 27 | * Update config.guess+sub. 28 | * Bump compat and S-V. 29 | * Add testsuite. 30 | * Remove dh-autoreconf B-D. 31 | * Remove libsdate.la and shlibs file. 32 | * Remove suid bit from libsdate.so.0.0.1. 33 | * Remove hardcoded CFLAGS. 34 | 35 | -- Christoph Berg Sat, 19 May 2018 17:10:13 +0200 36 | 37 | sdate (0.4+nmu1) unstable; urgency=medium 38 | 39 | * Non-maintainer upload. 40 | * Fix FTBFS by running autoreconf also inside the subdirectory 41 | "fake". (Closes: #818443) 42 | * Additionally also remove config.h.in, fake/Makefile.in, 43 | fake/aclocal.m4, and fake/configure in the clean target. 44 | 45 | -- Axel Beckert Sat, 10 Sep 2016 00:06:27 +0200 46 | 47 | sdate (0.4) unstable; urgency=medium 48 | 49 | * B-D on dh-autoreconf and update rules file to use dh --with autoreconf. 50 | Closes: #744657. 51 | 52 | -- Christoph Berg Fri, 25 Apr 2014 10:05:19 +0200 53 | 54 | sdate (0.3.1+nmu1) unstable; urgency=low 55 | 56 | * Non-maintainer upload. 57 | * debian/rules: add dh_installdeb to fix non-generation of maintainer 58 | scripts and non-invocation of ldconfig (Closes: #553011) 59 | 60 | -- Stefano Zacchiroli Sat, 14 Nov 2009 16:10:08 +0100 61 | 62 | sdate (0.3.1) unstable; urgency=low 63 | 64 | * Update config.guess & sub at build time. (Closes: #534813) 65 | * Bump Standards-Version, use DH compat 7. 66 | 67 | -- Christoph Berg Sun, 16 Aug 2009 14:00:06 +0200 68 | 69 | sdate (0.3) unstable; urgency=low 70 | 71 | * The epoch is now configurable, use sdate -e 1977-03 or set 72 | SDATE_EPOCH. 73 | 74 | -- Christoph Berg Tue, 25 Apr 2006 15:17:19 +0200 75 | 76 | sdate (0.2.1) unstable; urgency=low 77 | 78 | * Capitalize September in Description and documentation (Closes: #306372, 79 | thanks to Joey Schulze). 80 | * Remove sharutils Build-Dep. 81 | * Lintian: our package name is ok. 82 | * Bump Standards-Version. 83 | * I'm DD :-). 84 | 85 | -- Christoph Berg Mon, 5 Sep 2005 12:01:45 +0200 86 | 87 | sdate (0.2) unstable; urgency=low 88 | 89 | * Fixed algorithm to work independently of timezone. 90 | * First Debian upload (Closes: #304266). 91 | * Wrote manpage. 92 | * Added lintian and linda overrides. 93 | 94 | -- Christoph Berg Sun, 24 Apr 2005 02:07:48 +0200 95 | 96 | sdate (0.1) unstable; urgency=low 97 | 98 | * Initial version. 99 | * Sources copied from fakeroot 1.1.2. 100 | 101 | -- Christoph Berg Fri, 15 Oct 2004 18:05:54 +0200 102 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: sdate 2 | Section: utils 3 | Priority: optional 4 | Build-Depends: 5 | debhelper (>= 12.8), 6 | debhelper-compat (= 13), 7 | libc6-dev-s390x [s390], 8 | libc6-dev-sparc64 [sparc], 9 | Maintainer: Christoph Berg 10 | Standards-Version: 4.5.1 11 | Vcs-Git: https://github.com/df7cb/sdate.git 12 | Vcs-Browser: https://github.com/df7cb/sdate 13 | Homepage: https://www.df7cb.de/projects/sdate/ 14 | 15 | Package: sdate 16 | Architecture: any 17 | Depends: ${misc:Depends}, ${shlibs:Depends} 18 | Description: never ending September date 19 | sdate wraps the libc localtime() and gmtime() functions to output the eternal 20 | september 1993 date. 21 | . 22 | sdate works like fakeroot (on which its code is based) by setting LD_PRELOAD 23 | to a wrapper library. 24 | . 25 | * http://www.catb.org/~esr/jargon/html/S/September-that-never-ended.html 26 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | sdate is written and maintained by Christoph Berg . 2 | The first package was built on Fri Sep 4063 18:59:08 CEST 1993. 3 | 4 | Copyright (C) 1993 Christoph Berg 5 | 6 | sdate is based on fakeroot: 7 | 8 | GNU copyleft joost witteveen, . 9 | 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 2 of the License, or 13 | (at your option) any later version. 14 | 15 | On Debian systems, the complete text of the GNU General Public License 16 | can be found in `/usr/share/common-licenses/GPL'. 17 | -------------------------------------------------------------------------------- /debian/gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml 3 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml 4 | 5 | reprotest: 6 | extends: .test-reprotest-diffoscope 7 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | export DEB_BUILD_MAINT_OPTIONS=hardening=+all 4 | 5 | %: 6 | dh $@ 7 | 8 | execute_after_dh_auto_install: 9 | rm debian/sdate/usr/lib/*/libsdate.a 10 | rm debian/sdate/usr/lib/*/libsdate.la 11 | rm debian/sdate/usr/lib/*/libsdate.so 12 | -------------------------------------------------------------------------------- /debian/sdate.lintian-overrides: -------------------------------------------------------------------------------- 1 | # we aren't actually a library 2 | sdate binary: package-name-doesnt-match-sonames libsdate0 3 | sdate binary: no-symbols-control-file 4 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/tests/control: -------------------------------------------------------------------------------- 1 | Depends: @, perl 2 | Tests: sdate 3 | Restrictions: allow-stderr 4 | -------------------------------------------------------------------------------- /debian/tests/sdate: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export LC_ALL=C 4 | 5 | set -eux 6 | 7 | sdate 8 | sdate | grep 1993 9 | 10 | sdate --covid 19 11 | sdate --covid 19 | grep 2020 12 | 13 | sdate -e 1977-03 14 | sdate -e 1977-03 | grep 'Mar.*1977' 15 | 16 | sdate perl -le '@a = localtime; print "@a"' 17 | sdate perl -le '@a = localtime; print "@a"' | grep ' 93 ' 18 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | 3 | man_MANS = sdate.1 4 | 5 | #another automake bug workaround 6 | EXTRA_DIST = $(man_MANS) 7 | -------------------------------------------------------------------------------- /doc/sdate.1: -------------------------------------------------------------------------------- 1 | .\" Process this file with 2 | .\" groff -man -Tascii foo.1 3 | .\" 4 | .\" "verbatim" environment (from strace.1) 5 | .de CW 6 | .sp 7 | .nf 8 | .ft CW 9 | .. 10 | .de CE 11 | .ft 12 | .fi 13 | .sp 14 | .. 15 | .\" 16 | .TH sdate 1 "4620 September 1993" "Debian Project" "Debian manual" 17 | .\" Manpage by Christoph Berg 18 | .SH NAME 19 | sdate \- never ending September date 20 | .SH SYNOPSIS 21 | .B sdate 22 | .B [\-e|\-\-epoch 23 | .IB yyyy-mm] 24 | .B [\-c|\-\-covid 25 | .IB vv] 26 | .B [\-l|\-\-lib 27 | .IB library] 28 | .BI [\-\-] 29 | .BI [command] 30 | .SH DESCRIPTION 31 | .B sdate 32 | runs a command in an environment wherein it wraps the libc localtime() and 33 | gmtime() calls such that the program will use the eternal September date. 34 | The wrapper functions are in a shared library 35 | .B /usr/lib/libsdate/libsdate.so* 36 | which is loaded through the 37 | .B LD_PRELOAD 38 | mechanism of the dynamic loader. (See 39 | .BR ld.so (8)) 40 | .SH OPTIONS 41 | .TP 42 | \fB\-e\fR \fIyyyy-mm\fR, \fB\-\-epoch\fR \fIyyyy-mm\fR 43 | Specify an alternative epoch, default is 1993-09. 44 | .TP 45 | \fB\-c\fR \fIvv\fR, \fB\-\-covid\fR \fIvv\fR 46 | Enable COVID mode, for the specified variant. Sets epoch to 47 | an appropriate value for the variant. 48 | .TP 49 | \fB\-l\fR \fIlibrary\fR, \fB\-\-lib\fR \fIlibrary\fR 50 | Specify an alternative wrapper library. 51 | .TP 52 | .BI [\-\-] \ command 53 | Any command you want to be ran. Use \(oq\-\-\(cq if in the command 54 | you have other options that may confuse sdate's option parsing. 55 | .TP 56 | .BI \-h 57 | Display help. 58 | .TP 59 | .BI \-v 60 | Display version. 61 | .SH FILES 62 | .I /usr/lib/libsdate/* 63 | The shared library containing the wrapper functions. 64 | .SH ENVIRONMENT 65 | .B LD_PRELOAD 66 | .SH LIMITATIONS 67 | .B 68 | .IP "Library versions" 69 | Every command executed within 70 | .B sdate 71 | needs to be linked to the same version of the C library as 72 | .B sdate 73 | itself. 74 | .SH SEE ALSO 75 | .TP 76 | http://www.catb.org/\(tiesr/jargon/html/S/September-that-never-ended.html 77 | .TP 78 | https://www.df7cb.de/projects/sdate/ 79 | .SH COPYING 80 | .B sdate 81 | is distributed under the GNU General Public License. 82 | (GPL v2 or later). 83 | .SH AUTHORS 84 | .TP 85 | Christoph Berg 86 | .RI < cb@df7cb.de > 87 | -------------------------------------------------------------------------------- /libsdate.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1993 Christoph Berg 3 | This program is free software, see COPYING for copyright terms. 4 | sdate is based on fakeroot: 5 | 6 | Copyright: GPL. 7 | Author: joost witteveen (joostje@debian.org) 8 | */ 9 | /* #define _POSIX_C_SOURCE 199309L whatever that may mean...*/ 10 | /* #define _BSD_SOURCE I use strdup, S_IFDIR, etc */ 11 | 12 | /* Roderich Schupp writes (bug #79100): 13 | /usr/include/dlfcn.h from libc6 2.2-5 defines RTLD_NEXT only 14 | when compiled with _GNU_SOURCE defined. Hence libfakeroot.c doesn't pick 15 | it 16 | up and does a dlopen("/lib/libc.so.6",...) in get_libc(). 17 | This works most of the time, but explodes if you have an arch-optimized 18 | libc installed: the program now has two versions of libc.so 19 | (/lib/libc.so.6 and, say, /lib/i586/libc.so.6) mapped. Again for 20 | some programs you might get away with this, but running bash under 21 | fakeroot 22 | always bombs. Simple fix: 23 | */ 24 | #define _GNU_SOURCE 25 | 26 | #include "config.h" 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | /* sdate */ 40 | #include 41 | 42 | 43 | /* 44 | Where are those shared libraries? 45 | If I knew of a configure/libtool way to find that out, I'd use it. Or 46 | any other way other than the method I'm using below. Does anybody know 47 | how I can get that location? (BTW, symply linking a programme, and running 48 | `ldd' on it isn't the option, as Digital Unix doesn't have ldd) 49 | */ 50 | 51 | 52 | /* 53 | Note that LIBCPATH isn't actually used on Linux or Solaris, as RTLD_NEXT 54 | is defined and we use that to get the `next_*' functions 55 | 56 | Linux: 57 | */ 58 | 59 | /* OSF1 :*/ 60 | /*#define LIBCPATH "/usr/shlib/libc.so"*/ 61 | 62 | /* 63 | // next_wrap_st: 64 | // this structure is used in next_wrap, which is defined in 65 | // wrapstruct.h, included below 66 | */ 67 | 68 | struct next_wrap_st{ 69 | void **doit; 70 | char *name; 71 | }; 72 | 73 | void *get_libc(){ 74 | 75 | #ifndef RTLD_NEXT 76 | void *lib=0; 77 | if(!lib){ 78 | lib= dlopen(LIBCPATH,RTLD_LAZY); 79 | } 80 | if (NULL==lib) { 81 | fprintf(stderr, "Couldn't find libc at: %s\n", LIBCPATH); 82 | abort(); 83 | } 84 | return lib; 85 | #else 86 | return RTLD_NEXT; 87 | #endif 88 | } 89 | void load_library_symbols(void); 90 | 91 | #include "wrapped.h" 92 | #include "wraptmpf.h" 93 | #include "wrapdef.h" 94 | #include "wrapstruct.h" 95 | 96 | 97 | void load_library_symbols(void){ 98 | /* this function loads all original functions from the C library. 99 | I ran into problems when each function individually 100 | loaded it's original counterpart, as RTLD_NEXT seems to have 101 | a different meaning in files with different names than libtricks.c 102 | (I.E, dlsym(RTLD_NEXT, ...) called in vsearch.c returned funtions 103 | defined in libtricks */ 104 | /* The calling of this function itself is somewhat tricky: 105 | the awk script wrapawk generates several .h files. In wraptmpf.h 106 | there are temporary definitions for tmp_*, that do the call 107 | to this function. The other generated .h files do even more tricky 108 | things :) */ 109 | 110 | static int done=0; 111 | int i; 112 | char* msg; 113 | 114 | if(!done){ 115 | for(i=0; next_wrap[i].doit; i++){ 116 | *(next_wrap[i].doit)=dlsym(get_libc(), next_wrap[i].name); 117 | if ( (msg = dlerror()) != NULL){ 118 | fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg); 119 | /* abort ();*/ 120 | } 121 | } 122 | } 123 | } 124 | 125 | /* sdate */ 126 | 127 | static inline int epoch_days(int y, int m) /* days past 1970-01-01 */ 128 | { 129 | /* 1 2 3 4 5 6 7 8 9 10 11 12 */ 130 | static int mon_offset[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; 131 | return 365 * (y - 70) 132 | + (int)((y - 69) / 4) /* leap days in previous years */ 133 | + ((y % 4 == 0) && (m >= 2)) /* this year's leap day */ 134 | + mon_offset[m]; 135 | } 136 | 137 | static struct tm *septemberfy(struct tm *t) 138 | { 139 | static int sep_offset = -1; 140 | static int sep_y = 93; 141 | static int sep_m = 8; 142 | 143 | if (sep_offset == -1) { 144 | char *e; 145 | if ((e = getenv("SDATE_EPOCH"))) { 146 | sscanf(e, "%d-%d", &sep_y, &sep_m); 147 | sep_m--; 148 | } 149 | 150 | if (sep_y < 70) 151 | sep_y += 100; 152 | if (sep_y > 1900) 153 | sep_y -= 1900; 154 | if (sep_y < 1 || sep_y > 199) /* range where our leap year stuff works */ 155 | sep_y = 93; 156 | if (sep_m < 0 || sep_m > 11) 157 | sep_m = 8; 158 | 159 | sep_offset = epoch_days(sep_y, sep_m); 160 | } 161 | 162 | if((t->tm_year == sep_y && t->tm_mon > sep_m) || t->tm_year > sep_y) { 163 | #ifdef DEBUG 164 | fprintf(stderr, "septemberfy: %d-%d-%d\n", t->tm_year, t->tm_mon, t->tm_mday); 165 | #endif 166 | if(t->tm_mon >= 0 && t->tm_mon < 12) 167 | t->tm_mday += epoch_days(t->tm_year, t->tm_mon) - sep_offset; 168 | t->tm_mon = sep_m; 169 | t->tm_year = sep_y; 170 | } 171 | return t; 172 | } 173 | 174 | struct tm *gmtime(const time_t *timep) { 175 | struct tm *result = next_gmtime(timep); 176 | #ifdef DEBUG 177 | fputs("gmtime wrapped\n", stderr); 178 | #endif 179 | return septemberfy(result); 180 | } 181 | 182 | struct tm *gmtime_r(const time_t *timep, struct tm *result) { 183 | #ifdef DEBUG 184 | fputs("gmtime_r wrapped\n", stderr); 185 | #endif 186 | result = next_gmtime_r(timep, result); 187 | return septemberfy(result); 188 | } 189 | 190 | struct tm *localtime(const time_t *timep) { 191 | struct tm *result = next_localtime(timep); 192 | #ifdef DEBUG 193 | fputs("localtime wrapped\n", stderr); 194 | #endif 195 | return septemberfy(result); 196 | } 197 | 198 | struct tm *localtime_r(const time_t *timep, struct tm *result) { 199 | #ifdef DEBUG 200 | fputs("localtime_r wrapped\n", stderr); 201 | #endif 202 | result = next_localtime_r(timep, result); 203 | return septemberfy(result); 204 | } 205 | 206 | /* 207 | time_t mktime(struct tm *tm) { 208 | #ifdef DEBUG 209 | fputs("mktime wrapped\n", stderr); 210 | #endif 211 | return next_mktime(tm); 212 | } 213 | */ 214 | -------------------------------------------------------------------------------- /localtime.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1993 Christoph Berg 3 | * This program is free software, see COPYING for copyright terms. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define LEN 100 12 | 13 | int main (int argc, char **argv) 14 | { 15 | char s[LEN]; 16 | struct tm t; 17 | time_t ti; 18 | char *format = "%F %T"; 19 | 20 | setlocale(LC_ALL, ""); 21 | 22 | ti = time(NULL); 23 | localtime_r(&ti, &t); 24 | 25 | /* 26 | if((t.tm_year == 93 && t.tm_mon == 8) || t.tm_year > 93) { 27 | struct tm sep93 = { 0, 0, 0, 28 | 31, 7, 93, 29 | 0, 0, 0 30 | }; 31 | time_t epoch = mktime(&sep93); 32 | int d = (int)((ti - epoch) / 86400); 33 | t.tm_year = 93; 34 | t.tm_mon = 8; 35 | t.tm_mday = d; 36 | } 37 | */ 38 | 39 | if(argc > 2) 40 | exit(2); 41 | if(argc == 2) 42 | format = argv[1]; 43 | 44 | if(strftime(s, LEN, format, &t) == 0) { 45 | exit(1); 46 | } 47 | 48 | puts(s); 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | bin_SCRIPTS=sdate 3 | EXTRA_DIST=sdate.in 4 | CLEANFILES=sdate 5 | 6 | do_subst = sed -e 's,[@]prefix[@],$(prefix),g' \ 7 | -e 's,[@]bindir[@],$(bindir),g' \ 8 | -e 's,[@]libdir[@],$(libdir),g' \ 9 | -e 's,[@]sdate_transformed[@],'`echo sdate | sed -e '$(transform)'`',g' \ 10 | -e 's,[@]VERSION[@],$(VERSION),g' 11 | 12 | sdate: $(srcdir)/sdate.in Makefile 13 | $(do_subst) < $(srcdir)/sdate.in > sdate 14 | chmod +x sdate 15 | -------------------------------------------------------------------------------- /scripts/instdebug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ln -sf `pwd`/.libs/libtricks.so.0.0.1 /usr/lib/libtricks/libtricks.so.0.0.1 -------------------------------------------------------------------------------- /scripts/sdate.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage () { 4 | cat - <&2 32 | exit 1 33 | fi 34 | 35 | eval set -- "$TEMP" 36 | 37 | while test "X$1" != "X--"; do 38 | case "$1" in 39 | -l|--lib) 40 | shift 41 | LIB=`eval echo "$1"` 42 | PATHS= 43 | ;; 44 | -e|--epoch) 45 | shift 46 | SDATE_EPOCH="$1" 47 | export SDATE_EPOCH 48 | ;; 49 | -c|--covid) 50 | shift 51 | case "$1" in 52 | 19) 53 | SDATE_EPOCH="2020-03" 54 | export SDATE_EPOCH 55 | ;; 56 | *) 57 | echo "Unknown COVID variant - supported variants are: 19" >&2 58 | exit 1 59 | ;; 60 | esac 61 | ;; 62 | -v|--version) 63 | echo "sdate version @VERSION@" 64 | exit 0 65 | ;; 66 | -h|--help) 67 | usage 68 | exit 0 69 | ;; 70 | esac 71 | shift 72 | done 73 | 74 | shift #get rid of the '--' 75 | 76 | # make sure the preload is available 77 | if [ -n "$PATHS" ] 78 | then 79 | for dir in `echo $PATHS | sed 's/:/ /g'` 80 | do 81 | if test -r "$dir/$LIB" 82 | then 83 | libfound=yes 84 | fi 85 | done 86 | else 87 | if test -r "$LIB" 88 | then 89 | libfound=yes 90 | fi 91 | fi 92 | 93 | if test $libfound = no 94 | then 95 | echo >&2 "sdate: preload library not found in $PATHS, aborting." 96 | exit 1 97 | fi 98 | 99 | # Keep other library paths 100 | if test -n "$LD_LIBRARY_PATH"; then 101 | PATHS="$PATHS:$LD_LIBRARY_PATH" 102 | fi 103 | # ...and preloaded libs 104 | if test -n "$LD_PRELOAD"; then 105 | LIB="$LIB $LD_PRELOAD" 106 | fi 107 | 108 | if test -z "$*"; then 109 | LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" date 110 | RESULT=$? 111 | else 112 | LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB" "$@" 113 | RESULT=$? 114 | fi 115 | 116 | exit $RESULT 117 | -------------------------------------------------------------------------------- /simple.c: -------------------------------------------------------------------------------- 1 | /* Dummy C program; we use this in the package build process to construct a 2 | * proper shlibs file for libfakeroot 3 | */ 4 | int main(void) { 5 | return(0); 6 | } 7 | -------------------------------------------------------------------------------- /stamp-h.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/df7cb/sdate/61d98241dc47fcfb84f3297666ca3a93ba5ed3ec/stamp-h.in -------------------------------------------------------------------------------- /test/day: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | print "Sun Apr 24 00:52:39 2005 CET = 1993-08-31 +4254days\n"; 6 | 7 | my $time = 1114296759; 8 | #my $time = 746755200 + 30*86400; 9 | 10 | my $end = $time + 100000; 11 | 12 | for (; $time < $end; $time += 3600) { 13 | print scalar localtime $time; 14 | print " "; 15 | print scalar gmtime $time; 16 | print "\n"; 17 | } 18 | -------------------------------------------------------------------------------- /test/enum: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use POSIX qw/mktime/; 5 | 6 | my $epoch = mktime(0, 0, 0, 31, 7, 93, 0, 0, 0); # 1993-08-31 7 | #my $epoch = mktime(0, 0, 0, 28, 1, 77, 0, 0, 0); # 1977-02-28 8 | 9 | foreach my $d (0 .. 38888) { 10 | my $time = $epoch + 86400 * $d; 11 | my $day = (localtime($time))[3]; 12 | print "$d != ". localtime($time) ."\n" if $d != $day; 13 | } 14 | -------------------------------------------------------------------------------- /test/enum.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | LD_PRELOAD=obj/.libs/libsdate.so perl test/enum 4 | -------------------------------------------------------------------------------- /wrapawk: -------------------------------------------------------------------------------- 1 | #Saluton Emacson! Bonvolu elekti -*- mode: awk; -*-. Dankon. 2 | 3 | BEGIN{ 4 | headerfile="wrapped.h"; 5 | deffile="wrapdef.h"; 6 | structfile="wrapstruct.h"; 7 | tmpffile="wraptmpf.h"; 8 | FS=";"; 9 | WARNING="/* Automatically generated file. Do not edit. Edit wrapawk/wrapfunc.inp. */"; 10 | print WARNING > headerfile; 11 | print "#ifndef WRAPPED_H" > headerfile; 12 | print "#define WRAPPED_H" > headerfile; 13 | print WARNING > deffile; 14 | print "#ifndef WRAPDEF_H" > deffile; 15 | print "#define WRAPDEF_H" > deffile; 16 | print WARNING > tmpffile; 17 | print "#ifndef WRAPTMPF_H" > tmpffile; 18 | print "#define WRAPTMPF_H" > tmpffile; 19 | print WARNING > structfile; 20 | print "#ifndef WRAPSTRUCT_H" > structfile; 21 | print "#define WRAPSTRUCT_H" > structfile; 22 | print "struct next_wrap_st next_wrap[]= {" > structfile; 23 | } 24 | 25 | /\/\*/{ 26 | } 27 | /^(\#)/{ 28 | print $0 > structfile; 29 | print $0 > tmpffile; 30 | print $0 > deffile; 31 | print $0 > headerfile; 32 | 33 | } 34 | /^[^\/].*;.*;.*;/{ 35 | name=$1; 36 | ret=$2; 37 | argtype=$3; 38 | argname=$4; 39 | MACRO=$5; 40 | if(MACRO){ 41 | print " {(void(*))&NEXT_" MACRO "_NOARG, " name "_QUOTE}," > structfile; 42 | print "extern " ret " (*NEXT_" MACRO "_NOARG)" argtype ";" > headerfile; 43 | print ret " (*NEXT_" MACRO "_NOARG)" argtype "=TMP_" MACRO ";"> deffile; 44 | 45 | print ret " TMP_" MACRO, argtype "{" > tmpffile; 46 | print " load_library_symbols();" > tmpffile; 47 | print " return NEXT_" MACRO "_NOARG " argname ";" > tmpffile; 48 | print "}" > tmpffile; 49 | print "" > tmpffile; 50 | } else { 51 | print " {(void(*))&next_" name ", \"" name "\"}," > structfile; 52 | print "extern " ret " (*next_" name ")" argtype ";" > headerfile; 53 | print ret " (*next_" name ")" argtype "=tmp_" name ";"> deffile; 54 | 55 | print ret " tmp_" name, argtype "{" > tmpffile; 56 | print " load_library_symbols();" > tmpffile; 57 | print " return next_" name, argname ";" > tmpffile; 58 | print "}" > tmpffile; 59 | print "" > tmpffile; 60 | } 61 | } 62 | 63 | /^ *$/{ 64 | print > structfile; 65 | print > headerfile; 66 | print > deffile; 67 | print > tmpffile; 68 | } 69 | 70 | END{ 71 | print " {NULL, NULL}," > structfile; 72 | print "};" > structfile; 73 | print "#endif" > structfile; 74 | print "#endif" > tmpffile; 75 | print "#endif" > deffile; 76 | print "#endif" > headerfile; 77 | } 78 | -------------------------------------------------------------------------------- /wrapfunc.inp: -------------------------------------------------------------------------------- 1 | /* This file lists the functions that are wrapped by libtricks, their */ 2 | /* arguments, and the way to call them. This is then used to generate */ 3 | /* the wrapper functions declarations in wrapped.h, the wrapper functions */ 4 | /* definitions wrapdef.h (actually, only assignments of the function */ 5 | /* variables), the structure of wraped functions in wrapstruct.h, */ 6 | /* and the temporary definitions (that hold until one of them is executed)*/ 7 | /* in wraptmpf.h */ 8 | /**/ */ 9 | /**/ */ 10 | /* each line of this file lists 4 fields, seperated by a ";". */ 11 | /* The first field is the name of the wrapped function, then it's return */ 12 | /* value. After that come the function arguments with types, and the last */ 13 | /* field contains the function arguments without types. */ 14 | /**/ 15 | 16 | gmtime;struct tm*;(const time_t *timep);(timep) 17 | gmtime_r;struct tm*;(const time_t *timep, struct tm *result);(timep, result) 18 | localtime;struct tm*;(const time_t *timep);(timep) 19 | localtime_r;struct tm*;(const time_t *timep, struct tm *result);(timep, result) 20 | --------------------------------------------------------------------------------