1 # $MirOS: contrib/code/jupp/configure.ac,v 1.65 2017/12/07 00:48:10 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.1jupp32)
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(selinux,
69 [ --disable-selinux disable SELinux context copying],
70 selinux=$enableval, selinux=yes)
72 AC_ARG_ENABLE([search_libs],
73 [ --disable-search-libs do not search in any external libraries],
74 search_libs=$enableval, search_libs=yes)
76 if test x"$search_libs" = x"no"; then
77 search_libs_selinux=""
78 search_libs_snprintf=""
83 AC_SEARCH_LIBS(openpty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()]))
84 AC_SEARCH_LIBS(login_tty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()]))
85 if test x"$terminfo" = x"no"; then
86 echo "DISabling looking for terminal libraries entirely!"
88 AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities]))
90 AC_SEARCH_LIBS(snprintf, $search_libs_snprintf, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf]))
91 if test x"$selinux" = x"no"; then
92 echo "DISabling looking for SELinux support"
94 AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions]))
100 AC_ARG_ENABLE([getpwnam],
101 [ --disable-getpwnam disable use of getpwnam function],
102 getpwnam=$enableval, getpwnam=yes)
103 test x"$getpwnam" = x"no" && CPPFLAGS="$CPPFLAGS -DJOE_NOPWNAM"
105 AC_ARG_ENABLE([termidx],
106 [ --disable-termidx do not build the termidx binary],
107 termidx=$enableval, termidx=yes)
108 AM_CONDITIONAL([WANT_TERMIDX], [test x"$termidx" != x"no"])
110 AC_ARG_ENABLE([sysconfjoesubdir],
111 [ --enable-sysconfjoesubdir=/joe (default value)],
112 [sysconfjoesubdir=$enableval], [sysconfjoesubdir=yes])
113 if test x"$sysconfjoesubdir" = x"yes"; then
114 sysconfjoesubdir=/joe
115 elif test x"$sysconfjoesubdir" = x"no"; then
118 AC_SUBST(sysconfjoesubdir)
120 AC_ARG_ENABLE([win32reloc],
121 [ --enable-win32reloc enable win32 self-relocation],
122 [win32reloc=$enableval], [win32reloc=no])
123 if test x"$win32reloc" = x"yes"; then
127 AC_DEFINE_UNQUOTED([JOERC], ["$sysconfdir$sysconfjoesubdir"], [Unix absolute paths base])
129 AC_DEFINE_UNQUOTED([JUPP_WIN32RELOC], [$JUPP_WIN32RELOC], [Use Win32 argv0-relative paths?])
130 if test x"$win32reloc" = x"yes"; then
131 joeinitfile='\\fBjoerc\\fR in the same directory as the binary resides in'
132 joeinitcopy='which resides in the same directory as the binary'
133 joeresides='C:\\eProgramme\\ejupp32\\ejoe.exe'
135 jrcafter=' in the same directory as the binary'
136 elif test x"$win32reloc" = x"old"; then
137 joeinitfile='\\fBc:/windows/system32/joe/joerc\\fR'
138 joeinitcopy='which resides in \\fBc:/windows/system32/joe/joerc\\fR'
139 joeresides='c:/windows/system32/joe.exe'
140 jrcbefore='c:/windows/system32/joe/'
143 joeinitfile='usually \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
144 joeinitcopy='which normally resides in \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
145 joeresides=$bindir'/joe'
146 jrcbefore=$sysconfdir$sysconfjoesubdir/
149 AC_SUBST(joeinitfile)
150 AC_SUBST(joeinitcopy)
156 # Checks for header files.
159 sys/dirent.h sys/ioctl.h sys/param.h sys/stat.h sys/termio.h \
160 sys/termios.h sys/time.h sys/types.h sys/wait.h errno.h fcntl.h \
161 langinfo.h limits.h locale.h paths.h pty.h pwd.h sgtty.h signal.h \
162 stdlib.h string.h termio.h termios.h time.h unistd.h util.h utime.h \
163 utmp.h bsd/string.h selinux/context.h selinux/selinux.h \
167 if test "$ac_cv_sys_posix_termios" = "yes"; then
168 AC_DEFINE(HAVE_POSIX_TERMIOS, 1, [We have <termios.h> and maybe <sys/termios.h>])
170 if test "$ac_cv_header_termio_h" = "yes" -a "$ac_cvs_header_sys_termio_h" = "yes" ]; then
171 AC_DEFINE(HAVE_SYSV_TERMIO, 1, [We have <termio.h> and <sys/termio.h>])
178 # Checks for typedefs, structures, and compiler characteristics.
182 if test "$cross_compiling" = "yes" ; then
183 AC_MSG_WARN(cross compiling so assuming defaults for most 32 bit machines)
185 AC_CHECK_SIZEOF(char, 1)
186 AC_CHECK_SIZEOF(short, 2)
187 AC_CHECK_SIZEOF(int, 4)
188 AC_CHECK_SIZEOF(long, 4)
189 AC_CHECK_SIZEOF(void *, 4)
190 AC_CHECK_SIZEOF(long long, 8)
191 AC_CHECK_SIZEOF(off_t, 8)
192 AC_CHECK_TYPE([sighandler_t],
193 [AC_DEFINE([HAVE_SIGHANDLER_T], 1, [Define if you have the `sighandler_t' type.])],
195 [/* if you have signal.h header, include it */
200 # Checks for library functions.
202 AC_PROG_GCC_TRADITIONAL
208 AC_CHECK_TYPE([ssize_t], [], [
209 AC_DEFINE([ssize_t], [int], [Define to `int' if <sys/types.h> does not define.])
213 AC_CHECK_FUNCS([getcwd getwd])
214 if test x"$ac_cv_func_getcwd" != xyes; then
215 if test x"$ac_cv_func_getwd" != xyes; then
216 AC_MSG_ERROR([don't know how to get current working directory])
219 AC_CHECK_FUNCS([isblank])
220 if test x"$ac_cv_func_isblank" = xyes; then
223 AC_CHECK_FUNCS([alarm mkdir mkstemp putenv setlocale strchr strdup utime setpgid])
224 AC_CHECK_FUNCS([setitimer sigaction sigvec siginterrupt sigprocmask isatty])
225 AC_CHECK_FUNCS([strlcpy strlcat nl_langinfo get_current_dir_name ctime popen])
227 AC_ARG_ENABLE([fork],
228 [ --disable-fork disable use of fork],
229 use_fork=$enableval, use_fork=yes)
230 test x"$use_fork" = x"no" && ac_cv_func_fork=no
231 AC_CHECK_FUNCS([fork unsetenv])
232 case $use_fork:$ac_cv_func_fork in
237 AC_DEFINE_UNQUOTED([WANT_FORK], [$use_fork], [We have fork(2) and want to use it])
238 if test $use_fork = 1; then
239 echo "Enabling use of fork(), concurrent subshells, etc."
241 echo "DISabling use of fork() and concurrent subshells (NOMMU)!"
245 [ --disable-fpu disable use of floating point arithmetics],
246 use_fpu=$enableval, use_fpu=yes)
247 if test x"$use_fpu" = x"no"; then
252 AC_DEFINE_UNQUOTED([WANT_MATH], [$use_fpu], [Can we use the FPU?])
253 if test $use_fpu = 1; then
254 echo "Enabling use of floating point arithmetics"
256 echo "DISabling Math support for lack of an FPU!"
259 AC_ARG_ENABLE([small],
260 [ --enable-small reduce memory footprint by a few KiB],
261 use_small=$enableval, use_small=no)
262 if test x"$use_small" = x"yes"; then
263 # for constrained systems (like 8 MiB RAM total) only
264 AC_DEFINE([SMALL], [1], [Reduce memory footprint slightly])
267 AC_CHECK_DECLS([strlcpy, strlcat, popen])
268 AC_CHECK_DECLS([ctime], [], [], [AC_INCLUDES_DEFAULT
269 #ifdef TIME_WITH_SYS_TIME
270 # include <sys/time.h>
273 # ifdef HAVE_SYS_TIME_H
274 # include <sys/time.h>
281 joe_REINSTALL_SIGHANDLERS
283 # Check for programs..
284 AC_CHECK_PROG(SPELL,aspell,aspell,ispell)
286 AC_CONFIG_FILES([Makefile joerc jmacsrc jstarrc rjoerc jpicorc
287 syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf syntax/sh.jsf syntax/python.jsf
288 syntax/conf.jsf syntax/php.jsf syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf
289 syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf syntax/xml.jsf syntax/tcl.jsf
290 charmaps/klingon syntax/lisp.jsf syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf
291 syntax/asm.jsf syntax/tex.jsf])