Update debian package to libnfs 1.9.6.
[deb_libnfs.git] / configure.ac
CommitLineData
84004dbf 1AC_PREREQ(2.50)
080d2311 2AC_INIT([libnfs], [1.9.6], [ronniesahlberg@gmail.com])
6c437065
TN
3AC_CONFIG_HEADERS([config.h])
4AM_INIT_AUTOMAKE([foreign])
5AC_CANONICAL_HOST
84004dbf 6
6c437065
TN
7# Work around stupid autoconf default cflags. pt 1
8SAVE_CFLAGS="x${CFLAGS}"
84004dbf 9
6c437065
TN
10AC_PROG_CC
11AC_PROG_LIBTOOL
84004dbf 12
6c437065 13AM_PROG_CC_C_O
6a14f02f 14PKG_PROG_PKG_CONFIG
84004dbf 15
6c437065
TN
16# Work around stupid autoconf default cflags. pt 2
17if test "$SAVE_CFLAGS" = "x"; then
18 CFLAGS=""
84004dbf 19fi
e644e700 20
71f48059
RS
21# We always want 64 bit file offsets
22CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"
23
6c437065
TN
24#option: examples
25AC_ARG_ENABLE([examples],
26 [AC_HELP_STRING([--enable-examples],
27 [Build example programs])],
28 [ENABLE_EXAMPLES=$enableval],
29 [ENABLE_EXAMPLES="no"])
13283beb 30
d70bb152 31# We need popt to compile the examples
13283beb 32if test x$ENABLE_EXAMPLES = xyes; then
d70bb152
RS
33AC_MSG_CHECKING(whether libpopt is available)
34ac_save_CFLAGS="$CFLAGS"
35ac_save_LIBS="$LIBS"
36CFLAGS="$CFLAGS $GLIB_CFLAGS"
37LIBS="$GLIB_LIBS $LIBS -lpopt"
38AC_TRY_RUN([
39/*
40 * Just see if we can compile/link with popt
41 */
42#include <popt.h>
43
44int main(int argc, const char *argv[])
45{
46 struct poptOption popt_options[] = {
47 POPT_TABLEEND
48 };
49 poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
50
51 return 0;
52}
53], ac_cv_have_popt=yes, ac_cv_have_popt=no,
54 [echo $ac_n "compile with POPT. Assuming OK... $ac_c"
55 ac_cv_have_popt=yes])
56CFLAGS="$ac_save_CFLAGS"
57LIBS="$ac_save_LIBS"
58if test "$ac_cv_have_popt" = yes ; then
59 AC_MSG_RESULT(yes)
13283beb 60 MAYBE_EXAMPLES="examples"
d70bb152
RS
61else
62 AC_MSG_RESULT(no)
63 AC_MSG_NOTICE(You need libpopt to compile the sample libnfs clients.)
64 AC_MSG_NOTICE(Only the library will be compiled and installed.)
65fi
13283beb 66fi
d70bb152 67
6c437065
TN
68AC_SUBST(MAYBE_EXAMPLES)
69
d70bb152 70
fc01d2a9 71case $host in
fc01d2a9
TN
72 *solaris*)
73 AC_CHECK_HEADERS([sys/filio.h])
647d2ea1 74 AC_CHECK_HEADERS([sys/sockio.h])
5fe97d10
RS
75 AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])])
76 AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])])
fc01d2a9
TN
77 ;;
78 *)
79 ;;
80esac
81
d7c6e9aa
RS
82# check for poll.h
83dnl Check for poll.h
84AC_CHECK_HEADERS([poll.h])
85
00748f36
RS
86# check for unistd.h
87dnl Check for unistd.h
88AC_CHECK_HEADERS([unistd.h])
89
bff8fe46
RS
90# check for netdb.h
91dnl Check for netdb.h
92AC_CHECK_HEADERS([netdb.h])
93
94# check for utime.h
95dnl Check for utime.h
96AC_CHECK_HEADERS([utime.h])
97
98# check for net/if.h
99dnl Check for net/if.h
100AC_CHECK_HEADERS([net/if.h])
101
23844203
RS
102# check for sys/time.h
103dnl Check for sys/time.h
104AC_CHECK_HEADERS([sys/time.h])
105
00748f36
RS
106# check for sys/ioctl.h
107dnl Check for sys/ioctl.h
108AC_CHECK_HEADERS([sys/ioctl.h])
109
108c622a
RS
110# check for sys/vfs.h
111dnl Check for sys/vfs.h
112AC_CHECK_HEADERS([sys/vfs.h])
113
114# check for sys/statvfs.h
115dnl Check for sys/statvfs.h
116AC_CHECK_HEADERS([sys/statvfs.h])
117
7057e733
RS
118# check for sys/socket.h
119dnl Check for sys/socket.h
120AC_CHECK_HEADERS([sys/socket.h])
121
1c8b4547
PL
122# check for netinet/tcp.h
123dnl Check for netinet/tcp.h
124AC_CHECK_HEADERS([netinet/tcp.h])
125
72897005
RS
126# check for netinet/in.h
127dnl Check for netinet/in.h
128AC_CHECK_HEADERS([netinet/in.h])
129
c022471e
RS
130# check for arpa/inet.h
131dnl Check for arpa/inet.h
132AC_CHECK_HEADERS([arpa/inet.h])
133
f7f931c7
RS
134# check for SA_LEN
135dnl Check if sockaddr data structure includes a "sa_len"
136AC_CHECK_MEMBER([struct sockaddr.sa_len],
137 [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ],
138 [],
139 [
140#include <sys/types.h>
141#include <sys/socket.h>
142])
143
d7c6e9aa
RS
144# check for sockaddr_storage
145dnl Check if sockaddr structure includes a "ss_family"
146AC_CHECK_MEMBER([struct sockaddr_storage.ss_family],
147 [ AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[Whether we have sockaddr_Storage]) ],
148 [],
149 [
150#include <sys/types.h>
151#include <sys/socket.h>
152])
153
fc08ac45
RL
154AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
155
156# check where makedev is defined
157AC_HEADER_MAJOR
158
6c437065
TN
159#output
160AC_CONFIG_FILES([Makefile]
ca3bb55c 161 [doc/Makefile]
6c437065
TN
162 [include/Makefile]
163 [lib/Makefile]
164 [mount/Makefile]
165 [nfs/Makefile]
6916a665 166 [nlm/Makefile]
ed09b567 167 [nsm/Makefile]
6c437065
TN
168 [portmap/Makefile]
169 [rquota/Makefile]
c7ddf2e5 170 [utils/Makefile]
6c437065
TN
171 [examples/Makefile]
172 )
173
ea545df9 174AC_OUTPUT([libnfs.pc])