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