1
dnl Process this file with autoconf to produce a configure script.
2
AC_REVISION([$Id: configure.in,v 1.16 2000/02/17 21:29:54 crosser Exp $])dnl
4
dnl $Log: configure.in,v $
5
dnl Revision 1.16 2000/02/17 21:29:54 crosser
6
dnl final cleanup for 3.04, change version
7
dnl change debugging levels
9
dnl Revision 1.15 2000/02/01 22:04:15 crosser
10
dnl xchdir() function iterates thru path elements
11
dnl define DEVVERSION for extra verbosity
13
dnl Revision 1.14 2000/01/23 15:51:01 crosser
14
dnl work in progress on folder tree support
16
dnl Revision 1.13 1999/12/26 13:59:45 crosser
17
dnl sort frame list for erase command; new version 3.03
19
dnl Revision 1.12 1999/12/11 14:10:15 crosser
20
dnl Support sgtty terminal control
21
dnl Proper "fake speed" handling (needed two values)
23
dnl Revision 1.11 1999/12/01 21:41:23 crosser
24
dnl add "pseudo" speed
26
dnl Revision 1.10 1999/11/29 05:39:11 crosser
29
dnl Revision 1.9 1999/11/17 13:48:08 crosser
30
dnl check if need to include getopt.h
32
dnl Revision 1.8 1999/11/09 18:55:03 crosser
33
dnl work on windows version
35
dnl Revision 1.7 1999/09/19 12:33:11 crosser
36
dnl Mention comlite32 in the README
38
dnl Revision 1.6 1999/08/14 09:00:33 crosser
39
dnl Create version.h's in dos and win23 directories
41
dnl Revision 1.5 1999/08/01 23:28:06 crosser
42
dnl multiple enhancements
44
dnl Revision 1.4 1999/03/12 23:22:30 crosser
45
dnl check utime and timezone things
47
dnl Revision 1.3 1999/03/12 10:06:23 crosser
50
dnl Revision 1.2 1999/03/10 22:34:43 crosser
53
dnl Revision 1.1 1999/03/06 13:16:06 crosser
58
AM_INIT_AUTOMAKE(photopc, 3.04)
59
AM_CONFIG_HEADER(config.h dos/version.h win32/version.h)
61
dnl Checks for programs.
64
if test "X$ac_cv_prog_gcc" = "Xyes"; then
65
CFLAGS="$CFLAGS -Wall"
70
AC_PATH_PROG(ECHO, echo, echo)dnl
71
AC_PATH_PROG(LN, ln, ln)dnl
72
AC_PATH_PROG(MV, mv, mv)dnl
73
AC_PATH_PROG(RM, rm, rm)dnl
77
AC_PATH_PROG(AR, ar, ar)dnl
80
dnl Checks for header files.
82
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/select.h unistd.h sched.h)
83
AC_CHECK_HEADERS(termios.h termio.h sgtty.h utime.h sys/utime.h)
85
AC_ARG_ENABLE(termios,
86
[ --disable-termios do not use POSIX terminal control])
87
if test X$enable_termios != Xno && test X$ac_cv_header_termios_h = Xyes; then
88
AC_DEFINE(USE_TERMIOS)
89
elif test X$ac_cv_header_sgtty_h = Xyes; then
91
elif test X$ac_cv_header_termio_h = Xyes; then
94
AC_MSG_ERROR([No usable terminal control (neither of termios/sgtty/termio)])
97
dnl Checks for typedefs, structures, and compiler characteristics.
104
AC_MSG_CHECKING([whether struct tm has tm_gmtoff])
105
AC_CACHE_VAL(ac_cv_tm_gmtoff, [AC_TRY_COMPILE([
106
#if TIME_WITH_SYS_TIME
107
# include <sys/time.h>
111
# include <sys/time.h>
119
], ac_cv_tm_gmtoff=yes, ac_cv_tm_gmtoff=no)])dnl
120
AC_MSG_RESULT($ac_cv_tm_gmtoff)
121
if test X$ac_cv_tm_gmtoff = Xyes; then
122
AC_DEFINE(HAVE_TM_GMTOFF)
126
AC_MSG_CHECKING([whether struct utimbuf is defined])
127
AC_CACHE_VAL(ac_cv_have_utimbuf, [AC_TRY_COMPILE([
128
#if TIME_WITH_SYS_TIME
129
# include <sys/time.h>
133
# include <sys/time.h>
141
# ifdef HAVE_SYS_UTIME_H
142
# include <sys/utime.h>
148
], ac_cv_have_utimbuf=yes, ac_cv_have_utimbuf=no)])dnl
149
AC_MSG_RESULT($ac_cv_have_utimbuf)
150
if test X$ac_cv_have_utimbuf = Xyes; then
151
AC_DEFINE(HAVE_UTIMBUF)
154
AC_MSG_CHECKING([whether optarg is defined in headers])
155
AC_CACHE_VAL(ac_cv_optarg_defined, [AC_TRY_COMPILE([
156
#include <sys/types.h>
166
], ac_cv_optarg_defined=yes, ac_cv_optarg_defined=no)])dnl
167
AC_MSG_RESULT($ac_cv_optarg_defined)
168
if test X$ac_cv_optarg_defined = Xyes; then
169
AC_DEFINE(OPTARG_DEFINED)
172
AC_CHECK_SIZEOF(short,2)
173
AC_CHECK_SIZEOF(int,4)
174
AC_CHECK_SIZEOF(long,4)
176
dnl define INT16 and INT32
177
AC_ARG_WITH(int16, [ --with-int16=TYPE integer type that is 16 bits (autodetect)],
179
if test "X$with_int16" != "Xno" && test "X$with_int16" != "Xyes" && test "X$with_int16" != "X"; then
182
if test "X$ac_cv_sizeof_short" = "X2"; then
185
if test "X$ac_cv_sizeof_int" = "X2"; then
190
AC_ARG_WITH(int32, [ --with-int32=TYPE integer type that is 32 bits (autodetect)],
192
if test "X$with_int32" != "Xno" && test "X$with_int32" != "Xyes" && test "X$with_int32" != "X"; then
195
if test "X$ac_cv_sizeof_long" = "X4"; then
198
if test "X$ac_cv_sizeof_int" = "X4"; then
207
AC_DEFINE_UNQUOTED(INT16,$INT16)dnl
208
AC_DEFINE_UNQUOTED(INT32,$INT32)dnl
210
dnl Define LOWMEMORY model
211
AC_ARG_WITH(lomemory, [ --with-lowmemory Build lowmemory model],
212
AC_DEFINE(LOWMEMORY))
214
dnl Use RT priority (default yes)
215
AC_ARG_WITH(rtprio, [ --without-rtprio Do not use realtime priority])
216
if test "X$with_rtprio" = "X"; then
219
if test "X$with_rtprio" = "Xyes"; then
220
AC_DEFINE(USE_RTPRIO)
223
dnl Checks for library functions.
224
AC_CHECK_FUNCS(rename mkdir select strerror strspn)
225
AC_CHECK_FUNCS(uname cfmakeraw sched_setscheduler nanosleep)
228
AC_REPLACE_FUNCS(usleep getopt)
229
AC_CHECK_FUNC(strcasecmp, [], [LIBOBJS="$LIBOBJS strcscmp.o"])
231
dnl this sould be done after determining the target system type...
234
dnl check if all necessary functions are detected
235
if test $ac_cv_header_termios_h != yes; then
236
AC_MSG_ERROR([Cannot work without termios!])
238
if test $ac_cv_func_select != yes; then
239
AC_MSG_ERROR([Cannot work without select() function!])
241
if test $ac_cv_func_vprintf != yes; then
242
AC_MSG_ERROR([Cannot work without v*printf() functions!])
244
if test $INT16 = unknown; then
245
AC_MSG_ERROR([Cannot determine 16bit integer type!])
247
if test $INT32 = unknown; then
248
AC_MSG_ERROR([Cannot determine 32bit integer type!])
253
AC_DEFINE(DEVVERSION);;
256
# This is necessary so that .o files in LIBOBJS are also built via
257
# the ANSI2KNR-filtering rules.
258
LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
260
if test "X$with_rtprio" = "Xyes"; then
262
AC_MSG_RESULT([*** "photopc" program must be setuid root to use realtime priority])