dnl --------------------------------------------------------------------- dnl Process this file with autoconf to produce a configure script. AC_INIT(amsn) AC_CONFIG_HEADER(utils/linux/capture/config.h) APPNAME=amsn APPVERSION=0.96 APPRELEASE=1 APPSTABLE=yes AC_SUBST(APPVERSION) AC_SUBST(APPNAME) AC_SUBST(APPRELEASE) AC_SUBST(APPSTABLE) dnl --------------------------------------------------------------------- dnl compile time options AC_ARG_ENABLE(debug, [ --enable-debug enable some debuging informations],[enable_debug=yes]) AC_SUBST(DEBUG) if test "$enable_debug" == "yes" ; then DEBUG="yes" else DEBUG="no" fi AC_ARG_ENABLE(static, [ --enable-static enable static link of libstdc++],[enable_static=yes]) AC_SUBST(STATIC) if test "$enable_static" == "yes" ; then STATIC="yes" else STATIC="no" fi dnl subst configure command AC_SUBST(CONFIGURE_ARGS) CONFIGURE_ARGS=`echo $@` dnl Check for OS #`uname -s` case `uname -s` in Linux) FOUND_OS="linux" ;; OpenBSD) # *BSD has important stuff (from ports) in /usr/local ... CFLAGS="$CFLAGS -lm -I/usr/local/include/libpng -I/usr/local/include -L/usr/local/lib" LDFLAGS="$LDFLAGS -L/usr/local/lib" TK_INC_SPEC=/usr/local/include/tk8.4/generic FOUND_OS="bsd" ;; FreeBSD | NetBSD) # *BSD has important stuff (from ports) # in /usr/local ... CFLAGS="$CFLAGS -I/usr/local/include -L/usr/local/lib" LDFLAGS="$LDFLAGS -L/usr/local/lib" FOUND_OS="bsd" ;; Darwin) FOUND_OS="mac" CFLAGS="$CFLAGS -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" CXXFLAGS="$CXXFLAGS -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" LDFLAGS="$LDFLAGS -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" # Directories in which the Tcl core can be found TCL_INC_SPEC="-I../../Frameworks/Tcl.framework/Headers -DUSE_TCL_STUBS" TCL_STUB_LIB_SPEC="-L../../Frameworks/Tcl.framework -ltclstub8.4\${TCL_DBGX}" # Directories in which the Tk core can be found TK_INC_SPEC="-I../../Frameworks/Tk.framework/Headers -DUSE_TK_STUBS" TK_STUB_LIB_SPEC="-L../../Frameworks/Tk.framework -ltkstub8.4\${TK_DBGX}" ;; *) AC_MSG_CHECKING(if amsn will build on `uname -s`) AC_MSG_RESULT(maybe) FOUND_OS="unknown" ;; esac dnl --------------------------------------------------------------------- dnl Checks for TCL and TK. AC_PREFIX_PROGRAM(wish) TCLSH=`which tclsh` VERSION=`echo "puts $::tcl_version ; exit" | ${TCLSH}` AC_ARG_ENABLE(version-check, [ --disable-version-check Disable checking that linked tcl/tk version is the same version that bin program tclsh ], [version_ok=$enableval], [version_ok=yes]) OLDV=`expr $VERSION \< 8.4` if test "x${version_ok}" == "xyes" -a $OLDV == 1; then AC_MSG_ERROR(Your current Tcl/Tk installation has a version number of $VERSION. The minimal version required for aMSN to run is Tcl/Tk 8.4) fi dnl --------------------------------------------------------------------- dnl Checks for programs. AC_PROG_CC CC_INSTALLED=`which $CC` if test "x${CC_INSTALLED}" == "x"; then AC_MSG_ERROR(You need a C compiler (gcc) to compiler aMSN. Please install gcc and try again) fi AC_PROG_CXX CXX_INSTALLED=`which $CXX` if test "x${CXX_INSTALLED}" == "x"; then AC_MSG_ERROR(You need a C++ compiler (g++) to compiler aMSN. Please install g++ and try again) fi BUILD_DIR=`pwd` cd ${srcdir} TOP_DIR=`pwd` LIBDIR=`pwd` cd "${BUILD_DIR}" AC_SUBST(TCLSH) AC_SUBST(TOP_DIR) AC_SUBST(LIBDIR) AC_SUBST(BUILD_DIR) if test $FOUND_OS != "mac"; then #-------------------------------------------------------------------- # Read in configuration information generated by Tcl for shared # libraries, and arrange for it to be substituted into our # Makefile. #-------------------------------------------------------------------- AC_MSG_CHECKING(tcl build dir) TCL_LIB_DIR=$exec_prefix/lib dirs=" /usr/lib/tcl8.4a* \ /usr/local/lib/tcl8.4a* \ /usr/lib/tcl8.4b* \ /usr/local/lib/tcl8.4b* \ /usr/lib/tcl8.4 \ /usr/lib/tcl8.4.* \ /usr/local/lib/tcl8.4 \ /usr/local/lib/tcl8.4.* \ /usr/lib/tcl8.5 \ /usr/lib/tcl8.5.* \ /usr/local/lib/tcl8.5 \ /usr/local/lib/tcl8.5.* \ /Library/Frameworks/Tcl.framework \ ~/Library/Frameworks/Tcl.framework \ /Network/Library/Frameworks/Tcl.framework \ /System/Library/Frameworks/Tcl.framework \ /usr/local/lib \ /usr/lib \ /usr/local/lib64 \ /usr/lib64 \ /usr/lib64/tcl8.4a* \ /usr/local/lib64/tcl8.4a* \ /usr/lib64/tcl8.4b* \ /usr/local/lib64/tcl8.4b* \ /usr/lib64/tcl8.4 \ /usr/lib64/tcl8.4.* \ /usr/local/lib64/tcl8.4 \ /usr/local/lib64/tcl8.4.* \ /usr/lib64/tcl8.5 \ /usr/lib64/tcl8.5.* \ /usr/local/lib64/tcl8.5 \ /usr/local/lib64/tcl8.5.* \ `locate tclConfig.sh`" for i in $dirs ; do if test -f "$i"; then i=`dirname $i` fi if test -d "$i" -a -f "$i/tclConfig.sh"; then file=$i/tclConfig.sh . $file if test "x${version_ok}" != "xyes"; then VERSION=${TCL_VERSION} fi if test "x${TCL_INC_DIR}" != "x" -o "x${TCL_INC_SPEC}" != "x" \ -o "x${TCL_INCLUDE_DIR}" != "x" -o "x${TCL_INCLUDE_SPEC}" != "x"; then if test "x${TCL_VERSION}" == "x${VERSION}" ; then TCL_LIB_DIR=`cd $i; pwd` break; fi elif test -f ${TCL_PREFIX}/include/tcl.h; then TCL_LIB_DIR=`cd $i; pwd` break; fi fi done AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl binaries from DIR], TCL_LIB_DIR=$withval,) if test -d $TCL_LIB_DIR; then AC_MSG_RESULT([using tcl library in $TCL_LIB_DIR]) else AC_MSG_ERROR(Unable to find Tcl directory or Tcl package is not tcl-dev) fi cd ${TCL_LIB_DIR}/.. TCL_TOP_DIR=`pwd` cd "${BUILD_DIR}" #-------------------------------------------------------------------- file=$TCL_LIB_DIR/tclConfig.sh . $file #CC=$TCL_CC #CXX=$TCL_CXX SHLIB_CFLAGS=`echo "$TCL_SHLIB_CFLAGS" |sed -e "s|PIC|pic|" -e "s|+Z|+z|"` SHLIB_LD=$TCL_SHLIB_LD SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX DL_LIBS=$TCL_DL_LIBS #LD_FLAGS=$TCL_LD_FLAGS TCL_BASE=`echo ${TCL_LIB_SPEC} |sed -e "s|^.*-l||"` TCL_STUB_BASE=`echo ${TCL_STUB_LIB_SPEC} |sed -e "s|^.*-l||"` AC_SUBST(TCL_LIB_DIR) if test "x${TCL_INC_SPEC}" != "x" ; then TCL_INC_DIR=$TCL_INC_SPEC fi if test "x${TCL_INCLUDE_SPEC}" != "x"; then TCL_INC_DIR=$TCL_INCLUDE_SPEC fi if test "x${TCL_INC_DIR}" == "x"; then TCL_INC_DIR=$TCL_INCLUDE_DIR fi if test "x${TCL_INC_DIR}" == "x" -a -f ${TCL_PREFIX}/include/tcl.h; then TCL_INC_DIR=${TCL_PREFIX}/include fi if test "x${TCL_INC_DIR}" == "x"; then AC_MSG_ERROR(You dot not have a devel package of Tcl) fi case $TCL_INC_DIR in -I*) ;; *) TCL_INC_DIR=-I$TCL_INC_DIR;; esac TCL_INC_SPEC=$TCL_INC_DIR framework=`echo "${TCL_BASE}" | grep -- "-framework"` if test "x${framework}" == "x"; then TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_BASE}" fi TCL_STUB_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_STUB_BASE}" eval "TCL_UNSHARED_LIB_FILE=lib${TCL_BASE}${TCL_UNSHARED_LIB_SUFFIX}" eval "TCL_SHARED_LIB_FILE=lib${TCL_BASE}${TCL_SHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # Read in configuration information generated by TK, and # arrange for it to be substituted into our Makefile. #-------------------------------------------------------------------- AC_MSG_CHECKING(tk build dir) TK_LIB_DIR=$prefix/lib if test -f "${TCL_LIB_DIR}/tkConfig.sh"; then TK_LIB_DIR=$TCL_LIB_DIR else TK_LIB_DIR=$prefix/lib dirs="/usr/lib/tk8.4a* \ /usr/local/lib/tk8.4a* \ /usr/lib/tk8.4b* \ /usr/local/lib/tk8.4b* \ /usr/lib/tk8.4 \ /usr/lib/tk8.4.* \ /usr/local/lib/tk8.4 \ /usr/local/lib/tk8.4.* \ /usr/lib/tk8.5 \ /usr/lib/tk8.5.* \ /usr/local/lib/tk8.5 \ /usr/local/lib/tk8.5.* \ /Library/Frameworks/Tk.framework \ ~/Library/Frameworks/Tk.framework \ /Network/Library/Frameworks/Tk.framework \ /System/Library/Frameworks/Tk.framework \ /usr/local/lib \ /usr/lib \ /usr/local/lib64 \ /usr/lib64 \ /usr/lib64/tk8.4a* \ /usr/local/lib64/tk8.4a* \ /usr/lib64/tk8.4b* \ /usr/local/lib64/tk8.4b* \ /usr/lib64/tk8.4 \ /usr/lib64/tk8.4.* \ /usr/local/lib64/tk8.4 \ /usr/local/lib64/tk8.4.* \ /usr/lib64/tk8.5 \ /usr/lib64/tk8.5.* \ /usr/local/lib64/tk8.5 \ /usr/local/lib64/tk8.5.* \ `locate tkConfig.sh`" for i in $dirs ; do if test -f "$i"; then i=`dirname $i` fi if test -d "$i" -a -f "$i/tkConfig.sh"; then file=$i/tkConfig.sh . $file if test "x${version_ok}" != "xyes"; then VERSION=${TK_VERSION} fi if test "x${TK_INC_DIR}" != "x" -o "x${TK_INC_SPEC}" != "x" \ -o "x${TK_INCLUDE_DIR}" != "x" -o "x${TK_INCLUDE_SPEC}" != "x"; then if test "x${TK_VERSION}" == "x${VERSION}"; then TK_LIB_DIR=`cd $i; pwd` break; fi elif test -f ${TK_PREFIX}/include/tk.h; then TK_LIB_DIR=`cd $i; pwd` break; fi fi done fi AC_ARG_WITH(tk, [ --with-tk=DIR use Tk binaries from DIR], TK_LIB_DIR=$withval,) if test -d $TK_LIB_DIR; then AC_MSG_RESULT([using tk library in $TK_LIB_DIR]) else AC_MSG_ERROR(Unable to find Tk directory or Tk package is not tk-dev) fi cd ${TK_LIB_DIR}/.. TK_TOP_DIR=`pwd` cd "${BUILD_DIR}" file=$TK_LIB_DIR/tkConfig.sh . $file AC_SUBST(TK_VERSION) AC_SUBST(TK_LIB) AC_SUBST(TK_LIBS) AC_SUBST(TK_LIB_DIR) if test "x${TK_INC_SPEC}" != "x" ; then TK_INC_DIR=$TK_INC_SPEC fi if test "x${TK_INCLUDE_SPEC}" != "x"; then TK_INC_DIR=$TK_INCLUDE_SPEC fi if test "x${TK_INC_DIR}" == "x"; then TK_INC_DIR=$TK_INCLUDE_DIR fi if test "x${TK_INC_DIR}" == "x" -a -f ${TK_PREFIX}/include/tk.h; then TK_INC_DIR=${TK_PREFIX}/include fi if test "x${TK_INC_DIR}" == "x"; then AC_MSG_ERROR(You dot not have a devel package of Tk) fi case $TK_INC_DIR in -I*) ;; *) TK_INC_DIR=-I$TK_INC_DIR;; esac TK_INC_SPEC=$TK_INC_DIR fi AC_SUBST(TCL_INC_SPEC) AC_SUBST(TK_INC_SPEC) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TK_STUB_LIB_SPEC) dnl --------------------------------------------------------------------- dnl do some OS specific stuff here dnl Check for libstdc++ AC_CHECK_LIB(stdc++,main,CXX_LIB="-lstdc++", AC_MSG_ERROR(stdc++ library not found) ) AC_SUBST(CXX_LIB) AC_SUBST(LDLIBS) AC_SUBST(FOUND_X11) AC_SUBST(FOUND_OS) FOUND_X11="no" dnl Check for X11 AC_PATH_XTRA if test "$no_x" != "yes"; then FOUND_X11="yes" X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" else AC_MSG_RESULT("Could not find X11 devel package, traydock will not be compiled") fi #--------------------------------------------------------------------------------------------- dnl --------------------------------------------------------------------- dnl Check for required libs for TkCxImage dnl Check for png AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, , AC_MSG_ERROR([png headers not found]))], AC_MSG_ERROR([libpng is required]), -lz -lm) dnl Check for jpeg AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [AC_CHECK_HEADER(jpeglib.h, [AC_CHECK_HEADER(jerror.h, , AC_MSG_ERROR([jerror headers not found]))], AC_MSG_ERROR([jpeg headers not found]))], AC_MSG_ERROR([libjpeg is required])) dnl --------------------------------------------------------------------- dnl Checks for functions AC_CHECK_FUNCS(ftello fseeko getpt strcasestr memmem dlopen ) AC_CHECK_LIB(pthread,pthread_create,LIBPTHREAD="-lpthread") if test "$LIBPTHREAD" = ""; then AC_CHECK_LIB(c_r,pthread_create,LIBPTHREAD="-lc_r") fi AC_SUBST(LIBPTHREAD) AC_SUBST(X_CFLAGS) AC_SUBST(X_LIBS) dnl --------------------------------------------------------------------- dnl deinterlace plugins AC_MSG_CHECKING(if mmx should be used) AC_SUBST(USE_MMX) if test "$enable_mmx" = "no" -o "$enable_mmx" = "yes"; then USE_MMX="$enable_mmx" else case "`uname -m`" in i586 | i686) USE_MMX="yes" ;; *) USE_MMX="no" ;; esac fi AC_MSG_RESULT($USE_MMX) dnl --------------------------------------------------------------------- dnl write out stuff AC_OUTPUT(Makefile) dnl --------------------------------------------------------------------- dnl compile time options summary cat <