X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=configure.ac;h=d4caed4441ba79d4aae7bff5a0aa39e8a12e3b5a;hb=d92a5752b7a8fd29b8152263e751c499ba22e2bf;hp=05711b088fec84b69a4cd3d24ad81fa3cf9dee19;hpb=6dd1fb33fedf945027b2b69ec180af5135ce16c8;p=netatalk.git diff --git a/configure.ac b/configure.ac index 05711b08..d4caed44 100644 --- a/configure.ac +++ b/configure.ac @@ -116,12 +116,17 @@ rm -rf conftest* case $host_cpu:$atalk_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc*:yes | x86_64:yes | i386:yes) - AC_MSG_RESULT([yes]) case $target_os in solaris2*) + AC_MSG_RESULT([yes]) atalk_libname="lib/64" ;; + *bsd* | dragonfly*) + AC_MSG_RESULT([no]) + atalk_libname="lib" + ;; *) + AC_MSG_RESULT([yes]) atalk_libname="lib64" ;; esac @@ -388,7 +393,6 @@ AC_ARG_ENABLE(locking, AC_ARG_ENABLE(redhat, [ --enable-redhat obsoleted ],[ echo "ERROR: --enable-redhat is obsoleted. Use --enable-redhat-sysv or --enable-redhat-systemd." - echo "exit 1" exit 1 ] ) @@ -412,14 +416,30 @@ AC_ARG_ENABLE(redhat-systemd, ) AC_ARG_ENABLE(suse, - [ --enable-suse use suse-style sysv configuration ],[ + [ --enable-suse obsoleted ],[ + echo "ERROR: --enable-suse is obsoleted. Use --enable-suse-sysv or --enable-suse-systemd." + exit 1 + ] +) + +AC_ARG_ENABLE(suse-sysv, + [ --enable-suse-sysv use suse-style sysv configuration ],[ if test "$enableval" = "yes"; then - sysv_style=suse + sysv_style=suse-sysv fi AC_MSG_RESULT([enabling suse-style sysv support]) ] ) +AC_ARG_ENABLE(suse-systemd, + [ --enable-suse-systemd use suse-style systemd (>=openSUSE12.1) configuration ],[ + if test "$enableval" = "yes"; then + sysv_style=suse-systemd + fi + AC_MSG_RESULT([enabling suse-style systemd support]) + ] +) + AC_ARG_ENABLE(gentoo, [ --enable-gentoo use gentoo-style sysv configuration ],[ if test "$enableval" = "yes"; then @@ -446,6 +466,15 @@ AC_ARG_ENABLE(debian, ] ) +AC_ARG_ENABLE(systemd, + [ --enable-systemd use general systemd configuration],[ + if test "$enableval" = "yes"; then + sysv_style=systemd + fi + AC_MSG_RESULT([enabling general systemd support]) + ] +) + dnl ----- timelord compilation (disabled by default) AC_MSG_CHECKING([whether timelord should be compiled]) compile_timelord=no @@ -587,7 +616,6 @@ if test x"$this_os" = "xfreebsd"; then AC_MSG_RESULT([ * FreeBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD]) - AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics]) AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW) fi @@ -596,7 +624,6 @@ if test x"$this_os" = "xkfreebsd-gnu"; then AC_MSG_RESULT([ * GNU/kFreeBSD specific configuration]) AC_DEFINE(BSD4_4, 1, [BSD compatiblity macro]) AC_DEFINE(FREEBSD, 1, [Define if OS is FreeBSD]) - AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics]) AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW) fi @@ -661,62 +688,6 @@ fi dnl ----- see etc/afpd/quota.c AC_DEFINE(HAVE_BROKEN_DBTOB, 1, [Define if dbtob is broken]) - netatalk_cv_linux_sendfile=yes - AC_MSG_CHECKING([use sendfile syscall]) - AC_ARG_ENABLE(sendfile, - [ --disable-sendfile disable linux sendfile syscall],[ - if test x"$enableval" = x"no"; then - netatalk_cv_linux_sendfile=no - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) - - fi - ],[ - AC_MSG_RESULT([yes]) - ] - - ) - - if test x"$netatalk_cv_linux_sendfile" = "xyes"; then - AC_CACHE_CHECK([for linux sendfile support],netatalk_cv_HAVE_SENDFILE,[ - AC_TRY_LINK([#include ], -[\ -int tofd, fromfd; -off_t offset; -size_t total; -ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); -], -netatalk_cv_HAVE_SENDFILE=yes,netatalk_cv_HAVE_SENDFILE=no)]) - -# Try and cope with broken Linux sendfile.... - AC_CACHE_CHECK([for broken linux sendfile support],netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE,[ - AC_TRY_LINK([\ -#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) -#undef _FILE_OFFSET_BITS -#endif -#include ], -[\ -int tofd, fromfd; -off_t offset; -size_t total; -ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); -], -netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=no,netatalk_cv_HAVE_BROKEN_SENDFILE=cross)]) - - if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) - AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available]) - AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) - elif test x"$netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then - AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available]) - AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken]) - AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used]) - else - netatalk_cv_linux_sendfile=no - AC_MSG_RESULT(no); - fi - fi dnl ----- Linux/alpha specific ----- if test x"$this_cpu" = "xalpha"; then @@ -871,6 +842,43 @@ if test x"$this_os" = "xtru64"; then sysv_style=tru64 fi +dnl ------ Check for sendfile() -------- +netatalk_cv_search_sendfile=yes +AC_ARG_ENABLE(sendfile, + [ --disable-sendfile disable sendfile syscall], + [if test x"$enableval" = x"no"; then + netatalk_cv_search_sendfile=no + fi] +) + +if test x"$netatalk_cv_search_sendfile" = x"yes"; then + case "$host_os" in + *linux*) + AC_DEFINE(SENDFILE_FLAVOR_LINUX,1,[Whether linux sendfile() API is available]) + AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) + ;; + + *solaris*) + AC_DEFINE(SENDFILE_FLAVOR_SOLARIS, 1, [Solaris sendfile()]) + AC_SEARCH_LIBS(sendfile, sendfile) + AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) + ;; + + *freebsd*) + AC_DEFINE(SENDFILE_FLAVOR_BSD, 1, [Define if the sendfile() function uses BSD semantics]) + AC_CHECK_FUNC([sendfile], [netatalk_cv_HAVE_SENDFILE=yes]) + ;; + + *) + ;; + + esac + + if test x"$netatalk_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) + fi +fi + dnl -- check for libgcrypt, if found enables DHX UAM AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes neta_cv_have_libgcrypt=yes @@ -1290,13 +1298,13 @@ AM_CONDITIONAL(USE_PGP, test x$compile_pgp = xyes) AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$neta_cv_have_openssl != xyes) AM_CONDITIONAL(USE_NETBSD, test x$sysv_style = xnetbsd) AM_CONDITIONAL(USE_REDHAT_SYSV, test x$sysv_style = xredhat-sysv) -AM_CONDITIONAL(USE_REDHAT_SYSTEMD, test x$sysv_style = xredhat-systemd) -AM_CONDITIONAL(USE_SUSE, test x$sysv_style = xsuse) +AM_CONDITIONAL(USE_SUSE_SYSV, test x$sysv_style = xsuse-sysv) AM_CONDITIONAL(USE_SHADOWPW, test x$shadowpw = xyes) AM_CONDITIONAL(USE_TRU64, test x$sysv_style = xtru64) AM_CONDITIONAL(USE_SOLARIS, test x$sysv_style = xsolaris) AM_CONDITIONAL(USE_GENTOO, test x$sysv_style = xgentoo) AM_CONDITIONAL(USE_DEBIAN, test x$sysv_style = xdebian) +AM_CONDITIONAL(USE_SYSTEMD, test x$sysv_style = xsystemd || test x$sysv_style = xredhat-systemd || test x$sysv_style = xsuse-systemd) AM_CONDITIONAL(USE_UNDEF, test x$sysv_style = x) AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes) AM_CONDITIONAL(USE_APPLETALK, test x$netatalk_cv_ddp_enabled = xyes) @@ -1336,6 +1344,7 @@ AC_OUTPUT([Makefile distrib/config/netatalk-config distrib/initscripts/Makefile distrib/m4/Makefile + distrib/systemd/Makefile doc/Makefile etc/Makefile etc/afpd/Makefile