]> arthur.barton.de Git - netatalk.git/blob - macros/netatalk.m4
Add tracker_miner_manager and try to manually index new files
[netatalk.git] / macros / netatalk.m4
1 dnl Kitchen sink for configuration macros
2
3 dnl Whether to enable developer build
4 AC_DEFUN([AC_DEVELOPER], [
5     AC_MSG_CHECKING([whether to enable developer build])
6     AC_ARG_ENABLE(
7         developer,
8         AS_HELP_STRING([--enable-developer], [whether to enable developer build (ABI checking)]),
9         enable_dev=$enableval,
10         enable_dev=no
11     )
12     AC_MSG_RESULT([$enable_dev])
13     AM_CONDITIONAL(DEVELOPER, test x"$enable_dev" = x"yes")
14 ])
15
16 dnl Tracker, for Spotlight
17 AC_DEFUN([AC_NETATALK_SPOTLIGHT], [
18     ac_cv_tracker_pkg_default=tracker-sparql-0.12
19     AC_ARG_WITH([tracker-pkg-config],
20         [AS_HELP_STRING([--with-tracker-pkg-config],[name of the Tracker SPARQL pkg in pkg-config])],
21         [ac_cv_tracker_pkg=$withval],
22         [ac_cv_tracker_pkg=$ac_cv_tracker_pkg_default])
23
24     AC_MSG_NOTICE([searching for $ac_cv_tracker_pkg])
25
26     PKG_CHECK_MODULES([TRACKER], [$ac_cv_tracker_pkg >= 0.12], [ac_cv_have_tracker=yes], [ac_cv_have_tracker=no])
27
28     if test x"$ac_cv_have_tracker" = x"no" ; then
29         if test x"$need_tracker" = x"yes" ; then
30             AC_MSG_ERROR([$ac_cv_tracker_pkg not found])
31         fi
32     else
33         AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker library is available])
34         fi
35
36     AC_SUBST(TRACKER_CFLAGS)
37     AC_SUBST(TRACKER_LIBS)
38     AM_CONDITIONAL(HAVE_TRACKER, [test x"$ac_cv_have_tracker" = x"yes"])
39
40     ac_cv_tracker_miner_pkg_default=tracker-miner-0.12
41     AC_ARG_WITH([tracker-miner-pkg-config],
42         [AS_HELP_STRING([--with-tracker-miner-pkg-config],[name of the Tracker miner pkg in pkg-config])],
43         [ac_cv_tracker_miner_pkg=$withval],
44         [ac_cv_tracker_miner_pkg=$ac_cv_tracker_miner_pkg_default])
45
46     AC_MSG_NOTICE([searching for $ac_cv_tracker_miner_pkg])
47
48     PKG_CHECK_MODULES([TRACKER_MINER], [$ac_cv_tracker_miner_pkg >= 0.12], [ac_cv_have_tracker_miner=yes], [ac_cv_have_tracker_miner=no])
49
50     if test x"$ac_cv_have_tracker_miner" = x"yes" ; then
51         AC_DEFINE(HAVE_TRACKER_MINER, 1, [Define if Tracker miner library is available])
52         AC_SUBST(TRACKER_MINER_CFLAGS)
53         AC_SUBST(TRACKER_MINER_LIBS)
54         fi
55 ])
56
57 dnl Whether to disable bundled libevent
58 AC_DEFUN([AC_NETATALK_LIBEVENT], [
59     AC_MSG_CHECKING([whether to disable bundled libevent (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)])
60     AC_ARG_ENABLE(
61         bundled-libevent,
62         [AS_HELP_STRING([--disable-bundled-libevent],[whether the bundled version of libevent shall not be used (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)
63         ])],
64         use_bundled_libevent=$enableval,
65         use_bundled_libevent=yes
66     )
67
68     if test x"$use_bundled_libevent" = x"yes" ; then
69         AC_MSG_RESULT([no])
70         AC_CONFIG_SUBDIRS([libevent])
71     else
72         AC_MSG_RESULT([yes])
73     fi
74     AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
75 ])
76
77 dnl Filesystem Hierarchy Standard (FHS) compatibility
78 AC_DEFUN([AC_NETATALK_FHS], [
79 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
80 AC_ARG_ENABLE(fhs,
81         [  --enable-fhs            use Filesystem Hierarchy Standard (FHS) compatibility],[
82         if test "$enableval" = "yes"; then
83                 bindir="/bin"
84                 sbindir="/sbin"
85                 sysconfdir="/etc"
86                 libdir="/lib"
87                 localstatedir="/var"
88                 mandir="/usr/share/man"
89                 uams_path="${libdir}/netatalk"
90                 PKGCONFDIR="${sysconfdir}"
91                 SERVERTEXT="${localstatedir}/netatalk/msg"
92                 use_pam_so=yes
93                 AC_DEFINE(FHS_COMPATIBILITY, 1, [Define if you want compatibily with the FHS])
94                 AC_MSG_RESULT([yes])
95         else
96                 AC_MSG_RESULT([no])
97         fi
98         ],[
99                 AC_MSG_RESULT([no])
100         ]
101 )])
102
103 dnl 64bit platform check
104 AC_DEFUN([AC_NETATALK_64BIT_LIBS], [
105 AC_MSG_CHECKING([whether to check for 64bit libraries])
106 # Test if the compiler is in 64bit mode
107 echo 'int i;' > conftest.$ac_ext
108 atalk_cv_cc_64bit_output=no
109 if AC_TRY_EVAL(ac_compile); then
110     case `/usr/bin/file conftest.$ac_objext` in
111     *"ELF 64"*)
112       atalk_cv_cc_64bit_output=yes
113       ;;
114     esac
115 fi
116 rm -rf conftest*
117
118 case $host_cpu:$atalk_cv_cc_64bit_output in
119 powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes)
120     case $target_os in
121     solaris2*)
122         AC_MSG_RESULT([yes])
123         atalk_libname="lib/64"
124         ;;
125     *bsd* | dragonfly*)
126         AC_MSG_RESULT([no])
127         atalk_libname="lib"
128         ;;
129     *)
130         AC_MSG_RESULT([yes])
131         atalk_libname="lib64"
132         ;;
133     esac
134     ;;
135 *:*)
136     AC_MSG_RESULT([no])
137     atalk_libname="lib"
138     ;;
139 esac
140 ])
141
142 dnl Check for optional admin group support
143 AC_DEFUN([AC_NETATALK_ADMIN_GROUP], [
144     netatalk_cv_admin_group=yes
145     AC_MSG_CHECKING([for administrative group support])
146     AC_ARG_ENABLE(admin-group,
147             [  --disable-admin-group   disable admin group],[
148             if test x"$enableval" = x"no"; then
149                          AC_DEFINE(ADMIN_GRP, 0, [Define if the admin group should be enabled])
150                          netatalk_cv_admin_group=no
151                          AC_MSG_RESULT([no])
152                 else
153                          AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
154                          AC_MSG_RESULT([yes])
155             fi],[
156                 AC_DEFINE(ADMIN_GRP, 1, [Define if the admin group should be enabled])
157                 AC_MSG_RESULT([yes])
158         ])
159 ])
160
161 dnl Check for optional cracklib support
162 AC_DEFUN([AC_NETATALK_CRACKLIB], [
163 netatalk_cv_with_cracklib=no
164 AC_ARG_WITH(cracklib,
165         [  --with-cracklib[[=DICT]]  enable/set location of cracklib dictionary [[no]]],[
166         if test "x$withval" != "xno" ; then
167                 cracklib="$withval"
168                 AC_CHECK_LIB(crack, main, [
169                         AC_DEFINE(USE_CRACKLIB, 1, [Define if cracklib should be used])
170                         LIBS="$LIBS -lcrack"
171                         if test "$cracklib" = "yes"; then
172                                 cracklib="/usr/$atalk_libname/cracklib_dict"
173                         fi
174                         AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
175                                 [path to cracklib dictionary])
176                         AC_MSG_RESULT([setting cracklib dictionary to $cracklib])
177                         netatalk_cv_with_cracklib=yes
178                         ],[
179                         AC_MSG_ERROR([cracklib not found!])
180                         ]
181                 )
182         fi
183         ]
184 )
185 AC_MSG_CHECKING([for cracklib support])
186 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
187 ])
188
189 dnl Check whether to enable debug code
190 AC_DEFUN([AC_NETATALK_DEBUG], [
191 AC_MSG_CHECKING([whether to enable verbose debug code])
192 AC_ARG_ENABLE(debug,
193         [  --enable-debug          enable verbose debug code],[
194         if test "$enableval" != "no"; then
195                 if test "$enableval" = "yes"; then
196                         AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
197                 else
198                         AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
199                 fi 
200                 AC_MSG_RESULT([yes])
201         else
202                 AC_MSG_RESULT([no])
203         AC_DEFINE(NDEBUG, 1, [Disable assertions])
204         fi
205         ],[
206                 AC_MSG_RESULT([no])
207         AC_DEFINE(NDEBUG, 1, [Disable assertions])
208         ]
209 )
210 ])
211
212 dnl Check whethe to disable tickle SIGALARM stuff, which eases debugging
213 AC_DEFUN([AC_NETATALK_DEBUGGING], [
214 AC_MSG_CHECKING([whether to enable debugging with debuggers])
215 AC_ARG_ENABLE(debugging,
216         [  --enable-debugging      disable SIGALRM timers and DSI tickles (eg for debugging with gdb/dbx/...)],[
217         if test "$enableval" != "no"; then
218                 if test "$enableval" = "yes"; then
219                         AC_DEFINE(DEBUGGING, 1, [Define if you want to disable SIGALRM timers and DSI tickles])
220                 else
221                         AC_DEFINE_UNQUOTED(DEBUGGING, $enableval, [Define if you want to disable SIGALRM timers and DSI tickles])
222                 fi 
223                 AC_MSG_RESULT([yes])
224         else
225                 AC_MSG_RESULT([no])
226         fi
227         ],[
228                 AC_MSG_RESULT([no])
229         ]
230 )
231
232 ])
233
234 dnl Check for optional shadow password support
235 AC_DEFUN([AC_NETATALK_SHADOW], [
236 netatalk_cv_use_shadowpw=no
237 AC_ARG_WITH(shadow,
238         [  --with-shadow           enable shadow password support [[auto]]],
239         [netatalk_cv_use_shadowpw="$withval"],
240         [netatalk_cv_use_shadowpw=auto]
241 )
242
243 if test "x$netatalk_cv_use_shadowpw" != "xno"; then
244     AC_CHECK_HEADER([shadow.h])
245     if test x"$ac_cv_header_shadow_h" = x"yes"; then
246         netatalk_cv_use_shadowpw=yes
247         AC_DEFINE(SHADOWPW, 1, [Define if shadow passwords should be used])
248     else 
249       if test "x$shadowpw" = "xyes"; then
250         AC_MSG_ERROR([shadow support not available])
251       else
252         netatalk_cv_use_shadowpw=no
253       fi
254     fi 
255 fi
256
257 AC_MSG_CHECKING([whether shadow support should be enabled])
258 if test "x$netatalk_cv_use_shadowpw" = "xyes"; then
259         AC_MSG_RESULT([yes])
260 else
261         AC_MSG_RESULT([no])
262 fi
263 ])
264
265 dnl Check for optional valid-shell-check support
266 AC_DEFUN([AC_NETATALK_SHELL_CHECK], [
267 netatalk_cv_use_shellcheck=yes
268 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
269 AC_ARG_ENABLE(shell-check,
270         [  --disable-shell-check   disable checking for a valid shell],[
271         if test "$enableval" = "no"; then 
272                 AC_DEFINE(DISABLE_SHELLCHECK, 1, [Define if shell check should be disabled])
273                 AC_MSG_RESULT([no])
274                 netatalk_cv_use_shellcheck=no
275         else
276                 AC_MSG_RESULT([yes])
277         fi
278         ],[
279                 AC_MSG_RESULT([yes])
280         ]
281 )
282 ])
283
284 dnl Check for optional sysv initscript install
285 AC_DEFUN([AC_NETATALK_INIT_STYLE], [
286     AC_ARG_WITH(init-style,
287                 [  --with-init-style       use OS specific init config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|solaris|systemd]]],
288                 init_style="$withval", init_style=none
289     )
290     case "$init_style" in 
291     "redhat")
292             AC_MSG_ERROR([--with-init-style=redhat is obsoleted. Use redhat-sysv or redhat-systemd.])
293         ;;
294     "redhat-sysv")
295             AC_MSG_RESULT([enabling redhat-style sysv initscript support])
296             ;;
297     "redhat-systemd")
298             AC_MSG_RESULT([enabling redhat-style systemd support])
299             ;;
300     "suse")
301             AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
302         ;;
303     "suse-sysv")
304             AC_MSG_RESULT([enabling suse-style sysv initscript support])
305             ;;
306     "suse-systemd")
307             AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
308             ;;
309     "gentoo")
310             AC_MSG_RESULT([enabling gentoo-style initscript support])
311         ;;
312     "netbsd")
313             AC_MSG_RESULT([enabling netbsd-style initscript support])
314         ;;
315     "debian")
316             AC_MSG_RESULT([enabling debian-style initscript support])
317         ;;
318     "solaris")
319             AC_MSG_RESULT([enabling solaris-style SMF support])
320         ;;
321     "systemd")
322             AC_MSG_RESULT([enabling general systemd support])
323         ;;
324     "none")
325             AC_MSG_RESULT([disabling init-style support])
326         ;;
327     *)
328             AC_MSG_ERROR([illegal init-style])
329         ;;
330     esac
331     AM_CONDITIONAL(USE_NETBSD, test x$init_style = xnetbsd)
332     AM_CONDITIONAL(USE_REDHAT_SYSV, test x$init_style = xredhat-sysv)
333     AM_CONDITIONAL(USE_SUSE_SYSV, test x$init_style = xsuse-sysv)
334     AM_CONDITIONAL(USE_SOLARIS, test x$init_style = xsolaris)
335     AM_CONDITIONAL(USE_GENTOO, test x$init_style = xgentoo)
336     AM_CONDITIONAL(USE_DEBIAN, test x$init_style = xdebian)
337     AM_CONDITIONAL(USE_SYSTEMD, test x$init_style = xsystemd || test x$init_style = xredhat-systemd || test x$init_style = xsuse-systemd)
338     AM_CONDITIONAL(USE_UNDEF, test x$init_style = xnone)
339
340 ])
341
342 dnl OS specific configuration
343 AC_DEFUN([AC_NETATALK_OS_SPECIFIC], [
344 case "$host_os" in
345         *aix*)                          this_os=aix ;;
346         *freebsd*)                      this_os=freebsd ;;
347         *hpux11*)                       this_os=hpux11 ;;
348         *irix*)                         this_os=irix ;;
349         *linux*)                        this_os=linux ;;
350         *osx*)                          this_os=macosx ;;
351         *darwin*)                       this_os=macosx ;;
352         *netbsd*)                       this_os=netbsd ;;
353         *openbsd*)                      this_os=openbsd ;;
354         *osf*)                          this_os=tru64 ;;
355         *solaris*)                      this_os=solaris ;;
356 esac
357
358 case "$host_cpu" in
359         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
360         alpha)                                          this_cpu=alpha ;;
361         mips)                                           this_cpu=mips ;;
362         powerpc|ppc)                            this_cpu=ppc ;;
363 esac
364
365 dnl --------------------- GNU source
366 case "$this_os" in
367         linux)  AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
368         ;;
369      kfreebsd-gnu) AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
370         ;;
371 esac
372
373 dnl --------------------- operating system specific flags (port from sys/*)
374
375 dnl ----- FreeBSD specific -----
376 if test x"$this_os" = "xfreebsd"; then 
377         AC_MSG_RESULT([ * FreeBSD specific configuration])
378         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
379         AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
380     AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
381 fi
382
383 dnl ----- GNU/kFreeBSD specific -----
384 if test x"$this_os" = "xkfreebsd-gnu"; then 
385         AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration])
386         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
387         AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD])
388     AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
389 fi
390
391 dnl ----- Linux specific -----
392 if test x"$this_os" = "xlinux"; then 
393         AC_MSG_RESULT([ * Linux specific configuration])
394         
395         dnl ----- check if we need the quotactl wrapper
396     AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
397                 [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
398                 AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
399         )
400
401
402         dnl ----- as far as I can tell, dbtob always does the wrong thing
403         dnl ----- on every single version of linux I've ever played with.
404         dnl ----- see etc/afpd/quota.c
405         AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken])
406
407         need_dash_r=no
408 fi
409
410 dnl ----- NetBSD specific -----
411 if test x"$this_os" = "xnetbsd"; then 
412         AC_MSG_RESULT([ * NetBSD specific configuration])
413         AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
414         AC_DEFINE(NETBSD, 1, [Define if OS is NetBSD])
415     AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EFTYPE, errno returned by open with O_NOFOLLOW)
416
417         CFLAGS="-I\$(top_srcdir)/sys/netbsd $CFLAGS"
418         need_dash_r=yes 
419
420         dnl ----- NetBSD does not have crypt.h, uses unistd.h -----
421         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
422 fi
423
424 dnl ----- OpenBSD specific -----
425 if test x"$this_os" = "xopenbsd"; then 
426         AC_MSG_RESULT([ * OpenBSD specific configuration])
427     AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro])
428         dnl ----- OpenBSD does not have crypt.h, uses unistd.h -----
429         AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
430 fi
431
432 dnl ----- Solaris specific -----
433 if test x"$this_os" = "xsolaris"; then 
434         AC_MSG_RESULT([ * Solaris specific configuration])
435         AC_DEFINE(__svr4__, 1, [Solaris compatibility macro])
436         AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
437         AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
438         AC_DEFINE(SOLARIS, 1, [Solaris compatibility macro])
439     AC_DEFINE(_XOPEN_SOURCE, 600, [Solaris compilation environment])
440     AC_DEFINE(__EXTENSIONS__,  1, [Solaris compilation environment])
441         CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
442         need_dash_r=yes
443         init_style=solaris
444
445         solaris_module=no
446         AC_MSG_CHECKING([if we can build Solaris kernel module])
447         if test -x /usr/ccs/bin/ld && test x"$netatalk_cv_ddp_enabled" = x"yes" ; then
448                 solaris_module=yes
449         fi
450         AC_MSG_RESULT([$solaris_module])
451
452         COMPILE_64BIT_KMODULE=no
453         KCFLAGS=""
454         KLDFLAGS=""
455         COMPILE_KERNEL_GCC=no
456
457         if test "$solaris_module" = "yes"; then
458            dnl Solaris kernel module stuff
459            AC_MSG_CHECKING([if we have to build a 64bit kernel module])
460
461            # check for isainfo, if not found it has to be a 32 bit kernel (<=2.6)       
462            if test -x /usr/bin/isainfo; then
463                 # check for 64 bit platform
464                 if isainfo -kv | grep '^64-bit'; then
465                         COMPILE_64BIT_KMODULE=yes
466                 fi
467            fi
468
469            AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
470
471            if test "${GCC}" = yes; then
472                 COMPILE_KERNEL_GCC=yes
473                 if test "$COMPILE_64BIT_KMODULE" = yes; then
474                 
475                         AC_MSG_CHECKING([if we can build a 64bit kernel module])
476                         
477                         case `$CC --version 2>/dev/null` in
478                         [[12]].* | 3.0.*)
479                                 COMPILE_64BIT_KMODULE=no
480                                 COMPILE_KERNEL_GCC=no   
481                                 solaris_module=no;;
482                         *)
483                                 # use for 64 bit
484                                 KCFLAGS="-m64"
485                                 #KLDFLAGS="-melf64_sparc"
486                                 KLDFLAGS="-64";;
487                         esac    
488                         
489                         AC_MSG_RESULT([$COMPILE_64BIT_KMODULE])
490                         
491                 else
492                         KCFLAGS=""
493                         KLDFLAGS=""
494                 fi
495                 KCFLAGS="$KCFLAGS -D_KERNEL -Wall -Wstrict-prototypes"
496            else
497                 if test "$COMPILE_64BIT_KMODULE" = yes; then
498                 # use Sun CC (for a 64-bit kernel, uncomment " -xarch=v9 -xregs=no%appl ")
499                         KCFLAGS="-xarch=v9 -xregs=no%appl"
500                         KLDFLAGS="-64"
501                 else
502                         KCFLAGS=""
503                         KLDFLAGS=""
504                 fi
505                 KCFLAGS="-D_KERNEL $KCFLAGS -mno-app-regs -munaligned-doubles -fpcc-struct-return"
506            fi
507
508            AC_CACHE_CHECK([for timeout_id_t],netatalk_cv_HAVE_TIMEOUT_ID_T,[
509            AC_LINK_IFELSE([AC_LANG_PROGRAM([[\
510 #include <sys/stream.h>
511 #include <sys/ddi.h>]], [[\
512 timeout_id_t dummy;
513 ]])],[netatalk_cv_HAVE_TIMEOUT_ID_T=yes],[netatalk_cv_HAVE_TIMEOUT_ID_T=no])])
514
515            AC_DEFINE(HAVE_TIMEOUT_ID_T, test x"$netatalk_cv_HAVE_TIMEOUT_ID" = x"yes", [define for timeout_id_t])
516         fi
517
518         AC_SUBST(COMPILE_KERNEL_GCC)
519         AC_SUBST(COMPILE_64BIT_KMODULE)
520         AC_SUBST(KCFLAGS)
521         AC_SUBST(KLDFLAGS)
522 fi
523
524 dnl Whether to run ldconfig after installing libraries
525 AC_PATH_PROG(NETA_LDCONFIG, ldconfig, , [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/bin])
526 echo NETA_LDCONFIG = $NETA_LDCONFIG
527 AM_CONDITIONAL(RUN_LDCONFIG, test x"$this_os" = x"linux" -a x"$NETA_LDCONFIG" != x"")
528 ])
529
530 dnl Check for building PGP UAM module
531 AC_DEFUN([AC_NETATALK_PGP_UAM], [
532 AC_MSG_CHECKING([whether the PGP UAM should be build])
533 AC_ARG_ENABLE(pgp-uam,
534         [  --enable-pgp-uam        enable build of PGP UAM module],[
535         if test "$enableval" = "yes"; then 
536                 if test "x$neta_cv_have_openssl" = "xyes"; then 
537                         AC_DEFINE(UAM_PGP, 1, [Define if the PGP UAM module should be compiled])
538                         compile_pgp=yes
539                         AC_MSG_RESULT([yes])
540                 else
541                         AC_MSG_RESULT([no])
542                 fi
543         fi
544         ],[
545                 AC_MSG_RESULT([no])
546         ]
547 )
548 ])
549
550 dnl Check for building Kerberos V UAM module
551 AC_DEFUN([AC_NETATALK_KRB5_UAM], [
552 netatalk_cv_build_krb5_uam=no
553 AC_ARG_ENABLE(krbV-uam,
554         [  --enable-krbV-uam       enable build of Kerberos V UAM module],
555         [
556                 if test x"$enableval" = x"yes"; then
557                         NETATALK_GSSAPI_CHECK([
558                                 netatalk_cv_build_krb5_uam=yes
559                         ],[
560                                 AC_MSG_ERROR([need GSSAPI to build Kerberos V UAM])
561                         ])
562                 fi
563         ]
564         
565 )
566
567 AC_MSG_CHECKING([whether Kerberos V UAM should be build])
568 if test x"$netatalk_cv_build_krb5_uam" = x"yes"; then
569         AC_MSG_RESULT([yes])
570 else
571         AC_MSG_RESULT([no])
572 fi
573 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
574 ])
575
576 dnl Check if we can directly use Kerberos 5 API, used for reading keytabs
577 dnl and automatically construction DirectoryService names from that, instead
578 dnl of requiring special configuration in afp.conf
579 AC_DEFUN([AC_NETATALK_KERBEROS], [
580 AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
581 AC_ARG_WITH([kerberos],
582     [AS_HELP_STRING([--with-kerberos], [Kerberos 5 support (default=auto)])],
583     [],
584     [with_kerberos=auto])
585 AC_MSG_RESULT($with_kerberos)
586
587 if test x"$with_kerberos" != x"no"; then
588    have_krb5_header="no"
589    AC_CHECK_HEADERS([krb5/krb5.h krb5.h], [have_krb5_header="yes"; break])
590    if test x"$have_krb5_header" = x"no" && test x"$with_kerberos" != x"auto"; then
591       AC_MSG_FAILURE([--with-kerberos was given, but no headers found])
592    fi
593
594    AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
595    AC_MSG_CHECKING([for krb5-config])
596    if test -x "$KRB5_CONFIG"; then
597       AC_MSG_RESULT([$KRB5_CONFIG])
598       KRB5_CFLAGS="`$KRB5_CONFIG --cflags krb5`"
599       KRB5_LIBS="`$KRB5_CONFIG --libs krb5`"
600       AC_SUBST(KRB5_CFLAGS)
601       AC_SUBST(KRB5_LIBS)
602       with_kerberos="yes"
603    else
604       AC_MSG_RESULT([not found])
605       if test x"$with_kerberos" != x"auto"; then
606          AC_MSG_FAILURE([--with-kerberos was given, but krb5-config could not be found])
607       fi
608    fi
609 fi
610
611 if test x"$with_kerberos" = x"yes"; then
612    AC_DEFINE([HAVE_KERBEROS], [1], [Define if Kerberos 5 is available])
613 fi
614
615 dnl Check for krb5_free_unparsed_name and krb5_free_error_message
616 save_CFLAGS="$CFLAGS"
617 save_LIBS="$LIBS"
618 CFLAGS="$KRB5_CFLAGS"
619 LIBS="$KRB5_LIBS"
620 AC_CHECK_FUNCS([krb5_free_unparsed_name krb5_free_error_message])
621 CFLAGS="$save_CFLAGS"
622 LIBS="$save_LIBS"
623 ])
624
625 dnl Check for overwrite the config files or not
626 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
627 AC_MSG_CHECKING([whether configuration files should be overwritten])
628 AC_ARG_ENABLE(overwrite,
629         [  --enable-overwrite      overwrite configuration files during installation],
630         [OVERWRITE_CONFIG="${enable_overwrite}"],
631         [OVERWRITE_CONFIG="no"]
632 )
633 AC_MSG_RESULT([$OVERWRITE_CONFIG])
634 AC_SUBST(OVERWRITE_CONFIG)
635 ])
636
637 dnl Check for LDAP support, for client-side ACL visibility
638 AC_DEFUN([AC_NETATALK_LDAP], [
639 AC_MSG_CHECKING(for LDAP (necessary for client-side ACL visibility))
640 AC_ARG_WITH(ldap,
641     [AS_HELP_STRING([--with-ldap],
642         [LDAP support (default=auto)])],
643         netatalk_cv_ldap=$withval,
644         netatalk_cv_ldap=auto
645         )
646 AC_MSG_RESULT($netatalk_cv_ldap)
647
648 save_CFLAGS="$CFLAGS"
649 save_LDFLAGS="$LDFLAGS"
650 save_LIBS="$LIBS"
651 CFLAGS=""
652 LDFLAGS=""
653 LIBS=""
654 LDAP_CFLAGS=""
655 LDAP_LDFLAGS=""
656 LDAP_LIBS=""
657
658 if test x"$netatalk_cv_ldap" != x"no" ; then
659    if test x"$netatalk_cv_ldap" != x"yes" -a x"$netatalk_cv_ldap" != x"auto"; then
660        CFLAGS="-I$netatalk_cv_ldap/include"
661        LDFLAGS="-L$netatalk_cv_ldap/lib"
662    fi
663         AC_CHECK_HEADER([ldap.h], netatalk_cv_ldap=yes,
664         [ if test x"$netatalk_cv_ldap" = x"yes" ; then
665             AC_MSG_ERROR([Missing LDAP headers])
666         fi
667                 netatalk_cv_ldap=no
668         ])
669         AC_CHECK_LIB(ldap, ldap_init, netatalk_cv_ldap=yes,
670         [ if test x"$netatalk_cv_ldap" = x"yes" ; then
671             AC_MSG_ERROR([Missing LDAP library])
672         fi
673                 netatalk_cv_ldap=no
674         ])
675 fi
676
677 if test x"$netatalk_cv_ldap" = x"yes"; then
678     LDAP_CFLAGS="$CFLAGS"
679     LDAP_LDFLAGS="$LDFLAGS"
680     LDAP_LIBS="-lldap"
681         AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
682 fi
683
684 AC_SUBST(LDAP_CFLAGS)
685 AC_SUBST(LDAP_LDFLAGS)
686 AC_SUBST(LDAP_LIBS)
687 CFLAGS="$save_CFLAGS"
688 LDLFLAGS="$save_LDLFLAGS"
689 LIBS="$save_LIBS"
690 ])
691
692 dnl Check for ACL support
693 AC_DEFUN([AC_NETATALK_ACL], [
694 AC_MSG_CHECKING(whether to support ACLs)
695 AC_ARG_WITH(acls,
696     [AS_HELP_STRING([--with-acls],
697         [Include ACL support (default=auto)])],
698     [ case "$withval" in
699       yes|no)
700           with_acl_support="$withval"
701                   ;;
702       *)
703           with_acl_support=auto
704           ;;
705       esac ],
706     [with_acl_support=auto])
707 AC_MSG_RESULT($with_acl_support)
708
709 if test x"$with_acl_support" = x"no"; then
710         AC_MSG_RESULT(Disabling ACL support)
711         AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
712 else
713     with_acl_support=yes
714 fi
715
716 if test x"$with_acl_support" = x"yes" ; then
717         AC_MSG_NOTICE(checking whether ACL support is available:)
718         case "$host_os" in
719         *sysv5*)
720                 AC_MSG_NOTICE(Using UnixWare ACLs)
721                 AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
722                 ;;
723         *solaris*)
724                 AC_MSG_NOTICE(Using solaris ACLs)
725                 AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
726                 ACL_LIBS="$ACL_LIBS -lsec"
727                 ;;
728         *hpux*)
729                 AC_MSG_NOTICE(Using HPUX ACLs)
730                 AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
731                 ;;
732         *irix*)
733                 AC_MSG_NOTICE(Using IRIX ACLs)
734                 AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
735                 ;;
736         *aix*)
737                 AC_MSG_NOTICE(Using AIX ACLs)
738                 AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
739                 ;;
740         *osf*)
741                 AC_MSG_NOTICE(Using Tru64 ACLs)
742                 AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
743                 ACL_LIBS="$ACL_LIBS -lpacl"
744                 ;;
745         *darwin*)
746                 AC_MSG_NOTICE(ACLs on Darwin currently not supported)
747                 AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
748                 ;;
749         *)
750                 AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
751                 case "$host_os" in
752                 *linux*)
753                         AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
754                         ;;
755                 esac
756                 AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
757                         acl_LIBS=$LIBS
758                         LIBS="$LIBS $ACL_LIBS"
759                         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
760                                 #include <sys/types.h>
761                                 #include <sys/acl.h>
762                         ]], [[
763                                 acl_t acl;
764                                 int entry_id;
765                                 acl_entry_t *entry_p;
766                                 return acl_get_entry(acl, entry_id, entry_p);
767                         ]])],[netatalk_cv_HAVE_POSIX_ACLS=yes],[netatalk_cv_HAVE_POSIX_ACLS=no
768                 with_acl_support=no])
769                         LIBS=$acl_LIBS
770                 ])
771                 if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
772                         AC_MSG_NOTICE(Using POSIX ACLs)
773                         AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
774                         AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
775                                 acl_LIBS=$LIBS
776                                 LIBS="$LIBS $ACL_LIBS"
777                                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
778                                         #include <sys/types.h>
779                                         #include <sys/acl.h>
780                                 ]], [[
781                                         acl_permset_t permset_d;
782                                         acl_perm_t perm;
783                                         return acl_get_perm_np(permset_d, perm);
784                                 ]])],[netatalk_cv_HAVE_ACL_GET_PERM_NP=yes],[netatalk_cv_HAVE_ACL_GET_PERM_NP=no])
785                                 LIBS=$acl_LIBS
786                         ])
787                         if test x"$netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
788                                 AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
789                         fi
790
791
792                        AC_CACHE_CHECK([for acl_from_mode], netatalk_cv_HAVE_ACL_FROM_MODE,[
793                                acl_LIBS=$LIBS
794                                LIBS="$LIBS $ACL_LIBS"
795                 AC_CHECK_FUNCS(acl_from_mode,
796                                [netatalk_cv_HAVE_ACL_FROM_MODE=yes],
797                                [netatalk_cv_HAVE_ACL_FROM_MODE=no])
798                                LIBS=$acl_LIBS
799                        ])
800                        if test x"netatalk_cv_HAVE_ACL_FROM_MODE" = x"yes"; then
801                                AC_DEFINE(HAVE_ACL_FROM_MODE,1,[Whether acl_from_mode() is available])
802                        fi
803
804                 else
805                         AC_MSG_NOTICE(ACL support is not avaliable)
806                         AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
807                 fi
808                 ;;
809     esac
810 fi
811
812 if test x"$with_acl_support" = x"yes" ; then
813    AC_CHECK_HEADERS([acl/libacl.h])
814     AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
815     AC_SUBST(ACL_LIBS)
816 fi
817 ])
818
819 dnl Check for Extended Attributes support
820 AC_DEFUN([AC_NETATALK_EXTENDED_ATTRIBUTES], [
821 neta_cv_eas="ad"
822 neta_cv_eas_sys_found=no
823 neta_cv_eas_sys_not_found=no
824
825 AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
826
827 case "$this_os" in
828
829   *osf*)
830         AC_SEARCH_LIBS(getproplist, [proplist])
831         AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
832                    [neta_cv_eas_sys_found=yes],
833                    [neta_cv_eas_sys_not_found=yes])
834         AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
835                    [neta_cv_eas_sys_not_found=yes])
836         AC_CHECK_FUNCS([sizeof_proplist_entry],,
837                    [neta_cv_eas_sys_not_found=yes])
838   ;;
839
840   *solaris*)
841         AC_CHECK_FUNCS([attropen],
842                    [neta_cv_eas_sys_found=yes; AC_DEFINE(HAVE_EAFD, 1, [extattr API has full fledged fds for EAs])],
843                    [neta_cv_eas_sys_not_found=yes])
844   ;;
845
846   'freebsd')
847     AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
848                    [neta_cv_eas_sys_found=yes],
849                    [neta_cv_eas_sys_not_found=yes])
850     AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
851                    [neta_cv_eas_sys_not_found=yes])
852     AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
853                    [neta_cv_eas_sys_not_found=yes])
854     AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
855                    [neta_cv_eas_sys_not_found=yes])
856   ;;
857
858   *freebsd4* | *dragonfly* )
859     AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
860   ;;
861
862   *)
863         AC_SEARCH_LIBS(getxattr, [attr])
864
865     if test "x$neta_cv_eas_sys_found" != "xyes" ; then
866        AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
867                       [neta_cv_eas_sys_found=yes],
868                       [neta_cv_eas_sys_not_found=yes])
869            AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
870                       [neta_cv_eas_sys_not_found=yes])
871            AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
872                       [neta_cv_eas_sys_not_found=yes])
873     fi
874
875     if test "x$neta_cv_eas_sys_found" != "xyes" ; then
876            AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
877                       [neta_cv_eas_sys_found=yes],
878                       [neta_cv_eas_sys_not_found=yes])
879            AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
880                       [neta_cv_eas_sys_not_found=yes])
881     fi
882
883     if test "x$neta_cv_eas_sys_found" != "xyes" ; then
884            AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
885                       [neta_cv_eas_sys_not_found=yes])
886        AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
887                       [neta_cv_eas_sys_not_found=yes])
888     fi
889   ;;
890 esac
891
892 # Do xattr functions take additional options like on Darwin?
893 if test x"$ac_cv_func_getxattr" = x"yes" ; then
894         AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
895                 old_LIBS=$LIBS
896                 LIBS="$LIBS $ACL_LIBS"
897                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
898                         #include <sys/types.h>
899                         #if HAVE_ATTR_XATTR_H
900                         #include <attr/xattr.h>
901                         #elif HAVE_SYS_XATTR_H
902                         #include <sys/xattr.h>
903                         #endif
904                 ]], [[
905                         getxattr(0, 0, 0, 0, 0, 0);
906                 ]])],[smb_attr_cv_xattr_add_opt=yes],[smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
907         ])
908         if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
909                 AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
910         fi
911 fi
912
913 if test "x$neta_cv_eas_sys_found" = "xyes" ; then
914    if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
915       neta_cv_eas="$neta_cv_eas | sys"
916    fi
917 fi
918 AC_DEFINE_UNQUOTED(EA_MODULES,["$neta_cv_eas"],[Available Extended Attributes modules])
919 ])
920
921 dnl Check for libsmbsharemodes from Samba for Samba/Netatalk access/deny/share modes interop
922 dnl Defines "neta_cv_have_smbshmd" to "yes" or "no"
923 dnl AC_SUBST's "SMB_SHAREMODES_CFLAGS" and "SMB_SHAREMODES_LDFLAGS"
924 dnl AM_CONDITIONAL's "USE_SMB_SHAREMODES"
925 AC_DEFUN([AC_NETATALK_SMB_SHAREMODES], [
926     neta_cv_have_smbshmd=no
927     AC_ARG_WITH(smbsharemodes-lib,
928                 [  --with-smbsharemodes-lib=PATH        PATH to libsmbsharemodes lib from Samba],
929                 [SMB_SHAREMODES_LDFLAGS="-L$withval -lsmbsharemodes"]
930     )
931     AC_ARG_WITH(smbsharemodes-include,
932                 [  --with-smbsharemodes-include=PATH    PATH to libsmbsharemodes header from Samba],
933                 [SMB_SHAREMODES_CFLAGS="-I$withval"]
934     )
935     AC_ARG_WITH(smbsharemodes,
936                 [AS_HELP_STRING([--with-smbsharemodes],[Samba interop (default is yes)])],
937                 [use_smbsharemodes=$withval],
938                 [use_smbsharemodes=yes]
939     )
940
941     if test x"$use_smbsharemodes" = x"yes" ; then
942         AC_MSG_CHECKING([whether to enable Samba/Netatalk access/deny/share-modes interop])
943
944         saved_CFLAGS="$CFLAGS"
945         saved_LDFLAGS="$LDFLAGS"
946         CFLAGS="$SMB_SHAREMODES_CFLAGS $CFLAGS"
947         LDFLAGS="$SMB_SHAREMODES_LDFLAGS $LDFLAGS"
948
949         AC_LINK_IFELSE(
950             [#include <unistd.h>
951              #include <stdio.h>
952              #include <sys/time.h>
953              #include <time.h>
954              #include <stdint.h>
955              /* From messages.h */
956              struct server_id {
957                  pid_t pid;
958              };
959              #include "smb_share_modes.h"
960              int main(void) { (void)smb_share_mode_db_open(""); return 0;}],
961             [neta_cv_have_smbshmd=yes]
962         )
963
964         AC_MSG_RESULT($neta_cv_have_smbshmd)
965         AC_SUBST(SMB_SHAREMODES_CFLAGS, [$SMB_SHAREMODES_CFLAGS])
966         AC_SUBST(SMB_SHAREMODES_LDFLAGS, [$SMB_SHAREMODES_LDFLAGS])
967         CFLAGS="$saved_CFLAGS"
968         LDFLAGS="$saved_LDFLAGS"
969     fi
970
971     AM_CONDITIONAL(USE_SMB_SHAREMODES, test x"$neta_cv_have_smbshmd" = x"yes")
972 ])
973
974 dnl ------ Check for sendfile() --------
975 AC_DEFUN([AC_NETATALK_SENDFILE], [
976 netatalk_cv_search_sendfile=yes
977 AC_ARG_ENABLE(sendfile,
978     [  --disable-sendfile       disable sendfile syscall],
979     [if test x"$enableval" = x"no"; then
980             netatalk_cv_search_sendfile=no
981         fi]
982 )
983
984 if test x"$netatalk_cv_search_sendfile" = x"yes"; then
985    case "$host_os" in
986    *linux*)
987         AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available])
988         AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
989         ;;
990
991     *solaris*)
992         AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()])
993         AC_SEARCH_LIBS(sendfile, sendfile)
994         AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
995         AC_CHECK_FUNCS([sendfilev])
996         ;;
997
998     *freebsd*)
999         AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics])
1000         AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes])
1001         ;;
1002
1003     *)
1004         ;;
1005
1006     esac
1007
1008     if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then
1009         AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
1010     fi
1011 fi
1012 ])
1013
1014 dnl --------------------- Check if realpath() takes NULL
1015 AC_DEFUN([AC_NETATALK_REALPATH], [
1016 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
1017     neta_cv_REALPATH_TAKES_NULL, [
1018         AC_RUN_IFELSE([AC_LANG_SOURCE([[
1019             #include <stdio.h>
1020             #include <limits.h>
1021             #include <signal.h>
1022
1023             void exit_on_core(int ignored) {
1024                  exit(1);
1025             }
1026
1027             main() {
1028                 char *newpath;
1029                 signal(SIGSEGV, exit_on_core);
1030                 newpath = realpath("/tmp", NULL);
1031                 exit((newpath != NULL) ? 0 : 1);
1032             }]])],[neta_cv_REALPATH_TAKES_NULL=yes],[neta_cv_REALPATH_TAKES_NULL=no],[neta_cv_REALPATH_TAKES_NULL=cross
1033         ])
1034     ]
1035 )
1036
1037 if test x"$neta_cv_REALPATH_TAKES_NULL" = x"yes"; then
1038     AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL])
1039 fi
1040 ])