build with autotools

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2012-06-12 09:48:05 +02:00
parent fc8f69c8bb
commit c850c8b404
17 changed files with 128 additions and 25 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
/*.o
/genimage
/Makefile.in
/Makefile

View File

@ -1,14 +0,0 @@
CFLAGS=-Wall
LDFLAGS=-lconfuse
all: genimage
DEPS = genimage.h list.h
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
genimage: genimage.o image-jffs2.o image-ext2.o image-ubi.o image-ubifs.o \
image-flash.o image-file.o image-tar.o image-hd.o util.o config.o
clean:
rm -f *.o genimage

47
Makefile.am Normal file
View File

@ -0,0 +1,47 @@
EXTRA_DIST = \
test.config \
flash.conf
CLEANFILES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\"
AM_CFLAGS = ${my_CFLAGS} \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections
AM_LDFLAGS = \
-Wl,--gc-sections \
-Wl,--as-needed
bin_PROGRAMS = genimage
genimage_SOURCES = \
genimage.c \
config.c \
util.c \
image-ext2.c \
image-file.c \
image-flash.c \
image-hd.c \
image-jffs2.c \
image-tar.c \
image-ubi.c \
image-ubifs.c
genimage_CFLAGS = \
$(AM_CFLAGS) \
$(CONFUSE_CFLAGS)
genimage_LDADD = \
$(CONFUSE_LIBS)
noinst_HEADERS = \
genimage.h \
list.h

19
autogen.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh -e
if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
chmod +x .git/hooks/pre-commit && \
echo "Activated pre-commit hook."
fi
autoreconf --install --symlink
args="--prefix=/usr"
echo
echo "----------------------------------------------------------------"
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
echo "./configure CFLAGS='-g -O0' $args"
echo

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

54
configure.ac Normal file
View File

@ -0,0 +1,54 @@
AC_PREREQ(2.60)
AC_INIT([genimage],
[1],
[s.hauer@pengutronix.de],
[genimage],
[http://www.pengutronix.de/genimage/])
AC_CONFIG_SRCDIR([genimage.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT([disable-static pic-only])
AC_PREFIX_DEFAULT([/usr])
AC_PROG_MKDIR_P
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
[], [enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"], [
AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
])
my_CFLAGS="-Wall \
-Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wpointer-arith \
-Wpointer-arith -Wsign-compare -Wchar-subscripts \
-Wstrict-prototypes -Wshadow \
-Wformat-security -Wtype-limits"
AC_SUBST([my_CFLAGS])
PKG_CHECK_MODULES(CONFUSE, libconfuse)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
=====
prefix: ${prefix}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
debug: ${enable_debug}
])

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <confuse.h>
#include <stdlib.h>

View File

@ -1,4 +1,3 @@
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -1,4 +1,3 @@
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

View File

@ -15,7 +15,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>

6
m4/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4

1
util.c
View File

@ -1,4 +1,3 @@
#define _GNU_SOURCE
#include <confuse.h>
#include <stdio.h>
#include <string.h>