fix up gfarris's mistaken commit to gnome-common (revert to yesterday's versions)
[platform/upstream/gnome-common.git] / macros / psiconv.m4
1 dnl
2 dnl PSICONV_INIT 
3 dnl
4
5 AC_DEFUN([PSICONV_INIT],[
6         AC_SUBST(PSICONV_LIBS)
7         AC_SUBST(PSICONV_CFLAGS)
8
9         AC_ARG_WITH(psiconv-includes,
10         [  --with-psiconv-includes Specify location of Psiconv headers],[
11         psiconv_cflags="-I$withval"
12         ])
13         
14         AC_ARG_WITH(psiconv-libs,
15         [  --with-psiconv-libs     Specify location of Psiconv libs],[
16         psiconv_libs="-L$withval"
17         ])
18
19         AC_ARG_WITH(psiconv,
20         [  --with-psiconv          Enable/disable Psiconv support],
21                 if test x$withval = xyes; then
22                         want_psiconv=yes
23                 else
24                         if test "x$withval" = xno; then
25                                 want_psiconv=no
26                         else
27                                 want_psiconv=yes
28                         fi
29                 fi,
30                 want_psiconv=yes)
31
32         
33             if test "$want_psiconv" = "yes"; then
34               ac_save_CFLAGS="$CFLAGS"
35               ac_save_LIBS="$LIBS"
36               CFLAGS="$CFLAGS $psiconv_cflags"
37               LIBS="$LIBS $psiconv_libs"
38               AC_CHECK_LIB(psiconv,psiconv_parse,want_psiconv=yes,want_psiconv=no)
39               CFLAGS="$ac_save_CFLAGS"
40               LIBS="$ac_save_LIBS"
41             fi
42             
43             if test "$want_psiconv" = "yes"; then
44               PSICONV_LIBS="${psiconv_libs} -lpsiconv"
45               PSICONV_CFLAGS="$psiconv_cflags"
46               with_psiconv=true
47             else
48               PSICONV_LIBS=""
49               PSICONV_CFLAGS=""
50               with_psiconv=false
51             fi
52         AM_CONDITIONAL(WITH_PSICONV,$with_psiconv)
53 ])