comparison m4macros/purple.m4 @ 15903:402236ee7981

Rename gaim.m4 to purple.m4. This is for other applications that want to compile against libpurple, right? Do you think we need a gaim.m4 for backward compatibility?
author Mark Doliner <mark@kingant.net>
date Sun, 25 Mar 2007 01:01:22 +0000
parents
children
comparison
equal deleted inserted replaced
15902:3a45be1c3281 15903:402236ee7981
1 dnl ###########################################################################
2 dnl # Configure paths for libpurple
3 dnl # Gary Kramlich 2005
4 dnl #
5 dnl # Based off of glib-2.0.m4 by Owen Taylor
6 dnl ###########################################################################
7
8 dnl ###########################################################################
9 dnl # AM_PATH_PURPLE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
10 dnl #
11 dnl # Test for purple and define PURPLE_CFLAGS, PURPLE_LIBS, PURPLE_DATADIR, and
12 dnl # PURPLE_LIBDIR
13 dnl ###########################################################################
14 AC_DEFUN([AM_PATH_PURPLE],
15 [dnl
16 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
17
18 no_purple=""
19
20 if test x"$PKG_CONFIG" != x"no" ; then
21 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
22 :
23 else
24 echo "*** pkg-config is too old; version 0.7 or newer is required."
25 no_purple="yes"
26 PKG_CONFIG="no"
27 fi
28 else
29 no_purple="yes"
30 fi
31
32 min_version=ifelse([$1], ,2.0.0,$1)
33 found_version=""
34
35 AC_MSG_CHECKING(for purple - version >= $min_version)
36
37 if test x"$no_purple" = x"" ; then
38 PURPLE_DATADIR=`$PKG_CONFIG --variable=datadir purple`
39 PURPLE_LIBDIR=`$PKG_CONFIG --variable=libdir purple`
40
41 PURPLE_CFLAGS=`$PKG_CONFIG --cflags purple`
42 PURPLE_LIBS=`$PKG_CONFIG --libs purple`
43
44 purple_version=`$PKG_CONFIG --modversion purple`
45 purple_major_version=`echo $purple_version | cut -d. -f 1`
46 purple_minor_version=`echo $purple_version | cut -d. -f 2`
47
48 dnl # stash the micro version in a temp variable. Then stash
49 dnl # the numeric for it in purple_micro_version and anything
50 dnl # else in purple_extra_version.
51 purple_micro_version_temp=`echo $purple_version | cut -d. -f 3`
52 purple_micro_version=`echo $purple_micro_version_temp | sed 's/[[^0-9]]//g'`
53 purple_extra_version=`echo $purple_micro_version_temp | sed 's/[[0-9]]//g'`
54
55 dnl # get the major, minor, and macro that the user gave us
56 min_major_version=`echo $min_version | cut -d. -f 1`
57 min_minor_version=`echo $min_version | cut -d. -f 2`
58 min_micro_version=`echo $min_version | cut -d. -f 3`
59
60 dnl # check the users version against the version from pkg-config
61 if test $purple_major_version -eq $min_major_version -a \
62 $purple_minor_version -ge $min_minor_version -a \
63 $purple_micro_version -ge $min_micro_version
64 then
65 :
66 else
67 no_purple="yes"
68 found_version="$purple_major_version.$purple_minor_version.$purple_micro_version$purple_extra_version"
69 fi
70
71 dnl # Do we want a compile test here?
72 fi
73
74 if test x"$no_purple" = x"" ; then
75 AC_MSG_RESULT(yes (version $purple_major_version.$purple_minor_version.$purple_micro_version$purple_extra_version))
76 ifelse([$2], , :, [$2])
77 else
78 AC_MSG_RESULT(no)
79 if test x"$PKG_CONFIG" = x"no" ; then
80 echo "*** A new enough version of pkg-config was not found."
81 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
82 fi
83
84 if test x"found_version" != x"" ; then
85 echo "*** A new enough version of purple was not found."
86 echo "*** You have version $found_version"
87 echo "*** See http://pidgin.im/"
88 fi
89
90 PURPLE_CFLAGS=""
91 PURPLE_LIBS=""
92 PURPLE_DATADIR=""
93 PURPLE_LIBDIR=""
94
95 ifelse([$3], , :, [$3])
96 fi
97
98 AC_SUBST(PURPLE_CFLAGS)
99 AC_SUBST(PURPLE_LIBS)
100 AC_SUBST(PURPLE_DATADIR)
101 AC_SUBST(PURPLE_LIBDIR)
102 ])