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
|
dnl ---------------------------------------------------------------------------
dnl WX_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWindows, and define WX_CFLAGS and WX_LIBS. Set WX_CONFIG
dnl environment variable to override the default name of the wx-config script
dnl to use.
dnl ---------------------------------------------------------------------------
AC_DEFUN(WX_PATH_WXCONFIG,
[
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
AC_ARG_WITH(wx-config, [ --with-wx-config=CONFIG Name of wx-config script to use (optional)],
wx_config="$withval", wx_config="")
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
if test x${WX_CONFIG+set} != xset ; then
WX_CONFIG=$wx_config_exec_prefix/bin/wx-config
fi
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
if test x${WX_CONFIG+set} != xset ; then
WX_CONFIG=$wx_config_prefix/bin/wx-config
fi
fi
dnl deal with optional wx-config
if test x$wx_config != x ; then
WX_CONFIG=$wx_config
fi
if test x${WX_CONFIG+set} != xset ; then
WX_CONFIG=wx-config
fi
AC_PATH_PROG(WX_CONFIG, $WX_CONFIG, no)
min_wx_version=ifelse([$1], ,2.2.1,$1)
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
no_wx=""
if test "$WX_CONFIG" = "no" ; then
no_wx=yes
else
WX_CFLAGS=`$WX_CONFIG $wx_config_args --cflags`
WX_LIBS=`$WX_CONFIG $wx_config_args --libs`
wx_config_major_version=`$WX_CONFIG $wx_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`$WX_CONFIG $wx_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`$WX_CONFIG $wx_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
fi
if test "x$no_wx" = x ; then
AC_MSG_RESULT(yes (version $wx_config_major_version.$wx_config_minor_version.$wx_config_micro_version))
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
WX_CFLAGS=""
WX_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_LIBS)
])
dnl ---------------------------------------------------------------------------
dnl FIND_GNOME
dnl
dnl Finds GNOME (if present) and fills in GNOME_DATA_DIR and USE_GNOME conditional
dnl ---------------------------------------------------------------------------
AC_DEFUN(FIND_GNOME,
[
AC_MSG_CHECKING(for GNOME data directory)
GNOME_DATA_DIR=`gnome-config --datadir 2>/dev/null`
if test x$GNOME_DATA_DIR = x ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT($GNOME_DATA_DIR)
fi
AC_SUBST(GNOME_DATA_DIR)
AM_CONDITIONAL(USE_GNOME, test x$GNOME_DATA_DIR != x)
])
dnl ---------------------------------------------------------------------------
dnl FIND_KDE
dnl
dnl Finds KDE (if present) and fills in KDE_DATA_DIR and USE_KDE conditional
dnl ---------------------------------------------------------------------------
AC_DEFUN(FIND_KDE,
[
AC_MSG_CHECKING(for KDE data directory)
if test x$KDEDIR = x ; then
AC_MSG_RESULT(no)
KDE_DATA_DIR=""
else
KDE_DATA_DIR=$KDEDIR/share
AC_MSG_RESULT($KDE_DATA_DIR)
fi
AC_SUBST(KDE_DATA_DIR)
AM_CONDITIONAL(USE_KDE, test x$KDEDIR != x)
])
|