[go: up one dir, main page]

File: configure.in

package info (click to toggle)
smbnetfs 0.5.3a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,256 kB
  • sloc: ansic: 6,743; sh: 1,044; makefile: 30
file content (137 lines) | stat: -rw-r--r-- 3,591 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
AC_INIT([SMBNetFS],[0.5.3а])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([src/config.h])
AC_PROG_CC

AC_CHECK_FUNCS([setxattr])
AC_CHECK_FUNC(backtrace_symbols_fd,
    [AC_DEFINE([HAVE_BACKTRACE], [], [Linux])]
)
AC_CHECK_FUNC(strndup,
    [AC_DEFINE([HAVE_STRNDUP], [], [Linux])]
)
AC_CHECK_FUNC(setlocale, [found_setlocale=yes])
if test "x$found_setlocale" != "xyes" ; then
    AC_MSG_ERROR([*** No setlocale() implementation found in C library])
fi


export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
CFLAGS="$CFLAGS -Wall -W"
LDFLAGS="$LDFLAGS -rdynamic"


dnl ***********************
dnl *** Tests for iconv ***
dnl ***********************
AC_ARG_WITH(libiconv,
    [AS_HELP_STRING(--with-libiconv=@<:@no/gnu/native@:>@,
	use the libiconv library)],
    ,
    [with_libiconv=maybe])

found_iconv=no
case $with_libiconv in
    maybe)
	# Check in the C library first
	AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])

	# Check if we have GNU libiconv
	if test $found_iconv = "no"; then
	    AC_CHECK_LIB(iconv, libiconv_open, 
		[with_libiconv=gnu; found_iconv=yes])
	fi

	# Check if we have a iconv in -liconv, possibly from vendor
	if test $found_iconv = "no"; then
	    AC_CHECK_LIB(iconv, iconv_open, 
		[with_libiconv=native; found_iconv=yes])
	fi
	;;
    no)
	AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
        ;;
    gnu|yes)
	AC_CHECK_LIB(iconv, libiconv_open, 
	    [with_libiconv=gnu; found_iconv=yes])
	;;
    native)
	AC_CHECK_LIB(iconv, iconv_open, 
	    [with_libiconv=native; found_iconv=yes])
	;;
esac

if test "x$found_iconv" = "xno" ; then
    AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
fi

case $with_libiconv in
    gnu)
	AC_DEFINE(USE_LIBICONV_GNU, 1, [Using GNU libiconv])
	;;
    native)
	AC_DEFINE(USE_LIBICONV_NATIVE, 1, 
	    [Using a native implementation of iconv in a separate library])
	;;
esac


dnl **********************
dnl *** Tests for fuse ***
dnl **********************
PKG_CHECK_MODULES(FUSE, [fuse >= 2.6])
LIBS="$LIBS $FUSE_LIBS"
CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DFUSE_USE_VERSION=26 $FUSE_CFLAGS"


dnl *******************************
dnl *** Tests for gnome-keyring ***
dnl *******************************

AC_ARG_WITH(gnome-keyring,
	[AS_HELP_STRING(--with-gnome-keyring=@<:@no/yes@:>@,
		use gnome-keyring as password storage @<:@default=auto@:>@)],
	,
	[with_gnome_keyring=maybe])

if test x"$with_gnome_keyring" != xno; then
	PKG_CHECK_MODULES(GNOME_KEYRING, [gnome-keyring-1 >= 2.28],
		[AC_DEFINE([HAVE_GNOME_KEYRING], [],
			[use gnome-keyring as password storage])],
		[# mandatory depend
		if test x"$with_gnome_keyring" = xyes; then
			AC_MSG_ERROR([unable to find usable gnome-keyring])
		fi])
	LIBS="$LIBS $GNOME_KEYRING_LIBS"
	CFLAGS="$CFLAGS $GNOME_KEYRING_CFLAGS"
fi

dnl ******************************
dnl *** Tests for libsmbclient ***
dnl ******************************

#LIBS="/tmp/s/test/libsmbclient.a $FUSE_LIBS -lc -lcrypt -lresolv -lnsl -ldl"

AC_CHECK_LIB(smbclient, smbc_new_context, [], [
	echo "Error!!! libsmbclient >= 3.0.20 required."
	exit 1
])

AC_CHECK_LIB(smbclient, smbc_setOptionUserData, 
    [AC_DEFINE(HAVE_LIBSMBCLIENT_3_2, 1, [Using Samba-3.2 api])],
    [AC_CHECK_MEMBER(SMBCCTX.close_fn, [], 
	[echo "Error!!! libsmbclient >= 3.0.20 required."; exit 1],
	[#include <libsmbclient.h>]
    )]
)

dnl ******************
dnl *** Final step ***
dnl ******************

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

echo ""
echo "  Do not use old libsmbclient version, libsmbclient >= 3.2.0 is recommended."
echo ""