dnl Process this file with autoconf to produce a configure script. AC_INIT(gtkyahoo.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(gtkyahoo, 0.18.3) AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX AM_PATH_GTK(1.2.0, [LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" AC_DEFINE(WITH_GTK) ], AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) dnl Only use -Wall if we have gcc if test "x$GCC" = "xyes"; then if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi fi AC_MSG_CHECKING(for debugging support) AC_ARG_WITH( debug, [ --with-debug enable debugging routines], [ if test "x$withval" = xyes; then AC_MSG_RESULT([enabled]) CFLAGS="$CFLAGS -DENABLE_DEBUG" else AC_MSG_RESULT([disabled]) fi ], [ AC_MSG_RESULT([disabled]) ]) AC_MSG_CHECKING(for electric-fence support) AC_ARG_WITH( efence, [ --with-efence=PREFIX enable use of efence library ], [ if test "x$withval" = xyes; then AC_MSG_RESULT([disabled, must specify value]) elif test "x$withval" = xno; then AC_MSG_RESULT([disabled]) elif test "x$withval" = x; then AC_MSG_RESULT([disabled, must specify value]) else AC_MSG_RESULT([enabled, $withval]) LIBS="-L$withval/lib -lefence $LIBS" AC_SUBST(LIBS) fi ], [ AC_MSG_RESULT([disabled]) ]) AC_MSG_CHECKING(for dmalloc support) AC_ARG_WITH( dmalloc, [ --with-dmalloc=PREFIX enable use of dmalloc library ], [ if test "x$withval" = xyes; then AC_MSG_RESULT([disabled, must specify value]) elif test "x$withval" = xno; then AC_MSG_RESULT([disabled]) elif test "x$withval" = x; then AC_MSG_RESULT([disabled, must specify value]) else AC_MSG_RESULT([enabled, $withval]) LIBS="-L$withval/lib -ldmalloc $LIBS" CFLAGS="-I$withval/include $CFLAGS" AC_DEFINE(USE_DMALLOC) AC_SUBST(LIBS) AC_SUBST(CFLAGS) fi ], [ AC_MSG_RESULT([disabled]) ]) AC_MSG_CHECKING(for socks v4 support) AC_ARG_WITH( socks4, [ --with-socks4=PREFIX enable use of socks v4 ], [ if test "x$withval" = xyes; then AC_MSG_RESULT([disabled, must specify value]) elif test "x$withval" = xno; then AC_MSG_RESULT([disabled]) elif test "x$withval" = x; then AC_MSG_RESULT([disabled, must specify value]) else AC_MSG_RESULT([enabled, $withval]) LIBS="-L$withval/lib -lsocks $LIBS" CFLAGS="-I$withval/include $CFLAGS" AC_DEFINE(WITH_SOCKS4) AC_SUBST(LIBS) AC_SUBST(CFLAGS) fi ], [ AC_MSG_RESULT([disabled]) ]) AC_MSG_CHECKING(for socks v5 support) AC_ARG_WITH( socks5, [ --with-socks5=PREFIX enable use of socks v5 ], [ if test "x$withval" = xyes; then AC_MSG_RESULT([disabled, must specify value]) elif test "x$withval" = xno; then AC_MSG_RESULT([disabled]) elif test "x$withval" = x; then AC_MSG_RESULT([disabled, must specify value]) else AC_MSG_RESULT([enabled, $withval]) LIBS="-L$withval/lib -lsocks5 $LIBS" CFLAGS="-I$withval/include $CFLAGS" AC_DEFINE(WITH_SOCKS5) AC_SUBST(LIBS) AC_SUBST(CFLAGS) fi ], [ AC_MSG_RESULT([disabled]) ]) dnl dnl Path to perl for later use dnl AC_ARG_WITH( perl, [ --with-perl=PATH] [ path to perl executable to use], [ AC_MSG_CHECKING(for perl) if test "x$withval" != x; then PATH_PROG_PERL="$withval" AC_DEFINE_UNQUOTED(PATH_PROG_PERL, "$PATH_PROG_PERL") AC_MSG_RESULT($withval) else AC_MSG_RESULT(not found) fi ], [ AC_PATH_PROG(PATH_PROG_PERL, perl, no) AC_DEFINE_UNQUOTED(PATH_PROG_PERL, "$PATH_PROG_PERL") ]) dnl dnl Path to sendmail for default email handler dnl AC_ARG_WITH( sendmail, [ --with-sendmail=PATH] [ path to sendmail executable to use], [ AC_MSG_CHECKING(for sendmail) if test "x$withval" != x; then PATH_PROG_SENDMAIL="$withval" AC_DEFINE_UNQUOTED(PATH_PROG_SENDMAIL, "$PATH_PROG_SENDMAIL") AC_MSG_RESULT($withval) else AC_MSG_RESULT(not found) fi ], [ AC_PATH_PROG(PATH_PROG_SENDMAIL, sendmail, no) AC_DEFINE_UNQUOTED(PATH_PROG_SENDMAIL, "$PATH_PROG_SENDMAIL") ]) dnl dnl Path to netscape for default email handler dnl AC_ARG_WITH( netscape, [ --with-netscape=PATH] [ path to netscape executable to use], [ AC_MSG_CHECKING(for netscape) if test "x$withval" != x; then PATH_PROG_NETSCAPE="$withval" AC_DEFINE_UNQUOTED(PATH_PROG_NETSCAPE, "$PATH_PROG_NETSCAPE") AC_MSG_RESULT($withval) else AC_MSG_RESULT(not found) fi ], [ AC_PATH_PROG(PATH_PROG_NETSCAPE, netscape, no) AC_DEFINE_UNQUOTED(PATH_PROG_NETSCAPE, "$PATH_PROG_NETSCAPE") ]) AC_ARG_WITH( url-handler, [ --with-url-handler=PATH] [ path to url-handler executable to use], [ if test "x$withval" != x; then PATH_PROG_URLHANDLER="$withval" AC_DEFINE_UNQUOTED(PATH_PROG_URLHANDLER, "$PATH_PROG_URLHANDLER") AC_MSG_RESULT($withval) else AC_MSG_RESULT(not found) fi ], [ AC_PATH_PROGS(PATH_PROG_URLHANDLER, [gnome-moz-remote], no) if test "x$PATH_PROG_URLHANDLER" != xno; then AC_DEFINE_UNQUOTED(PATH_PROG_URLHANDLER, "$PATH_PROG_URLHANDLER") fi ]) AC_ARG_WITH( libyahoo, [ --with-libyahoo=PATH] [ path to libyahoo], [ static_lib=libyahoo.a if test "x$withval" != x; then if test -f $withval/$static_lib ; then LIBYAHOO_LIB="$withval/$static_lib" elif test -f $withval/.libs/$static_lib ; then LIBYAHOO_LIB="$withval/.libs/$static_lib" else AC_MSG_RESULT(The directory given doesn't seem to contain a libyahoo library) fi if test \! -z "${LIBYAHOO_LIB}" ; then LIBS="$LIBYAHOO_LIB $LIBS" AC_SUBST(LIBS) fi if test -f $withval/libyahoo.h ; then PATH_LIBYAHOO_INC="$withval" elif test -f $withval/include/libyahoo.h ; then PATH_LIBYAHOO_INC="$withval/include" else AC_MSG_RESULT(The directory given doesn't seem to contain a libyahoo header file) fi if test \! -z "${PATH_LIBYAHOO_INC}" ; then CFLAGS="-I$PATH_LIBYAHOO_INC $CFLAGS" AC_SUBST(CFLAGS) fi AC_MSG_RESULT(libyahoo lib in $PATH_LIBYAHOO_LIB and headers in $PATH_LIBYAHOO_INC) else AC_MSG_RESULT(not found) fi ], [ if test -d libyahoo ; then AC_MSG_RESULT([I'm going to assume there's a libyahoo built in the subdirectory ./libyahoo]) LIBS="./libyahoo/.libs/libyahoo.a $LIBS" CFLAGS="-I./libyahoo $CFLAGS" AC_SUBST(LIBS) AC_SUBST(CFLAGS) AC_CONFIG_SUBDIRS(libyahoo) else AC_MSG_RESULT([You have not given a location for libyahoo, I hope it's in your LIBPATH]) fi ]) dnl Check for the MIT-SCREEN-SAVER server extension have_mit=no with_mit_req=unspecified CPPFLAGS=-I/usr/X11R6/include AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes]) dnl Now check to see if it's really in the library; XF86Free-3.3 ships dnl scrnsaver.h, but doesn't include the code in libXext.a, the idiots! dnl if test "$have_mit" = yes; then AC_CHECK_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm -L/usr/X11R6/lib -lX11) if test "$have_mit" = no; then dnl Looks like XF86Free-3.3 actually puts it in XExExt instead dnl of in Xext. AC_CHECK_LIB(XExExt, XScreenSaverRegister, [have_mit=yes; EB_LIBS="$EB_LIBS -lXExExt"], [true], -L/usr/X11R6/lib -lX11 -lXext -lm) fi if test "$have_mit" = no; then dnl Looks like some versions of XFree86 (whichever version dnl it is that comes with RedHat Linux 2.0 -- I can't find a version dnl number) put this garbage in Xss instead of Xext. AC_CHECK_LIB(Xss, XScreenSaverRegister, [have_mit=yes; EB_LIBS="$EB_LIBS -lXss"], [true], -L/usr/X11R6/lib -lX11 -lXext -lm) fi if test "$have_mit" = yes; then AC_DEFINE(CAN_GET_X_IDLE_TIME) fi fi CPPFLAGS= LIBS="$LIBS $EB_LIBS" AC_HEADER_STDC AC_CHECK_HEADERS(stdarg.h string.h strings.h ctype.h sys/wait.h sys/types.h) AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)],) AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)],) AC_CHECK_FUNC(waitpid, [AC_DEFINE(HAVE_WAITPID)],) AC_OUTPUT(Makefile gtkyahoo.spec:gtkyahoo.spec.in:gtkyahoo.spec.src gtkyahoo-ximian.spec:gtkyahoo-ximian.spec.in:gtkyahoo.spec.src debian/changelog gtkyahoo.lsm gtkyahoo-sound-handler)