diff options
author | Richard Weinberger <richard@nod.at> | 2016-04-26 22:09:08 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2016-11-17 11:36:55 +0100 |
commit | d39ea7019cb204420c53a203ff9ccbb4cab0d4b3 (patch) | |
tree | 313257adc2b8242c298d060ea29a256fa7394011 /configure.ac | |
parent | f600c700fcc7e703698c1a1164f14ad8d42479b1 (diff) |
Change build system to autotools
This patch is largely based on Richards original RFC.
The major differences to the RFC patch are:
- Add missing sumtools & mtdpart targets
- Fix name of mkfs.jffs2 target
- Add missing subdir-objects option for non-recursive make
- Move all automake options to configure.ac
- Add manpages to install target
- Make XATTR & LZO support configurable
- Install binaries to sbin directory like in the old build system
- Install flash_erase wrapper script
- Add files missing from distribution target
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c021c6d --- /dev/null +++ b/configure.ac @@ -0,0 +1,47 @@ +AC_PREREQ([2.60]) + +AC_INIT([mtd-utils], 1.5.2, [linux-mtd@lists.infradead.org], mtd-utils) +AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2]) +AM_SILENT_RULES([yes]) +AC_PROG_LIBTOOL +AC_DISABLE_STATIC +AC_PROG_CC +AC_PROG_INSTALL + +AC_ARG_WITH([xattr], + [AS_HELP_STRING([--without-xattr], + [Disable support forextended file attributes])], + [case "${withval}" in + yes) AM_CONDITIONAL([WITHOUT_XATTR], [false]) ;; + no) AM_CONDITIONAL([WITHOUT_XATTR], [true]) ;; + *) AC_MSG_ERROR([bad value ${withval} for --without-xattr]) ;; + esac], + [AM_CONDITIONAL([WITHOUT_XATTR], [false])]) + + +AC_ARG_WITH([lzo], + [AS_HELP_STRING([--without-lzo], [Disable support for LZO compression])], + [case "${withval}" in + yes) AM_CONDITIONAL([WITHOUT_LZO], [false]) ;; + no) AM_CONDITIONAL([WITHOUT_LZO], [true]) ;; + *) AC_MSG_ERROR([bad value ${withval} for --without-lzo]) ;; + esac], + [AM_CONDITIONAL([WITHOUT_LZO], [false])]) + + +PKG_CHECK_MODULES(ZLIB, [ zlib ]) +PKG_CHECK_MODULES(UUID, [ uuid ]) + +AM_COND_IF([WITHOUT_LZO], [], [ + have_lzo="yes" + AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo]) + AC_ARG_VAR([LZO_LIBS], [linker flags for lzo]) + AC_CHECK_LIB([lzo2], [lzo1x_1_15_compress], [LZO_LIBS="-llzo2"], + [AC_CHECK_LIB([lzo],[lzo1x_1_15_compress],[LZO_LIBS="-llzo"], + [have_lzo="no"] + )] + ) + test "${have_lzo}" != "yes" && AC_MSG_ERROR([lzo missing]) +]) + +AC_OUTPUT([Makefile]) |