Bug 4722 - --without-sendfile-support option is ineffective
Summary: --without-sendfile-support option is ineffective
Status: RESOLVED DUPLICATE of bug 8344
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.25a
Hardware: Other All
: P3 major
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 23:39 UTC by David Leonard (550 5.7.1 Unable to deliver)
Modified: 2013-09-02 14:50 UTC (History)
0 users

See Also:


Attachments
Correct --with[out]-sendfile-support processing (870 bytes, patch)
2007-11-12 20:18 UTC, David Leonard (550 5.7.1 Unable to deliver)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Leonard (550 5.7.1 Unable to deliver) 2007-06-21 23:39:45 UTC
Specifying --without-sendfile-support to configure has no effect. This is because configure.in incorrectly initialises with_sendfile_support=yes after the command-line arguments have been processed.

This appears to be the case for a whole bunch of options:

--without-ldap-support
--without-ads-support
--without-dnsupdate-support 
--without-pam-for-crypt
--without-sendfile-support

This is because configure.in contains code like this:

  with_sendfile_support=yes
  AC_MSG_CHECKING(whether to check to support sendfile)
  AC_ARG_WITH(sendfile-support,
  [  --with-sendfile-support Check for sendfile support (default=yes)],
  [ case "$withval" in
    yes)
        AC_MSG_RESULT(yes);
        case "$host_os" in
              ...
        esac
        ;;
    *)
        AC_MSG_RESULT(no)
        ;;
    esac],
    AC_MSG_RESULT(yes)
  )

I think instead the right way to handle this is to set the default inside the AC_ARG_WITH() [if you must] and then check/switch on the $with_foo variable outside of the AC_ARG_WITH() call, like this:

  AC_ARG_WITH(sendfile-support,
    [  --with-sendfile-support Check for sendfile support (default=yes)],,
    [with_sendfile_support=yes])
  AC_MSG_CHECKING([whether to check to support sendfile])
  case "$with_sendfile_support" in
     yes)
        AC_MSG_RESULT(yes)
        case "$host_os" in
                ...
        esac
        ;;
     *)
        AC_MSG_RESULT(no)
        ;;
  esac
Comment 1 David Leonard (550 5.7.1 Unable to deliver) 2007-06-21 23:50:30 UTC
oops: I guessed that list of --without- options by grepping for ^with_ in configure.in, and got it wrong
Comment 2 David Leonard (550 5.7.1 Unable to deliver) 2007-11-12 20:18:13 UTC
Created attachment 2965 [details]
Correct --with[out]-sendfile-support processing

Because the AC_ARG_WITH macro expands earlier than the "with_sendfile_support=yes" initialiser, this patch puts the initialiser into the macro so it is evaluated AFTER --with-sendfile-support processing.
Comment 3 Björn Jacke 2013-09-02 14:50:15 UTC

*** This bug has been marked as a duplicate of bug 8344 ***