maint: update copyright year
[autoconf.git] / tests / erlang.at
blob0f4a018f0f0153d163583f6bbeae20e926b71c9a
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Erlang low level compiling and utility macros.])
5 # Copyright (C) 2009-2011 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it 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.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301, USA.
23 # Since the macros which compile are required by most tests, check
24 # them first.  But remember that looking for a compiler is even more
25 # primitive, so check those first.
28 ## ----------------- ##
29 ## Erlang Compiler.  ##
30 ## ----------------- ##
32 AT_CHECK_MACRO([Erlang],
33 [[AC_ERLANG_PATH_ERL([no])
34 AC_ERLANG_PATH_ERLC([no])
35 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
36 AC_LANG([Erlang])
37 ## Can't compile, but can run an Erlang module:
38 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
39                   [AC_MSG_RESULT([ok])
40                    AC_MSG_ERROR([compiling Erlang program should fail])],
41                   [AC_MSG_RESULT([failed])])
42 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
43               [AC_MSG_RESULT([ok])],
44               [AC_MSG_RESULT([failed])
45                AC_MSG_ERROR([could not run test program])])
46 ]],
47 [AT_KEYWORDS([Erlang])])
50 ## ---------------------- ##
51 ## Erlang lib detection.  ##
52 ## ---------------------- ##
54 AT_CHECK_MACRO([AC_ERLANG_CHECK_LIB],
55 [[AC_ERLANG_PATH_ERL([no])
56 AC_ERLANG_PATH_ERLC([no])
57 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
58 AC_ERLANG_CHECK_LIB([stdlib],
59                     [AC_MSG_RESULT([ok])],
60                     [AC_MSG_RESULT([failed])])
61 ## Test that the lib path detection really detected a directory:
62 if test "$ERLANG_LIB_DIR_stdlib" != "not found" \
63   && test ! -d "$ERLANG_LIB_DIR_stdlib"; then
64         AC_MSG_ERROR([incorrect ERLANG_LIB_DIR_stdlib variable])
66 ]],
67 [AT_KEYWORDS([Erlang])])
70 ## --------------------------- ##
71 ## Erlang root dir detection.  ##
72 ## --------------------------- ##
74 AT_CHECK_MACRO([AC_ERLANG_SUBST_ROOT_DIR],
75 [[AC_ERLANG_PATH_ERL([no])
76 AC_ERLANG_PATH_ERLC([no])
77 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
78 AC_ERLANG_SUBST_ROOT_DIR
79 ## Test that the root path detection really detected a directory:
80 if test ! -d "$ERLANG_ROOT_DIR"; then
81         AC_MSG_ERROR([incorrect ERLANG_ROOT_DIR variable])
83 ]],
84 [AT_KEYWORDS([Erlang])])
87 ## -------------------------- ##
88 ## Erlang lib dir detection.  ##
89 ## -------------------------- ##
91 AT_CHECK_MACRO([AC_ERLANG_SUBST_LIB_DIR],
92 [[AC_ERLANG_PATH_ERL([no])
93 AC_ERLANG_PATH_ERLC([no])
94 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
95 AC_ERLANG_SUBST_LIB_DIR
96 ## Test that the lib path detection really detected a directory:
97 if test ! -d "$ERLANG_LIB_DIR"; then
98         AC_MSG_ERROR([incorrect ERLANG_LIB_DIR variable])
101 [AT_KEYWORDS([Erlang])])
104 ## ----------------------------------- ##
105 ## Erlang install base dir detection.  ##
106 ## ----------------------------------- ##
108 AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
109                [AT_KEYWORDS([Erlang])])
112 ## ---------------------------------- ##
113 ## Erlang install lib dir detection.  ##
114 ## ---------------------------------- ##
116 AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
117 [[AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR([test_blah], [1.24-b])
118 ## Test that the generated directory name is well-formed:
119 if test `echo "$ERLANG_INSTALL_LIB_DIR_test_blah" | sed -e 's/^.*\///'` != "test_blah-1.24-b"; then
120         AC_MSG_ERROR([incorrect ERLANG_INSTALL_LIB_DIR_test_blah variable])
123 [AT_KEYWORDS([Erlang])])
126 ## -------------------------- ##
127 ## Erlang version detection.  ##
128 ## -------------------------- ##
130 AT_CHECK_MACRO([AC_ERLANG_SUBST_ERTS_VER],
131 [[AC_ERLANG_PATH_ERL([no])
132 AC_ERLANG_PATH_ERLC([no])
133 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
134 AC_ERLANG_SUBST_ERTS_VER
136 [AT_KEYWORDS([Erlang])])