xffm, samba, cygwin

Brian J. Tarricone bjt23 at cornell.edu
Thu Sep 23 08:13:10 CEST 2004


edscott wilson garcia wrote:

>El mié, 22-09-2004 a las 14:42, Brian J. Tarricone escribió:
>  
>
>>On 09/22/04 13:37, edscott wilson garcia wrote:
>>    
>>
>>>El mi?, 22-09-2004 a las 10:16, Maarten Boekhold escribi?:
>>>      
>>>
>>>>edscott wilson garcia wrote:
>>>>        
>>>>
>>>>>El mar, 21-09-2004 a las 09:51, Maarten Boekhold escribi?:
>>>>>
>>>>>          
>>>>>
>>>>>>edscott wrote:
>>>>>>
>>>>>>If you can come up with some configure/autotools magic to conditionally 
>>>>>>exclude samba from the build, I'd be much obliged.
>>>>>>            
>>>>>>
>>>>> 
>>>>>OK, done. Just run configure with --disable-smbbranch.
>>>>>          
>>>>>
>>>>Hmmm, do you know of a way to always set this to --disable-smbbranch 
>>>>when on the cygwin platform? I'm not too familiar with autoconf, just 
>>>>got a bit the hang of automake...
>>>>
>>>>I'm looking for something similar to:
>>>>
>>>>configure.ac:
>>>>AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""])
>>>>
>>>>Makefile.am:
>>>>if HAVE_CYGWIN
>>>>...
>>>>endif
>>>>        
>>>>
>>>This Makefile.am modification will probably do the trick:
>>>
>>>if HAVE_CYGWIN
>>>  CFLAGS=CFLAGS -DUSE_SMB_BRANCH=0
>>>endif
>>>
>>>After changing all occurrences of 
>>>#ifdef USE_SMB_BRANCH
>>>to 
>>>#if USE_SMB_BRANCH==1
>>>
>>>in the source code. Yes?
>>>      
>>>
>>won't this break the linux install?  IIRC, if there's no samba,
>>USE_SMB_BRANCH won't be defined at all, and #if USE_SMB_BRANCH==1 will
>>probably generate a preprocessor error.  i'm not sure why there's a need
>>to special-case it at all.  won't the configure script just not detect
>>samba on cygwin and thus not define USE_SMB_BRANCH?
>>    
>>
>
>No, because samba is not needed for compilation at all. If samba is not
>installed, when you try to open the smb branch you get a message telling
>you that smbclient is not found. You can then install samba and the smb
>branch will work correctly without restarting xffm.
>
>So by default USE_SMB_BRANCH is always defined. If you just do not want
>to compile the samba module and completely obliterate the existance of
>the samba branch, you undefine USE_SMB_BRANCH with --disable-smbbranch.
>Maarten wants --disable-smbbranch to be the default for cygwin. I'm
>afraid I don't know how to do this from configure.ac, but it should work
>from the automake with -DUSE_SMB_BRANCH=0, probably using 
>
>#if defined(USE_SMB_BRANCH) && USE_SMB_BRANCH==0
>
probably the easiest thing to do would be something like:

uname_has_cygwin = `uname | grep \"CYGWIN\"`
AM_CONDITIONAL([HAVE_CYGWIN], [test "x$uname_has_cygwin" != "x"])
if test "x$uname_has_cygwin" = "x"; then
    AC_DEFINE([USE_SMB_BRANCH], [1], [define if whatever])
fi

or, if you still want to keep the --disable-smbbranch flag, just wrap 
the if/fi logic for that inside my if/fi block.

    -brian



More information about the Xfce4-dev mailing list