File: configure.in

package info (click to toggle)
isync 0.9.2-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 580 kB
  • ctags: 184
  • sloc: ansic: 2,835; sh: 841; makefile: 68
file content (71 lines) | stat: -rw-r--r-- 1,654 bytes parent folder | download
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
AC_INIT(src/isync.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(isync, 0.9.2)

AM_MAINTAINER_MODE

AM_PROG_CC_STDC
if test "$GCC" = yes; then
    CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wmissing-prototypes"
fi

AC_CHECK_FUNCS(getopt_long)

AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, inet_ntoa)

ssl=false
AC_ARG_WITH(ssl,
  [  --with-ssl=DIR	yes/no/OpenSSL installation root [detect]],
  [ob_cv_with_ssl=$withval])
if test "x$ob_cv_with_ssl" != xno; then
    if test -d "$ob_cv_with_ssl/lib"; then
	CPFLAGS="$CPPFLAGS -I$ob_cv_with_ssl/include"
	LDFLAGS="$LDFLAGS -L$ob_cv_with_ssl/lib"
    fi
    AC_CHECK_LIB(crypto, ERR_error_string, [cryptolib=" -lcrypto"])
    AC_CHECK_LIB(ssl, SSL_library_init, [
	LIBS="-lssl$cryptolib $LIBS"
	AC_DEFINE(HAVE_LIBSSL, 1, [Define if you want SSL support])
	ssl=true
      ],[
	if test -n "$ob_cv_with_ssl"; then
	    AC_MSG_ERROR([can't find OpenSSL])
	fi
      ])
fi

AC_CACHE_CHECK(for dbm_open, ac_cv_dbmopen,
	[ac_cv_dbmopen=no
	AC_TRY_LINK([#include <ndbm.h>],
		[dbm_open(0,0,0);],[ac_cv_dbmopen=yes])])
if test $ac_cv_dbmopen = no; then
	AC_CACHE_CHECK([for dbm_open in -ldb], ac_cv_libdb,
		[save_LIBS="$LIBS"
		LIBS="$LIBS -ldb"
		ac_cv_libdb=no
		AC_TRY_LINK([#define DB_DBM_HSEARCH 1
#include <db.h>],
			[dbm_open(0,0,0);],
			[ac_cv_libdb=yes])
		LIBS="$save_LIBS"])

	if test $ac_cv_libdb = yes; then
		LIBS="$LIBS -ldb"
		AC_DEFINE(HAVE_LIBDB, 1, [Define if you have libdb])
	else
		AC_MSG_ERROR([Could not find dbm_open(), you must install libdb])
	fi
fi

AC_OUTPUT(Makefile src/Makefile isync.spec)

if $ssl; then
    AC_MSG_RESULT([
Using SSL
])
else
    AC_MSG_RESULT([
Not using SSL
])
fi