1 # $MirOS: contrib/code/jupp/configure.ac,v 1.61 2017/12/02 05:26:39 tg Exp $
3 # Process this file with autoconf to produce a configure script.
5 # We need AC_PROG_EGREP
8 #### Here's the only place where to change version number ####
9 AC_INIT(joe, 3.1jupp31dev)
10 #### But see main.c for the Copyright (c) owner and year! ####
11 AC_CONFIG_SRCDIR([b.c])
20 AM_CONFIG_HEADER(autoconf.h)
22 # Checks for programs.
31 CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX"
34 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
39 *-*-mirbsd* | *-*-openbsd*)
40 AC_DEFINE(HAVE_GCC_ATTRIBUTE_BOUNDED, 1, [Define if GCC has Anil's bounds checker])
45 # Checks for libraries.
47 search_libs_selinux="selinux"
48 search_libs_snprintf="snprintf db"
50 search_libs_util="util"
53 [ --disable-curses disable use of curses library],
54 curses=$enableval, curses=yes)
55 test x"$curses" = x"yes" && \
56 search_libs_term="$search_libs_term tinfo ncursesw ncurses curses"
58 AC_ARG_ENABLE(termcap,
59 [ --disable-termcap disable use of termcap library],
60 termcap=$enableval, termcap=yes)
61 test x"$termcap" = x"yes" && \
62 search_libs_term="$search_libs_term termcap"
64 AC_ARG_ENABLE(terminfo,
65 [ --disable-terminfo disable use of terminfo functions],
66 terminfo=$enableval, terminfo=yes)
68 AC_ARG_ENABLE([search_libs],
69 [ --disable-search-libs do not search in any external libraries],
70 search_libs=$enableval, search_libs=yes)
72 if test x"$search_libs" = x"no"; then
73 search_libs_selinux=""
74 search_libs_snprintf=""
79 AC_SEARCH_LIBS(openpty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()]))
80 AC_SEARCH_LIBS(login_tty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()]))
81 if test x"$terminfo" = x"no"; then
82 echo "DISabling looking for terminal libraries entirely!"
84 AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities]))
86 AC_SEARCH_LIBS(snprintf, $search_libs_snprintf, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf]))
87 AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions]))
92 AC_ARG_ENABLE([getpwnam],
93 [ --disable-getpwnam disable use of getpwnam function],
94 getpwnam=$enableval, getpwnam=yes)
95 test x"$getpwnam" = x"no" && CPPFLAGS="$CPPFLAGS -DJOE_NOPWNAM"
97 AC_ARG_ENABLE([termidx],
98 [ --disable-termidx do not build the termidx binary],
99 termidx=$enableval, termidx=yes)
100 AM_CONDITIONAL([WANT_TERMIDX], [test x"$termidx" != x"no"])
102 AC_ARG_ENABLE([sysconfjoesubdir],
103 [ --enable-sysconfjoesubdir=/joe (default value)],
104 [sysconfjoesubdir=$enableval], [sysconfjoesubdir=yes])
105 if test x"$sysconfjoesubdir" = x"yes"; then
106 sysconfjoesubdir=/joe
107 elif test x"$sysconfjoesubdir" = x"no"; then
110 AC_SUBST(sysconfjoesubdir)
112 AC_ARG_ENABLE([win32reloc],
113 [ --enable-win32reloc enable win32 self-relocation],
114 [win32reloc=$enableval], [win32reloc=no])
115 AM_CONDITIONAL([JUPP_WIN32RELOC], [test x"$win32reloc" = x"yes"])
116 if test x"$win32reloc" = x"yes"; then
117 joeinitfile='\\fBjoerc\\fR in the same directory as the binary resides in'
118 joeinitcopy='which resides in the same directory as the binary'
119 joeresides='C:\\eProgramme\\ejupp32\\ejoe.exe'
121 jrcafter=' in the same directory as the binary'
122 elif test x"$win32reloc" = x"old"; then
123 joeinitfile='\\fBc:/windows/system32/joe/joerc\\fR'
124 joeinitcopy='which resides in \\fBc:/windows/system32/joe/joerc\\fR'
125 joeresides='c:/windows/system32/joe.exe'
126 jrcbefore='c:/windows/system32/joe/'
129 joeinitfile='usually \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
130 joeinitcopy='which normally resides in \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
131 joeresides=$bindir'/joe'
132 jrcbefore=$sysconfdir$sysconfjoesubdir/
135 AC_SUBST(joeinitfile)
136 AC_SUBST(joeinitcopy)
142 # Checks for header files.
145 sys/dirent.h sys/ioctl.h sys/param.h sys/stat.h sys/termio.h \
146 sys/termios.h sys/time.h sys/types.h sys/wait.h errno.h fcntl.h \
147 langinfo.h limits.h locale.h paths.h pty.h pwd.h sgtty.h signal.h \
148 stdlib.h string.h termio.h termios.h time.h unistd.h util.h utime.h \
149 utmp.h bsd/string.h selinux/context.h selinux/selinux.h \
153 if test "$ac_cv_sys_posix_termios" = "yes"; then
154 AC_DEFINE(HAVE_POSIX_TERMIOS, 1, [We have <termios.h> and maybe <sys/termios.h>])
156 if test "$ac_cv_header_termio_h" = "yes" -a "$ac_cvs_header_sys_termio_h" = "yes" ]; then
157 AC_DEFINE(HAVE_SYSV_TERMIO, 1, [We have <termio.h> and <sys/termio.h>])
164 if test "$ac_cv_header_selinux_selinux_h" = "yes" -a "$ac_cv_header_selinux_context_h" = "yes" ; then
165 echo "Enabling SELinux context copying!"
166 AC_DEFINE(HAVE_SELINUX_HDR, 1, [We have SELinux headers])
169 # Checks for typedefs, structures, and compiler characteristics.
174 if test "$cross_compiling" = "yes" ; then
175 AC_MSG_WARN(cross compiling so assuming defaults for most 32 bit machines)
177 AC_CHECK_SIZEOF(char, 1)
178 AC_CHECK_SIZEOF(short, 2)
179 AC_CHECK_SIZEOF(int, 4)
180 AC_CHECK_SIZEOF(long, 4)
181 AC_CHECK_SIZEOF(void *, 4)
182 AC_CHECK_SIZEOF(long long, 8)
183 AC_CHECK_SIZEOF(off_t, 8)
184 AC_CHECK_TYPE([sighandler_t],
185 [AC_DEFINE([HAVE_SIGHANDLER_T], 1, [Define if you have the `sighandler_t' type.])],
187 [/* if you have signal.h header, include it */
192 # Checks for library functions.
194 AC_PROG_GCC_TRADITIONAL
200 AC_CHECK_TYPE([ssize_t], [], [
201 AC_DEFINE([ssize_t], [int], [Define to `int' if <sys/types.h> does not define.])
205 AC_CHECK_FUNCS([getcwd getwd])
206 if test x"$ac_cv_func_getcwd" != xyes; then
207 if test x"$ac_cv_func_getwd" != xyes; then
208 AC_MSG_ERROR([don't know how to get current working directory])
211 AC_CHECK_FUNCS([isblank])
212 if test x"$ac_cv_func_isblank" = xyes; then
215 AC_CHECK_FUNCS([alarm mkdir mkstemp putenv setlocale strchr strdup utime setpgid])
216 AC_CHECK_FUNCS([setitimer sigaction sigvec siginterrupt sigprocmask isatty])
217 AC_CHECK_FUNCS([strlcpy strlcat nl_langinfo get_current_dir_name ctime popen])
219 AC_ARG_ENABLE([fork],
220 [ --disable-fork disable use of fork],
221 use_fork=$enableval, use_fork=yes)
222 test x"$use_fork" = x"no" && ac_cv_func_fork=no
223 AC_CHECK_FUNCS([fork unsetenv])
224 case $use_fork:$ac_cv_func_fork in
229 AC_DEFINE_UNQUOTED([WANT_FORK], [$use_fork], [We have fork(2) and want to use it])
230 if test $use_fork = 1; then
231 echo "Enabling use of fork(), concurrent subshells, etc."
233 echo "DISabling use of fork() and concurrent subshells (NOMMU)!"
237 [ --disable-fpu disable use of floating point arithmetics],
238 use_fpu=$enableval, use_fpu=yes)
239 if test x"$use_fpu" = x"no"; then
244 AC_DEFINE_UNQUOTED([WANT_MATH], [$use_fpu], [Can we use the FPU?])
245 if test $use_fpu = 1; then
246 echo "Enabling use of floating point arithmetics"
248 echo "DISabling Math support for lack of an FPU!"
252 AC_CHECK_DECLS([strlcpy, strlcat, popen])
253 AC_CHECK_DECLS([ctime], [], [], [AC_INCLUDES_DEFAULT
254 #ifdef TIME_WITH_SYS_TIME
255 # include <sys/time.h>
258 # ifdef HAVE_SYS_TIME_H
259 # include <sys/time.h>
266 joe_REINSTALL_SIGHANDLERS
268 AH_VERBATIM([_PARAMS],[/* Check to see if we can use strict prototypes */
271 # define PARAMS(protos) protos
273 # define PARAMS(protos) ()
277 # Check for programs..
278 AC_CHECK_PROG(SPELL,aspell,aspell,ispell)
280 AC_CONFIG_FILES([Makefile joerc jmacsrc jstarrc rjoerc jpicorc
281 syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf syntax/sh.jsf syntax/python.jsf
282 syntax/conf.jsf syntax/php.jsf syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf
283 syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf syntax/xml.jsf syntax/tcl.jsf
284 charmaps/klingon syntax/lisp.jsf syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf
285 syntax/asm.jsf syntax/tex.jsf])