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