2009-07-23 20:47:52 +08:00
|
|
|
# -*- Autotest -*-
|
|
|
|
|
|
|
|
AT_BANNER([Erlang low level compiling and utility macros.])
|
|
|
|
|
|
|
|
# Copyright (C) 2009 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
Update License to GPLv3+ including new Autoconf Exception.
* NEWS, README: Update licensing information.
* COPYING.EXCEPTION: New file.
* Makefile.am (EXTRA_DIST): Distribute it.
* cfg.mk (autom4te-update): Remove copyright change warning.
* lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4,
lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4,
lib/autoconf/autoupdate.m4, lib/autoconf/c.m4,
lib/autoconf/erlang.m4, lib/autoconf/fortran.m4,
lib/autoconf/functions.m4, lib/autoconf/general.m4,
lib/autoconf/headers.m4, lib/autoconf/lang.m4,
lib/autoconf/libs.m4, lib/autoconf/oldnames.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/autotest.m4, lib/autotest/general.m4,
lib/autotest/specific.m4, lib/m4sugar/foreach.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception
statement, bump to GPLv3.
* bin/autoconf.as, bin/autoheader.in, bin/autom4te.in,
bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in,
bin/ifnames.in: Bump to GPLv3+, adjust --version output
to reflect the GPLv3+ and the Autoconf Exception.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm,
lib/Autom4te/General.pm, lib/Autom4te/Request.pm,
lib/autom4te.in, lib/autoscan/autoscan.pre,
lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el,
lib/freeze.mk, tests/atlocal.in, tests/autoscan.at,
tests/autotest.at, tests/base.at, tests/c.at,
tests/compile.at, tests/erlang.at, tests/foreign.at,
tests/fortran.at, tests/local.at, tests/m4sh.at,
tests/m4sugar.at, tests/mktests.sh, tests/semantics.at,
tests/statesave.m4, tests/suite.at, tests/tools.at,
tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
2009-09-10 01:53:31 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2009-07-23 20:47:52 +08:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
# 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
|
|
# Since the macros which compile are required by most tests, check
|
|
|
|
# them first. But remember that looking for a compiler is even more
|
|
|
|
# primitive, so check those first.
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------- ##
|
|
|
|
## Erlang Compiler. ##
|
|
|
|
## ----------------- ##
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([Erlang],
|
2009-09-13 19:40:06 +08:00
|
|
|
[[AC_ERLANG_PATH_ERL([no])
|
|
|
|
AC_ERLANG_PATH_ERLC([no])
|
|
|
|
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_LANG([Erlang])
|
|
|
|
## Can't compile, but can run an Erlang module:
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
|
2009-07-24 10:37:58 +08:00
|
|
|
[AC_MSG_RESULT([ok])
|
|
|
|
AC_MSG_ERROR([compiling Erlang program should fail])],
|
|
|
|
[AC_MSG_RESULT([failed])])
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
|
2009-07-24 10:37:58 +08:00
|
|
|
[AC_MSG_RESULT([ok])],
|
|
|
|
[AC_MSG_RESULT([failed])
|
|
|
|
AC_MSG_ERROR([could not run test program])])
|
|
|
|
]],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|
2009-07-23 20:47:52 +08:00
|
|
|
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
## ---------------------- ##
|
|
|
|
## Erlang lib detection. ##
|
|
|
|
## ---------------------- ##
|
2009-07-23 20:47:52 +08:00
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_CHECK_LIB],
|
2009-09-13 19:40:06 +08:00
|
|
|
[[AC_ERLANG_PATH_ERL([no])
|
|
|
|
AC_ERLANG_PATH_ERLC([no])
|
|
|
|
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_ERLANG_CHECK_LIB([stdlib],
|
2009-07-24 10:37:58 +08:00
|
|
|
[AC_MSG_RESULT([ok])],
|
|
|
|
[AC_MSG_RESULT([failed])])
|
|
|
|
## Test that the lib path detection really detected a directory:
|
|
|
|
if test "$ERLANG_LIB_DIR_stdlib" != "not found" \
|
|
|
|
&& test ! -d "$ERLANG_LIB_DIR_stdlib"; then
|
|
|
|
AC_MSG_ERROR([incorrect ERLANG_LIB_DIR_stdlib variable])
|
|
|
|
fi
|
|
|
|
]],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|
2009-07-23 20:47:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
## --------------------------- ##
|
|
|
|
## Erlang root dir detection. ##
|
|
|
|
## --------------------------- ##
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_SUBST_ROOT_DIR],
|
2009-09-13 19:40:06 +08:00
|
|
|
[[AC_ERLANG_PATH_ERL([no])
|
|
|
|
AC_ERLANG_PATH_ERLC([no])
|
|
|
|
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_ERLANG_SUBST_ROOT_DIR
|
2009-07-24 10:37:58 +08:00
|
|
|
## Test that the root path detection really detected a directory:
|
|
|
|
if test ! -d "$ERLANG_ROOT_DIR"; then
|
|
|
|
AC_MSG_ERROR([incorrect ERLANG_ROOT_DIR variable])
|
|
|
|
fi
|
|
|
|
]],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|
2009-07-23 20:47:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
## -------------------------- ##
|
|
|
|
## Erlang lib dir detection. ##
|
|
|
|
## -------------------------- ##
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_SUBST_LIB_DIR],
|
2009-09-13 19:40:06 +08:00
|
|
|
[[AC_ERLANG_PATH_ERL([no])
|
|
|
|
AC_ERLANG_PATH_ERLC([no])
|
|
|
|
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_ERLANG_SUBST_LIB_DIR
|
2009-07-24 10:37:58 +08:00
|
|
|
## Test that the lib path detection really detected a directory:
|
|
|
|
if test ! -d "$ERLANG_LIB_DIR"; then
|
|
|
|
AC_MSG_ERROR([incorrect ERLANG_LIB_DIR variable])
|
|
|
|
fi
|
|
|
|
]],
|
2009-07-23 20:47:52 +08:00
|
|
|
[AT_KEYWORDS([Erlang])])
|
|
|
|
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
## ----------------------------------- ##
|
|
|
|
## Erlang install base dir detection. ##
|
|
|
|
## ----------------------------------- ##
|
2009-07-23 20:47:52 +08:00
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|
2009-07-23 20:47:52 +08:00
|
|
|
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
## ---------------------------------- ##
|
|
|
|
## Erlang install lib dir detection. ##
|
|
|
|
## ---------------------------------- ##
|
2009-07-23 20:47:52 +08:00
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
|
|
|
|
[[AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR([test_blah], [1.24-b])
|
|
|
|
## Test that the generated directory name is well-formed:
|
|
|
|
if test `echo "$ERLANG_INSTALL_LIB_DIR_test_blah" | sed -e 's/^.*\///'` != "test_blah-1.24-b"; then
|
|
|
|
AC_MSG_ERROR([incorrect ERLANG_INSTALL_LIB_DIR_test_blah variable])
|
|
|
|
fi
|
|
|
|
]],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|
2009-07-23 20:47:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
## -------------------------- ##
|
|
|
|
## Erlang version detection. ##
|
|
|
|
## -------------------------- ##
|
|
|
|
|
2009-07-24 10:37:58 +08:00
|
|
|
AT_CHECK_MACRO([AC_ERLANG_SUBST_ERTS_VER],
|
2009-09-13 19:40:06 +08:00
|
|
|
[[AC_ERLANG_PATH_ERL([no])
|
|
|
|
AC_ERLANG_PATH_ERLC([no])
|
|
|
|
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
|
2009-07-23 20:47:52 +08:00
|
|
|
AC_ERLANG_SUBST_ERTS_VER
|
2009-07-24 10:37:58 +08:00
|
|
|
]],
|
|
|
|
[AT_KEYWORDS([Erlang])])
|