Commit 89c639d8 authored by Victor Seva's avatar Victor Seva

Imported Upstream version 6.0

parent db575c00
......@@ -3,7 +3,7 @@ language: c
env:
global:
- _COMPILE="libtool --mode=compile --tag=CC gcc"
- _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX"
- _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX"
- _INSTALL="libtool --mode=install install -p"
- _LINK="libtool --mode=link --tag=CC gcc"
- _LIBS="-lm -Wl,-E -ldl -lreadline"
......@@ -12,6 +12,10 @@ env:
- bindir=$prefix/bin
- incdir=$prefix/include
- libdir=$prefix/lib
- _inst=$TRAVIS_BUILD_DIR/_inst
- luadir=$_inst/share/lua
- luaexecdir=$_inst/lib/lua
matrix:
- LUA=lua5.3
- LUA=lua5.2
......@@ -28,12 +32,12 @@ before_install:
# Fetch Lua sources.
- cd $TRAVIS_BUILD_DIR
- 'if test lua5.3 = "$LUA"; then
curl http://www.lua.org/work/lua-5.3.0-rc2.tar.gz | tar xz;
cd lua-5.3.0;
curl http://www.lua.org/ftp/lua-5.3.1.tar.gz | tar xz;
cd lua-5.3.1;
fi'
- 'if test lua5.2 = "$LUA"; then
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz;
cd lua-5.2.3;
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz;
cd lua-5.2.4;
fi'
- 'if test lua5.1 = "$LUA"; then
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz;
......@@ -87,12 +91,12 @@ before_install:
# Tidy up file droppings.
- cd $TRAVIS_BUILD_DIR
- rm -rf lua-5.3.0 lua-5.2.3 lua-5.1.5 LuaJIT-2.0.3 luarocks-2.2.0
- rm -rf lua-5.3.1 lua-5.2.4 lua-5.1.5 LuaJIT-2.0.3 luarocks-2.2.0
install:
# Use Lua 5.3 compatible rocks, where available.
- 'for rock in ansicolors specl""; do
- 'for rock in ansicolors ldoc specl""; do
if test -z "$rock"; then break; fi;
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
......@@ -106,21 +110,37 @@ install:
sleep 1; touch configure;
fi'
# Build from rockspec.
- export ROCKSPEC=lyaml-5.1.4-1.rockspec
- 'test -f "$ROCKSPEC" || ROCKSPEC=lyaml-git-1.rockspec'
- sudo luarocks make $ROCKSPEC LUA="$LUA"
# Build from rockspec, forcing uninstall of older luarocks installed
# above when testing the git rockspec, both for enforcing backwards
# compatibility by default, and for ease of maintenance.
- if test -f 'lyaml-6.0-1.rockspec'; then
sudo luarocks make 'lyaml-6.0-1.rockspec' LUA="$LUA";
else
sudo luarocks make --force 'lyaml-git-1.rockspec' LUA="$LUA";
fi
# Clean up files created by root
- sudo git clean -dfx
- sudo rm -rf slingshot
- sudo rm -rf slingshot /tmp/ldoc
script:
# Reconfigure for in-tree test install.
- test -f configure || ./bootstrap --verbose
- test -f Makefile || ./configure --disable-silent-rules LUA="$LUA"
- ./configure --prefix="$_inst" --disable-silent-rules LUA="$LUA"
# Verify luarocks installation.
- make installcheck || make installcheck V=1
# Verify local build.
- make
- make check V=1
- make check || make check V=1
# Verify configured installation.
- make install prefix="$_inst" luadir="$luadir" luaexecdir="$luaexecdir"
- LUA_PATH="$luadir/?.lua;$luadir/?/init.lua;;"
LUA_CPATH="$luaexecdir/?.so;;"
make installcheck V=1
# Run sanity checks on CI server, ignoring buggy automakes.
......
......@@ -6,6 +6,7 @@ this list, please file an issue on github (run `./configure --help`
for the URL).
* Andrew Danforth <acd@weirdness.net>:
Designed and implemented lyaml.
Designed and implemented the C LibYAML binding.
* Gary V. Vaughan <gary@gnu.org>:
Lua 5.2 compatibility, build system, luarock packaging, releases.
Lua 5.2 and 5.3 compatibility, build system, luarock packaging,
lymal Lua code, release.
This diff is collapsed.
......@@ -25,6 +25,8 @@ LUA_PATH ?= ;
LUA_CPATH ?= ;
SPECL_ENV =
CHECK_ENV =
INSTALLCHECK_ENV =
## ---------- ##
......@@ -52,6 +54,7 @@ check_local =
dist_bin_SCRIPTS =
dist_lua_DATA =
doc_DATA =
installcheck_local =
install_exec_hooks = remove-luaexec-lafiles
uninstall_hooks = uninstall-luaexec-modules
lib_LTLIBRARIES =
......@@ -74,16 +77,18 @@ check-local: $(check_local)
## Installation. ##
## ------------- ##
installcheck-local: $(installcheck_local)
install-exec-hook: $(install_exec_hooks)
# Neither Lua itself, nor LuaRocks can use .la files, and LuaRocks
# actually moves such files aside anyway, so we just remove them from
# the installation directory.
remove-luaexec-lafiles:
@for la in $(luaexec_LTLIBRARIES); do \
f=`echo "$$la" |sed 's|^.*/||'`; \
echo rm -f $(luaexecdir)/$$f; \
rm -f $(luaexecdir)/$$f; \
@for la in $(luaexec_LTLIBRARIES); do \
f=`echo "$$la" |sed 's|^.*/||'`; \
echo rm -f $(DESTDIR)$(luaexecdir)/$$f; \
rm -f $(DESTDIR)$(luaexecdir)/$$f; \
done
......@@ -96,9 +101,9 @@ uninstall-hook: $(uninstall_hooks)
# We removed the .la files from luaexecdir, so the standard uninstall,
# with libtool --mode=uninstall, can't find everything anymore.
uninstall-luaexec-modules:
@for la in $(luaexec_LTLIBRARIES); do \
base=`echo "$$la" \
|sed 's|^.*/\(.*\)\.la|\1|'`; \
echo rm -f $(luaexecdir)/$$base.so; \
rm -f $(luaexecdir)/$$base.so; \
@for la in $(luaexec_LTLIBRARIES); do \
base=`echo "$$la" \
|sed 's|^.*/\(.*\)\.la|\1|'`; \
echo rm -f $(DESTDIR)$(luaexecdir)/$$base.so; \
rm -f $(DESTDIR)$(luaexecdir)/$$base.so; \
done
This diff is collapsed.
# lyaml NEWS - User visible changes
## Noteworthy changes in release 6.0 (2015-07-27) [stable]
### New Features
- `lyaml.load` now correctly reads a !!bool tagged scalar from a
YAML document, or an implicit bool value, according to
[the specification][boolspec].
```yaml
%TAG ! tag:yaml.org,2002:
---
truthy:
- !bool Y
- !bool y
- !bool True
- !bool "on"
falsey:
- !bool n
- !bool OFF
- !bool garbage
```
- `lyaml.load` now correctly reads a !!float tagged scalar from a
YAML document, or an implicit float value, according to
[the specification][floatspec].
- `lyaml.load` now correctly reads a !!int tagged scalar from a
YAML document, or an implicit integer value, according to
[the specification][intspec].
- `lyaml.load` now supports the !!merge key type according to
[the specification][mergespec].
```yaml
- &MERGE { x: 1, y: 2 }
- &OVERRIDE { x: 0, z: 1 }
-
<< : [&MERGE, &OVERRIDE]
z: 3
```
The anchored tables remain in the document too, so this results in
the following Lua table:
```lua
{ -- START_STREAM
{ -- START_DOCUMENT
{ x = 1, y = 2 }, -- MERGE
{ x = 0, z = 1 }, -- OVERRIDE
{ x = 1, y = 2, z = 3}, -- <<<
} -- END_DOCUMENT
} -- END_STREAM
```
### Bug fixes
- Multi-line strings were previously being dumped using single quotes
which caused the dumped YAML to break.
For example, { foo = "a\nmultiline\nstring" } would get dumped as:
```yaml
foo: 'a
multiline
string'
```
Note the extra line-breaks in between each line. This also causes
YAML parsing to fail (since the blank lines didn't have the expected
indentation).
This patch fixes the dump to use the YAML literal syntax for any
multi-line strings so the same example gets dumped as:
```yaml
foo: |-
a
multiline
string
```
- `lyaml.load` now correctly reads the !!null tag in a YAML
document as an `lyaml.null` reference, identical to the "~"
shorthand syntax, according to [the specification][nullspec].
### Incompatible Changes
- `lyaml.load` now takes a table of options as an optional second
argument, not a simple boolean to determine whether all documents
should be returned from the stream. For now, a `true` second
argument will be converted to the modern equivalent:
```lua
lyaml.load (document, { all = true })
```
- `lyaml.dump` now takes a table of options as an optional second
argument, not an initial table of anchors. For now, a second
argument without any new API keys will be converted to the modern
equivalent:
```lua
lyaml.dump (t, { anchors = arg2 })
```
[boolspec]: http://yaml.org/type/bool.html
[floatspec]: http://yaml.org/type/float.html
[intspec]: http://yaml.org/type/int.html
[mergespec]: http://yaml.org/type/merge.html
[nullspec]: http://yaml.org/type/null.html
## Noteworthy changes in release 5.1.4 (2015-01-01) [stable]
- This release is functionally identical to the last.
......
......@@ -19,11 +19,79 @@ and [%YAML 1.1][yaml11] format strings.
```lua
local lyaml = require "lyaml"
local t = lyaml.load (YAML-STRING)
local yamlstr = lyaml.dump (LUA-TABLE)
local t = lyaml.load (YAML-STRING, [OPTS-TABLE])
local yamlstr = lyaml.dump (LUA-TABLE, [OPTS-TABLE])
local null = lyaml.null ()
```
#### `lyaml.load`
`lyaml.load` accepts a YAML string for parsing. If the YAML string contains
multiple documents, only the first document will be returned by default. To
return multiple documents as a table, set `all = true` in the second
argument OPTS-TABLE.
```lua
lyaml.load("foo: bar")
--> { foo = "bar" }
lyaml.load("foo: bar", { all = true })
--> { { foo = "bar" } }
multi_doc_yaml = [[
---
one
...
---
two
...
]]
lyaml.load(multi_doc_yaml)
--> "one"
lyaml.load(multi_doc_yaml, { all = true })
--> { "one", "two" }
```
You can supply an alternative function for converting implicit plain
scalar values in the `implicit_scalar` field of the OPTS-TABLE argument;
otherwise a default is composed from the functions in the `lyaml.implicit`
module.
You can also supply an alternative table for coverting explicitly tagged
scalar values in the `explicit_scalar` field of the OPTS-TABLE argument;
otherwise all supported tags are parsed by default using the functions
from the `lyaml.explicit` module.
#### `lyaml.dump`
`lyaml.dump` accepts a table of values to dump. Each value in the table
represents a single YAML document. To dump a table of lua values this means
the table must be wrapped in another table (the outer table represents the
YAML documents, the inner table is the single document table to dump).
```lua
lyaml.dump({ { foo = "bar" } })
--> ---
--> foo: bar
--> ...
lyaml.dump({ "one", "two" })
--> --- one
--> ...
--> --- two
--> ...
```
If you need to round-trip load a dumped document, and you used a custom
function for converting implicit scalars, then you should pass that same
function in the `implicit_scalar` field of the OPTS-TABLE argument to
`lyaml.dump` so that it can quote strings that might otherwise be
implicitly converted on reload.
#### Nil Values
[Lua] tables treat `nil` valued keys as if they were not there,
where [YAML] explicitly supports `null` values (and keys!). Lyaml
will retain [YAML] `null` values as `lyaml.null ()` by default,
......
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.14'
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.14.1], [],
m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
......@@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.14.1])dnl
[AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -118,7 +118,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -163,15 +163,14 @@ AC_SUBST([AR])dnl
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -202,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -393,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -469,7 +468,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -559,8 +558,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
......@@ -633,7 +632,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi])
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
......@@ -662,7 +665,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -673,7 +676,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
......@@ -683,7 +686,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -704,7 +707,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -754,7 +757,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -793,7 +796,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -822,7 +825,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -869,7 +872,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -888,7 +891,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -969,7 +972,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1029,7 +1032,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1057,7 +1060,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -1076,7 +1079,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......
......@@ -33,6 +33,7 @@
buildreq='
git - http://git-scm.com
tar - http://www.gnu.org/s/tar
ldoc 1.4.2 http://rocks.moonscript.org/manifests/steved/ldoc-1.4.2-1.rockspec
specl 14 http://rocks.moonscript.org/manifests/gvvaughan/specl-14-1.rockspec
'
......@@ -56,6 +57,7 @@ slingshot_files='
# Prequisite rocks that need to be installed for travis builds to work.
travis_extra_rocks='
ansicolors
ldoc
specl
'
......
......@@ -4,7 +4,7 @@
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
......
......@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
......
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2013-11-29'
timestamp='2014-11-04'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -24,12 +24,12 @@ timestamp='2013-11-29'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner.
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
# Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
......@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
......@@ -579,8 +579,9 @@ EOF
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
......@@ -826,7 +827,7 @@ EOF
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
......@@ -969,10 +970,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*)
or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
......@@ -1371,154 +1372,6 @@ EOF
exit ;;
esac
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif