| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 
 | AC_INIT(README)
if test -d /usr/share/games ; then
    OBVDIR="/usr/share/games/acm"
else
    OBVDIR=\$\(prefix\)/games/acm
fi
AC_SUBST(OBVDIR)
rand=0
random=0
if test "$OPENWINHOME" = "" ; then
	ow=/usr/openwin
else
	ow=$OPENWINHOME
fi
# Solaris special handling ...
SOLARIS=0
if uname -sr | grep '^SunOS 5' >/dev/null ; then
	LIBS="$LIBS -R/usr/ucblib -L/usr/ucblib -lucb"
	SOLARIS=1
fi
# Linux ?
LINUX=0
if uname -s | grep -i linux > /dev/null ; then
	LINUX=1
fi 
if uname -s | grep -i "GNU/kFreeBSD" > /dev/null ; then
        LINUX=1
fi 
AC_PROG_CC
AC_CHECK_LIB(nsl, xdr_free, [LIBS="$LIBS -lnsl"])
if test "$LINUX" = "0" ; then
	AC_CHECK_LIB(elf, elf_end, [LIBS="$LIBS -lelf"])
fi
AC_DEFUN(AC_M_PI_LONG_DOUBLE,
[AC_CACHE_CHECK(for M_PI casted to long double, ac_cv_m_pi_long_double,
[AC_TRY_RUN([#include <math.h>
#ifndef M_PI
#define M_PI 3.1415926
#endif
  int main() {
  exit(sizeof(double) < sizeof(M_PI)); }],
  ac_cv_m_pi_long_double=no, ac_cv_m_pi_long_double=yes,
  ac_cv_m_pi_long_double=no)
  ])
  if test $ac_cv_m_pi_long_double = yes; then
	AC_DEFINE(M_PI_LONG_DOUBLE)
  fi
])   
AC_DEFUN(AC_HAVE_STRUCT_SIGACTION,
[AC_CACHE_CHECK(for sigaction structure, ac_cv_struct_sigaction,
[AC_TRY_COMPILE([#include <signal.h>
#include <sys/signal.h>],[ struct sigaction s; ],
  ac_cv_struct_sigaction=yes, ac_cv_struct_sigaction=no)
  ])
  if test $ac_cv_struct_sigaction = yes; then
        AC_DEFINE(HAVE_STRUCT_SIGACTION)
  fi
])  
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h malloc.h unistd.h)
if test "$LINUX" = "0" ; then
	AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf")
fi
AC_TYPE_SIGNAL
AC_HAVE_STRUCT_SIGACTION
AC_M_PI_LONG_DOUBLE
AC_PATH_X
test "$x_includes" != "NONE" -a "$x_includes" != "" && CFLAGS="$CFLAGS -I${x_includes}"
test "$x_libraries" != "NONE" -a "$x_libraries" != "" && LIBS="$LIBS -L${x_libraries}"
LIBS="$LIBS -lX11"
AC_SUBST(VLIB_EXTRA_C_FILES)
AC_SUBST(VLIB_EXTRA_O_FILES)
AC_CHECK_LIB(Xext, XdbeSwapBuffers, 
  [ echo "Found X11 double buffering extension"; 
    LIBS="$LIBS -lXext";
    VLIB_EXTRA_C_FILES="Vdbe.c";
    VLIB_EXTRA_O_FILES="Vdbe.o";
    AC_DEFINE(HAVE_X11_DBE) ])
AC_SUBST(SRC_EXTRA_C_FILES)
AC_SUBST(SRC_EXTRA_O_FILES)
AC_CHECK_LIB(X11, XInitImage, 
  [echo "Found X11R6 XInitImage"],
  [ SRC_EXTRA_C_FILES="ImUtil.c";
    SRC_EXTRA_O_FILES="ImUtil.o" ])
AC_MSG_CHECKING(should the IEEE 1278 DIS protocol be used...)
AC_ARG_ENABLE(dis,
[  --enable-dis             broadcast IEEE 1278 DIS packets],
[if test "$enableval" = yes; then
  AC_MSG_RESULT(yes)
  AC_DEFINE(HAVE_DIS)
else
  AC_MSG_RESULT(no)
fi], AC_DEFINE(HAVE_DIS) AC_MSG_RESULT(yes))
AC_MSG_CHECKING(if DIS debugging should be compiled-in)
AC_ARG_ENABLE(dis-debug,
[  --enable-dis-debug       compile-in DIS debugging messages],
[if test "$enableval" = yes; then
  AC_MSG_RESULT(yes)
  AC_DEFINE(DIS_DEBUG)
else
  AC_MSG_RESULT(no)
fi], AC_MSG_RESULT(no))
AC_MSG_CHECKING(should DIS experimental request/grant control be used...)
AC_ARG_ENABLE(request-control,
[  --enable-request-control use experimental DIS request control protocol],
[if test "$enableval" = yes; then
  AC_MSG_RESULT(yes)
  AC_DEFINE(USE_REQUEST_CONTROL)
else
  AC_MSG_RESULT(no)
fi], AC_DEFINE(USE_REQUEST_CONTROL) AC_MSG_RESULT(yes))
AC_CHECKING(checking for an ACM-compatible audio library ...)
unset ac_cv_lib_audio
AC_CHECK_LIB(audio, AuCloseServer, [echo "Found NCD Netaudio libraries"; 
  LIBS="$LIBS -lXt -laudio -lm"; AC_DEFINE(NETAUDIO)],,-lXt -lm)
if test "$ac_cv_lib_audio" = "no"; then
unset ac_cv_lib_audio
AC_CHECK_LIB(audio, ACloseAudio, [echo "Found HP audio libraries"; 
  LIBS="$LIBS -laudio"; AC_DEFINE(HPAUDIO)])
    if test "$ac_cv_lib_audio" = "no"; then
	AC_MSG_WARN(No ACM-compatible audio library was found -- ACM will compile anyway)
    fi
fi
unset ac_cv_lib_audio
AC_CHECK_LIB(socket, bind, [LIBS="$LIBS -lsocket"])
AC_CHECK_LIB(dnet_stub, main, [LIBS="$LIBS -ldnet_stub"])
if uname -srv | grep '^AIX 2 3' >/dev/null ; then
    :
else
	AC_CHECK_LIB(bsd, main, [LIBS="$LIBS -lbsd"])
fi
LIBS="$LIBS -lm"
AC_REPLACE_FUNCS(strdup)
AC_CHECK_FUNC(rand, AC_DEFINE(HAVE_RAND),
  AC_CHECK_FUNC(random, AC_DEFINE(HAVE_RANDOM),
    [AC_MSG_ERROR(Hmm. Your system does not support either random() or rand().)
      exit 1]))
AC_CHECK_FUNC(isnan, AC_DEFINE(HAVE_ISNAN),
  AC_CHECK_FUNC(_isnan, [AC_DEFINE(HAVE_ISNAN) AC_DEFINE(isnan,_isnan)]))
AC_CHECK_FUNC(sigvec, AC_DEFINE(HAVE_SIGVEC),
  AC_CHECK_FUNC(sigvector, AC_DEFINE(HAVE_SIGVECTOR)))
# Solaris has the copysign function in libc but provides no
# prototype when compiling with gcc in __GCC__ mode.
if test "$SOLARIS" = "0" ; then
	AC_CHECK_FUNC(copysign, AC_DEFINE(HAVE_COPYSIGN))
fi
AC_CONFIG_SUBDIRS(dis dxf2obj gedit)
AC_OUTPUT(Makefile src/Makefile V/Makefile V/lib/Makefile V/test/Makefile objects/Makefile)
 |