Netatalk for macOS - networking classic and modern Macs

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

Hi all
This new thread is related to a fork of Netatalk that I have patched to allow clean compilation on current Mac hardware. It allows modern Intel Macs to network and exchange files with classic Macs running Mac OS 9.2.2. The original inspiration came from @mabam's afpfs-ng thread on this same forum:
viewtopic.php?p=69619#p69619
I worked initially on the Netatalk 2.2 branch but the good news is that the more recent 3.1 branch is now compiling and working well. It has been tested on Big Sur 11.2.3 and allows for much faster file transfers compared with the older branch. As it is a WIP I'll update the thread with a how-to as soon as I've ironed out the remaining code refinement. In a nutshell the new fork provides an AFP 2.2 server for macOS hosts that connects with classic Mac clients using Apple's Data Stream Interface (DSI) over TCP/IP.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: Netatalk for macOS - networking classic and modern Macs

Post by mabam »

Great you have 3.1 working too! I’m looking forward to try it once you have the code ready.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

dgsga wrote: Sun Mar 14, 2021 7:52 pm Hi all
This new thread is related to a fork of Netatalk that I have patched to allow clean compilation on current Mac hardware. It allows modern Intel Macs to network and exchange files with classic Macs running Mac OS 9.2.2. The original inspiration came from @mabam's afpfs-ng thread on this same forum:
viewtopic.php?p=69619#p69619
I worked initially on the Netatalk 2.2 branch but the good news is that the more recent 3.1 branch is now compiling and working well. It has been tested on Big Sur 11.2.3 and allows for much faster file transfers compared with the older branch. As it is a WIP I'll update the thread with a how-to as soon as I've ironed out the remaining code refinement. In a nutshell the new fork provides an AFP 2.2 server for macOS hosts that connects with classic Mac clients using Apple's Data Stream Interface (DSI) over TCP/IP.
What target systems will this run on? I ask because I've got some older systems (10.6 server and 10.11) where I'd like to deploy something like this, as well as 11.2.3 systems.
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

In theory you should be able to compile on those systems as long as you have the relevant command line tools installed and Netatalk's dependencies installed using Homebrew. I'm going to try compiling it on Mojave and will report back...
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

dgsga wrote: Mon Mar 15, 2021 7:40 pm In theory you should be able to compile on those systems as long as you have the relevant command line tools installed and Netatalk's dependencies installed using Homebrew. I'm going to try compiling it on Mojave and will report back...
Homebrew's in an interesting situation... it officially only supports back as far as 10.12 now, although I have still been able to get some stuff working under 10.11. 10.6 works on an alternate fork of Homebrew, but there's very little in that repository. MacPorts seems to be in much better shape for older OS versions.
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

Let the games commence...

The code is now in a fit state for me to post the how-to:
1. Install Homebrew and command line tools. CLT installs with:

Code: Select all

sudo xcode-select --install
2. Install dependencies, these are essential:

Code: Select all

brew install automake autoconf libtool libgcrypt berkeley-db openssl gcc
3. Clone patched Netatalk 3.1.12 branch from my Github repo:

Code: Select all

git clone https://github.com/dgsga/Netatalk3.git
4. cd to Netatalk3 directory then:

Code: Select all

./bootstrap
./configure --without-acls --without-ldap --without-dtrace CC=gcc-10
make
sudo make install
5. Edit /usr/local/etc/afp.conf to set up your shares (see the online Netatalk 3 manual for how to do this).
6. Note that the repo root contains a script called netatalk-init that can be used to start, stop and restart the AFP server. It can also be run as root on startup using a Launch Daemon. At some point I'll get around to doing this automagically.
7. From the Mac OS 9 client side the share can be accessed via Apple>Network Browser>Connect To Server>IP address of your AFP server. In Mac OS 9 the default authentication method is DHX via PAM. I will be removing the insecure authentication methods (cleartext password and randnum) as they are outdated.

You'll notice that we have to compile with Homebrew's gcc rather than native clang. For some reason the code compiles cleanly with clang but the binaries are non-functional. If anyone has any clues about why this might be, speak out!

Enjoy!!
Last edited by dgsga on Thu Mar 18, 2021 8:07 am, edited 1 time in total.
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

adespoton wrote: Mon Mar 15, 2021 8:57 pm
dgsga wrote: Mon Mar 15, 2021 7:40 pm In theory you should be able to compile on those systems as long as you have the relevant command line tools installed and Netatalk's dependencies installed using Homebrew. I'm going to try compiling it on Mojave and will report back...
Homebrew's in an interesting situation... it officially only supports back as far as 10.12 now, although I have still been able to get some stuff working under 10.11. 10.6 works on an alternate fork of Homebrew, but there's very little in that repository. MacPorts seems to be in much better shape for older OS versions.
@adespoton Let me know how you get on with MacPorts, in theory if you can install the dependencies it should work. You don't have to have the most recent versions of openssl or Berkeley-DB. Netatalk itself hasn't been updated since November 2018 so maybe it'll become abandonware as new versions of macOS will not be supporting AFP :(
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

The repo now uses Homebrew libevent so you need to install this as another dependency:

Code: Select all

brew install libevent
I have also removed all unused code and simplified the bootstrap mechanism so now all you need to run is:

Code: Select all

./bootstrap
make
sudo make install
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

Currently doing port install on 10.4.11... we'll see how it goes :)

-- only hiccough so far is that berkeley-db doesn't appear to exist under MacPorts? I think it must have a different name. I had the other dependencies either already installed, or they shared the same name (including libevent).

So now I just need to figure out how bdb maps between homebrew and macports, and then I can attempt to clone and build :D
thecloud
Student Driver
Posts: 19
Joined: Mon Oct 19, 2015 4:39 am

Re: Netatalk for macOS - networking classic and modern Macs

Post by thecloud »

Berkeley DB is just 'db' in MacPorts, but the version number is part of the name:

Code: Select all

$ port info db62
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
db62 @6.2.32 (databases)
Variants:             java, [+]sql, tcl, universal

Description:          Version 6.2 of the Berkeley Data Base library which offers (key/value) storage with optional concurrent access or transactions
                      interface. This port will install the AES (American Encryption Standard) enabled version.
Homepage:             https://www.oracle.com/database/berkeley-db/db.html

Platforms:            darwin
License:              AGPL-3
Maintainers:          none
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

adespoton wrote: Thu Mar 25, 2021 2:11 am Currently doing port install on 10.4.11... we'll see how it goes :)

-- only hiccough so far is that berkeley-db doesn't appear to exist under MacPorts? I think it must have a different name. I had the other dependencies either already installed, or they shared the same name (including libevent).

So now I just need to figure out how bdb maps between homebrew and macports, and then I can attempt to clone and build :D
Let us know how you get on... You might need to alter the bootstrap file compile flags so your compiler finds BDB and libevent as I think MacPorts uses /opt/local rather than /usr/local as the install location.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

Thanks for the heads-up. I ended up re-basing my MacPorts config as it was getting out of date... so my G4 Mini spent the last day compiling GCC7. Once I've got everything running smoothly and db installed, I'll fix the bootstrap. I'll try to make a version that checks whether it's Homebrew or MacPorts being used and sets libs/paths appropriately.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

Hmm... while waiting for my G4 to complete port install outdated, I decided to try it on my Big Sur ia64 Mac.

Results are:

Code: Select all

Making all in netatalk
  CC       netatalk-netatalk.o
netatalk.c:47:10: fatal error: event2/event.h: No such file or directory
   47 | #include <event2/event.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [netatalk-netatalk.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Libevent is properly installed; it's possible one of my xcode libraries is clobbering something like libtool. Thoughts?

[edit] Meanwhile, the G4 setup keeps dying on libgrypt. And then I realized I had already installed Homebrew on there too! I'd forgotten that I had backported it. Libgcrypt appears to work under Homebrew, so soon we'll see if this'll work with a hacky 10.4.11 Homebrew.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

dgsga wrote: Thu Mar 25, 2021 8:06 pm
adespoton wrote: Thu Mar 25, 2021 2:11 am Currently doing port install on 10.4.11... we'll see how it goes :)

-- only hiccough so far is that berkeley-db doesn't appear to exist under MacPorts? I think it must have a different name. I had the other dependencies either already installed, or they shared the same name (including libevent).

So now I just need to figure out how bdb maps between homebrew and macports, and then I can attempt to clone and build :D
Let us know how you get on... You might need to alter the bootstrap file compile flags so your compiler finds BDB and libevent as I think MacPorts uses /opt/local rather than /usr/local as the install location.
Is there something missing from the repo? I've got pretty much everything in place from a mix of MacPorts and PPC Homebrew, but that event error is showing up now on 10.4.11, 10.14.6 and 11.2.3.
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

@adespoton (or all others interested): Did you also try to compile Netatalk 2 from @dgsga's fork and did you compile it successfully? - On my machine, a Core2Duo MacBook Pro mid-2009 running macOS 10.14.6 Mojave with Xcode 11.3.1 (11C504), it fails with: :???:

Code: Select all

 […]
  CCLD     libatalk.la
copying selected object files to avoid basename conflicts...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(dummy.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(ad_mmap.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(ad_sendfile.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(module.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(strcasestr.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(strlcpy.o) has no symbols
Making all in bin
Making all in adv1tov2
  CC       adv1tov2.o
  CCLD     adv1tov2
ld: warning: directory not found for option '-L../libatalk'
Making all in cnid
make[3]: Nothing to be done for `all'.
Making all in megatron
  CC       asingle.o
  CC       hqx.o
  CC       macbin.o
  CC       megatron.o
  CC       nad.o
  CC       updcrc.o
  CCLD     megatron
ld: warning: directory not found for option '-L../libatalk'
Making all in uniconv
  CC       uniconv.o
  CC       iso8859_1_adapted.o
  CCLD     uniconv
ld: warning: directory not found for option '-L../../../libatalk'
ld: warning: directory not found for option '-L../libatalk'
Making all in misc
  CC       netacnv.o
  CCLD     netacnv
ld: warning: directory not found for option '-L../libatalk'
  CC       logger_test.o
  CCLD     logger_test
ld: warning: directory not found for option '-L../libatalk'
  CC       fce-fce.o
  CCLD     fce
ld: warning: directory not found for option '-L../libatalk'
Making all in ad
  CC       ad-ad.o
  CC       ad-ad_find.o
  CC       ad-ad_util.o
  CC       ad-ad_ls.o
  CC       ad-ad_cp.o
  CC       ad-ad_mv.o
  CC       ad-ad_rm.o
  CCLD     ad
ld: warning: directory not found for option '-L../../../libatalk'
ld: warning: directory not found for option '-L../libatalk'
make[3]: Nothing to be done for `all-am'.
Making all in config
Making all in pam
sed -e "s,[@]PAM_DIRECTIVE[@],required,g" \
		-e "s,[@]PAM_AUTH[@],pam_permit.so," \
		-e "s,[@]PAM_ACCOUNT[@],pam.opendirectory.so," \
		-e "s,[@]PAM_PASSWORD[@],pam.opendirectory.so," \
		-e "s,[@]PAM_SESSION[@],pam_permit.so," \
	    <netatalk.pam.tmpl >netatalk.pam
make[3]: Nothing to be done for `all-am'.
Making all in etc
Making all in afpd
  CC       hash-hash.o
  CCLD     hash
  CC       fce-fce_api.o
  CC       fce-fce_util.o
  CCLD     fce
ld: warning: directory not found for option '-L../libatalk'
duplicate symbol '_invalid_dircache_entries' in:
    fce-fce_api.o
    fce-fce_util.o
duplicate symbol '_current_vol' in:
    fce-fce_api.o
    fce-fce_util.o
ld: 2 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status
make[3]: *** [fce] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

… for the sake of completeness, compiling Netatalk 3 on the same machine fails with the very same error message as already reported by @adespoton:

Code: Select all

  CCLD     cnid_metad
Making all in netatalk
  CC       netatalk-netatalk.o
netatalk.c:47:10: fatal error: event2/event.h: No such file or directory
   47 | #include <event2/event.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [netatalk-netatalk.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

Le petit prince wrote: Wed Mar 31, 2021 10:03 am … for the sake of completeness, compiling Netatalk 3 on the same machine fails with the very same error message as already reported by @adespoton:

Code: Select all

  CCLD     cnid_metad
Making all in netatalk
  CC       netatalk-netatalk.o
netatalk.c:47:10: fatal error: event2/event.h: No such file or directory
   47 | #include <event2/event.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [netatalk-netatalk.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This missing header is part of libevent and should be installed if you run 'brew install libevent'. I can't update the opening post to reflect the fact that the netatalk3 repo no longer uses built-in libevent, it uses the Homebrew one so dependencies are always kept up-to-date.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Netatalk for macOS - networking classic and modern Macs

Post by adespoton »

dgsga wrote: Wed Mar 31, 2021 6:44 pm
Le petit prince wrote: Wed Mar 31, 2021 10:03 am … for the sake of completeness, compiling Netatalk 3 on the same machine fails with the very same error message as already reported by @adespoton:

Code: Select all

  CCLD     cnid_metad
Making all in netatalk
  CC       netatalk-netatalk.o
netatalk.c:47:10: fatal error: event2/event.h: No such file or directory
   47 | #include <event2/event.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [netatalk-netatalk.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This missing header is part of libevent and should be installed if you run 'brew install libevent'. I can't update the opening post to reflect the fact that the netatalk3 repo no longer uses built-in libevent, it uses the Homebrew one so dependencies are always kept up-to-date.
That was my first thought. But I double checked that homebrew libevent was installed, and it was: "libevent 2.1.12 is already installed and up-to-date"

And yet, when running make, I bail at:

Code: Select all

netatalk.c:47:10: fatal error: event2/event.h: No such file or directory
47 | #include <event2/event.h>
   |         ^---------------
compilation terminated.
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

Thank you, dgsga, for your answer.

I've double-checked Homebrew's output, but libevent is definitely installed:

Code: Select all

Warning: libevent 2.1.12 is already installed and up-to-date.
To reinstall 2.1.12, run:
  brew reinstall libevent
I'll now try if compiling from source (brew reinstall -s libevent) makes a difference. My MacBook Pro's CPU is a Core2Duo without SSE4.2 and AVX, so due to this IMHO rather shortsighted commit I've to compile formulas from source from time to time.
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

Le petit prince wrote: Wed Mar 31, 2021 9:55 am @adespoton (or all others interested): Did you also try to compile Netatalk 2 from @dgsga's fork and did you compile it successfully? - On my machine, a Core2Duo MacBook Pro mid-2009 running macOS 10.14.6 Mojave with Xcode 11.3.1 (11C504), it fails with: :???:

Code: Select all

 […]
  CCLD     libatalk.la
copying selected object files to avoid basename conflicts...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(dummy.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(ad_mmap.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(ad_sendfile.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(module.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(strcasestr.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libatalk.a(strlcpy.o) has no symbols
Making all in bin
Making all in adv1tov2
  CC       adv1tov2.o
  CCLD     adv1tov2
ld: warning: directory not found for option '-L../libatalk'
Making all in cnid
make[3]: Nothing to be done for `all'.
Making all in megatron
  CC       asingle.o
  CC       hqx.o
  CC       macbin.o
  CC       megatron.o
  CC       nad.o
  CC       updcrc.o
  CCLD     megatron
ld: warning: directory not found for option '-L../libatalk'
Making all in uniconv
  CC       uniconv.o
  CC       iso8859_1_adapted.o
  CCLD     uniconv
ld: warning: directory not found for option '-L../../../libatalk'
ld: warning: directory not found for option '-L../libatalk'
Making all in misc
  CC       netacnv.o
  CCLD     netacnv
ld: warning: directory not found for option '-L../libatalk'
  CC       logger_test.o
  CCLD     logger_test
ld: warning: directory not found for option '-L../libatalk'
  CC       fce-fce.o
  CCLD     fce
ld: warning: directory not found for option '-L../libatalk'
Making all in ad
  CC       ad-ad.o
  CC       ad-ad_find.o
  CC       ad-ad_util.o
  CC       ad-ad_ls.o
  CC       ad-ad_cp.o
  CC       ad-ad_mv.o
  CC       ad-ad_rm.o
  CCLD     ad
ld: warning: directory not found for option '-L../../../libatalk'
ld: warning: directory not found for option '-L../libatalk'
make[3]: Nothing to be done for `all-am'.
Making all in config
Making all in pam
sed -e "s,[@]PAM_DIRECTIVE[@],required,g" \
		-e "s,[@]PAM_AUTH[@],pam_permit.so," \
		-e "s,[@]PAM_ACCOUNT[@],pam.opendirectory.so," \
		-e "s,[@]PAM_PASSWORD[@],pam.opendirectory.so," \
		-e "s,[@]PAM_SESSION[@],pam_permit.so," \
	    <netatalk.pam.tmpl >netatalk.pam
make[3]: Nothing to be done for `all-am'.
Making all in etc
Making all in afpd
  CC       hash-hash.o
  CCLD     hash
  CC       fce-fce_api.o
  CC       fce-fce_util.o
  CCLD     fce
ld: warning: directory not found for option '-L../libatalk'
duplicate symbol '_invalid_dircache_entries' in:
    fce-fce_api.o
    fce-fce_util.o
duplicate symbol '_current_vol' in:
    fce-fce_api.o
    fce-fce_util.o
ld: 2 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status
make[3]: *** [fce] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This error is happening because you're compiling with (? Homebrew's) GCC rather than macOS's native clang. Thanks for pointing it out, it is fixed in the latest commit to the Netatalk repo...
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

Le petit prince wrote: Wed Mar 31, 2021 10:52 pm Thank you, dgsga, for your answer.

I've double-checked Homebrew's output, but libevent is definitely installed:

Code: Select all

Warning: libevent 2.1.12 is already installed and up-to-date.
To reinstall 2.1.12, run:
  brew reinstall libevent
I'll now try if compiling from source (brew reinstall -s libevent) makes a difference. My MacBook Pro's CPU is a Core2Duo without SSE4.2 and AVX, so due to this IMHO rather shortsighted commit I've to compile formulas from source from time to time.
If you're compiling from source you may need to run 'brew link libevent'. Have you checked to see if the symbolic link in /usr/local/include/event2/event2.h is there? It should point to the header in /usr/local/Cellar/libevent/2.1.12/include/event2?

@adespoton, Have you got these two paths in your bootstrap file as per the original one in the repo:

Code: Select all

--with-libevent-header=/usr/local/include \
--with-libevent-lib=/usr/local/lib \
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

dgsga wrote: Thu Apr 01, 2021 7:20 amThis error is happening because you're compiling with (? Homebrew's) GCC rather than macOS's native clang. Thanks for pointing it out, it is fixed in the latest commit to the Netatalk repo...
Thank you very much! Your Netatalk2 fork is now going through the 'make' process flawlessly on my machine. :smile:

As for Netatalk3:
dgsga wrote: Thu Apr 01, 2021 7:27 amIf you're compiling from source you may need to run 'brew link libevent'. Have you checked to see if the symbolic link in /usr/local/include/event2/event2.h is there? It should point to the header in /usr/local/Cellar/libevent/2.1.12/include/event2?
Thank you. Compiling libevent from source did not change anything (not that I would have expected it to, but trying it and being successful with it would have still made it worth). According to Homebrew, the self-compiled libevent seems linked:

Code: Select all

Warning: Already linked: /usr/local/Cellar/libevent/2.1.12
To relink:
  brew unlink libevent && brew link libevent
On my machine, Homebrew has apparently set the symbolic link for the entire folder and not the individual file (username anonymized):

Code: Select all

/usr/local/include $ ls -al event2
lrwxr-xr-x  1 $myusername  admin  40  1 Apr 00:45 event2 -> ../Cellar/libevent/2.1.12/include/event2
In my admittedly still amateurish understanding and as I clearly see /usr/local/Cellar/libevent/2.1.12/include/event2/event.h exists, the file isn't invoked because somehow the make process possibly doesn't search for it in that place? Which makes me wonder if the problem is somehow related to one of these two issues with Homebrew's libevent on Macs - just in case that rings a bell with others here:

https://github.com/litespeedtech/lsquic/issues/41

https://stackoverflow.com/questions/58741942/event-h-no-such-file-or-directory-even-when-libevent-dev-is-installed
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

Update: I got Netatalk3 to compile successfully by executing

Code: Select all

./configure --without-acls --without-ldap --without-dtrace
without

Code: Select all

CC=gcc-10
This has apparently compiled functional Netatalk 3.1.13 binaries:

Code: Select all

sh-3.2# ls -al /usr/local/sbin/afpd 
-rwxr-xr-x  1 root  admin  244408  1 Apr 16:30 /usr/local/sbin/afpd
sh-3.2# /usr/local/sbin/afpd -v
afpd 3.1.13 - Apple Filing Protocol (AFP) daemon of Netatalk

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. Please see the file COPYING for further information and details.

afpd has been compiled with support for these features:

          AFP versions:	2.2 3.0 3.1 3.2 3.3 3.4 
         CNID backends:	dbd last tdb 
      Zeroconf support:	No
  TCP wrappers support:	No
         Quota support:	No
   Admin group support:	Yes
    Valid shell checks:	Yes
            EA support:	ad
          LDAP support:	No
         D-Bus support:	No

              afp.conf:	/usr/local/etc/afp.conf
           extmap.conf:	/usr/local/etc/extmap.conf
       state directory:	/usr/local/var/netatalk/
    afp_signature.conf:	/usr/local/var/netatalk/afp_signature.conf
      afp_voluuid.conf:	/usr/local/var/netatalk/afp_voluuid.conf
       UAM search path:	/usr/local/lib/netatalk//
  Server messages path:	/usr/local/var/netatalk/msg/

sh-3.2#
Le petit prince
Tinkerer
Posts: 47
Joined: Wed May 12, 2004 9:03 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by Le petit prince »

Configuring Netatalk3 for use with a Mac OS 9 QEMU VM seems quite a challenge now: The clang-compiled /usr/local/sbin/afpd doesn't seem to launch properly, i.e. it displays its info text normally on a './afpd -V' (see above), but I don't see it in 'ps aux' after a 'netatalk-init start' (@dsgsa: … or was that what you meant by "For some reason the code compiles cleanly with clang but the binaries are non-functional."?).

Setting 'log file = /var/log/afpd.log' and 'loglevel = default:maxdebug' in /usr/local/etc/afp.conf doesn't create a log file in /var/log, either.

Is there maybe anybody who could provide a basic afp.conf file, known to be functional, for further troubleshooting?
dgsga
Tinkerer
Posts: 45
Joined: Wed Feb 17, 2021 8:13 pm

Re: Netatalk for macOS - networking classic and modern Macs

Post by dgsga »

I have no idea why the GCC 10 compiled Netatalk3 runs but the clang one doesn't. It's a pity as it would be good to just use the native macOS toolchain. I think it's something to do with the linking but I don't know how to fix it. In the meantime I'll keep using the GCC compiled version.
Post Reply