Move build system to rebar3

References #15.
This commit is contained in:
Jean-Sébastien Pédron 2016-11-10 09:57:41 +01:00
parent 31e0453f04
commit 5292225bcb
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
23 changed files with 8 additions and 949 deletions

27
.gitignore vendored
View File

@ -1,35 +1,14 @@
.sw?
.*.sw?
*.beam
Makefile.in
/ac-aux/
/aclocal.m4
/autom4te.cache/
/config.h.in
/config.h.in~
/configure
# Files produced by Debian package.
build-stamp
configure-stamp
debian/*.debhelper.log
debian/*.substvars
debian/*/
debian/build/
debian/files
!debian/source/
# Files produced by rebar.
/.eunit/
/.rebar/
/rebar
/deps/
/ebin/yamerl.app
/_build/
/doc/
/ebin
/rebar.lock
# Elixir Support
/_build/
/doc/
/mix.lock
/yamerl-*-contents.tar.gz
*.ez

View File

View File

@ -1,15 +0,0 @@
ACLOCAL_FLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include src ebin testsuite
EXTRA_DIST = README.md \
AUTHORS \
COPYING \
debian/changelog \
debian/compat \
debian/control \
debian/copyright \
debian/rules \
debian/source/format \
debian/source/options

View File

@ -1,319 +0,0 @@
dnl ------------------------------------------------------------------
dnl Autoconf initialization.
dnl ------------------------------------------------------------------
AC_INIT([yamerl], [0.3.3])
AC_CONFIG_SRCDIR([src/yamerl_app.erl])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([ac-aux])
AM_INIT_AUTOMAKE([1.11 -Wall foreign])
AC_PREREQ([2.64])
ECHO=echo
COLORED_ECHO_INIT
dnl ------------------------------------------------------------------
dnl Internal functions for this configure script.
dnl ------------------------------------------------------------------
dnl EMKOPTS is used by Emakefile(s).
append_to_EMKOPTS () {
if test -z "[$]EMKOPTS"; then
EMKOPTS="[$]1"
else
EMKOPTS="[$]{EMKOPTS% }, [$]1"
fi
}
dnl Expand shell variables to have a nice output in the final report.
expand_var () {
local v=`eval echo '$'[$]1`
while test "`echo [$]v | grep [[$]] > /dev/null && echo nok`"; do
v=`eval echo [$]v`
done
echo [$]v
}
dnl ------------------------------------------------------------------
dnl Options.
dnl ------------------------------------------------------------------
dnl Debugging option.
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug],
[turn on debugging [[default=yes]]]),,
enable_debug=yes)
if test "x${enable_debug}" = "xyes"; then
append_to_EMKOPTS "{d, debug}"
fi
AC_ARG_ENABLE([warnings],
AC_HELP_STRING([--enable-warnings],
[treat warnings as errors [[default=no]]]),,
enable_warnings=no)
if test "x${enable_warnings}" = "xyes"; then
append_to_EMKOPTS "warnings_as_errors"
fi
AC_ARG_ENABLE([export_all],
AC_HELP_STRING([--enable-export-all],
[export all Erlang functions [[default=no]]]),,
enable_export_all=no)
if test "x${enable_export_all}" = "xyes"; then
append_to_EMKOPTS "export_all"
fi
dnl Include debug symbols.
append_to_EMKOPTS "debug_info"
dnl Print any warnings.
append_to_EMKOPTS "report_warnings"
append_to_EMKOPTS "{warn_format, 1}"
append_to_EMKOPTS "warn_export_vars"
append_to_EMKOPTS "warn_shadow_vars"
append_to_EMKOPTS "warn_unused_import"
dnl ------------------------------------------------------------------
dnl Erlang environment.
dnl ------------------------------------------------------------------
echo
COLORED_ECHO([%BErlang environment%b])
dnl Available flags.
AC_ARG_WITH([erlang],
AC_HELP_STRING([--with-erlang=PREFIX],
[prefix where Erlang is installed (optional)]),
with_erlang=${withval%/},
with_erlang="")
dnl erl(1) is used to compile Erlang modules.
if test "x${with_erlang}" = "x"; then
AC_ERLANG_PATH_ERL
AC_ERLANG_PATH_ERLC
else
erl_path="${with_erlang}/bin"
AC_ERLANG_PATH_ERL(, [$erl_path$PATH_SEPARATOR$PATH])
AC_ERLANG_PATH_ERLC(, [$erl_path$PATH_SEPARATOR$PATH])
fi
if test "x${ERL}" = "x"; then
AC_MSG_ERROR([
Erlang not found. Fill the ERL variable with erl(1) path or provide
Erlang prefix with --with-erlang.])
fi
dnl escript(1) is used by the testsuite.
AC_ARG_VAR([ESCRIPT], [Erlang/OTP interpreter command [autodetected]])
if test "x${ESCRIPT}" = "x"; then
if test "x${with_erlang}" = "x"; then
AC_PATH_PROG([ESCRIPT], [escript],,)
else
erl_path="${with_erlang}/bin"
AC_PATH_PROG([ESCRIPT], [escript],,
[$erl_path$PATH_SEPARATOR$PATH])
fi
else
AC_MSG_CHECKING([for escript])
AC_MSG_RESULT([$ESCRIPT])
fi
if test "x${ESCRIPT}" = "x"; then
AC_MSG_WARN([
escript(1) not found. Fill the ESCRIPT variable with escript(1) path if
you want to use the testsuite.])
fi
dnl dialyzer(1) is used by the testsuite.
AC_ARG_VAR([DIALYZER], [Erlang/OTP discrepancy analyzer [autodetected]])
if test "x${DIALYZER}" = "x"; then
if test "x${with_erlang}" = "x"; then
AC_PATH_PROG([DIALYZER], [dialyzer],,)
else
erl_path="${with_erlang}/bin"
AC_PATH_PROG([DIALYZER], [dialyzer],,
[$erl_path$PATH_SEPARATOR$PATH])
fi
else
AC_MSG_CHECKING([for dialyzer])
AC_MSG_RESULT([$DIALYZER])
fi
if test "x${DIALYZER}" = "x"; then
AC_MSG_WARN([
dialyzer(1) not found. Fill the DIALYZER variable with dialyzer(1) path if
you want it to be run during the testsuite.])
fi
dnl Declare ERL_LIBS as precious.
AC_ARG_VAR([ERL_LIBS], [Erlang/OTP applications search path [none]])
dnl Get Erlang $ROOT dir and lib dir.
AC_ERLANG_SUBST_ROOT_DIR
AC_ERLANG_SUBST_LIB_DIR
dnl Get ERTS version.
ERLANG_CHECK_ERTS
ERLANG_CHECK_RELEASE
dnl Erlang R14B02 (ERTS 5.8.3) is required.
AX_COMPARE_VERSION([${ERLANG_ERTS_VER}], [ge], [5.8.3],
[is_erlang_r14b02="yes"],
[is_erlang_r14b02="no"])
if test "x${is_erlang_r14b02}" = "xno"; then
AC_MSG_ERROR([
Erlang R14B02 is required but only Erlang $ERLANG_RELEASE was found!])
fi
dnl Determine directories for installation.
if test "x${prefix}" = "xNONE"; then
dnl Inside Erlang lib directory.
ERLANG_INSTALL_LIB_DIR="${ERLANG_LIB_DIR}"
else
dnl Under $prefix
ERLANG_INSTALL_LIB_DIR="${prefix}"
fi
AC_ERLANG_SUBST_INSTALL_LIB_DIR
AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
dnl ------------------------------------------------------------------
dnl Erlang applicatons.
dnl ------------------------------------------------------------------
dnl "compiler" install directory.
AC_ARG_WITH([erlang_compiler],
AC_HELP_STRING([--with-erlang-compiler=PREFIX],
[prefix where the "compiler" Erlang application is installed (optional)]),
with_erlang_compiler=${withval%/},
with_erlang_compiler="")
ERL_LIBS_save=$ERL_LIBS
if test "x${with_erlang_compiler}" != "x"; then
ERL_LIBS="${with_erlang_compiler}:${ERL_LIBS}"
fi
export ERL_LIBS
AC_ERLANG_CHECK_LIB([compiler],, [AC_MSG_ERROR([
"compiler" Erlang application not found.
Provide compiler install path with --with-erlang-compiler.])])
ERL_LIBS=$ERL_LIBS_save
export ERL_LIBS
dnl "tools" install directory.
AC_ARG_WITH([erlang_tools],
AC_HELP_STRING([--with-erlang-tools=PREFIX],
[prefix where the "tools" Erlang application is installed (optional)]),
with_erlang_tools=${withval%/},
with_erlang_tools="")
ERL_LIBS_save=$ERL_LIBS
if test "x${with_erlang_tools}" != "x"; then
ERL_LIBS="${with_erlang_tools}:${ERL_LIBS}"
fi
export ERL_LIBS
AC_ERLANG_CHECK_LIB([tools],, [AC_MSG_ERROR([
"tools" Erlang application not found.
Provide tools install path with --with-erlang-tools.])])
ERL_LIBS=$ERL_LIBS_save
export ERL_LIBS
dnl "eunit" install directory.
AC_ARG_WITH([erlang_eunit],
AC_HELP_STRING([--with-erlang-eunit=PREFIX],
[prefix where the "eunit" Erlang application is installed (optional)]),
with_erlang_eunit=${withval%/},
with_erlang_eunit="")
ERL_LIBS_save=$ERL_LIBS
if test "x${with_erlang_eunit}" != "x"; then
ERL_LIBS="${with_erlang_eunit}:${ERL_LIBS}"
fi
export ERL_LIBS
AC_ERLANG_CHECK_LIB([eunit],, [AC_MSG_WARN([
"eunit" Erlang application not found.
Provide eunit install path with --with-erlang-eunit.])])
ERL_LIBS=$ERL_LIBS_save
export ERL_LIBS
dnl "yamler" install directory.
AC_ARG_WITH([erlang_yamler],
AC_HELP_STRING([--with-erlang-yamler=PREFIX],
[prefix where the "yamler" Erlang application is installed (optional)]),
with_erlang_yamler=${withval%/},
with_erlang_yamler="")
ERL_LIBS_save=$ERL_LIBS
if test "x${with_erlang_yamler}" != "x"; then
ERL_LIBS="${with_erlang_yamler}:${ERL_LIBS}"
fi
export ERL_LIBS
AC_ERLANG_CHECK_LIB([yamler])
ERL_LIBS=$ERL_LIBS_save
export ERL_LIBS
AM_CONDITIONAL([HAVE_YAMLER], [test x"$ERLANG_LIB_DIR_yamler" != x"not found"])
dnl ------------------------------------------------------------------
dnl Final substitutions.
dnl ------------------------------------------------------------------
AC_SUBST(EMKOPTS)
AC_SUBST(APP_RELEASE_DATE)
AC_SUBST(APP_DISTSUFFIX)
exp_ERLANG_INSTALL_LIB_DIR_yamerl=`expand_var ERLANG_INSTALL_LIB_DIR_yamerl`
AC_SUBST(exp_ERLANG_INSTALL_LIB_DIR_yamerl)
dnl ------------------------------------------------------------------
dnl Autoconf output.
dnl ------------------------------------------------------------------
echo
AM_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([
include/Makefile
src/Makefile
src/Emakefile.in
ebin/Makefile
ebin/yamerl.app.in
ebin/yamerl.appup
testsuite/Makefile
testsuite/etest
Makefile
])
AC_CONFIG_FILES([
testsuite/dialyzer
], [chmod +x testsuite/dialyzer])
AC_CONFIG_FILES([
testsuite/benchmark
], [chmod +x testsuite/benchmark])
AC_OUTPUT
dnl --------------------------------------------------
dnl Configuration report
dnl --------------------------------------------------
echo
COLORED_ECHO([ %B== ${PACKAGE_NAME} ${PACKAGE_VERSION}${APP_DISTSUFFIX} ==%b])
echo
COLORED_ECHO([Configuration:])
COLORED_ECHO([ Prefix: ${prefix}])
COLORED_ECHO([ Application dir.: ${exp_ERLANG_INSTALL_LIB_DIR_yamerl}])
echo
COLORED_ECHO([ Erlang emulator: ${ERL}])
COLORED_ECHO([ Erlang compiler: ${ERLC}])
COLORED_ECHO([ Erlang interpreter: ${ESCRIPT}])
echo
COLORED_ECHO([ Debug: ${enable_debug}])
COLORED_ECHO([ Warnings as errors: ${enable_warnings}])
COLORED_ECHO([ Export all: ${enable_export_all}])
echo

49
debian/changelog vendored
View File

@ -1,49 +0,0 @@
erlang-yamerl (0.3.3-1) stable; urgency=low
* yamerl_parser: Fix an infinite loop with "key:"
-- Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> Sun, 30 Oct 2016 00:38:26 +0200
erlang-yamerl (0.3.2-1) stable; urgency=low
* yamerl_parser: Don't build with HiPE by default
* Elixir/hex.pm support
* Fix generation of yamerl.app with nawk(1)
-- Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> Sat, 28 Mar 2015 01:43:31 +0100
erlang-yamerl (0.3.1-1) stable; urgency=low
* Fix bug with re:run/3 usage and Unicode string (#5).
* yamerl_constr: Ensure the node module is loaded.
* Allow to run the testsuite using rebar.
* Improve documentation.
-- Jean-Sébastien Pédron <jean-sebastien@yakaz.com> Tue, 22 Jul 2014 16:52:57 +0200
erlang-yamerl (0.3.0-1) stable; urgency=low
* Rename application to "yamerl".
* Fix Debian package.
-- Jean-Sébastien Pédron <jean-sebastien@yakaz.com> Wed, 26 Mar 2014 11:08:22 +0100
erlang-yaml (0.2.0-1) experimental; urgency=low
* Package for Erlang R15B03.
-- Jean-Sébastien Pédron <jean-sebastien@yakaz.com> Tue, 11 Sep 2012 15:22:24 +0200
erlang-yaml (0.1.1-1) experimental; urgency=low
* Add float support
* Add YAML failsafe/json/core schemas
* Bugfixes
-- Jean-Sébastien Pédron <jean-sebastien@yakaz.com> Fri, 27 Jan 2012 10:33:02 +0100
erlang-yaml (0.1.0-1) experimental; urgency=low
* Initial release.
-- Jean-Sébastien Pédron <jean-sebastien@yakaz.com> Thu, 23 Jun 2011 17:56:47 +0200

1
debian/compat vendored
View File

@ -1 +0,0 @@
9

30
debian/control vendored
View File

@ -1,30 +0,0 @@
Source: erlang-yamerl
Section: devel
Priority: optional
Maintainer: Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>
Uploaders: Christopher Faulet <christopher@yakaz.com>,
Jean-Sébastien Pédron <jean-sebastien@yakaz.com>
Build-Depends: debhelper (>= 9),
dh-autoreconf,
erlang-base-hipe | erlang-base,
erlang-tools,
erlang-eunit,
erlang-xmerl,
erlang-dev
Standards-Version: 3.9.4
Package: erlang-yamerl
Architecture: all
Depends: ${misc:Depends}, ${erlang:Depends}
Description: Pure Erlang YAML 1.2 parser
YAML is a human-friendly, cross language, Unicode based data
serialization language designed around the common native data types of
agile programming languages
.
yamerl is a pure Erlang application which is able to parse YAML 1.1
and YAML 1.2 documents, as well as JSON documents. It only depends on
standard Erlang/OTP applications, no external dependency is required.
It doesn't use native code either (neither port drivers nor NIFs)
.
yamerl is distributed under the terms of the 2-clause BSD license; see
COPYING.

59
debian/copyright vendored
View File

@ -1,59 +0,0 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: yamerl
Upstream-Contact: Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>
Source: https://github.com/yakaz/yamerl
Files: *
Copyright: 2012-2014, Yakaz
2016, Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>
License: BSD-2-clause
Copyright (c) 2012-2014 Yakaz
Copyright (c) 2016 Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr>
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Files: testsuite/data/benchmark/mochijson2.erl
Copyright: 2007, Mochi Media, Inc.
License: Expat
This is the MIT license.
.
Copyright (c) 2007 Mochi Media, Inc.
.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

11
debian/rules vendored
View File

@ -1,11 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@ --parallel --with autoreconf
override_dh_auto_configure:
dh_auto_configure -- --prefix=/usr/lib/erlang/lib

View File

@ -1 +0,0 @@
3.0 (quilt)

31
debian/source/options vendored
View File

@ -1,31 +0,0 @@
tar-ignore = *.a
tar-ignore = *.la
tar-ignore = *.o
tar-ignore = *.so
tar-ignore = .*.sw?
tar-ignore = */*~
tar-ignore = ,,*
tar-ignore = .[#~]*
tar-ignore = .arch-ids
tar-ignore = .arch-inventory
tar-ignore = .be
tar-ignore = .bzr
tar-ignore = .bzr.backup
tar-ignore = .bzr.tags
tar-ignore = .bzrignore
tar-ignore = .cvsignore
tar-ignore = .deps
tar-ignore = .git
tar-ignore = .gitattributes
tar-ignore = .gitignore
tar-ignore = .hg
tar-ignore = .hgignore
tar-ignore = .hgtags
tar-ignore = .shelf
tar-ignore = .svn
tar-ignore = CVS
tar-ignore = DEADJOE
tar-ignore = RCS
tar-ignore = _MTN
tar-ignore = _darcs
tar-ignore = {arch}

0
debian/watch vendored
View File

View File

@ -1,41 +0,0 @@
beamdir = $(ERLANG_INSTALL_LIB_DIR_yamerl)/ebin
APP_NAME = $(PACKAGE_NAME)
APP_FILES = $(APP_NAME).app $(APP_NAME).appup
BEAM_FILES = *.beam
beam_DATA = $(APP_FILES) $(BEAM_FILES)
CLEANFILES = $(APP_NAME).app $(BEAM_FILES)
# $(APP_NAME).app is generated automatically with all the BEAM files
# present in the ebin/ directory.
$(APP_NAME).app: Makefile.am $(APP_NAME).app.in
@echo "Generate: $@"
@src=`echo $$(ls $(BEAM_FILES) | sort)`; \
$(AWK) -v src="$$src" \
"/{vsn, *{cmd,/ { \
line = \$$0; \
sub(/{vsn.*/, \"{vsn, \\\"$(VERSION)\\\"},\", line); \
print line; \
next; \
} \
{ print; } \
/% DO NOT EDIT: Modules list is generated/ { \
indent = index(\$$0, \"%\"); \
indent = substr(\$$0, 1, indent - 1); \
split(src, mods); \
mods_count = 0; \
for (mod in mods) { \
mods_count++ \
} \
for (i = 1; i <= mods_count; i++) { \
mod = mods[i]; \
sub(/\.beam/, \"\", mod); \
if (i != mods_count) \
print indent mod \",\"; \
else \
print indent mod \
} \
}" $(APP_NAME).app.in > $@

View File

@ -1 +0,0 @@
../src/yamerl.app.src

View File

@ -1,10 +0,0 @@
%% -*-erlang-*-
%% vim:ft=erlang:
{ "@VERSION@",
[
%% To upgrade from the specified version to current one.
], [
%% To downgrade from the current version to the specified one.
]
}.

View File

@ -1,9 +0,0 @@
headersdir = $(ERLANG_INSTALL_LIB_DIR_yamerl)/include
nobase_dist_headers_DATA = yamerl_types.hrl \
yamerl_errors.hrl \
yamerl_tokens.hrl \
yamerl_nodes.hrl \
yamerl_nodes_yamerl_extensions.hrl \
internal/yamerl_parser.hrl \
internal/yamerl_constr.hrl

View File

@ -1,94 +0,0 @@
dnl Macro to compare version numbers in configure.
dnl
AC_DEFUN([AX_COMPARE_VERSION], [
# Used to indicate true or false condition
ax_compare_version=false
# Convert the two version strings to be compared into a format that
# allows a simple string comparison. The end result is that a version
# string of the form 1.12.5-r617 will be converted to the form
# 0001001200050617. In other words, each number is zero padded to four
# digits, and non digits are removed.
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-e 's/[[^0-9]]//g'`
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
dnl # then the first line is used to determine if the condition is true.
dnl # The sed right after the echo is to remove any indented white space.
m4_case(m4_tolower($2),
[lt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[gt],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
],
[le],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],
[ge],[
ax_compare_version=`echo "x$A
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
],[
dnl Split the operator from the subversion count if present.
m4_bmatch(m4_substr($2,2),
[0],[
# A count of zero means use the length of the shorter version.
# Determine the number of characters in A and B.
ax_compare_version_len_A=`echo "$A" | awk '{print(length)}'`
ax_compare_version_len_B=`echo "$B" | awk '{print(length)}'`
# Set A to no more than B's length and B to no more than A's length.
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
],
[[0-9]+],[
# A count greater than zero means use only that many subversions
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
],
[.+],[
AC_WARNING(
[illegal OP numeric parameter: $2])
],[])
# Pad zeros at end of numbers to make same length.
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
B="$B`echo $A | sed 's/./0/g'`"
A="$ax_compare_version_tmp_A"
# Check for equality or inequality as necessary.
m4_case(m4_tolower(m4_substr($2,0,2)),
[eq],[
test "x$A" = "x$B" && ax_compare_version=true
],
[ne],[
test "x$A" != "x$B" && ax_compare_version=true
],[
AC_WARNING([illegal OP parameter: $2])
])
])
AS_VAR_POPDEF([A])dnl
AS_VAR_POPDEF([B])dnl
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
if test "$ax_compare_version" = "true" ; then
m4_ifvaln([$4],[$4],[:])dnl
m4_ifvaln([$5],[else $5])dnl
fi
]) dnl AX_COMPARE_VERSION

View File

@ -1,75 +0,0 @@
dnl
dnl Macro to output bold and colored text.
dnl
dnl COLORED_ECHO_INIT
dnl This macro must be called first to initialize a context.
AC_DEFUN([COLORED_ECHO_INIT],
[
dnl Prepare fancy console output, taken from GNU shtools.
colored_echo_bold=''
colored_echo_norm=''
AC_PROG_AWK
if test x"$AWK" = x"not found"; then
return
fi
case $TERM in
xterm|xterm*|vt220|vt220*)
dnl For the most important terminal types we directly know the
dnl sequences.
colored_echo_bold=`$AWK 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
colored_echo_norm=`$AWK 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
;;
vt100|vt100*|cygwin)
colored_echo_bold=`$AWK 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
colored_echo_norm=`$AWK 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
;;
*)
dnl For all others, we try to use a possibly existing `tput' or
dnl `tcout' utility.
paths=`$ECHO $PATH | sed -e 's/:/ /g'`
for tool in tput tcout; do
for dir in $paths; do
if test -r "$dir/$tool" ; then
for seq in bold md smso; do
bold="`$dir/$tool $seq 2>/dev/null`"
if test ".$bold" != . ; then
colored_echo_bold="$bold"
break
fi
done
if test ".$colored_echo_bold" != . ; then
for seq in sgr0 me rmso init reset; do
norm="`$dir/$tool $seq 2>/dev/null`"
if test ".$norm" != . ; then
colored_echo_norm="$norm"
break
fi
done
fi
break
fi
done
if test x"$colored_echo_bold" != "x" -a x"$colored_echo_norm" != "x"; then
break;
fi
done
;;
esac
])
dnl COLORED_ECHO(TEXT)
dnl Output text with:
dnl o everything between %B and %b displayed bold.
AC_DEFUN([COLORED_ECHO],
[
text=`$ECHO $seo "$1" | sed -e "s/%B/${colored_echo_bold}/g" -e "s/%b/${colored_echo_norm}/g" 2>/dev/null`
$ECHO $seo "$text"
text=`$ECHO $sec "$1" | sed -e "s/%B//g" -e "s/%b//g" 2>/dev/null`
_AS_ECHO_LOG($text)
])

View File

@ -1,68 +0,0 @@
dnl
dnl More functions to query Erlang environment.
dnl
dnl ERLANG_CHECK_ERTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Substitudes
dnl ERLANG_ERTS_DIR
dnl ERLANG_ERTS_VER
AC_DEFUN([ERLANG_CHECK_ERTS],
[
AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
AC_REQUIRE([AC_ERLANG_SUBST_ROOT_DIR])[]dnl
AC_CACHE_CHECK([for Erlang/OTP ERTS version],
[erlang_cv_erts_ver],
[
AC_LANG_PUSH(Erlang)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
file:write_file("conftest.out", erlang:system_info(version)),
halt(0)])],
[erlang_cv_erts_ver=`cat conftest.out`],
[if test ! -f conftest.out; then
AC_MSG_FAILURE([test Erlang program execution failed])
else
erlang_cv_erts_ver="not found"
fi])
AC_LANG_POP(Erlang)[]dnl
])
AC_CACHE_CHECK([for Erlang/OTP ERTS directory],
[erlang_cv_erts_dir],
[
erlang_cv_erts_dir="${ERLANG_ROOT_DIR}/erts-$erlang_cv_erts_ver"
if test ! -d "$erlang_cv_erts_dir"; then
erlang_cv_erts_dir="${ERLANG_ROOT_DIR}/usr"
fi
])
AC_SUBST([ERLANG_ERTS_DIR], [$erlang_cv_erts_dir])
AC_SUBST([ERLANG_ERTS_VER], [$erlang_cv_erts_ver])
AS_IF([test "$erlang_cv_erts_ver" = "not found"], [$2], [$1])
])
dnl ERLANG_CHECK_RELEASE()
dnl Substitudes
dnl ERLANG_RELEASE
AC_DEFUN([ERLANG_CHECK_RELEASE],
[
AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
AC_REQUIRE([AC_ERLANG_SUBST_ROOT_DIR])[]dnl
AC_CACHE_CHECK([for Erlang/OTP release],
[erlang_cv_release],
[
AC_LANG_PUSH(Erlang)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
file:write_file("conftest.out", erlang:system_info(otp_release)),
halt(0)])],
[erlang_cv_release=`cat conftest.out`],
[if test ! -f conftest.out; then
AC_MSG_FAILURE([test Erlang program execution failed])
else
erlang_cv_release="not found"
fi])
AC_LANG_POP(Erlang)[]dnl
])
AC_SUBST([ERLANG_RELEASE], [$erlang_cv_release])
])

View File

@ -1,10 +1,2 @@
%% -*-erlang-*-
%% vim:ft=erlang:
{pre_hooks, [
{eunit, "./testsuite/prepare-testsuite-for-rebar"}
]}.
{post_hooks, [
{clean, "rm -rf test"}
]}.

View File

@ -1,14 +0,0 @@
%% -*-erlang-*-
%% vim:ft=erlang:
{
[
%% DO NOT EDIT: Modules list is generated by Makefile.am.
],
[
@EMKOPTS@,
{outdir, "@builddir@/../ebin"},
{i, "@top_srcdir@/include"},
{i, "@top_builddir@/include"}
]
}.

View File

@ -1,71 +0,0 @@
erlsrcdir = $(ERLANG_INSTALL_LIB_DIR_yamerl)/src
dist_erlsrc_DATA = yamerl_app.erl \
yamerl_sup.erl \
yamerl_errors.erl \
yamerl_parser.erl \
yamerl_constr.erl \
yamerl_node_seq.erl \
yamerl_node_map.erl \
yamerl_node_str.erl \
yamerl_node_str_json.erl \
yamerl_node_null.erl \
yamerl_node_null_json.erl \
yamerl_node_bool.erl \
yamerl_node_bool_json.erl \
yamerl_node_bool_ext.erl \
yamerl_node_int.erl \
yamerl_node_int_json.erl \
yamerl_node_int_ext.erl \
yamerl_node_float.erl \
yamerl_node_float_json.erl \
yamerl_node_float_ext.erl \
yamerl_node_size.erl \
yamerl_node_timestamp.erl \
yamerl_node_ipaddr.erl \
yamerl_node_erlang_atom.erl \
yamerl_node_erlang_fun.erl \
yamerl_yamler_compat.erl \
yamerl.erl
CLEANFILES = Emakefile
all-local: Emakefile
@$(ERL) +B -noshell \
-pa @top_builddir@/ebin \
-eval "case make:all() of \
up_to_date -> \
halt(0); \
Err -> \
io:format(\"~p~n\", [Err]), \
halt(1) \
end"
# Emakefile is generated automatically with the source files declared above.
Emakefile: Makefile.am Emakefile.in
@echo "Generate: $@"
@$(AWK) -v src='$(dist_erlsrc_DATA)' \
"{ print } \
/% DO NOT EDIT: Modules list is generated/ { \
indent = index(\$$0, \"%\"); \
indent = substr(\$$0, 1, indent - 1); \
split(src, files); \
files_count = 0; \
for (file in files) { \
files_count++ \
} \
mods_count = 0; \
for (i = 1; i <= files_count; i++) { \
if (files[i] !~ /\.erl$$/) \
continue; \
mods[++mods_count] = files[i] \
} \
for (i = 1; i <= mods_count; i++) { \
mod = mods[i]; \
sub(/\.erl/, \"\", mod); \
if (i != mods_count) \
print indent \"'$(srcdir)/\" mod \"',\";\
else \
print indent \"'$(srcdir)/\" mod \"'\" \
} \
}" Emakefile.in > $@

View File

@ -5,10 +5,8 @@
{description,
"YAML parser in pure Erlang"
},
{vsn, {cmd, "awk '/^AC_INIT\\(/ { ver=$0; sub(/AC_INIT\\(\\[[^]]+\\], *\\[/, \"\", ver); sub(/\\].*/, \"\", ver); print ver; } { next; }' configure.ac"}},
{modules, [
%% DO NOT EDIT: Modules list is generated by Makefile.am.
]},
{vsn, "0.4.0"},
{modules, []},
{registered, [yamerl_sup]},
{applications, [
kernel,
@ -20,24 +18,13 @@
%% DO NOT EDIT: The final configuration is made in sys.config.
{node_mods, []}
]},
%% Hex.pm package informations.
{maintainers, [
"Yakaz",
"Jean-Sebastien Pedron <jean-sebastien.pedron@dumbbell.fr>"
]},
{licenses, ["BSD 2-Clause"]},
{links, [
{"GitHub", "https://github.com/yakaz/yamerl"},
{"Doc", "https://github.com/yakaz/yamerl/tree/master/doc"}
]},
{files, [
"rebar.config",
"configure.ac", % The package version is taken there.
"include/*.hrl",
"include/internal/*.hrl",
"src/yamerl.app.src",
"src/*.erl",
"README.md",
"AUTHORS",
"COPYING"
{"Github", "https://github.com/yakaz/yamerl"}
]}
]}.