1 # $MirOS: contrib/code/jupp/configure.ac,v 1.54 2017/01/11 22:09:19 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.1jupp30)
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 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([search_libs],
65 [ --disable-search-libs do not search in any external libraries],
66 search_libs=$enableval, search_libs=yes)
68 if test x"$search_libs" = x"no"; then
69 search_libs_selinux=""
70 search_libs_snprintf=""
75 AC_SEARCH_LIBS(openpty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()]))
76 AC_SEARCH_LIBS(login_tty, $search_libs_util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()]))
77 AC_SEARCH_LIBS(tgetflag, $search_libs_term, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities]))
78 AC_SEARCH_LIBS(snprintf, $search_libs_snprintf, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf]))
79 AC_SEARCH_LIBS(is_selinux_enabled, $search_libs_selinux, AC_DEFINE_UNQUOTED(HAVE_SELINUX_FUN, 1, [We have SELinux functions]))
84 AC_ARG_ENABLE([getpwnam],
85 [ --disable-getpwnam disable use of getpwnam function],
86 getpwnam=$enableval, getpwnam=yes)
87 test x"$getpwnam" = x"no" && CPPFLAGS="$CPPFLAGS -DJOE_NOPWNAM"
89 AC_ARG_ENABLE([termidx],
90 [ --disable-termidx do not build the termidx binary],
91 termidx=$enableval, termidx=yes)
92 AM_CONDITIONAL([WANT_TERMIDX], [test x"$termidx" != x"no"])
94 AC_ARG_ENABLE([sysconfjoesubdir],
95 [ --enable-sysconfjoesubdir=/joe (default value)],
96 [sysconfjoesubdir=$enableval], [sysconfjoesubdir=yes])
97 if test x"$sysconfjoesubdir" = x"yes"; then
99 elif test x"$sysconfjoesubdir" = x"no"; then
102 AC_SUBST(sysconfjoesubdir)
104 AC_ARG_ENABLE([win32reloc],
105 [ --enable-win32reloc enable win32 self-relocation],
106 [win32reloc=$enableval], [win32reloc=no])
107 AM_CONDITIONAL([JUPP_WIN32RELOC], [test x"$win32reloc" = x"yes"])
108 if test x"$win32reloc" = x"yes"; then
109 joeinitfile='\\fBjoerc\\fR in the same directory as the binary resides in'
110 joeinitcopy='which resides in the same directory as the binary'
111 joeresides='C:\\eProgramme\\ejupp32\\ejoe.exe'
113 jrcafter=' in the same directory as the binary'
114 elif test x"$win32reloc" = x"old"; then
115 joeinitfile='\\fBc:/windows/system32/joe/joerc\\fR'
116 joeinitcopy='which resides in \\fBc:/windows/system32/joe/joerc\\fR'
117 joeresides='c:/windows/system32/joe.exe'
118 jrcbefore='c:/windows/system32/joe/'
121 joeinitfile='usually \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
122 joeinitcopy='which normally resides in \\fB'$sysconfdir$sysconfjoesubdir'/joerc\\fR'
123 joeresides=$bindir'/joe'
124 jrcbefore=$sysconfdir$sysconfjoesubdir/
127 AC_SUBST(joeinitfile)
128 AC_SUBST(joeinitcopy)
134 # Checks for header files.
137 sys/dirent.h sys/ioctl.h sys/param.h sys/stat.h sys/termio.h \
138 sys/termios.h sys/time.h sys/types.h sys/wait.h errno.h fcntl.h \
139 langinfo.h limits.h locale.h paths.h pty.h pwd.h sgtty.h signal.h \
140 stdlib.h string.h termio.h termios.h time.h unistd.h util.h utime.h \
141 utmp.h bsd/string.h selinux/context.h selinux/selinux.h \
145 if test "$ac_cv_sys_posix_termios" = "yes"; then
146 AC_DEFINE(HAVE_POSIX_TERMIOS, 1, [We have <termios.h> and maybe <sys/termios.h>])
148 if test "$ac_cv_header_termio_h" = "yes" -a "$ac_cvs_header_sys_termio_h" = "yes" ]; then
149 AC_DEFINE(HAVE_SYSV_TERMIO, 1, [We have <termio.h> and <sys/termio.h>])
156 if test "$ac_cv_header_selinux_selinux_h" = "yes" -a "$ac_cv_header_selinux_context_h" = "yes" ; then
157 echo "Enabling SELinux context copying!"
158 AC_DEFINE(HAVE_SELINUX_HDR, 1, [We have SELinux headers])
161 # Checks for typedefs, structures, and compiler characteristics.
166 if test "$cross_compiling" = "yes" ; then
167 AC_MSG_WARN(cross compiling so assuming defaults for most 32 bit machines)
169 AC_CHECK_SIZEOF(char, 1)
170 AC_CHECK_SIZEOF(short, 2)
171 AC_CHECK_SIZEOF(int, 4)
172 AC_CHECK_SIZEOF(long, 4)
173 AC_CHECK_SIZEOF(void *, 4)
174 AC_CHECK_SIZEOF(long long, 8)
175 AC_CHECK_SIZEOF(off_t, 8)
176 AC_CHECK_TYPE([sighandler_t],
177 [AC_DEFINE([HAVE_SIGHANDLER_T], 1, [Define if you have the `sighandler_t' type.])],
179 [/* if you have signal.h header, include it */
184 # Checks for library functions.
186 AC_PROG_GCC_TRADITIONAL
192 AC_CHECK_TYPE([ssize_t], [], [
193 AC_DEFINE([ssize_t], [int], [Define to `int' if <sys/types.h> does not define.])
197 AC_CHECK_FUNCS([getcwd getwd])
198 if test x"$ac_cv_func_getcwd" != xyes; then
199 if test x"$ac_cv_func_getwd" != xyes; then
200 AC_MSG_ERROR([don't know how to get current working directory])
203 AC_CHECK_FUNCS([isblank])
204 if test x"$ac_cv_func_isblank" = xyes; then
207 AC_CHECK_FUNCS([alarm mkdir mkstemp putenv setlocale strchr strdup utime setpgid])
208 AC_CHECK_FUNCS([setitimer sigaction sigvec siginterrupt sigprocmask])
209 AC_CHECK_FUNCS([strlcpy strlcat nl_langinfo get_current_dir_name ctime popen])
211 AC_CHECK_DECLS([strlcpy, strlcat, popen])
212 AC_CHECK_DECLS([ctime], [], [], [AC_INCLUDES_DEFAULT
213 #ifdef TIME_WITH_SYS_TIME
214 # include <sys/time.h>
217 # ifdef HAVE_SYS_TIME_H
218 # include <sys/time.h>
225 joe_REINSTALL_SIGHANDLERS
227 AH_VERBATIM([_PARAMS],[/* Check to see if we can use strict prototypes */
230 # define PARAMS(protos) protos
232 # define PARAMS(protos) ()
236 # Check for programs..
237 AC_CHECK_PROG(SPELL,aspell,aspell,ispell)
239 AC_CONFIG_FILES([Makefile joerc jmacsrc jstarrc rjoerc jpicorc
240 syntax/c.jsf syntax/perl.jsf syntax/verilog.jsf syntax/sh.jsf syntax/python.jsf
241 syntax/conf.jsf syntax/php.jsf syntax/mail.jsf syntax/pascal.jsf syntax/html.jsf
242 syntax/vhdl.jsf syntax/fortran.jsf syntax/java.jsf syntax/xml.jsf syntax/tcl.jsf
243 charmaps/klingon syntax/lisp.jsf syntax/csh.jsf syntax/mason.jsf syntax/diff.jsf
244 syntax/asm.jsf syntax/tex.jsf])