Added "--with-userdir" to configure script to change the default user settings directory
[synfig.git] / synfig-studio / trunk / config / synfig.m4
1 # SINFG M4 Macro
2 # For GNU Autotools
3 # $Id: sinfg.m4,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $
4 #
5 # By Robert B. Quattlebaum Jr. <darco@users.sf.net>
6 #
7
8 AC_DEFUN([SINFG_DEPS],
9 [
10         USING_ETL(,$2)
11         AM_PATH_XML2(,,$2)
12         AC_CHECK_FUNCS([floor pow sqrt],,$2)
13         $1
14 ])
15
16 AC_DEFUN([USING_SINFG],
17 [
18         AC_ARG_WITH(sinfg-includes,
19         [  --with-sinfg-includes    Specify location of sinfg headers],[
20         CXXFLAGS="$CXXFLAGS -I$withval"
21         ])
22
23         AC_PATH_PROG(SINFG_CONFIG,sinfg-config,no)
24
25         if test "$SINFG_CONFIG" = "no"; then
26                 no_SINFG_config="yes"
27                 $2
28         else
29                 AC_MSG_CHECKING([if $SINFG_CONFIG works])
30                 if $SINFG_CONFIG --libs >/dev/null 2>&1; then
31                         SINFG_VERSION="`$SINFG_CONFIG --version`"
32                         AC_MSG_RESULT([yes, $SINFG_VERSION])
33                         SINFG_CXXFLAGS="`$SINFG_CONFIG --cxxflags`"
34                         SINFG_CFLAGS="`$SINFG_CONFIG --cflags`"
35                         SINFG_LIBS="`$SINFG_CONFIG --libs`"
36                         CXXFLAGS="$CXXFLAGS $SINFG_CXXFLAGS"
37                         AC_SUBST(SINFG_CXXFLAGS)
38                         AC_SUBST(SINFG_LIBS)
39                         AC_SUBST(SINFG_CFLAGS)
40                         $1
41                 else
42                         AC_MSG_RESULT(no)
43                         no_SINFG_config="yes"
44                         $2
45                 fi
46         fi
47
48         SINFG_DEPS($1,$2)
49 ])
50
51