ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-users: Re: [Wireshark-users] [Wireshark-dev] T-Shark Cross Compilation issue

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 16 Oct 2009 14:04:23 -0700

On Oct 16, 2009, at 1:34 PM, Jeff Morriss wrote:

I think I may have (finally, after several wrong turns) figured out
what's wrong with cross-compilation: we're not calling
AC_CANONICAL_TARGET any more (this was commented out in rev 25232).

...presumably because it somehow caused problems with getting automake to have the Makefile create ustar tarballs by default:

	$ svn log configure.in

		...

	------------------------------------------------------------------------
r25232 | gerald | 2008-05-05 10:03:22 -0700 (Mon, 05 May 2008) | 3 lines

Have autoconf generate "ustar" tar files by default. This should let us have
	paths longer than 99 characters.

		...

and

	$ svn diff -r25231:25232 configure.in | more
	Index: configure.in
	===================================================================
	--- configure.in        (revision 25231)
	+++ configure.in        (revision 25232)
	@@ -1,7 +1,5 @@
	 # $Id$
	 #
	-AC_INIT(cfile.h)
	-
	 AC_PREREQ(2.52)

	 dnl Check for CPU / vendor / OS
	@@ -12,9 +10,10 @@

	 dnl AC_CANONICAL_HOST
	 dnl AC_CANONICAL_BUILD
	-AC_CANONICAL_TARGET
	+dnl AC_CANONICAL_TARGET

	-AM_INIT_AUTOMAKE(wireshark, 1.0.99)
	+AC_INIT(wireshark, 1.0.99)
	+AM_INIT_AUTOMAKE(tar-ustar)

	 AM_DISABLE_STATIC

Just un-commenting it breaks things, so can you try to see if it works
with configure.in starting like this:

Gerald? What was the problem that made you comment those out? Does moving the AC_CANONICAL_TARGET call after AC_INIT fix them?

(Also, Wireshark isn't a compiler, linker, assembler, or other build tool, so I don't think we need to worry about Canadian Cross builds; I'm not sure whether that means that we should remove AC_CANONICAL_TARGET and un-comment AC_CANONICAL_BUILD and AC_CANONICAL_HOST or not. The autoconf documentation says, in the Obsolete Macros section:

	http://www.gnu.org/software/autoconf/manual/autoconf.html#Obsolete-Macros

that running AC_CANONICAL_TARGET is sufficient to run the other macros:

	— Macro: AC_CANONICAL_SYSTEM
Determine the system type and set output variables to the names of the canonical system types. See Canonicalizing, for details about the variables this macro sets.

The user is encouraged to use either AC_CANONICAL_BUILD, or AC_CANONICAL_HOST, or AC_CANONICAL_TARGET, depending on the needs. Using AC_CANONICAL_TARGET is enough to run the two other macros (see Canonicalizing).

although it doesn't say that in the Canonicalizing section, so I don't know whether that's a formal commitment or not.)