1 AC_INIT([GNU Screen],[5.0.0],[https://savannah.gnu.org/bugs/?group=screen],[screen],[https://www.gnu.org/software/screen/])
4 AC_CONFIG_HEADERS([config.h])
7 AC_DEFINE_UNQUOTED([VERSION_MAJOR],
8 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
9 [Major version of GNU screen])
10 AC_DEFINE_UNQUOTED([VERSION_MINOR],
11 [`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`],
12 [Minor version of GNU screen])
13 AC_DEFINE_UNQUOTED([VERSION_REVISION],
14 [`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`],
15 [Micro revision of GNU screen])
18 AH_TEMPLATE([HAVE_EXECVPE], [system has execvpe() defined])
19 AH_TEMPLATE([HAVE_OPENPTY], [system has openpty() defined])
22 AH_TEMPLATE([ENABLE_UTMP], [Enable utmp support])
23 AH_TEMPLATE([HAVE_UTEMPTER], [system has utempter helper binary])
24 AH_TEMPLATE([HAVE_UT_EXIT], [utmpx struct has ut_exit field])
25 AH_TEMPLATE([HAVE_UT_HOST], [utmpx struct has ut_host field])
28 AH_TEMPLATE([ENABLE_PAM], [Enable Pluggable Authentication Modules support])
31 AH_TEMPLATE([ENABLE_TELNET], [Enable built-in telnet client])
34 AH_TEMPLATE([SOCKET_DIR], [Path to socket directory])
37 AH_TEMPLATE([SYSTEM_SCREENRC], [Path to system screenrc])
40 AH_TEMPLATE([PTY_MODE], [Default mode for pty devices])
41 AH_TEMPLATE([PTY_GROUP], [Default group for pty devices])
42 AH_TEMPLATE([PTY_ROFS], [pty devices are on read only filesystem])
46 dnl Check for sane compiler
49 AC_USE_SYSTEM_EXTENSIONS
53 AC_USE_SYSTEM_EXTENSIONS
56 dnl Check various system stuff
59 dnl check for execvpe()
60 AC_CHECK_FUNCS([execvpe])
63 AC_CHECK_FUNCS([seteuid setegid setreuid setresuid])
65 dnl curses compatible lib, we do forward declaration ourselves, only need to link to proper library
66 AC_SEARCH_LIBS([tgetent], [curses termcap termlib ncursesw tinfow ncurses tinfo], [], [
67 AC_MSG_ERROR([unable to find tgetent() function])
71 AC_SEARCH_LIBS([crypt], [crypt], [], [
72 AC_MSG_ERROR([unable to find crypt() function])
76 AC_CHECK_HEADERS(pty.h util.h libutil.h)
77 AC_SEARCH_LIBS([openpty], [util openpty bsd], [
78 AC_DEFINE(HAVE_OPENPTY)
80 AC_MSG_ERROR([unable to find openpty() function])
84 AC_SEARCH_LIBS([socket], [network], [], [
85 AC_MSG_ERROR([unable to find socket() function])
89 AC_CHECK_HEADERS(langinfo.h)
92 AC_CHECK_HEADERS(dirent.h)
95 dnl Check user changeable stuff
98 AC_ARG_ENABLE(pam, AS_HELP_STRING([--enable-pam],
99 [enable PAM support (default: enabled)]),
100 [enable_pam=$enableval],
102 AC_ARG_ENABLE(utmp, AS_HELP_STRING([--enable-utmp],
103 [enable utmp support (default: disabled)]),
104 [enable_utmp=$enableval],
106 AC_ARG_ENABLE(telnet, AS_HELP_STRING([--enable-telnet],
107 [enable telnet support (default: disabled)]),
108 [enable_telnet=$enableval],
110 AC_ARG_ENABLE(socket-dir, AS_HELP_STRING([--enable-socket-dir],
111 [enable global socket directory (default: disabled)]),
112 [enable_socket_dir=$enableval],
113 [enable_socket_dir=no])
115 AC_ARG_WITH(system_screenrc, AS_HELP_STRING([--with-system_screenrc],
116 [set location of system screenrc (default: /etc/screenrc)]),
117 [with_system_screenrc=$withval],
118 [with_system_screenrc=/etc/screenrc])
119 AC_ARG_WITH(pty-mode, AS_HELP_STRING([--with-pty-mode],
120 [set pty mode (default: 0622)]),
121 [with_pty_mode=$withval],
122 [with_pty_mode=0622])
123 AC_ARG_WITH(pty-group, AS_HELP_STRING([--with-pty-group],
124 [set pty group (default: 5)]),
125 [with_pty_group=$withval],
127 AC_ARG_WITH(pty-rofs, AS_HELP_STRING([--with-pty-rofs],
128 [set rofs handling (default: no)]),
129 [with_pty_rofs=$withval],
134 AS_IF([test "x$enable_pam" = "xyes"], [
135 AC_MSG_CHECKING(for PAM support)
138 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <security/pam_appl.h>]], [[
139 pam_start(0, 0, 0, 0);
140 pam_authenticate(0, 0);
142 ]])],[AC_MSG_RESULT(yes);
143 AC_DEFINE(ENABLE_PAM)],[AC_MSG_ERROR(no);LIBS="$oldlibs"])
148 AS_IF([test "x$enable_utmp" = "xyes"], [
149 AC_CHECK_HEADERS(utmpx.h, have_utmpx=yes, have_utmpx=no)
150 AS_IF([test "x$have_utmpx" != "xyes"],
151 AC_MSG_ERROR(Missing utmpx.h))
153 AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
154 AS_IF([test "x$have_utempter" = "xyes"], [
155 AC_DEFINE(HAVE_UTEMPTER)
156 LIBS="$LIBS -lutempter"
159 AC_MSG_CHECKING(if utmpx struct has ut_host field)
160 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <utmpx.h>]], [[
163 ]])],[AC_MSG_RESULT(yes)
164 AC_DEFINE(HAVE_UT_HOST)],[AC_MSG_RESULT(no)])
166 AC_MSG_CHECKING(if utmpx struct has ut_exit field)
167 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <utmpx.h>]], [[
170 ]])],[AC_MSG_RESULT(yes)
171 AC_DEFINE(HAVE_UT_EXIT)],[AC_MSG_RESULT(no)])
173 AC_DEFINE(ENABLE_UTMP)
178 AS_IF([test "x$enable_telnet" = "xyes"], [
179 AC_DEFINE(ENABLE_TELNET)
182 dnl -- enable_socket_dir
184 AS_IF([test "x$enable_socket_dir" != "xno"], [
185 AS_IF([test "x$enable_socket_dir" = "xyes"],
186 [enable_socket_dir="/run/screen"]
188 AC_DEFINE_UNQUOTED(SOCKET_DIR, "$enable_socket_dir")
191 dnl -- with_sysscreenrc
192 AC_DEFINE_UNQUOTED(SYSTEM_SCREENRC, "$with_system_screenrc")
195 AC_DEFINE_UNQUOTED(PTY_MODE, $with_pty_mode)
197 dnl -- with_pty_group
198 AC_DEFINE_UNQUOTED(PTY_GROUP, $with_pty_group)
201 AS_IF([test "x$with_pty_rofs" = "xyes"], [
206 dnl Generate files from *.in ones
209 AC_CONFIG_FILES([Makefile doc/Makefile])
217 echo "Configuration:"
219 echo " PAM support: .............................. $enable_pam"
220 echo " telnet support: ........................... $enable_telnet"
221 echo " utmp support: ............................. $enable_utmp"
222 echo " global socket directory: .................. $enable_socket_dir"
224 echo " system screenrc location: ................. $with_system_screenrc"
225 echo " pty mode: ................................. $with_pty_mode"
226 echo " pty group: ................................ $with_pty_group"
227 echo " pty on read only file system: ............. $with_pty_rofs"
230 AS_IF([test "x$enable_pam" != "xyes"], [
231 echo "!!! WARNING !!!"
232 echo "YOU ARE DISABLING PAM SUPPORT!"
233 echo "FOR screen TO WORK IT WILL NEED TO RUN AS SUID root BINARY"
234 echo "THIS CONFIGURATION IS _HIGHLY_ NOT RECOMMENDED!"
235 echo "!!! WARNING !!!"