forked from sahlberg/fuse-nfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·72 lines (58 loc) · 2.06 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
AC_PREREQ(2.50)
AC_INIT([fuse-nfs], [1.0.0], [ronniesahlberg@gmail.com])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
# Work around stupid autoconf default cflags. pt 1
SAVE_CFLAGS="x${CFLAGS}"
AC_PROG_CC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
# Work around stupid autoconf default cflags. pt 2
if test "$SAVE_CFLAGS" = "x"; then
CFLAGS=""
fi
# We always want 64 bit file offsets
CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"
if test "$ac_cv_prog_gcc" = yes; then
WARN_CFLAGS="-Wall -Werror -Wshadow -Wno-write-strings -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing"
fi
AC_SUBST(WARN_CFLAGS)
AC_CONFIG_HEADER(config.h)
AC_HEADER_ASSERT
AC_CHECK_HEADER([fuse.h], [], [AC_MSG_ERROR([fuse.h is missing. You need to install libfuse-dev])], [])
AC_CHECK_HEADER([nfsc/libnfs.h], [], [AC_MSG_ERROR([libnfs.h is missing. You need to install libnfs-dev])], [])
AC_CHECK_HEADERS([fuse.h])
AC_CACHE_CHECK([for st_atim support],libiscsi_cv_HAVE_ST_ATIM,[
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>],
[struct stat st; st.st_atim.tv_sec = 0;],
libiscsi_cv_HAVE_ST_ATIM=yes,libiscsi_cv_HAVE_ST_ATIM=no)])
if test x"$libiscsi_cv_HAVE_ST_ATIM" = x"yes"; then
AC_DEFINE(HAVE_ST_ATIM,1,[Whether we have st_atim support])
fi
AC_SEARCH_LIBS([fuse_get_context], [fuse dokanfuse1.dll dokanfuse2.dll], [], [
AC_MSG_ERROR([fuse library unavailable])
])
AC_CHECK_FUNC(gethostbyname,[SOCKETS_AVAILABLE=1])
AS_IF([test "$SOCKETS_AVAILABLE" = ""],[
OLD_LIBS=$LIBS
LIBS+=" -lws2"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], [[gethostbyname ("");]])], [SOCKETS_AVAILABLE=1], [LIBS=$OLD_LIBS])
])
AS_IF([test "$SOCKETS_AVAILABLE" = ""],[
OLD_LIBS=$LIBS
LIBS+=" -lws2_32"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], [[gethostbyname ("");]])], [SOCKETS_AVAILABLE=1], [LIBS=$OLD_LIBS])
])
#output
AC_CONFIG_FILES([Makefile]
[doc/Makefile]
[fuse/Makefile]
)
AC_OUTPUT([fuse-nfs.pc])