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) AM_PROG_LIBTOOL dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB 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 libPropList dnl ===================== LIBPL="" WS_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS) if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then WS_CHECK_HEADER(proplist.h) if test "x$ac_cv_header_proplist_h" = xyes; then LIBPL="-lPropList" fi fi if test "x$LIBPL" = "x"; then echo echo "ERROR!!! libPropList is not installed, or could not be found." echo " WSoundServer requires libPropList to build." echo " Please read INSTALL to find where you can find libPropList," echo " and install it first." echo " If you already have it installed, try using the" if test "x$ac_cv_lib_PropList_PLGetString" != 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(LIBPL) dnl Use gsdd ? dnl ========== AC_ARG_ENABLE(gsdd, [ --enable-gsdd enable using gsdd ],, enable_gsdd=no) if test "$enable_gsdd" = yes; then AC_DEFINE(HAVE_GSDD) fi dnl Check for libdockapp dnl ===================== LIBDA="" WS_CHECK_LIB(dockapp, DAInitialize, $X_EXTRA_LIBS -lX11 -lXext -lXpm) if test "x$ac_cv_lib_dockapp_DAInitialize" = 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_DAInitialize" != 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 dnl ESD setup dnl ========= AC_ARG_ENABLE(esd, [ --enable-esd enable ESD support ],, enable_esd=no) if test "$enable_esd" = yes; then AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) CFLAGS=$ESD_CFLAGS LIBS=$ESD_LIBS AC_CHECK_FUNCS(esd_get_latency) AM_CONDITIONAL(HAVE_ESD,test "x$have_esd" = xyes) found_sound=yes AC_DEFINE(DRIVER_ESD) driver="DRIVER_ESD" else 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 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 <get-wsound-flags #!/bin/sh prefix="$prefix" exec_prefix=\$prefix SCFLAGS="-I\$prefix/include $inc_search_path $ESD_CFLAGS $AUDIOFILE_CFLAGS -D$driver" $GSDD_CFLAGS SLFLAGS="-L\$exec_prefix/lib $lib_search_path" SLIBS="-lwsound $XLIBS $LIBPL $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