]> arthur.barton.de Git - netatalk.git/blob - configure.in
Fix DDP support so --enable-ddp and --disable-ddp work as expected.
[netatalk.git] / configure.in
1 dnl configure.in for netatalk
2
3 AC_INIT(bin/adv1tov2/adv1tov2.c)
4
5 NETATALK_VERSION=`cat VERSION`
6 AC_SUBST(NETATALK_VERSION)
7
8 AC_CANONICAL_SYSTEM
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 AM_CONFIG_HEADER(config.h)
11
12 dnl Reset locations to proper places
13 AC_PREFIX_DEFAULT(/usr)
14
15 dnl Checks for programs.
16 AC_PROG_AWK
17 AC_PROG_CC
18 AC_PROG_INSTALL
19 AC_PROG_LN_S
20 AC_PROG_MAKE_SET
21 AC_PROG_LIBTOOL
22
23 dnl *********************************************************************
24 dnl FIXME! FIXME! These should be selectable properly, and should produce
25 dnl the proper flags and defines...
26 dnl *********************************************************************
27
28 dnl Checks for libraries.
29 dnl Replace `main' with a function in -labs:
30 AC_CHECK_LIB(abs, main)
31 dnl Replace `main' with a function in -laudit:
32 AC_CHECK_LIB(audit, main)
33 dnl Replace `main' with a function in -lauth:
34 AC_CHECK_LIB(auth, main)
35 dnl Replace `main' with a function in -lcmd:
36 AC_CHECK_LIB(cmd, main)
37 dnl Replace `main' with a function in -lcom_err:
38 AC_CHECK_LIB(com_err, main)
39 dnl Replace `main' with a function in -lcrypt:
40 AC_CHECK_LIB(crypt, main)
41 dnl Replace `main' with a function in -lcrypto:
42 AC_CHECK_LIB(crypto, main)
43 dnl Replace `main' with a function in -ld:
44 AC_CHECK_LIB(d, main)
45 dnl Replace `main' with a function in -ldb:
46 AC_CHECK_LIB(db, main)
47 dnl Replace `main' with a function in -ldes:
48 AC_CHECK_LIB(des, main)
49 dnl Replace `main' with a function in -ldl:
50 AC_CHECK_LIB(dl, main)
51 dnl Replace `main' with a function in -lkauth:
52 AC_CHECK_LIB(kauth, main)
53 dnl Replace `main' with a function in -lkrb:
54 AC_CHECK_LIB(krb, main)
55 dnl Replace `main' with a function in -llwp:
56 AC_CHECK_LIB(lwp, main)
57 dnl Replace `main' with a function in -ln:
58 AC_CHECK_LIB(n, main)
59 dnl Replace `main' with a function in -lnsl:
60 AC_CHECK_LIB(nsl, main)
61 dnl Replace `main' with a function in -lprot:
62 AC_CHECK_LIB(prot, main)
63 dnl Replace `main' with a function in -lresolv:
64 AC_CHECK_LIB(resolv, main)
65 dnl Replace `main' with a function in -lrpcsvc:
66 AC_CHECK_LIB(rpcsvc, main)
67 dnl Replace `main' with a function in -lrx:
68 AC_CHECK_LIB(rx, main)
69 dnl Replace `main' with a function in -lrxkad:
70 AC_CHECK_LIB(rxkad, main)
71 dnl Replace `main' with a function in -lsocket:
72 AC_CHECK_LIB(socket, main)
73 dnl Replace `main' with a function in -lsys:
74 AC_CHECK_LIB(sys, main)
75 dnl Replace `main' with a function in -lubik:
76 AC_CHECK_LIB(ubik, main)
77
78 dnl Checks for header files.
79 AC_HEADER_DIRENT
80 AC_HEADER_STDC
81 AC_HEADER_SYS_WAIT
82 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
83
84 dnl Checks for typedefs, structures, and compiler characteristics.
85 AC_C_CONST
86 AC_TYPE_UID_T
87 AC_C_INLINE
88 AC_TYPE_MODE_T
89 AC_TYPE_OFF_T
90 AC_TYPE_PID_T
91 AC_TYPE_SIZE_T
92 AC_STRUCT_ST_RDEV
93 AC_HEADER_TIME
94 AC_STRUCT_TM
95
96 dnl Checks for library functions.
97 AC_TYPE_GETGROUPS
98 AC_PROG_GCC_TRADITIONAL
99 AC_FUNC_MEMCMP
100 AC_HEADER_MAJOR
101 AC_FUNC_MMAP
102 AC_TYPE_SIGNAL
103 AC_FUNC_UTIME_NULL
104 AC_FUNC_WAIT3
105 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul)
106
107 dnl --------------------------------------------------------------------------
108 dnl specific configuration comes in here:
109 dnl --------------------------------------------------------------------------
110
111 AC_ARG_WITH(admin-group,
112         [  --with-admin-group=grp  enable and set administrative group],
113         admin_grp="$withval"
114         AC_DEFINE_UNQUOTED(ADMIN_GRP, "$admin_grp")
115         AC_MSG_RESULT([enabling administrative group "$admin_grp"]),
116 )
117
118 AC_ARG_WITH(auth-printing-dir,
119         [  --with-auth-printing-dir=path
120               path to authenticated printing directory],
121                 cap_dir="$withval"
122                 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
123                 AC_DEFINE(USE_CAP)
124                 AC_MSG_RESULT([enabling authenticated printing support]),
125 )
126
127 AC_ARG_WITH(config-dir,
128         [  --with-config-dir=path  path to config files [default=/etc/atalk]],
129                 config_dir="$withval",
130                 config_dir="/etc/atalk"
131 )
132 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
133         [path to config dir [default=/etc/atalk]])
134 CONFIG_DIR="$config_dir"
135 AC_SUBST(CONFIG_DIR)
136 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR]),
137
138 AC_ARG_WITH(cracklib,
139         [  --with-cracklib=dict    enable/set location of cracklib dictionary],
140         cracklib="$withval"
141         AC_CHECK_LIB(crack, main,
142                 AC_DEFINE(USE_CRACKLIB) 
143                 LIBS="$LIBS -lcrack"
144                 AC_MSG_RESULT([enabling cracklib support])
145                 if test "$cracklib" = "yes"; then
146                         cracklib="/usr/lib/cracklib_dict"
147                 fi
148                 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
149                         [path to cracklib dictionary])
150                 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
151                 AC_MSG_ERROR([cracklib not found!])
152         )
153 )
154
155 AC_ARG_ENABLE(ddp,
156         [  --disable-ddp           disable DDP],
157         if test "$enableval" = "no"; then 
158                 AC_DEFINE(NO_DDP, 1)
159                 AC_MSG_RESULT([disabling DDP])
160         fi
161 )
162
163 AC_ARG_ENABLE(debug,
164         [  --enable-debug          enable debug code],
165         AC_DEFINE(DEBUG, 1)
166         AC_MSG_RESULT([enabling debugging code]),
167         AC_DEFINE(DEBUG, 0)
168 )
169
170 msg_dir=""
171 AC_ARG_WITH(message-dir,
172         [  --with-msg-dir=path     path to message files [default=/etc/atalk/msg]],
173                 msg_dir="$withval"
174                 if test x"$msg_dir" = "x"; then
175                         msg_dir="$CONFIG_DIR/msg"
176                 fi
177                 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
178                         [path to message dir [default=$CONFIG_DIR/msg]])
179                 SERVERTEXT="$msg_dir"
180                 AC_SUBST(SERVERTEXT)
181 )
182
183 AC_ARG_WITH(pam,
184         [  --with-pam              enable password authentication modules support],
185         AC_CHECK_LIB(pam, main,
186                 AC_DEFINE(USE_PAM)
187                 LIBS="$LIBS -lpam"
188                 AC_MSG_RESULT([enabling pam modules support])
189         )
190 )
191
192 AC_ARG_WITH(shadow,
193         [  --with-shadow           enable shadow password support],
194         AC_MSG_RESULT([enabling shadow password support])
195         AC_DEFINE(SHADOWPW)
196 )
197
198 AC_ARG_WITH(flock-locks,
199         [  --with-flock-locks      enable flock locks support],
200         AC_MSG_RESULT([enabling flock locks])
201         AC_DEFINE(USE_FLOCK_LOCKS)
202 )
203
204 AC_ARG_WITH(tcp-wrappers,
205         [  --with-tcp-wrappers     enable TCP wrappers support],
206         AC_CHECK_LIB(wrap, main,
207                 AC_DEFINE(TCPWRAP)
208                 LIBS="$LIBS -lwrap"
209                 AC_MSG_RESULT([enabling TCP wrappers support])
210         )
211 )
212
213 AC_ARG_WITH(uams-path,
214         [  --with-uams-path=path   path to UAMs [default=/etc/atalk/uams]],
215         uams_path="$withval",
216         uams_path="/etc/atalk/uams"
217 )
218 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
219         [path to UAMs [default=/etc/atalk/uams]])
220 UAMS_PATH="$uams_path"
221 AC_SUBST(UAMS_PATH)
222
223 dnl --------------------------------------------------------------------------
224 dnl drop in includes for top level directory structures here...
225 dnl --------------------------------------------------------------------------
226 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
227 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
228 AC_SUBST(LIBS)
229 AC_SUBST(CFLAGS)
230
231 dnl --------------------------------------------------------------------------
232 dnl specific configuration comes in here:
233 dnl --------------------------------------------------------------------------
234
235 dnl --------------------- determine operating system from "target"
236 case "$target" in
237 *linux*)   this_os=linux ;;
238 *solaris*) this_os=solaris ;;
239 esac
240
241 dnl --------------------- conditional libraries, etc from "target"
242
243 dnl List of Makefiles to generate
244
245 AC_OUTPUT([Makefile
246         bin/Makefile
247         bin/adv1tov2/Makefile
248         bin/aecho/Makefile
249         bin/afile/Makefile
250         bin/afppasswd/Makefile
251         bin/getzones/Makefile
252         bin/megatron/Makefile
253         bin/nbp/Makefile
254         bin/pap/Makefile
255         bin/psorder/Makefile
256         config/Makefile
257         contrib/Makefile
258         contrib/nu/Makefile
259         contrib/printing/Makefile
260         contrib/shell_utils/Makefile
261         contrib/timelord/Makefile
262         distrib/Makefile
263         distrib/config/Makefile
264         distrib/config/netatalk-config
265         distrib/initscripts/Makefile
266         distrib/initscripts/rc.atalk.redhat
267         distrib/m4/Makefile
268         etc/Makefile
269         etc/afpd/Makefile
270         etc/afpd/nls/Makefile
271         etc/atalkd/Makefile
272         etc/uams/Makefile
273         etc/papd/Makefile
274         etc/psf/Makefile
275         include/Makefile
276         include/atalk/Makefile
277         libatalk/Makefile
278         libatalk/adouble/Makefile
279         libatalk/asp/Makefile
280         libatalk/atp/Makefile
281         libatalk/compat/Makefile
282         libatalk/dsi/Makefile
283         libatalk/nbp/Makefile
284         libatalk/netddp/Makefile
285         libatalk/util/Makefile
286         man/Makefile
287         man/man1/Makefile
288         man/man3/Makefile
289         man/man4/Makefile
290         man/man8/Makefile
291         sys/Makefile
292         sys/netatalk/Makefile
293         ],
294         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
295 )
296