Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Compiling samba

Hi all

I've already asked this question once on this forum, but I'm still stuck...

I've been trying to compile samba on OS X for some time, but it wouldn't work. I got the hint here that the OS X samba is a rather "dirty hack" and that I'd need some patches for it to work, which I could get at http://www.opensource.apple.com/darwinsource/10.4.6.ppc/.

I downloaded the tarball samba-92.19 and now I've got the patches, but what am I supposed to do with them, how do I apply them? The tarball also contains quite a lot of other files, among them a Makefile which seems to have something to do with applying the patches, but I have no idea what to do with it. This Makefile starts like this:

# Set these variables as needed, then include this file, then:
#

# Project info
Project = samba/source
UserType = Administration
ToolType = Services
......

which is not exactly helpful, at least not for me. How do I "include" it? Usually I'd run configure, which will make the Makefile, and then make. But now I've already got a Makefile??? I'm no expert, I just know the very basics...

Any help is apprecieted,

Tina

G5 Dual 1.8, 23'' Cinema Display, Mac OS X (10.4.5), iMac G4/800, iBook G3/700, G4/400, iBook G3/366, iMac G3/233, PM 7200, Mac SE

Posted on Apr 19, 2006 3:34 AM

Reply
14 replies

Apr 19, 2006 1:12 PM in response to Dale Ranta

Yes, that IS exactly my problem. I always get an error when trying to "make".
I got this link form someone else on this forum and was told to grab all the patches for samba. There is a folder "patches" in the folder "samba-92.19". And in there is indeed a patch for Kerberos, which is where I get the error on "make".
So I believe (or hope) that I'm headed in the right direction, it's just that I don't know what exactly to do with the patches.

Tina

Apr 19, 2006 1:25 PM in response to Daniel Macks

OK, no problem. It's just that I already asked this question and got an answer, the one about the patches... so I thought that I now only need advice as to how to apply them. But here's my old post and the answer I got then:

Q:
"I tried to compile samba 3.0.20, but it's not working. Configure runs fine, but make stops with this error message:

Compiling libsmb/clikrb5.c
libsmb/clikrb5.c: In function 'krb5 locatekdc':
libsmb/clikrb5.c:214: error: 'krb5 krbhsthandle' undeclared (first use in this function)
libsmb/clikrb5.c:214: error: (Each undeclared identifier is reported only once
libsmb/clikrb5.c:214: error: for each function it appears in.)
libsmb/clikrb5.c:214: error: parse error before "hnd"
libsmb/clikrb5.c:215: error: 'krb5 krbhstinfo' undeclared (first use in this function)
libsmb/clikrb5.c:215: error: 'hinfo' undeclared (first use in this function)
libsmb/clikrb5.c:224: error: 'KRB5 KRBHSTKDC' undeclared (first use in this function)
libsmb/clikrb5.c:224: error: 'hnd' undeclared (first use in this function)
make: * [libsmb/clikrb5.o] Error 1

Seems to have something to do with kerberos? Any ideas? Or is it not possible to compile samba from source on OS X?"

A:
"Go out to http://www.opensource.apple.com/darwinsource/, pick your current revision of OS X (10.4.3??) and grab ALL the patches for Samba.

It then should compile."

Does this tell you anything?

Tina

Apr 21, 2006 8:04 AM in response to Dale Ranta

I was able to apply some of the patches I found at http://www.opensource.apple.com/darwinsource/10.4.6.ppc/samba-92.19/ using "patch" but not all of them. Some gave "failed" messages, and afterwards, samba still wouldn't compile, though I got a different error this time. I'll try it again this weekend maybe.
Dale, could you (or someone else) have another look at that link? I'm sure these ARE the patches needed for samba to compile on OS X.

Tina

Apr 21, 2006 1:23 PM in response to Tina Siegenthaler

Hi Tina, Guys,
I was hoping to have compiled samba before posting but I didn't get much further than you. Before I discuss that let me discuss the patches.

Guys, there are definitely patches in Apple's Samba project and you can find it by clicking on the samba-92.19 link on that page. A more accurate link to the patches is Index of /darwinsource/10.4.6.ppc/samba-92.19/patches. It's there.

It should be possible to apply the patches by cd'ing to the top level directory of Apple's unpacked tarball and simply executing something like:

find patches -name "*.diff" -exec echo 'patch -p0 < ". I'm not entirely sure what that does but both produced the same error messages that I posted above so it doesn't matter how they are run.

It's my guess that this package was meant to be compiled by simply executing "make" from the top level directory. There are many environment variables set in that make file and lots Configure options are set. I suspect that these are important in getting it to compile correctly. However, running "make" in the top level directory results in failure in the first compilation with isn't even in the samba/source directory. Thus, what I've discovered so far isn't a whole lot of help. However, I'll keep looking and maybe this partial information will cause someone else to think of something.<BR>--
Gary
~~~~
Anoint, v.:
To grease a king or other great functionary
already sufficiently slippery.
-- Ambrose Bierce, "The Devil's Dictionary"

Apr 21, 2006 1:48 PM in response to Gary Kerbaugh

Hi Gary

Thanks for jumping in! Your experience with trying to apply the patches is much the same as mine. You got exactly the same messages as me:

Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]

- for any of the patches.
I answered yes to all of them, but it didn't work in the end... but I'll keep trying. Not today, though, it's already late here. But at least I know now that what I tried wasn't completely wrong.

FYI: I'd like to compile samba myself because I need samba to work with the LDAP server at our university, and the precompiled version doesn't. I'd like to configure it with --with-ldapsam, which should enable the option "ldapsam_compat", making samba backward compatible with an older LDAP extension schema. If this will really work in the end is another question...

Tina

Apr 24, 2006 4:33 AM in response to Tina Siegenthaler

Hmm, I've had a look a the patches and the files they're supposed to patch, and it seems to me that all of the patches have already been applied. In some cases, there is even an .orig file next to the patched one.
So I just tried configure ( ./configure --with-krb5 --with-ads --with-cups --with-ldap --with-spinlocks --with-libiconv --with-readline=no --disable-shared --without-libsmbclient --with-winbind --with-pam --with-ldapsam --with-acl-support) and then make. I got a lot further with make than with the original samba version, but it eventually stops with a (new) error - sigh... this one:

Compiling libsmb/namequery.c
libsmb/namequery.c: In function 'internal resolvename':
libsmb/namequery.c:1135: error: 'DEBUGLEVEL' undeclared (first use in this function)
libsmb/namequery.c:1135: error: (Each undeclared identifier is reported only once
libsmb/namequery.c:1135: error: for each function it appears in.)
make: * [libsmb/namequery.o] Error 1

There's no patch for that file. Now what??

I also tried to run make in the directory samba-92.12 using the Makefile that is sitting there and which is supposed to apply the patches, but it didn't work.
Anyone got any further?

Tina

Apr 25, 2006 6:09 AM in response to Gary Kerbaugh

Hi Gary

It's my guess that this package was
meant to be compiled by simply executing "make" from
the top level directory. There are many environment
variables set in that make file and lots Configure
options are set. I suspect that these are important
in getting it to compile correctly. However, running
"make" in the top level directory results in failure
in the first compilation with isn't even in the
samba/source directory.


I tried that, too. Can you tell me where it failed for you? It did for me at configuring, complaining that libldap was needed for LDAP support:

checking for ldap_init in -lldap... no
checking for ldap_domain2hostlist... no
checking for ldap set_rebindproc... no
checking whether ldap set_rebindproc takes 3 arguments... 3
checking for ldap_initialize... no
configure: error: libldap is needed for LDAP support

locate libldap finds these files:

/usr/lib/libldap.dylib
/usr/lib/libldap_r.dylib

so I'm not sure if it just doesn't find the libs??

Did you get the same error? At first, it would stop even before starting to configure, I had to create the directory /tmp/samba/source/Build myself...


Tina

Compiling samba

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.