Commit | Line | Data |
---|---|---|
84004dbf | 1 | AC_PREREQ(2.50) |
9115b88c | 2 | AC_INIT([libnfs], [1.0.0]) |
6c437065 TN |
3 | AC_CONFIG_HEADERS([config.h]) |
4 | AM_INIT_AUTOMAKE([foreign]) | |
5 | AC_CANONICAL_HOST | |
84004dbf | 6 | |
6c437065 TN |
7 | # Work around stupid autoconf default cflags. pt 1 |
8 | SAVE_CFLAGS="x${CFLAGS}" | |
84004dbf | 9 | |
6c437065 TN |
10 | AC_PROG_CC |
11 | AC_PROG_LIBTOOL | |
84004dbf | 12 | |
6c437065 | 13 | AM_PROG_CC_C_O |
84004dbf | 14 | |
6c437065 TN |
15 | # Work around stupid autoconf default cflags. pt 2 |
16 | if test "$SAVE_CFLAGS" = "x"; then | |
17 | CFLAGS="" | |
84004dbf | 18 | fi |
e644e700 | 19 | |
6c437065 TN |
20 | AC_CHECK_PROG([HAVE_RPCGEN], [rpcgen], [yes], [no]) |
21 | if test x$HAVE_RPCGEN != xyes; then | |
22 | AC_MSG_ERROR([Can not find required program]) | |
d20a6d6b SR |
23 | fi |
24 | ||
6c437065 TN |
25 | #option: examples |
26 | AC_ARG_ENABLE([examples], | |
27 | [AC_HELP_STRING([--enable-examples], | |
28 | [Build example programs])], | |
29 | [ENABLE_EXAMPLES=$enableval], | |
30 | [ENABLE_EXAMPLES="no"]) | |
13283beb TN |
31 | |
32 | if test x$ENABLE_EXAMPLES = xyes; then | |
33 | MAYBE_EXAMPLES="examples" | |
34 | fi | |
6c437065 TN |
35 | AC_SUBST(MAYBE_EXAMPLES) |
36 | ||
fc4bdc22 RS |
37 | AC_ARG_ENABLE(tirpc, |
38 | [AC_HELP_STRING([--enable-tirpc], | |
39 | [enable use of TI-RPC @<:@default=no@:>@])], | |
40 | enable_tirpc=$enableval, | |
41 | enable_tirpc='no') | |
42 | ||
fc01d2a9 TN |
43 | case $host in |
44 | *darwin*) | |
45 | RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t" | |
46 | ;; | |
2b50be4e RS |
47 | *cygwin*) |
48 | RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t" | |
49 | ;; | |
fc01d2a9 TN |
50 | *solaris*) |
51 | AC_CHECK_HEADERS([sys/filio.h]) | |
647d2ea1 | 52 | AC_CHECK_HEADERS([sys/sockio.h]) |
4a75cfa2 TN |
53 | if test x$ENABLE_EXAMPLES = xyes; then |
54 | AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])]) | |
55 | AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])]) | |
56 | fi | |
fc01d2a9 TN |
57 | ;; |
58 | *) | |
59 | ;; | |
60 | esac | |
61 | ||
62 | AC_SUBST(RPCGENFLAGS) | |
63 | ||
f7f931c7 RS |
64 | # check for SA_LEN |
65 | dnl Check if sockaddr data structure includes a "sa_len" | |
66 | AC_CHECK_MEMBER([struct sockaddr.sa_len], | |
67 | [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ], | |
68 | [], | |
69 | [ | |
70 | #include <sys/types.h> | |
71 | #include <sys/socket.h> | |
72 | ]) | |
73 | ||
fc4bdc22 RS |
74 | echo "Use TI-RPC: $enable_tirpc" |
75 | if test "$enable_tirpc" = "yes"; then | |
76 | CFLAGS="${CFLAGS} -I /usr/include/tirpc" | |
77 | LDFLAGS="${LDFLAGS} -ltirpc" | |
78 | fi | |
79 | ||
6c437065 TN |
80 | #output |
81 | AC_CONFIG_FILES([Makefile] | |
82 | [include/Makefile] | |
83 | [lib/Makefile] | |
84 | [mount/Makefile] | |
85 | [nfs/Makefile] | |
86 | [portmap/Makefile] | |
87 | [rquota/Makefile] | |
88 | [examples/Makefile] | |
89 | ) | |
90 | ||
91 | AC_OUTPUT |