1 2 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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
dnl $Id: configure.in,v 1.5 1999/06/09 06:26:28 boyns Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(rplayd/rplayd.c)
AC_CONFIG_HEADER(include/config.h)
BUILD_TARGETS="include lib adpcm"
dnl
dnl Figure what version of rplay this is.
dnl
export srcdir
RPLAY_VERSION=`$srcdir/version`
echo configuring rplay version $RPLAY_VERSION
AC_SUBST(RPLAY_VERSION)
AC_DEFINE_UNQUOTED([RPLAY_VERSION], ["$RPLAY_VERSION"], "$RPLAY_VERSION")
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_CC
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_SUBST(CFLAGS)dnl
AC_SUBST(LDFLAGS)dnl
AC_ARG_ENABLE(rplayd-user, [ --enable-rplayd-user=USER], RPLAYD_USER=$enableval)
AC_ARG_ENABLE(rplayd-group, [ --enable-rplayd-group=GROUP], RPLAYD_GROUP=$enableval)
if test -n "$RPLAYD_USER"
then
AC_DEFINE_UNQUOTED([RPLAYD_USER], ["nobody"], "$RPLAYD_USER")
fi
if test -n "$RPLAYD_GROUP"
then
AC_DEFINE_UNQUOTED([RPLAYD_GROUP], ["audio"], "$RPLAYD_GROUP")
fi
dnl Programs
AC_ISC_POSIX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_PROGS(ETAGS, etags, true)
AC_CHECK_PROGS(MAKEDEPEND, makedepend, true)
AC_CHECK_PROGS(MAKEINFO, makeinfo, true)
AC_CHECK_PROGS(TEXI2DVI, texi2dvi, true)
AC_CHECK_PROGS(TEXI2HTML, texi2html, true)
AC_CHECK_PROGS(DVIPS, dvips, true)
dnl Check for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
dnl AC_PATH_XTRA
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h stdlib.h unistd.h memory.h string.h strings.h utime.h limits.h gsm.h gsm/gsm.h regex.h rxposix.h rx/rxposix.h)
AC_HEADER_SYS_WAIT
dnl Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Check for library functions.
AC_FUNC_MMAP
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd gethostname mkdir re_comp regcomp select snprintf socket strdup strerror strstr fstat fchmod fchown utime utimes memmove sigset vsnprintf waitpid random srandom)
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
AC_CHECK_LIB(nsl, t_accept, [LIBS="$LIBS -lnsl"])
AC_CHECK_LIB(readline, readline,
[AC_DEFINE([HAVE_LIBREADLINE], [], [use libreadline]) RL_LIBS="-lreadline"])
AC_SUBST(RL_LIBS)
AC_CHECK_LIB(gsm, gsm_decode,
[GSM_LIBS="-lgsm"; GSM_INCS=""],
[
GSM_LIBS="-L../gsm -lgsm"; GSM_INCS="-I\${srcdir}/../gsm"
BUILD_TARGETS="$BUILD_TARGETS gsm"
])
AC_SUBST(GSM_LIBS)
AC_SUBST(GSM_INCS)
dnl check for regcomp in libc, librx, or build rx
AC_CHECK_FUNCS(regcomp,
[],
[
AC_CHECK_LIB(rx, regcomp,
[RX_LIBS="-lrx"; RX_INCS=""],
[
RX_LIBS="-L../rx -lrx"; RX_INCS="-I\${srcdir}/../rx"
BUILD_TARGETS="$BUILD_TARGETS rx"
AC_CONFIG_SUBDIRS(rx)
])
])
AC_SUBST(RX_LIBS)
AC_SUBST(RX_INCS)
RPLAY_TOP=`pwd`
AC_SUBST(RPLAY_TOP)
dnl
dnl First check if target is already defined.
dnl
if test -n "$target" -a "$target" != "NONE"; then
RPLAY_TARGET=$target
echo "using specified $RPLAY_TARGET configuration"
fi
dnl
dnl Check for Sun
dnl
if test -z "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for sun)
AC_EGREP_CPP(yes,
[
#ifdef sun
yes
#endif
], is_sun=yes, is_sun=no)
AC_MSG_RESULT($is_sun)
if test $is_sun = "yes"; then
RPLAY_TARGET="sun"
fi
if test "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for solaris)
if test ! -f /vmunix; then
is_solaris=yes
RPLAY_TARGET="solaris"
else
is_solaris=no
fi
AC_MSG_RESULT($is_solaris)
fi
fi
dnl
dnl Check for Linux
dnl
if test -z "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for linux)
AC_EGREP_CPP(yes,
[
#ifdef linux
yes
#endif
], is_linux=yes, is_linux=no)
AC_MSG_RESULT($is_linux)
if test $is_linux = "yes"; then
RPLAY_TARGET="oss"
fi
fi
dnl
dnl Check for HP-UX
dnl
if test -z "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for hpux)
AC_EGREP_CPP(yes,
[
#ifdef __hpux
yes
#endif
], is_hpux=yes, is_hpux=no)
AC_MSG_RESULT($is_hpux)
if test $is_hpux = "yes"; then
RPLAY_TARGET="hpux"
fi
fi
dnl
dnl Check for SGI
dnl
if test -z "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for sgi)
AC_EGREP_CPP(yes,
[
#ifdef sgi
yes
#endif
], is_sgi=yes, is_sgi=no)
AC_MSG_RESULT($is_sgi)
if test $is_sgi = "yes"; then
RPLAY_TARGET="sgi"
AC_MSG_CHECKING(for multimedia development kit)
AC_CHECK_HEADERS(audio.h)
if test $ac_cv_header_audio_h = "no"; then
echo 'The multimedia development kit was not found.'
echo 'Please read the README.sgi file.'
exit -1
fi
fi
fi
dnl
dnl Check for FreeBSD
dnl
if test -z "$RPLAY_TARGET"; then
AC_MSG_CHECKING(for FreeBSD)
AC_EGREP_CPP(yes,
[
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
yes
#endif
], is_freebsd=yes, is_freebsd=no)
AC_MSG_RESULT($is_freebsd)
if test $is_freebsd = "yes"; then
RPLAY_TARGET="FreeBSD"
fi
fi
dnl
dnl *** Add new systems before this line ***
dnl
dnl
dnl Now make sure the system type has been found.
dnl
if test -z "$RPLAY_TARGET"; then
echo 'Sorry, I could not figure out what type of system you have.'
echo 'Will try the generic configuration.'
sleep 5
RPLAY_TARGET="generic"
fi
echo "using $RPLAY_TARGET configuration"
AC_SUBST(RPLAY_TARGET)
AC_LINK_FILES(rplayd/audio/audio_${RPLAY_TARGET}.c rplayd/audio/audio_${RPLAY_TARGET}.h, rplayd/audio.c rplayd/audio.h)
dnl
dnl Add special things to @DEFS@.
dnl
if test $RPLAY_TARGET = "solaris"; then
AC_DEFINE([SVR4], [], "target is solaris")
fi
DEFS=-DHAVE_CONFIG_H
AC_SUBST(DEFS)
dnl
dnl Add special things to @LIBS@.
dnl
if test $RPLAY_TARGET = "sgi"; then
LIBS="$LIBS -laudio"
fi
AC_SUBST(LIBS)
BUILD_TARGETS="$BUILD_TARGETS librplay rplayd rplay rptp doc"
case "$RPLAY_TARGET" in
oss|FreeBSD|generic) BUILD_TARGETS="$BUILD_TARGETS devrplay";;
esac
dnl
dnl add some autoheader stuff that should not be removed by autoheader
AH_BOTTOM([#include <config-add-bottom.h>])
AC_SUBST(BUILD_TARGETS)
AC_OUTPUT(Makefile.config Makefile include/Makefile lib/Makefile adpcm/Makefile gsm/Makefile librplay/Makefile rplayd/Makefile rplay/Makefile rptp/Makefile doc/Makefile devrplay/Makefile)
|