~xdv/mod-transform/trunk

« back to all changes in this revision

Viewing changes to m4/subversion.m4

  • Committer: Laurence Rowe
  • Date: 2010-07-30 20:11:13 UTC
  • mfrom: (84.1.1 mod-transform-clean)
  • Revision ID: laurence@lrowe.co.uk-20100730201113-2epmrdgj2n1vul12
merge in the externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Check for subversion client libraries
 
2
dnl CHECK_PATH_SUBVERSION(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 
3
AC_DEFUN([CHECK_PATH_SUBVERSION],
 
4
[dnl
 
5
 
 
6
AC_ARG_WITH(
 
7
    svn,
 
8
    [AC_HELP_STRING([--with-svn=PATH],[Path subversion headers and libraries])],
 
9
    svn_path="$withval",
 
10
    :)
 
11
 
 
12
AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
13
 
 
14
# Determine subversion include directory.
 
15
if test -z $svn_path; then
 
16
    test_paths="/usr/include /usr/include/subversion-1 
 
17
                /usr/local/include /usr/local/include/subversion-1"
 
18
else
 
19
    test_paths="${svn_path}/include ${svn_path}/include/subversion-1"
 
20
fi
 
21
 
 
22
for x in $test_paths ; do
 
23
    AC_MSG_CHECKING([for Subversion Includes in ${x}])
 
24
    if test -f ${x}/svn_version.h; then
 
25
        SVN_INCLUDES="-I$x"
 
26
        AC_MSG_RESULT([found it! Use --with-svn to specify another.])
 
27
        break
 
28
    else
 
29
        AC_MSG_RESULT(no)        
 
30
    fi
 
31
done
 
32
 
 
33
if test -z "$SVN_INCLUDES"; then
 
34
  ifelse([$2], , AC_MSG_ERROR([Subversion include files not found.]), $2)
 
35
fi
 
36
 
 
37
# Determine subversion lib directory
 
38
if test -z $svn_path; then
 
39
    test_paths="/usr/lib /usr/local/lib"
 
40
else
 
41
    test_paths="${svn_path}/lib"
 
42
fi
 
43
 
 
44
for x in $test_paths ; do
 
45
    svn_shlib="${x}/libsvn_repos-1${shrext_cmds}"
 
46
    AC_MSG_CHECKING([for Subversion library in ${x}])
 
47
    if test -f $svn_shlib; then
 
48
        AC_MSG_RESULT([yes])
 
49
        save_CFLAGS=$CFLAGS
 
50
        save_LDFLAGS=$LDFLAGS
 
51
        CFLAGS="$SVN_INCLUDES $CFLAGS"
 
52
        LDFLAGS="-L$x $LDFLAGS"
 
53
        AC_CHECK_LIB(svn_repos-1, svn_repos_open,
 
54
            SVN_LIBS="-R$x -L$x")
 
55
        dnl // TODO: Should we check for other libs here?
 
56
        CFLAGS=$save_CFLAGS
 
57
        LDFLAGS=$save_LDFLAGS
 
58
        break
 
59
    else
 
60
        AC_MSG_RESULT([no])
 
61
    fi
 
62
done
 
63
if test -z "$SVN_LIBS"; then
 
64
  ifelse([$2], , AC_MSG_ERROR([Subversion library not found.]), $2)
 
65
else
 
66
  AC_SUBST(SVN_LIBS)
 
67
  AC_SUBST(SVN_INCLUDES)
 
68
  ifelse([$1], , , $1)
 
69
fi
 
70
])