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
|
#! /bin/bash -norc
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Snack installation
dnl to configure the system for the local environment.
AC_INIT(../generic/snack.h)
SNACK_VERSION=2.2
#--------------------------------------------------------------------
# See if there was a command-line option for where Tcl is; if
# not, assume that its top-level directory is a sibling of ours.
#--------------------------------------------------------------------
SC_PATH_TCLCONFIG
#--------------------------------------------------------------------
# See if there was a command-line option for where Tk is; if
# not, assume that its top-level directory is a sibling of ours.
#--------------------------------------------------------------------
SC_PATH_TKCONFIG
#--------------------------------------------------------------------
if test "x${prefix}" = "xNONE"; then
prefix=/usr/local
fi
if test "x${exec_prefix}" = "xNONE"; then
exec_prefix=$prefix
fi
#SNACK_INSTALL_PATH=${exec_prefix}/lib
#SNACK_HINSTALL_PATH=${exec_prefix}/inc
#SNACK_LIB_SPEC="-L${exec_prefix}/lib -lsnack"
SNACK_INSTALL_PATH=${libdir}
SNACK_HINSTALL_PATH=${includedir}
SNACK_LIB_SPEC="-L${libdir} -lsnack"
#--------------------------------------------------------------------
# Read in configuration information generated by Tcl and
# arrange for it to be substituted into our Makefile.
#--------------------------------------------------------------------
file=$TCL_BIN_DIR/tclConfig.sh
. $file
if test "$TCL_SHARED_BUILD" = 0; then
AC_MSG_ERROR(Tcl and Tk must be configured with the --enable-shared flag)
fi
CFLAGS=$TCL_SHLIB_CFLAGS
LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
SHLIB_LD=$TCL_SHLIB_LD
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
CC=$TCL_CC
TCLVER=$TCL_VERSION
TCLAPI=""
if test "$TCLVER" != "8.0"; then
TCLAPI="-DTCL_81_API"
fi
#--------------------------------------------------------------------
# Read in configuration information generated by Tk and arrange
# for it to be substituted into our Makefile.
#--------------------------------------------------------------------
file=$TK_BIN_DIR/tkConfig.sh
. $file
XINCLUDES=$TK_XINCLUDES
#--------------------------------------------------------------------
# Set audio related variables for the supported systems
#--------------------------------------------------------------------
system=`uname -s`-`uname -r`
AINC=""
ALIB=""
case $system in
BSD/OS-4.*)
AFLAG="-DOSS"
ALIB="-lossaudio"
AOBJ="jkAudIO_oss.o"
;;
HP-UX-*.1*)
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
CFLAGS=$CFLAGS
else
CFLAGS="-Ae +z"
fi
AINC="-I/opt/audio/include"
AFLAG="-DHPUX"
ALIB="-L/opt/audio/lib -lAlib"
AOBJ="jkAudIO_hp.o"
if test "$SHLIB_LD" = "ld -b" ; then
# this will not work if gcc is used as "linker"
SHLIB_LD="$SHLIB_LD +s"
else
# gcc requires the prefix -Xlinker for each linker option
SHLIB_LD="$SHLIB_LD -Xlinker +s"
fi
;;
IRIX*)
AFLAG="-DIRIX"
ALIB="-laudio"
AOBJ="jkAudIO_sgi.o"
;;
IRIX64-6.*)
AFLAG="-DIRIX"
ALIB="-laudio"
AOBJ="jkAudIO_sgi.o"
;;
Linux*)
AFLAG="-DOSS"
AOBJ="jkAudIO_oss.o"
;;
NetBSD*|OpenBSD-*)
AFLAG="-DOSS"
ALIB="-lossaudio"
AOBJ="jkAudIO_oss.o"
;;
FreeBSD-*)
AFLAG="-DOSS"
ALIB=""
AOBJ="jkAudIO_oss.o"
;;
SunOS*)
AFLAG="-DSolaris"
AOBJ="jkAudIO_sun.o"
;;
Rhapsody-*|Darwin-*)
HACK=""
AFLAG="-DOS_X_CORE_AUDIO -DMA${HACK}C_OSX_TCL -DMA${HACK}C_OSX_TK"
ALIB="-framework CoreFoundation -framework CoreAudio"
AOBJ="jkAudIO_osx.o"
CFLAGS="-Os -fno-common"
;;
*)
AFLAG="-DOTHER"
AOBJ="jkAudIO_skel.o"
;;
esac
#--------------------------------------------------------------------
# Get the path to the NIST/SPHERE distribution. This is
# only necessary if you want to build the NIST package.
#--------------------------------------------------------------------
AC_ARG_WITH(nist-include,[ --with-nist-include=DIR use NIST/SPHERE includes in DIR],
NIST_INC_DIR=$withval, NIST_INC_DIR="")
NISTINC="-I$NIST_INC_DIR"
if test "$NISTINC" = "-I"; then
NISTINC=""
fi
AC_ARG_WITH(nist-lib,[ --with-nist-lib=DIR use NIST/SPHERE libraries in DIR],
NIST_LIB_DIR=$withval, NIST_LIB_DIR="")
NISTLIBS="$NIST_LIB_DIR/libsp.a $NIST_LIB_DIR/libutil.a"
LIBNIST=""
if test ! "$NIST_LIB_DIR" = ""; then
LIBNIST="libsnacksphere${SHLIB_SUFFIX}"
fi
#--------------------------------------------------------------------
# Get the path to the Ogg/Vorbis installation. This is
# only necessary if you want to build the snackogg package.
#--------------------------------------------------------------------
LIBOGG=""
AC_ARG_WITH(ogg-include,[ --with-ogg-include=DIR use Ogg/Vorbis includes in DIR],
OGG_INC_DIR=$withval, OGG_INC_DIR="")
AC_ARG_WITH(ogg-lib,[ --with-ogg-lib=DIR use Ogg/Vorbis libraries in DIR],
OGG_LIB_DIR=$withval, OGG_LIB_DIR="")
OGGINC="-I$OGG_INC_DIR"
OGGLIBS="-L$OGG_LIB_DIR -lvorbisenc -lvorbis -logg"
if test ! "$OGG_LIB_DIR" = ""; then
LIBOGG="libsnackogg${SHLIB_SUFFIX}"
fi
#--------------------------------------------------------------------
# Disable stub support. This is necessary if you
# want to run Snack with Tcl/Tk versions 8.0 through 8.0.5
#--------------------------------------------------------------------
AC_ARG_ENABLE(stubs,[ --disable-stubs disable stub support],,enableval2="no")
if test "$enableval2" = "no"; then
AC_MSG_RESULT(will use stubs (normal))
CFLAGS="$CFLAGS -DUSE_TCL_STUBS -DUSE_TK_STUBS"
TCL_LIB_SPEC="${TCL_STUB_LIB_SPEC}"
TK_LIB_SPEC="${TK_STUB_LIB_SPEC}"
STUBINITOBJ="snackStubInit.o"
DOSTUBLIB="stublib"
SNACK_STUB_LIB_FLAG="-lsnackstub$SNACK_VERSION"
if test "$TCLVER" = "8.0"; then
AC_MSG_WARN("You probably forgot to specify --disable-stubs")
fi
else
AC_MSG_RESULT(will not use stubs)
if test "$TCLVER" != "8.0"; then
STUBINITOBJ="snackStubInit.o"
else
STUBINITOBJ=""
fi
DOSTUBLIB=""
SNIST_LIB_SPEC="-lsnack"
fi
#--------------------------------------------------------------------
# Enable ALSA sound support.
#--------------------------------------------------------------------
AC_ARG_ENABLE(alsa,[ --enable-alsa enable ALSA support],,enableval3="no")
if test "$enableval3" != "no"; then
AC_MSG_RESULT(will use ALSA)
AFLAG="-DALSA"
ALIB="-lasound"
AOBJ="jkAudIO_alsa.o"
else
AC_MSG_RESULT(will use OSS)
fi
#--------------------------------------------------------------------
# Checks for header files.
_AC_INCLUDES_DEFAULT_REQUIREMENTS
AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(XINCLUDES)
AC_SUBST(TCL_INCLUDE_SPEC)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TK_LIB_SPEC)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TK_SRC_DIR)
AC_SUBST(TK_LIBS)
AC_SUBST(SNACK_INSTALL_PATH)
AC_SUBST(SNACK_HINSTALL_PATH)
AC_SUBST(SNACK_LIB_SPEC)
AC_SUBST(AINC)
AC_SUBST(AFLAG)
AC_SUBST(ALIB)
AC_SUBST(AOBJ)
AC_SUBST(NISTINC)
AC_SUBST(NISTLIBS)
AC_SUBST(LIBNIST)
AC_SUBST(OGGINC)
AC_SUBST(OGGLIBS)
AC_SUBST(LIBOGG)
AC_SUBST(TCLAPI)
AC_SUBST(LD_SEARCH_FLAGS)
AC_SUBST(TCLVER)
AC_SUBST(STUBINITOBJ)
AC_SUBST(DOSTUBLIB)
AC_SUBST(SNACK_STUB_LIB_FLAG)
AC_SUBST(SNACK_VERSION)
AC_OUTPUT(Makefile snackConfig.sh)
|