-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
160 lines (136 loc) · 5.29 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Autoconf script for Tramp -*- Autoconf -*-
# To rebuild the `configure' script from this, execute the command
# autoconf
# in the directory containing this script.
# Copyright (C) 2003-2020 Free Software Foundation, Inc.
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This file 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
### Code:
# I've tested it with 2.52. According to the Changelog of Autoconf,
# incompatible changes (with quotation) have appeared since 2.50.
AC_PREREQ([2.50])
# Initialize configure script. The only place where Tramp's version
# is kept is in lisp/tramp.el's "Version:" header.
# needs to be set.
# NOTE: the main purpose of the `regexp` call is to strip the final LF.
define([TRAMP_VERSION], regexp(esyscmd([sed -n -e 's/^;; Version: *//p' lisp/tramp.el]), [[-a-z0-9.]*], [\&]))
AC_INIT([Tramp], TRAMP_VERSION, [[email protected]])
AC_MSG_NOTICE([$PACKAGE_STRING])
# Check suitable make version.
AC_CHECK_PROGS([MAKE], [gmake make], [no])
if test "${MAKE}" = no; then
AC_MSG_ERROR([make not found])
fi
AC_MSG_CHECKING([for reasonable ${MAKE} version])
if test "$(${MAKE} -s -f test.makefile 123)" = 123; then
AC_MSG_RESULT([ok])
else
AC_MSG_RESULT([nok])
AC_MSG_ERROR([${MAKE} is not up-to-date, you need at least GNU make 3.76])
fi
AC_PROG_MAKE_SET
# Find the Emacs program to be used. Check version.
AC_EMACS_INFO
# Check suitable makeinfo version.
AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo], [no])
if test "${MAKEINFO}" = no; then
AC_MSG_ERROR([makeinfo not found])
fi
AC_MSG_CHECKING([for reasonable makeinfo version])
${MAKEINFO} texi/test.texi -o /dev/null 2>/dev/null >/dev/null
if test $? -eq 0; then
AC_MSG_RESULT([ok])
else
AC_MSG_RESULT([nok])
AC_MSG_ERROR([makeinfo is not up-to-date, you need at least Texinfo 4.6])
fi
# Check suitable texi2dvi and texi2pdf versions. Here we produce a
# warning only, because this shouldn't prevent Tramp exploitation.
if test "${MAKEINFO}" != no; then
AC_MSG_CHECKING([for reasonable makeinfo --dvi])
# "-o /dev/null" changes permissions of /dev/null. Not applicable.
${MAKEINFO} --dvi texi/test.texi 2>/dev/null >/dev/null
if test $? -eq 0; then
TEXI2DVI="yes"
AC_MSG_RESULT([ok])
else
TEXI2DVI="no"
AC_MSG_RESULT([nok])
AC_MSG_WARN([makeinfo --dvi doesn't work])
fi
AC_SUBST(TEXI2DVI)
test -e test.log && rm -f test.log
test -e test.dvi && rm -f test.dvi
AC_MSG_CHECKING([for reasonable makeinfo --pdf])
# "-o /dev/null" changes permissions of /dev/null. Not applicable.
${MAKEINFO} --pdf texi/test.texi 2>/dev/null >/dev/null
if test $? -eq 0; then
TEXI2PDF="yes"
AC_MSG_RESULT([ok])
else
TEXI2PDF="no"
AC_MSG_RESULT([nok])
AC_MSG_WARN([makeinfo --pdf doesn't work])
fi
AC_SUBST(TEXI2PDF)
test -e test.log && rm -f test.log
test -e test.pdf && rm -f test.pdf
fi
# Check existence of install-info. Again, we produce a warning only,
# because this shouldn't prevent Tramp exploitation.
AC_CHECK_PROG([INSTALL_INFO], [install-info], [install-info])
if test -z "${INSTALL_INFO}"; then
AC_PATH_PROG([INSTALL_INFO], [install-info], [no],
[$PATH:/usr/sbin:/sbin:/usr/local/bin])
fi
if test "${INSTALL_INFO}" = no; then
AC_MSG_WARN([install-info not found])
fi
# Checks whether Tramp installation chapter is needed.
# Necessary for maintainers only.
AC_EMACS_INSTALL
# Check target installation directories.
AC_PATH_LISPDIR
AC_PATH_INFODIR
AC_SUBST(abs_builddir)
AC_SUBST(prefix)
AC_SUBST(prefix_default)
AC_SUBST(datarootdir)
AC_SUBST(datarootdir_default)
AC_SUBST(datadir)
AC_SUBST(datadir_default)
AC_SUBST(lispdir)
AC_SUBST(lispdir_default)
AC_SUBST(infodir)
AC_SUBST(infodir_default)
# Check whether ftp-upload is available. Necessary for maintainers only;
# therefore there is no error or warning.
AC_CHECK_PROG([FTP_UPLOAD], [ftp-upload], [yes], [no])
# Define files to be cleaned up. Applicable in all directories.
TRAMP_CLEAN_FILES=".\\\\\#* \\\\\#* .*~ *~"
TRAMP_CLEAN_FILES="$TRAMP_CLEAN_FILES *.aux *.cp *.cps *.diff *.dvi *.elc"
TRAMP_CLEAN_FILES="$TRAMP_CLEAN_FILES *.fn *.fns *.html *.info *.ky *.log"
TRAMP_CLEAN_FILES="$TRAMP_CLEAN_FILES *.pdf *.pg *.tmp *.toc *.tp *.vr *.vrs"
AC_SUBST([TRAMP_CLEAN_FILES])
# *.elc files must be removed always. Otherwise, there could be problems
# if they are created with the wrong Emacs flavor.
rm -f lisp/*.elc test/*.elc
# Produce the Makefiles.
TRAMP_CONFIG_FILES="Makefile test/Makefile"
TRAMP_CONFIG_FILES="$TRAMP_CONFIG_FILES lisp/Makefile lisp/trampver.el"
TRAMP_CONFIG_FILES="$TRAMP_CONFIG_FILES texi/Makefile texi/trampver.texi"
AC_SUBST(TRAMP_CONFIG_FILES)
AC_CONFIG_FILES([$TRAMP_CONFIG_FILES])
AC_OUTPUT
# Regenerate autoloads.
AC_MSG_NOTICE([regenerate autoloads])
rm -f lisp/tramp-loaddefs.el
make EMACS=${EMACS} -s -C lisp autoloads