Prefer HTTPS to FTP and HTTP
[autoconf.git] / tests / erlang.at
blob0aefc641fa1f154b08e6820d423c93db1be44242
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Erlang low level compiling and utility macros.])
5 # Copyright (C) 2009-2017 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, see <https://www.gnu.org/licenses/>.
21 # Since the macros which compile are required by most tests, check
22 # them first.  But remember that looking for a compiler is even more
23 # primitive, so check those first.
26 ## ----------------- ##
27 ## Erlang Compiler.  ##
28 ## ----------------- ##
30 AT_CHECK_MACRO([Erlang],
31 [[AC_ERLANG_PATH_ERL([no])
32 AC_ERLANG_PATH_ERLC([no])
33 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
34 AC_LANG([Erlang])
35 ## Can't compile, but can run an Erlang module:
36 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
37                   [AC_MSG_RESULT([ok])
38                    AC_MSG_ERROR([compiling Erlang program should fail])],
39                   [AC_MSG_RESULT([failed])])
40 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [halt(0)])],
41               [AC_MSG_RESULT([ok])],
42               [AC_MSG_RESULT([failed])
43                AC_MSG_ERROR([could not run test program])])
44 ]],
45 [AT_KEYWORDS([Erlang])])
48 ## ---------------------- ##
49 ## Erlang lib detection.  ##
50 ## ---------------------- ##
52 AT_CHECK_MACRO([AC_ERLANG_CHECK_LIB],
53 [[AC_ERLANG_PATH_ERL([no])
54 AC_ERLANG_PATH_ERLC([no])
55 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
56 AC_ERLANG_CHECK_LIB([stdlib],
57                     [AC_MSG_RESULT([ok])],
58                     [AC_MSG_RESULT([failed])])
59 ## Test that the lib path detection really detected a directory:
60 if test "$ERLANG_LIB_DIR_stdlib" != "not found" \
61   && test ! -d "$ERLANG_LIB_DIR_stdlib"; then
62         AC_MSG_ERROR([incorrect ERLANG_LIB_DIR_stdlib variable])
64 ]],
65 [AT_KEYWORDS([Erlang])])
68 ## --------------------------- ##
69 ## Erlang root dir detection.  ##
70 ## --------------------------- ##
72 AT_CHECK_MACRO([AC_ERLANG_SUBST_ROOT_DIR],
73 [[AC_ERLANG_PATH_ERL([no])
74 AC_ERLANG_PATH_ERLC([no])
75 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
76 AC_ERLANG_SUBST_ROOT_DIR
77 ## Test that the root path detection really detected a directory:
78 if test ! -d "$ERLANG_ROOT_DIR"; then
79         AC_MSG_ERROR([incorrect ERLANG_ROOT_DIR variable])
81 ]],
82 [AT_KEYWORDS([Erlang])])
85 ## -------------------------- ##
86 ## Erlang lib dir detection.  ##
87 ## -------------------------- ##
89 AT_CHECK_MACRO([AC_ERLANG_SUBST_LIB_DIR],
90 [[AC_ERLANG_PATH_ERL([no])
91 AC_ERLANG_PATH_ERLC([no])
92 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
93 AC_ERLANG_SUBST_LIB_DIR
94 ## Test that the lib path detection really detected a directory:
95 if test ! -d "$ERLANG_LIB_DIR"; then
96         AC_MSG_ERROR([incorrect ERLANG_LIB_DIR variable])
98 ]],
99 [AT_KEYWORDS([Erlang])])
102 ## ----------------------------------- ##
103 ## Erlang install base dir detection.  ##
104 ## ----------------------------------- ##
106 AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
107                [AT_KEYWORDS([Erlang])])
110 ## ---------------------------------- ##
111 ## Erlang install lib dir detection.  ##
112 ## ---------------------------------- ##
114 AT_CHECK_MACRO([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
115 [[AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR([test_blah], [1.24-b])
116 ## Test that the generated directory name is well-formed:
117 if test `echo "$ERLANG_INSTALL_LIB_DIR_test_blah" | sed -e 's/^.*\///'` != "test_blah-1.24-b"; then
118         AC_MSG_ERROR([incorrect ERLANG_INSTALL_LIB_DIR_test_blah variable])
121 [AT_KEYWORDS([Erlang])])
124 ## -------------------------- ##
125 ## Erlang version detection.  ##
126 ## -------------------------- ##
128 AT_CHECK_MACRO([AC_ERLANG_SUBST_ERTS_VER],
129 [[AC_ERLANG_PATH_ERL([no])
130 AC_ERLANG_PATH_ERLC([no])
131 if test "$ERL" = "no" || test "$ERLC" = "no"; then AS_EXIT([77]); fi
132 AC_ERLANG_SUBST_ERTS_VER
134 [AT_KEYWORDS([Erlang])])