27 Jun 2007 harinath   » (Journeyer)

automake, make dist and long filenames

Harish noticed some strange behaviour with ‘make dist’. He later found out that it had to do with a file with an overly long pathname. Automake 1.9 by default forces ‘tar’ to work in the “most compatible” mode, and that mode supports pathnames only upto 99 characters long.

The solution is to ask automake to request tar to use the POSIX standard ‘pax’ format. Add a line like the following in the top-level Makefile.am.

AUTOMAKE_OPTIONS = tar-pax

However, life wouldn’t be interesting if it was so simple.

  • This option is not backwards compatible: older versions of automake don’t know about it, and they barf on unknown options
  • The tar that comes with SuSE 9.2 (IIRC) doesn’t support ‘pax’, but does support the ‘ustar’ format, an older POSIX standard. Luckily automake has an option to request ‘ustar’ format: tar-ustar

That gets us to mono’s solution. Here’s the configure.in tidbit that does the trick:

# Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
# The extra brackets are to foil regex-based scans.
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])

Now, please forget this trick, it’s gross. Just use automake 1.9.

PS: There’s an even simpler trick: start distributing ZIP files (make dist-zip) instead :-)

Syndicated 2006-01-18 14:22:00 from Slow and Steady

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!