rdmark/netatalk-2.x

Compile failure on Ubuntu 18.04

snhirsch opened this issue · 26 comments

Trying to build on Ubuntu 18.04. Invariably terminates with:

Makefile:871: ../../etc/afpd/.deps/test-uam.Po: No such file or directory
Makefile:872: ../../etc/afpd/.deps/test-unix.Po: No such file or directory
Makefile:873: ../../etc/afpd/.deps/test-volume.Po: No such file or directory
make[3]: *** No rule to make target '../../etc/afpd/.deps/test-volume.Po'.  Stop.
make[3]: Leaving directory '/net/src/net/netatalk/archive/Netatalk-2.x/test/afpd'
Makefile:429: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/net/src/net/netatalk/archive/Netatalk-2.x/test'
Makefile:482: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/net/src/net/netatalk/archive/Netatalk-2.x'
Makefile:412: recipe for target 'all' failed
make: *** [all] Error 2
Press any key to continue...

Please let me know what information you might need to debug this?

@snhirsch Thanks for reporting. As I mentioned over in the 68kmla thread, one thing you could do to help troubleshooting is to try building upstream branch-netatalk-2-2: https://github.com/Netatalk/Netatalk/tree/branch-netatalk-2-2

Don't use the stable 2.2.6 release, but rather the latest HEAD.

Same issue with the branch HEAD:

hirsch@z87:/net/src/net/netatalk/archive/netatalk-code$ git status 
On branch branch-netatalk-2-2
Your branch is up to date with 'origin/branch-netatalk-2-2'.

nothing to commit, working tree clean

I picked through Makefile.in and cannot find anything different about rules for 'test-volume' beyond the fact that it's placed last in a couple of the lists and sequences.

Interesting, so this goes even further back. I don't have too much insights into the inner workings of Autotools and Makefiles, so what I can suggest is to keep doing binary search to figure out if this broke with a particular change, or if it never worked in the first place.

You could try 2.2.6, 2.2.5... Although you might run into OpenSSL library incompatibilities, which require you to cherry pick a few upstream patches.

The one Makefile related patch that I helped authoring upstream is this one: Netatalk@74f73ea
You could always try the parent commit to see if this was the breaking point.

Bingo. The parent of 74f73ea... builds without errors. Have files been added, removed or relocated since then? If not I would think that Makefile.in might correct the issue as a workaround.

With this patch to configure.ac your latest GitHub version builds without error:

--- configure.ac.orig   2022-08-17 13:04:51.193021262 -0400
+++ configure.ac        2022-08-17 14:35:10.310742089 -0400
@@ -1,14 +1,13 @@
 dnl configure.in for netatalk

-AC_INIT([netatalk], [m4_esyscmd([echo -n `cat VERSION`])])
+AC_INIT(etc/afpd/main.c)

 NETATALK_VERSION=`cat $srcdir/VERSION`
 AC_SUBST(NETATALK_VERSION)

 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE([subdir-objects])
+AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
 AM_CONFIG_HEADER(config.h)
-AC_CONFIG_MACRO_DIRS([macros])
 AM_MAINTAINER_MODE([enable])

 dnl Checks for programs.

I have not installed or tested yet.

Good catch. So this change was made for forwards compatibility with automake. By reverting this we'd break compatibility with bleeding edge distros. This is the warning message from automake 1.16:

$ ./bootstrap
+ rm -rf autom4te.cache
+ aclocal -I macros
+ autoheader
+ libtoolize --force --copy
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in 'macros'.
libtoolize: copying file 'macros/libtool.m4'
libtoolize: copying file 'macros/ltoptions.m4'
libtoolize: copying file 'macros/ltsugar.m4'
libtoolize: copying file 'macros/ltversion.m4'
libtoolize: copying file 'macros/lt~obsolete.m4'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([macros])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
+ automake --include-deps --add-missing --foreign --copy
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.ac:12: installing './compile'
configure.ac:6: installing './missing'
bin/ad/Makefile.am: installing './depcomp'
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_asp.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_avahi.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_mdns.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_config.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_dsi.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_options.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_util.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afprun.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/appl.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/auth.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/afp_zeroconf.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/catsearch.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/desktop.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/dircache.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/directory.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/enumerate.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/extattrs.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/fce_api.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/fce_util.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/file.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/filedir.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/fork.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/gettok.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/hash.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/mangle.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/messages.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/nfsquota.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/ofork.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/quota.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/status.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/switch.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/uam.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/unix.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
test/afpd/Makefile.am:12: warning: source file '$(top_builddir)/etc/afpd/volume.c' is in a subdirectory,
test/afpd/Makefile.am:12: but option 'subdir-objects' is disabled
+ autoconf
+ exit 0

Interestingly, I see the same warnings with my system! But, it then builds correctly. Might be worthwhile including a modified (and renamed) configure.ac as a workaround for folks with older environments.

Are all those three changed lines mandatory or can we refine it further?

Grrr. I went back to a clean checkout of your project and am running into all sorts of siliness that didn't occur the last time. Missing libraries galore. And, the configure.ac file is nothing like the one that was there before. I must have wrapped myself completely into a circle somehow. I did note that none of the cleanup targets really worked properly so I must wedged myself into a state where it somehow could build. Currently trying to figure out why it cannot find libevent (never asked for it before).

UPDATE: My bad... Was on the master branch instead of 2-2. Still working.

So, this seems to be the minimum change required to build on Ubuntu 18.04:

diff --git a/configure.ac b/configure.ac
index f1cd934f..f23a08d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ NETATALK_VERSION=`cat $srcdir/VERSION`
 AC_SUBST(NETATALK_VERSION)
 
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE([subdir-objects])
+AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIRS([macros])
 AM_MAINTAINER_MODE([enable])

Not installed or tested, but it seems to all be there. Maybe leave that line in, but commented out with a note about workaround for older environments?

As per the automake documentation, you probably want to keep the legacy syntax for AC_INIT as well. See: https://www.gnu.org/software/automake/manual/html_node/Public-Macros.html

Otherwise, the macro will define the package name and version twice, which is not great.

Having the commented out lines for old systems is definitely an easy solution, but not great for discoverability. I read up on automake conditionals a little but couldn't find a way to do this more cleanly, yet. https://www.gnu.org/software/automake/manual/html_node/Usage-of-Conditionals.html

As should be clear, I am far from an expert on autotools. Do you have a handle on the semantic difference between the old and new macros? I just dragged out an older (2000) book on GNU Autotools and will refresh what little I know about them.

The one semantic difference that I could spot, from my limited understanding, is that the 'subdir-objects' flag is implicit in the old syntax, but has to be specified in the new syntax.

Apart from this, it's just a difference of where you define the package name, version string, and config source dir, I think.

Actually, could you test if this patch makes a difference in your environment? This was the one piece of logic that was dropped with the patch that I made last year. I doesn't seem to be a critical portion, but I'm just curious if it helps with backwards compatibility,

diff --git a/configure.ac b/configure.ac
index 8369bd0d..1fd0a86c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,7 @@
 dnl configure.in for netatalk

 AC_INIT([netatalk],[m4_esyscmd([echo -n `cat VERSION`])])
+AC_CONFIG_SRCDIR([etc/afpd/main.c])

 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([subdir-objects])

No, that yields the same error.

Just for fun you may want to try Netatalk-Classic, which has gone even further in refactoring the Makefiles. (https://github.com/christopherkobayashi/netatalk-classic)

That is just hopelessly broken on my system. Locked to specific, newer versions of automake and autoconf and newer compiler as well. Please do not use his build system as a guide! You have a much more flexible base at the moment.

UPDATE: Were you aware of this online doc? https://autotools.info/

This is a neat resource; thanks for sharing. Well noted on the compatibility there. I won't bring over the refactorings from that fork until autotools start to complain again about deprecated syntax.

But for the present situation are you planning to at least document the build workaround?

Yes, this is what I came up with: d29d011
If you don't mind please test that it's the right syntax!

Did you push that change to the netatalk-2-2 branch? Git pull is not getting anything.

Ah - didn't realize that. Thanks.

Does the code in the netatalk-2-x branch work for you?

Yes, it builds without incident. Still have not tried to install or run it. Thanks for your attention to the issue! Sounds like the workaround would be useful to the other person who reported it on the 68k forum (I think that's where it was).