aboutsummaryrefslogtreecommitdiffstats
path: root/macros/psiconv.m4
blob: eaf56f43ac9097169016b3890b2bcbad974dd477 (plain) (blame)
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
dnl
dnl PSICONV_INIT 
dnl

AC_DEFUN([PSICONV_INIT],[
    AC_SUBST(PSICONV_LIBS)
    AC_SUBST(PSICONV_CFLAGS)

    AC_ARG_WITH(psiconv-includes,
    [  --with-psiconv-includes Specify location of Psiconv headers],[
    psiconv_cflags="-I$withval"
    ])
    
    AC_ARG_WITH(psiconv-libs,
    [  --with-psiconv-libs     Specify location of Psiconv libs],[
    psiconv_libs="-L$withval"
    ])

    AC_ARG_WITH(psiconv,
    [  --with-psiconv          Enable/disable Psiconv support],
        if test x$withval = xyes; then
                want_psiconv=yes
            else
                if test "x$withval" = xno; then
                    want_psiconv=no
                else
                    want_psiconv=yes
                fi
        fi,
        want_psiconv=yes)

    
        if test "$want_psiconv" = "yes"; then
          ac_save_CFLAGS="$CFLAGS"
          ac_save_LIBS="$LIBS"
          CFLAGS="$CFLAGS $psiconv_cflags"
          LIBS="$LIBS $psiconv_libs"
          AC_CHECK_LIB(psiconv,psiconv_parse,want_psiconv=yes,want_psiconv=no)
          CFLAGS="$ac_save_CFLAGS"
          LIBS="$ac_save_LIBS"
        fi
        
        if test "$want_psiconv" = "yes"; then
          PSICONV_LIBS="${psiconv_libs} -lpsiconv"
          PSICONV_CFLAGS="$psiconv_cflags"
          with_psiconv=true
        else
          PSICONV_LIBS=""
          PSICONV_CFLAGS=""
          with_psiconv=false
        fi
    AM_CONDITIONAL(WITH_PSICONV,$with_psiconv)
])