#38 Makefile bug in squashfs-tools

closed-rejected
nobody
None
5
2010-07-16
2010-01-14
No

If you're cross-building and you're invoking Make with an explicit set of CFLAGS from the command line, this will fail.

Recommend changing:

CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2

to:

CPPFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2

instead (as I don't believe the default .c.o rule in gmake includes $(DEFINES)).

Discussion

  • Other change to make:

    --- squashfs4.0-target/squashfs-tools/sort.c.orig 2010-01-14 19:52:14.000000000 -0800
    +++ squashfs4.0-target/squashfs-tools/sort.c 2010-01-14 19:55:12.000000000 -0800
    @@ -34,7 +34,7 @@
    #include <string.h>
    #include <stdlib.h>

    -#include <squashfs_fs.h>
    +#include "squashfs_fs.h"
    #include "global.h"
    #include "sort.h"

     
  • And another change:

    --- squashfs4.0/squashfs-tools/unsquashfs.c.orig 2010-01-14 21:33:39.000000000 -0800
    +++ squashfs4.0/squashfs-tools/unsquashfs.c 2010-01-14 21:39:17.000000000 -0800
    @@ -21,6 +21,10 @@
    * unsquashfs.c
    */

    +#ifdef linux
    +#include <sys/sysinfo.h>
    +#endif
    +
    #include "unsquashfs.h"
    #include "squashfs_swap.h"
    #include "squashfs_compat.h"

     
  • Do you need anything else from me to close out this bug? Please let me know.

     
  • It is impossible to create a Makefile that will work for all users (especially cross compilation) out of the box, and it is a waste of my time trying to do so. All cross compiling frameworks (i.e. openembedded, buildroot) routinely patch Makefiles for cross compilation and their developers expect to have to do this. You have the source and if you're trying to cross compile then it can be assumed you know what you're doing and can alter the Makefiles as necessary.

     
    • status: open --> closed-rejected