| 1 |
dnl $Id: configure.in,v 1.5 1999/06/09 06:26:28 boyns Exp $ |
| 2 |
dnl |
| 3 |
dnl Process this file with autoconf to produce a configure script. |
| 4 |
dnl |
| 5 |
|
| 6 |
AC_INIT(rplayd/rplayd.c) |
| 7 |
AC_CONFIG_HEADER(include/config.h) |
| 8 |
|
| •9 |
BUILD_TARGETS="include lib adpcm" |
| 10 |
|
| 11 |
dnl |
| 12 |
dnl Figure what version of rplay this is. |
| 13 |
dnl |
| 14 |
|
| 15 |
export srcdir |
| 16 |
RPLAY_VERSION=`$srcdir/version` |
| 17 |
|
| 18 |
echo configuring rplay version $RPLAY_VERSION |
| 19 |
AC_SUBST(RPLAY_VERSION) |
| •20 |
AC_DEFINE_UNQUOTED([RPLAY_VERSION], ["$RPLAY_VERSION"], "$RPLAY_VERSION") |
| 21 |
|
| 22 |
# We want these before the checks, so the checks can modify their values. |
| 23 |
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 |
| 24 |
|
| 25 |
AC_PROG_CC |
| 26 |
|
| 27 |
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. |
| 28 |
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" |
| 29 |
|
| 30 |
AC_SUBST(CFLAGS)dnl |
| 31 |
AC_SUBST(LDFLAGS)dnl |
| 32 |
|
| 33 |
AC_ARG_ENABLE(rplayd-user, [ --enable-rplayd-user=USER], RPLAYD_USER=$enableval) |
| 34 |
AC_ARG_ENABLE(rplayd-group, [ --enable-rplayd-group=GROUP], RPLAYD_GROUP=$enableval) |
| 35 |
if test -n "$RPLAYD_USER" |
| 36 |
then |
| •37 |
AC_DEFINE_UNQUOTED([RPLAYD_USER], ["nobody"], "$RPLAYD_USER") |
| 38 |
fi |
| 39 |
if test -n "$RPLAYD_GROUP" |
| 40 |
then |
| •41 |
AC_DEFINE_UNQUOTED([RPLAYD_GROUP], ["audio"], "$RPLAYD_GROUP") |
| 42 |
fi |
| 43 |
|
| 44 |
|
| 45 |
dnl Programs |
| 46 |
AC_ISC_POSIX |
| 47 |
AC_PROG_CPP |
| 48 |
AC_PROG_INSTALL |
| 49 |
AC_PROG_LN_S |
| 50 |
AC_PROG_RANLIB |
| 51 |
AC_CHECK_PROGS(ETAGS, etags, true) |
| 52 |
AC_CHECK_PROGS(MAKEDEPEND, makedepend, true) |
| 53 |
AC_CHECK_PROGS(MAKEINFO, makeinfo, true) |
| 54 |
AC_CHECK_PROGS(TEXI2DVI, texi2dvi, true) |
| 55 |
AC_CHECK_PROGS(TEXI2HTML, texi2html, true) |
| 56 |
AC_CHECK_PROGS(DVIPS, dvips, true) |
| 57 |
|
| 58 |
dnl Check for header files. |
| 59 |
AC_HEADER_DIRENT |
| 60 |
AC_HEADER_STDC |
| 61 |
AC_HEADER_TIME |
| 62 |
dnl AC_PATH_XTRA |
| •63 |
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) |
| 64 |
AC_HEADER_SYS_WAIT |
| 65 |
|
| 66 |
dnl Check for typedefs, structures, and compiler characteristics. |
| 67 |
AC_C_CONST |
| 68 |
AC_TYPE_SIZE_T |
| 69 |
|
| 70 |
dnl Check for library functions. |
| 71 |
AC_FUNC_MMAP |
| 72 |
AC_FUNC_MEMCMP |
| 73 |
AC_FUNC_VPRINTF |
| 74 |
AC_TYPE_SIGNAL |
| 75 |
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) |
| 76 |
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"]) |
| 77 |
AC_CHECK_LIB(nsl, t_accept, [LIBS="$LIBS -lnsl"]) |
| 78 |
|
| •79 |
AC_CHECK_LIB(readline, readline, |
| 80 |
[AC_DEFINE([HAVE_LIBREADLINE], [], [use libreadline]) RL_LIBS="-lreadline"]) |
| 81 |
AC_SUBST(RL_LIBS) |
| 82 |
|
| •83 |
AC_CHECK_LIB(gsm, gsm_decode, |
| 84 |
[GSM_LIBS="-lgsm"; GSM_INCS=""], |
| 85 |
[ |
| 86 |
GSM_LIBS="-L../gsm -lgsm"; GSM_INCS="-I\${srcdir}/../gsm" |
| 87 |
BUILD_TARGETS="$BUILD_TARGETS gsm" |
| 88 |
]) |
| 89 |
AC_SUBST(GSM_LIBS) |
| 90 |
AC_SUBST(GSM_INCS) |
| 91 |
|
| •92 |
dnl check for regcomp in libc, librx, or build rx |
| 93 |
AC_CHECK_FUNCS(regcomp, |
| 94 |
[], |
| 95 |
[ |
| 96 |
AC_CHECK_LIB(rx, regcomp, |
| 97 |
[RX_LIBS="-lrx"; RX_INCS=""], |
| 98 |
[ |
| 99 |
RX_LIBS="-L../rx -lrx"; RX_INCS="-I\${srcdir}/../rx" |
| 100 |
BUILD_TARGETS="$BUILD_TARGETS rx" |
| 101 |
AC_CONFIG_SUBDIRS(rx) |
| 102 |
]) |
| 103 |
]) |
| 104 |
AC_SUBST(RX_LIBS) |
| 105 |
AC_SUBST(RX_INCS) |
| 106 |
|
| 107 |
RPLAY_TOP=`pwd` |
| 108 |
AC_SUBST(RPLAY_TOP) |
| 109 |
|
| 110 |
dnl |
| 111 |
dnl First check if target is already defined. |
| 112 |
dnl |
| 113 |
if test -n "$target" -a "$target" != "NONE"; then |
| 114 |
RPLAY_TARGET=$target |
| 115 |
echo "using specified $RPLAY_TARGET configuration" |
| 116 |
fi |
| 117 |
|
| 118 |
dnl |
| 119 |
dnl Check for Sun |
| 120 |
dnl |
| 121 |
if test -z "$RPLAY_TARGET"; then |
| 122 |
AC_MSG_CHECKING(for sun) |
| 123 |
AC_EGREP_CPP(yes, |
| 124 |
[ |
| 125 |
#ifdef sun |
| 126 |
yes |
| 127 |
#endif |
| 128 |
], is_sun=yes, is_sun=no) |
| 129 |
AC_MSG_RESULT($is_sun) |
| 130 |
if test $is_sun = "yes"; then |
| 131 |
RPLAY_TARGET="sun" |
| 132 |
fi |
| 133 |
if test "$RPLAY_TARGET"; then |
| 134 |
AC_MSG_CHECKING(for solaris) |
| 135 |
if test ! -f /vmunix; then |
| 136 |
is_solaris=yes |
| 137 |
RPLAY_TARGET="solaris" |
| 138 |
else |
| 139 |
is_solaris=no |
| 140 |
fi |
| 141 |
AC_MSG_RESULT($is_solaris) |
| 142 |
fi |
| 143 |
fi |
| 144 |
|
| 145 |
dnl |
| 146 |
dnl Check for Linux |
| 147 |
dnl |
| 148 |
if test -z "$RPLAY_TARGET"; then |
| 149 |
AC_MSG_CHECKING(for linux) |
| 150 |
AC_EGREP_CPP(yes, |
| 151 |
[ |
| 152 |
#ifdef linux |
| 153 |
yes |
| 154 |
#endif |
| 155 |
], is_linux=yes, is_linux=no) |
| 156 |
AC_MSG_RESULT($is_linux) |
| 157 |
if test $is_linux = "yes"; then |
| 158 |
RPLAY_TARGET="oss" |
| 159 |
fi |
| 160 |
fi |
| 161 |
|
| 162 |
dnl |
| 163 |
dnl Check for HP-UX |
| 164 |
dnl |
| 165 |
if test -z "$RPLAY_TARGET"; then |
| 166 |
AC_MSG_CHECKING(for hpux) |
| 167 |
AC_EGREP_CPP(yes, |
| 168 |
[ |
| 169 |
#ifdef __hpux |
| 170 |
yes |
| 171 |
#endif |
| 172 |
], is_hpux=yes, is_hpux=no) |
| 173 |
AC_MSG_RESULT($is_hpux) |
| 174 |
if test $is_hpux = "yes"; then |
| 175 |
RPLAY_TARGET="hpux" |
| 176 |
fi |
| 177 |
fi |
| 178 |
|
| 179 |
dnl |
| 180 |
dnl Check for SGI |
| 181 |
dnl |
| 182 |
if test -z "$RPLAY_TARGET"; then |
| 183 |
AC_MSG_CHECKING(for sgi) |
| 184 |
AC_EGREP_CPP(yes, |
| 185 |
[ |
| 186 |
#ifdef sgi |
| 187 |
yes |
| 188 |
#endif |
| 189 |
], is_sgi=yes, is_sgi=no) |
| 190 |
AC_MSG_RESULT($is_sgi) |
| 191 |
if test $is_sgi = "yes"; then |
| 192 |
RPLAY_TARGET="sgi" |
| 193 |
AC_MSG_CHECKING(for multimedia development kit) |
| 194 |
AC_CHECK_HEADERS(audio.h) |
| 195 |
if test $ac_cv_header_audio_h = "no"; then |
| 196 |
echo 'The multimedia development kit was not found.' |
| 197 |
echo 'Please read the README.sgi file.' |
| 198 |
exit -1 |
| 199 |
fi |
| 200 |
fi |
| 201 |
fi |
| 202 |
|
| 203 |
dnl |
| 204 |
dnl Check for FreeBSD |
| 205 |
dnl |
| 206 |
if test -z "$RPLAY_TARGET"; then |
| 207 |
AC_MSG_CHECKING(for FreeBSD) |
| 208 |
AC_EGREP_CPP(yes, |
| 209 |
[ |
| •210 |
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 211 |
yes |
| 212 |
#endif |
| 213 |
], is_freebsd=yes, is_freebsd=no) |
| 214 |
AC_MSG_RESULT($is_freebsd) |
| 215 |
if test $is_freebsd = "yes"; then |
| 216 |
RPLAY_TARGET="FreeBSD" |
| 217 |
fi |
| 218 |
fi |
| 219 |
|
| 220 |
dnl |
| 221 |
dnl *** Add new systems before this line *** |
| 222 |
dnl |
| 223 |
|
| 224 |
dnl |
| 225 |
dnl Now make sure the system type has been found. |
| 226 |
dnl |
| 227 |
if test -z "$RPLAY_TARGET"; then |
| 228 |
echo 'Sorry, I could not figure out what type of system you have.' |
| •229 |
echo 'Will try the generic configuration.' |
| 230 |
sleep 5 |
| 231 |
RPLAY_TARGET="generic" |
| 232 |
fi |
| 233 |
|
| 234 |
echo "using $RPLAY_TARGET configuration" |
| 235 |
AC_SUBST(RPLAY_TARGET) |
| 236 |
|
| 237 |
AC_LINK_FILES(rplayd/audio/audio_${RPLAY_TARGET}.c rplayd/audio/audio_${RPLAY_TARGET}.h, rplayd/audio.c rplayd/audio.h) |
| 238 |
|
| 239 |
dnl |
| 240 |
dnl Add special things to @DEFS@. |
| 241 |
dnl |
| 242 |
if test $RPLAY_TARGET = "solaris"; then |
| •243 |
AC_DEFINE([SVR4], [], "target is solaris") |
| 244 |
fi |
| •245 |
DEFS=-DHAVE_CONFIG_H |
| 246 |
AC_SUBST(DEFS) |
| 247 |
|
| 248 |
dnl |
| 249 |
dnl Add special things to @LIBS@. |
| 250 |
dnl |
| 251 |
if test $RPLAY_TARGET = "sgi"; then |
| 252 |
LIBS="$LIBS -laudio" |
| 253 |
fi |
| 254 |
AC_SUBST(LIBS) |
| 255 |
|
| 256 |
BUILD_TARGETS="$BUILD_TARGETS librplay rplayd rplay rptp doc" |
| 257 |
|
| •258 |
case "$RPLAY_TARGET" in |
| 259 |
oss|FreeBSD|generic) BUILD_TARGETS="$BUILD_TARGETS devrplay";; |
| 260 |
esac |
| 261 |
|
| •262 |
dnl |
| 263 |
dnl add some autoheader stuff that should not be removed by autoheader |
| 264 |
AH_BOTTOM([#include <config-add-bottom.h>]) |
| 265 |
|
| 266 |
AC_SUBST(BUILD_TARGETS) |
| 267 |
|
| 268 |
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) |