From: Robert Schwebel Subject: [patch] add autotool based build system In order to be able to cross build usplash, add an autotools based build system. Signed-off-by: Robert Schwebel --- Makefile.am | 50 ++++++++++++++ autogen.sh | 22 ++++++ bogl/Makefile.am | 92 +++++++++++++++++++++++++ configure.ac | 170 ++++++++++++++++++++++++++++++++++++++++++++++++ svgalib/Makefile.am | 3 svgalib/gl/Makefile.am | 28 +++++++ svgalib/src/Makefile.am | 35 +++++++++ 7 files changed, 400 insertions(+) Index: b/bogl/Makefile.am =================================================================== --- /dev/null +++ b/bogl/Makefile.am @@ -0,0 +1,92 @@ + +AM_CFLAGS = \ + -fPIC -I../ + +lib_LTLIBRARIES = libbogl.la +bin_PROGRAMS = bdftobogl pngtobogl bterm reduce-font +EXTRA_PROGRAMS = bogl-test bowl-boxes + +LIBBOGLSOURCES = \ + bogl.c \ + bogl-font.c \ + bogl-cfb.c \ + bogl-pcfb.c \ + bogl-tcfb.c + +if BUILD_VGA16 +LIBBOGLSOURCES += bogl-vga16.c +endif + +LIBBOMLSOURCES = \ + arrow.c \ + boml.c + +LIBBOWLSOURCES = \ + bowl.c \ + symbol.c + +LIBRSRCSOURCES = \ + helvB10.c \ + helvB12.c \ + helvR10.c \ + timBI18.c \ + tux75.c + +bdftobogl_SOURCES = \ + bdftobogl.c \ + $(LIBBOGLSOURCES) + +pngtobogl_SOURCES = \ + pngtobogl.c + +pngtobogl_CFLAGS = \ + $(libpng_CFLAGS) + +pngtobogl_LDADD = \ + -lgd -lm \ + $(libpng_LIBS) + +reduce_font_SOURCES = \ + reduce-font.c + +libbogl_la_SOURCES = \ + $(LIBBOGLSOURCES) \ + $(LIBBOMLSOURCES) \ + $(LIBBOWLSOURCES) \ + $(LIBRSRCSOURCES) \ + bowl-boxes.c + +libbogl_la_CFLAGS = $(AM_CFLAGS) + +bterm_SOURCES = \ + bterm.c \ + bogl-term.c \ + bogl-bgf.c + +bterm_LDADD = \ + .libs/libbogl.a + +bterm_DEPENDENCIES = \ + libbogl.la + +%.c: %.bdf bdftobogl + ./bdftobogl $< > $@ + +%.c: %.png pngtobogl + ./pngtobogl $< > $@ + +bogl_test_SOURCES = \ + bogl-test.c \ + tux75.c + +bogl_test_LDADD = \ + .libs/libbogl.a + +bogl_test_DEPENDENCIES = \ + libbogl.la + + +bowl_boxes_SOURCES = \ + $(libbogl_la_SOURCES) + +SUFFIXES: .png .bdf Index: b/Makefile.am =================================================================== --- /dev/null +++ b/Makefile.am @@ -0,0 +1,50 @@ + +SUBDIRS = $(BACKEND_dir) + +sbin_PROGRAMS = usplash usplash_write +lib_LTLIBRARIES = libusplash.la +dist_sbin_SCRIPTS = usplash_down update-usplash-theme + +include_HEADERS = libusplash.h usplash-theme.h usplash_backend.h +noinst_HEADERS = usplash.h usplash_bogl_backend.h usplash_svga_backend.h + +AM_CFLAGS = \ + -fPIC \ + -Ibogl + +libusplash_la_SOURCES = \ + libusplash.c \ + usplash-testcard.c \ + usplash-testcard-theme.c \ + bogl/helvB10.c + +libusplash_la_LIBADD = \ + -ldl + +if SVGA_BACKEND +SUBDIRS += svgalib +libusplash_la_SOURCES += usplash_svga.c +libusplash_la_LIBADD += -lx86 svgalib/gl/libvgagl.a svgalib/src/libvga.a +AM_CFLAGS += -DSVGA +endif + +SUBDIRS += bogl +libusplash_la_SOURCES += usplash_bogl.c +libusplash_la_LIBADD += bogl/.libs/libbogl.a + +usplash_SOURCES = \ + usplash.c + +usplash_LDADD = \ + libusplash.la + +usplash_write_SOURCES = \ + usplash_write.c + +%.c: %.bdf + ./bogl/bdftobogl $< > $@ + +%.c: %.png + ./bogl/pngtobogl $< > $@ + +SUFFIXES: .png .bdf Index: b/configure.ac =================================================================== --- /dev/null +++ b/configure.ac @@ -0,0 +1,170 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +AC_PREREQ(2.59) + +AC_INIT([usplash], [0.5.21], [bugs@pengutronix.de]) +AC_CONFIG_SRCDIR([libusplash.c]) +#AC_CONFIG_MACRO_DIR([config/m4]) +#AC_CONFIG_AUX_DIR([config/autoconf]) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AM_MAINTAINER_MODE + +CFLAGS="${CFLAGS} -Wall" + +# +# libtool library versioning stuff +# +# Library code modified: REVISION++ +# Interfaces changed/added/removed: CURRENT++ REVISION=0 +# Interfaces added: AGE++ +# Interfaces removed: AGE=0 +LT_CURRENT=0 +LT_REVISION=0 +LT_AGE=0 +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + + +# +# Checks for programs. +# +AC_PROG_CC +#AM_MISSING_PROG(PERL, perl, $missing_dir) +# libtool, old: +AC_LIBTOOL_WIN32_DLL +#AC_LIBTOOL_TAGS([]) +AC_PROG_LIBTOOL +# libtool, new: +# LT_INIT(win32-dll) + +AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2]) + +AC_DEFINE(BOGL_CFB_FB, 1, [Build cfb]) + +case $host_cpu in + i*86|arm*|x86_64|ia64) + build_vga16="yes" + AC_DEFINE(BOGL_VGA16_FB, 1, [Build vga16]) + ;; + *) + ;; +esac + +AM_CONDITIONAL(BUILD_VGA16, test "$build_vga16" = "yes") + +AC_MSG_CHECKING([whether to enable the SVGA backend]) +AC_ARG_ENABLE(svga-backend, + AS_HELP_STRING([--enable-svga-backend], [enable SVGA backend @<:@default=no@:>@]), + [ + case "$enableval" in + y | yes) CONFIG_SVGA=yes ;; + *) CONFIG_SVGA=no ;; + esac], + [CONFIG_SVGA=no]) +AC_MSG_RESULT([${CONFIG_SVGA}]) +AM_CONDITIONAL(SVGA_BACKEND, test "$CONFIG_SVGA" = "yes") + +# FIXME: +AM_CONDITIONAL(NO_ASM, test false) + +# +# Checks for libraries. +# + +## +# libgd +## +AC_CHECK_LIB([gd], [gdImageCreate], + libgd_LDFLAGS="-lgd" + AC_SUBST(libgd_LDFLAGS), + [AC_MSG_ERROR([cannot find/use libgd + This drawing library can be downloaded at http://www.boutell.com/gd])]) +AC_CHECK_HEADERS([gd.h],, [AC_MSG_ERROR([cannot find/use $ac_header])]) + +## +# libpng +## +REQUIRES_LIBPNG="libpng" +AC_SUBST(REQUIRES_LIBPNG) +PKG_CHECK_MODULES([libpng], + [${REQUIRES_LIBPNG}], + [], + [AC_MSG_ERROR([*** ${REQUIRES_LIBPNG} not found by pkg-config on your system])] +) +AC_SUBST(libpng_CFLAGS) +AC_SUBST(libpng_LIBS) + +# +# Checks for header files. +# +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([ \ + arpa/inet.h \ + limits.h \ + netdb.h \ + netinet/in.h \ + stddef.h \ + stdlib.h \ + string.h \ + sys/param.h \ + sys/socket.h \ + sys/time.h \ + sys/un.h \ + unistd.h \ + utime.h \ + ]) + + +# +# Checks for typedefs, structures, and compiler characteristics. +# +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME + + +# +# Checks for library functions. +# +AC_FUNC_MEMCMP +AC_TYPE_SIGNAL +AC_FUNC_STAT +AC_FUNC_UTIME_NULL +AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname gettimeofday memset mkdir socket utime]) + + +# +# Debugging +# +AC_MSG_CHECKING([whether to enable debugging]) +AC_ARG_ENABLE(debug, + AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=yes@:>@]), + [case "$enableval" in + y | yes) CONFIG_DEBUG=yes ;; + *) CONFIG_DEBUG=no ;; + esac], + [CONFIG_DEBUG=yes]) +AC_MSG_RESULT([${CONFIG_DEBUG}]) +if test "${CONFIG_DEBUG}" = "yes"; then + CFLAGS="${CFLAGS} -Wsign-compare -Wfloat-equal -Wformat-security -g -O1" + AC_DEFINE(DEBUG, 1, [debugging]) +else + CFLAGS="${CFLAGS} -O2" +fi + + +AC_CONFIG_FILES([ + Makefile + bogl/Makefile + svgalib/Makefile + svgalib/src/Makefile + svgalib/gl/Makefile + ]) +AC_OUTPUT + Index: b/autogen.sh =================================================================== --- /dev/null +++ b/autogen.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# +# usage: +# +# banner +# +banner() { + echo + TG=`echo $1 | sed -e "s,/.*/,,g"` + LINE=`echo $TG |sed -e "s/./-/g"` + echo $LINE + echo $TG + echo $LINE + echo +} + +banner "autoreconf" + +autoreconf --force --install --symlink -Wall || exit $? + +banner "Finished" Index: b/svgalib/gl/Makefile.am =================================================================== --- /dev/null +++ b/svgalib/gl/Makefile.am @@ -0,0 +1,28 @@ + +noinst_LIBRARIES = libvgagl.a + +libvgagl_a_CFLAGS = \ + -I$(srcdir)/../src/ \ + -fPIC + +libvgagl_a_CPPFLAGS = \ + -DNO_ASSEMBLY + +libvgagl_a_SOURCES = \ + cbitmap.c \ + driver.c \ + font8x8.c \ + grlib.c \ + line.c \ + palette.c \ + scale.c \ + mem.c \ + text.c + +# FIXME: +#if NO_ASM +#libvgagl_a_SOURCES += mem.c +#else +#libvgagl_a_SOURCES += mem.S +#endif + Index: b/svgalib/src/Makefile.am =================================================================== --- /dev/null +++ b/svgalib/src/Makefile.am @@ -0,0 +1,35 @@ + +noinst_LIBRARIES = libvga.a + +libvga_a_SOURCES = \ + accel.c \ + interface.c \ + modetab.c \ + timing.c \ + vesa.c \ + vga.c \ + vgaaccel.c \ + vgabgpage.c \ + vgabgvt.c \ + vgaclear.c \ + vgacol.c \ + vgaconvplanar.c \ + vgadraw.c \ + vgadrv.c \ + vgadump.c \ + vgaline.c \ + vgamisc.c \ + vgamodesel.c \ + vgapal.c \ + vgapci.c \ + vgapix.c \ + vgaregs.c + +libvga_a_CPPFLAGS = \ + -DINCLUDE_VESA_DRIVER \ + -DNO_ASSEMBLY \ + -DSVGALIB_CONFIG_FILE=\"/etc/vga/libvga.config\" + +libvga_a_CFLAGS = \ + -fPIC + Index: b/svgalib/Makefile.am =================================================================== --- /dev/null +++ b/svgalib/Makefile.am @@ -0,0 +1,3 @@ + +SUBDIRS = src gl +