Blame tests/erlang.at

Packit Service 9646c7
#							-*- Autotest -*-
Packit Service 9646c7
Packit Service 9646c7
AT_BANNER([Erlang low level compiling and utility macros.])
Packit Service 9646c7
Packit Service 9646c7
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
Packit Service 9646c7
#
Packit Service 9646c7
# This program is free software: you can redistribute it and/or modify
Packit Service 9646c7
# it under the terms of the GNU General Public License as published by
Packit Service 9646c7
# the Free Software Foundation, either version 3 of the License, or
Packit Service 9646c7
# (at your option) any later version.
Packit Service 9646c7
#
Packit Service 9646c7
# This program is distributed in the hope that it will be useful,
Packit Service 9646c7
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 9646c7
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 9646c7
# GNU General Public License for more details.
Packit Service 9646c7
#
Packit Service 9646c7
# You should have received a copy of the GNU General Public License
Packit Service 9646c7
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
# Since the macros which compile are required by most tests, check
Packit Service 9646c7
# them first.  But remember that looking for a compiler is even more
Packit Service 9646c7
# primitive, so check those first.
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## ----------------- ##
Packit Service 9646c7
## Erlang Compiler.  ##
Packit Service 9646c7
## ----------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([Erlang],
Packit Service 9646c7
[[AC_ERLANG_PATH_ERL([no])
Packit Service 9646c7
AC_ERLANG_PATH_ERLC([no])
Packit Service 9646c7
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
Packit Service 9646c7
AC_LANG([Erlang])
Packit Service 9646c7
## Can't compile, but can run an Erlang module:
Packit Service 9646c7
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
Packit Service 9646c7
		  [AC_MSG_RESULT([ok])
Packit Service 9646c7
		   AC_MSG_ERROR([compiling Erlang program should fail])],
Packit Service 9646c7
		  [AC_MSG_RESULT([failed])])
Packit Service 9646c7
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
Packit Service 9646c7
	      [AC_MSG_RESULT([ok])],
Packit Service 9646c7
	      [AC_MSG_RESULT([failed])
Packit Service 9646c7
	       AC_MSG_ERROR([could not run test program])])
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## ---------------------- ##
Packit Service 9646c7
## Erlang lib detection.  ##
Packit Service 9646c7
## ---------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_CHECK_LIB],
Packit Service 9646c7
[[AC_ERLANG_PATH_ERL([no])
Packit Service 9646c7
AC_ERLANG_PATH_ERLC([no])
Packit Service 9646c7
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
Packit Service 9646c7
AC_ERLANG_CHECK_LIB([stdlib],
Packit Service 9646c7
		    [AC_MSG_RESULT([ok])],
Packit Service 9646c7
		    [AC_MSG_RESULT([failed])])
Packit Service 9646c7
## Test that the lib path detection really detected a directory:
Packit Service 9646c7
if test "$ERLANG_LIB_DIR_stdlib" != "not found" \
Packit Service 9646c7
  && test ! -d "$ERLANG_LIB_DIR_stdlib"; then
Packit Service 9646c7
	AC_MSG_ERROR([incorrect ERLANG_LIB_DIR_stdlib variable])
Packit Service 9646c7
fi
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## --------------------------- ##
Packit Service 9646c7
## Erlang root dir detection.  ##
Packit Service 9646c7
## --------------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_SUBST_ROOT_DIR],
Packit Service 9646c7
[[AC_ERLANG_PATH_ERL([no])
Packit Service 9646c7
AC_ERLANG_PATH_ERLC([no])
Packit Service 9646c7
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
Packit Service 9646c7
AC_ERLANG_SUBST_ROOT_DIR
Packit Service 9646c7
## Test that the root path detection really detected a directory:
Packit Service 9646c7
if test ! -d "$ERLANG_ROOT_DIR"; then
Packit Service 9646c7
	AC_MSG_ERROR([incorrect ERLANG_ROOT_DIR variable])
Packit Service 9646c7
fi
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## -------------------------- ##
Packit Service 9646c7
## Erlang lib dir detection.  ##
Packit Service 9646c7
## -------------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_SUBST_LIB_DIR],
Packit Service 9646c7
[[AC_ERLANG_PATH_ERL([no])
Packit Service 9646c7
AC_ERLANG_PATH_ERLC([no])
Packit Service 9646c7
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
Packit Service 9646c7
AC_ERLANG_SUBST_LIB_DIR
Packit Service 9646c7
## Test that the lib path detection really detected a directory:
Packit Service 9646c7
if test ! -d "$ERLANG_LIB_DIR"; then
Packit Service 9646c7
	AC_MSG_ERROR([incorrect ERLANG_LIB_DIR variable])
Packit Service 9646c7
fi
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## ----------------------------------- ##
Packit Service 9646c7
## Erlang install base dir detection.  ##
Packit Service 9646c7
## ----------------------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
Packit Service 9646c7
	       [AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## ---------------------------------- ##
Packit Service 9646c7
## Erlang install lib dir detection.  ##
Packit Service 9646c7
## ---------------------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
Packit Service 9646c7
[[AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR([test_blah], [1.24-b])
Packit Service 9646c7
## Test that the generated directory name is well-formed:
Packit Service 9646c7
if test `echo "$ERLANG_INSTALL_LIB_DIR_test_blah" | sed -e 's/^.*\///'` != "test_blah-1.24-b"; then
Packit Service 9646c7
	AC_MSG_ERROR([incorrect ERLANG_INSTALL_LIB_DIR_test_blah variable])
Packit Service 9646c7
fi
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])
Packit Service 9646c7
Packit Service 9646c7
Packit Service 9646c7
## -------------------------- ##
Packit Service 9646c7
## Erlang version detection.  ##
Packit Service 9646c7
## -------------------------- ##
Packit Service 9646c7
Packit Service 9646c7
AT_CHECK_MACRO([AC_ERLANG_SUBST_ERTS_VER],
Packit Service 9646c7
[[AC_ERLANG_PATH_ERL([no])
Packit Service 9646c7
AC_ERLANG_PATH_ERLC([no])
Packit Service 9646c7
if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
Packit Service 9646c7
AC_ERLANG_SUBST_ERTS_VER
Packit Service 9646c7
]],
Packit Service 9646c7
[AT_KEYWORDS([Erlang])])