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 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
|
dnl $Id: configure.in,v 1.30 2000/01/19 15:28:46 dalroi Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/wsoundserver.c)
AM_INIT_AUTOMAKE(WSoundServer, 0.4.0)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
dnl Specify paths to look for libraries and headers
dnl ===============================================
AC_ARG_WITH(libs-from,
[ --with-libs-from pass compiler flags to look for libraries],
[lib_search_path="$withval $lib_search_path"])
AC_ARG_WITH(incs-from,
[ --with-incs-from pass compiler flags to look for header files],
[inc_search_path="$withval $inc_search_path"])
dnl ===========================================
dnl Stuff that uses X
dnl ===========================================
AC_PATH_XTRA
X_LIBRARY_PATH=$x_libraries
XCFLAGS="$X_CFLAGS"
XLFLAGS="$X_LIBS"
XLIBS="-lX11 $X_EXTRA_LIBS"
lib_search_path="$lib_search_path $XLFLAGS -L/usr/local/lib"
inc_search_path="$inc_search_path $XCFLAGS -I/usr/local/include"
AC_SUBST(X_LIBRARY_PATH)
dnl Check for libWUtil
dnl ==================
LIBWUTIL=""
WS_CHECK_LIB(WUtil, WMGetFromPLString, $X_EXTRA_LIBS)
if test "x$ac_cv_lib_WUtil_WMGetFromPLString" = xyes; then
WS_CHECK_HEADER(WINGs/WUtil.h)
if test "x$ac_cv_header_WINGs_WUtil_h" = xyes; then
LIBWUTIL="-lWUtil"
fi
fi
AC_SUBST(LIBWUTIL)
dnl Check for libdockapp
dnl =====================
LIBDA=""
WS_CHECK_LIB(dockapp, DAOpenDisplay, $X_EXTRA_LIBS -lX11 -lXext -lXpm)
if test "x$ac_cv_lib_dockapp_DAOpenDisplay" = xyes; then
WS_CHECK_HEADER(dockapp.h)
if test "x$ac_cv_header_dockapp_h" = xyes; then
LIBDA="-ldockapp -lX11 -lXext -lXpm"
fi
fi
if test "x$LIBDA" = "x"; then
echo
echo "ERROR!!! libdockapp is not installed, or could not be found."
echo " WSoundServer requires libdockapp to build."
echo " Please read INSTALL to find where you can find libdockapp,"
echo " and install it first."
echo " If you already have it installed, try using the"
if test "x$ac_cv_lib_dockapp_DAOpenDisplay" != xyes; then
echo " --with-libs-from flag to tell configure where the library"
echo " is installed and"
fi
echo " --with-incs-from flag to tell configure where the header"
echo " files are installed"
exit 1
fi
AC_SUBST(LIBDA)
AC_SUBST(XCFLAGS)
AC_SUBST(XLFLAGS)
AC_SUBST(XLIBS)
AC_SUBST(X_EXTRA_LIBS)
dnl ===============================================
dnl End of stuff that uses X
dnl ===============================================
dnl Check for libaudiofile
dnl ======================
case ${host_os} in
irix*)
echo
echo "Compiling on IRIX Platform."
echo "Home of the original libaudiofile. For now let's just simply assume"
echo "that libaudiofile is present on the system."
AUDIOFILE_LIBS="-laudiofile"
;;
*)
AM_PATH_AUDIOFILE(0.1.9, have_audiofile=yes, have_audiofile=no)
CFLAGS=$AUDIOFILE_CFLAGS
LIBS=$AUDIOFILE_LIBS
if test "x$AUDIOFILE_LIBS" = "x"; then
echo
echo "ERROR!!! libaudiofile is not installed, or could not be found."
echo " WSoundServer requires libaudiofile to build."
echo " Please read INSTALL to find where you can find libaudiofile,"
echo " and install it first."
echo " If you already have it installed, try using the"
if test "x$ac_cv_lib_audiofile_afOpenFile" != xyes; then
echo " --with-libs-from flag to tell configure where the library"
echo " is installed and"
fi
echo " --with-incs-from flag to tell configure where the header"
echo " files are installed"
exit 1
fi
;;
esac
if test "$enable_esd" = yes; then
dnl ESD already has libaudiofile parameters setup properly in its
dnl esd-config ... so no need to add duplicate libaudiofile
dnl references in the get-wsound-flags script
AUDIOFILE_CFLAGS=""
AUDIOFILE_LIBS=""
fi
dnl ===========================================
dnl Try to resolve which audio layer should be
dnl compiled during wslib building
dnl ===========================================
found_sound=no
echo "---------------------------------------------------------------------"
echo "--- Checking to see which audio header files your system uses.";
echo "--- Most of these checks should fail. Do not be alarmed.";
AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
AC_CHECK_HEADERS(sys/audioio.h sys/audio.io.h sun/audioio.h)
AC_CHECK_HEADERS(dmedia/audio.h sys/soundlib.h sys/asoundlib.h)
dnl Define the driver needed based on the first header file found
if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
test "${ac_cv_header_soundcard_h}" = "yes" || \
test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
found_sound=yes
AC_DEFINE(DRIVER_VOXWARE)
driver="DRIVER_VOXWARE"
fi
if test "${ac_cv_header_sys_audio_h}" = "yes"; then
case ${host_os} in
hpux*)
found_sound=yes
AC_DEFINE(DRIVER_HPUX)
driver="DRIVER_HPUX"
;;
esac
fi
if test "${ac_cv_header_sys_audioio_h}" = "yes" || \
test "${ac_cv_header_sys_audio_io_h}" = "yes" || \
test "${ac_cv_header_sun_audioio_h}" = "yes"; then
case ${host_os} in
solaris*)
found_sound=yes
AC_DEFINE(DRIVER_SOLARIS)
driver="DRIVER_SOLARIS"
esac
fi
if test "${ac_cv_header_dmedia_audio_h}" = "yes"; then
case ${host_os} in
irix*)
found_sound=yes
AC_DEFINE(DRIVER_IRIX)
driver="DRIVER_IRIX"
esac
fi
if test "$found_sound" = "no"; then
AC_MSG_ERROR([Could not find a supported audio layer])
driver="DRIVER_NONE"
fi
dnl Checks for library functions.
dnl =============================
LIBRARY_SEARCH_PATH="$lib_search_path"
HEADER_SEARCH_PATH="$inc_search_path"
AC_SUBST(LIBRARY_SEARCH_PATH)
AC_SUBST(HEADER_SEARCH_PATH)
dnl Debugging setup
dnl ===============
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging ],, enable_debug=no)
if test "$enable_debug" = yes; then
DFLAGS="-Wall -g -DDEBUG -ansi -pedantic"
# Efence makes things too slow. Add it by hand in the Makefiles
# if it is really needed.
# AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
fi
AC_SUBST(DFLAGS)
AC_OUTPUT(Makefile util/Makefile wslib/Makefile src/Makefile doc/Makefile)
dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
dnl parsed by m4
cat <<EOF >get-wsound-flags
#!/bin/sh
prefix="$prefix"
exec_prefix=\$prefix
SCFLAGS="-I\$prefix/include $inc_search_path $ESD_CFLAGS $AUDIOFILE_CFLAGS -D$driver"
SLFLAGS="-L\$exec_prefix/lib $lib_search_path"
SLIBS="-lwsound $XLIBS $LIBWUTIL $AUDIOFILE_LIBS $ESD_LIBS"
usage="Usage: get-wsound-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
if test \$# -eq 0; then
echo "\${usage}" 1>&2
exit 1
fi
while test \$# -gt 0; do
case \$1 in
--cflags)
echo \$SCFLAGS
;;
--ldflags|--lflags)
echo \$SLFLAGS
;;
--libs)
echo \$SLIBS
;;
*)
echo "\${usage}" 1>&2
exit 1
;;
esac
shift
done
EOF
sed 's/#lp#/[/g' get-wsound-flags | sed 's/#rp#/]/g' > wslib/get-wsound-flags
chmod 755 wslib/get-wsound-flags
rm -f get-wsound-flags
|