forked from jgehring/rsvndump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
94 lines (78 loc) · 2.83 KB
/
configure.ac
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(rsvndump, 0.6, [email protected])
AM_INIT_AUTOMAKE()
AC_PREFIX_DEFAULT([/usr/local])
test $prefix = NONE && prefix=/usr/local
AC_CONFIG_HEADER([config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
sinclude(m4/find_apr.m4)
sinclude(m4/find_apu.m4)
sinclude(m4/find_svn.m4)
sinclude(m4/rsvndump_conf.m4)
# Optional features
USE_MAN="no"
AC_ARG_ENABLE(man, [ --enable-man generate the man page], USE_MAN="$enableval", USE_MAN="no")
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Turn on debugging])], [debug="$enableval"], [debug="no"])
AM_CONDITIONAL([DEBUG], [test "x$debug" = "xyes"])
if test "x$debug" = "xyes"; then
CXXFLAGS="${CXXFLAGS} -O0 -g -DDEBUG"
CFLAGS="${CFLAGS} -O0 -g -DDEBUG"
else
CXXFLAGS="-O2 ${CXXFLAGS} -DNDEBUG"
CFLAGS="-O2 ${CFLAGS} -DNDEBUG"
fi
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_RANLIB
if test "$USE_MAN" = "yes"; then
RSVN_CHECK_MAN_PROGS
fi
AM_GNU_GETTEXT([external])
# Checks for headers
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([fcntl.h locale.h])
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_FUNC_MALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strchr], ,[AC_MSG_ERROR([Sorry, unable to compile this program without these functions])])
AC_CHECK_FUNCS([memset], ,[AC_LIBOBJ([memset])])
AC_CHECK_FUNCS([memcmp], ,[AC_LIBOBJ([memcmp])])
AC_CHECK_FUNCS([strdup], ,[AC_LIBOBJ([strdup])])
AC_CHECK_FUNCS([setlocale], , USE_NLS="no")
AC_CHECK_FUNCS([atexit strtol gettimeofday])
# Checks for libraries
RSVND_FIND_APR
SCFLAGS="$CFLAGS"
SCPPFLAGS="$CPPFLAGS"
CFLAGS="$CFLAGS $APR_INCLUDES $APR_CFLAGS"
CPPFLAGS="$CPPFLAGS $APR_INCLUDES $APR_CPPFLAGS"
RSVND_FIND_SVN
CFLAGS="$SCFLAGS"
CPPFLAGS="$SCPPFLAGS"
AC_SUBST([APR_CPPFLAGS])
AC_SUBST([APR_CFLAGS])
# Checks for library functions.
AC_CHECK_LIB([svn_fs-1], [svn_fs_initialize], ,[AC_MSG_ERROR([Neccessary Subversion libraries are missing])], [-L$SVN_PREFIX/lib])
AC_CHECK_LIB([svn_client-1], [svn_client_open_ra_session], ,[AC_MSG_ERROR([Neccessary Subversion libraries are missing])], [-L$SVN_PREFIX/lib])
AC_CHECK_LIB([svn_ra-1], [svn_ra_initialize], ,[AC_MSG_ERROR([Neccessary Subversion libraries are missing])], [-L$SVN_PREFIX/lib])
AC_CHECK_LIB([svn_subr-1], [svn_auth_open], ,[AC_MSG_ERROR([Neccessary Subversion libraries are missing])], [-L$SVN_PREFIX/lib])
AC_CHECK_LIB([svn_delta-1], [svn_txdelta_apply], ,[AC_MSG_ERROR([Neccessary Subversion libraries are missing])], [-L$SVN_PREFIX/lib])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([lib/Makefile])
AC_CONFIG_FILES([src/Makefile po/Makefile.in])
if test "$USE_MAN" = "yes"; then
DOC_SUBDIRS="doc"
AC_SUBST([DOC_SUBDIRS])
AC_CONFIG_FILES([doc/Makefile])
fi
AC_OUTPUT