From 64666e5fc9a170a0d47e5ec96bd95c937675177d Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 13 Mar 2013 20:10:47 -0400 Subject: [PATCH] build: Integrate Gnulib non-recursively using fix-gnulib. --- .gitignore | 1 + .gitmodules | 3 +++ Makefile.am | 22 +++++++++++----------- autogen.sh | 23 ----------------------- bootstrap | 41 +++++++++++++++++++++++++++++++++++++++++ common | 1 + configure.ac | 4 +++- m4/gnulib-cache.m4 | 5 +++-- src/Makefile.inc | 6 ++++-- 9 files changed, 67 insertions(+), 39 deletions(-) delete mode 100755 autogen.sh create mode 100755 bootstrap create mode 160000 common diff --git a/.gitignore b/.gitignore index c7c5662..d86e878 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ aclocal.m4 autom4te.cache /snippet +/exported.sh /lib missing diff --git a/.gitmodules b/.gitmodules index 009ae43..9d11b2e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "gnulib"] path = gnulib url = git://git.savannah.gnu.org/gnulib.git +[submodule "common"] + path = common + url = git://repo.or.cz/dxcommon.git diff --git a/Makefile.am b/Makefile.am index b5f27b1..7be6e9c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,22 +4,22 @@ # notice and this notice are preserved. This file is offered as-is, # without any warranty. -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -I common/m4 -EXTRA_DIST = m4/gnulib-cache.m4 -CLEANFILES = +EXTRA_DIST = m4/gnulib-cache.m4 +CLEANFILES = +MOSTLYCLEANFILES = AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib -AM_LDFLAGS = -L$(top_builddir)/lib -dist_man_MANS = -dist_doc_DATA = -noinst_HEADERS = -lib_LTLIBRARIES = -bin_PROGRAMS = +dist_man_MANS = +dist_doc_DATA = +noinst_HEADERS = +lib_LTLIBRARIES = +noinst_LTLIBRARIES = +bin_PROGRAMS = include doc/Makefile.inc include src/Makefile.inc include src/gui/Makefile.inc - -SUBDIRS = lib . +include lib/gnulib.mk diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 66a90e8..0000000 --- a/autogen.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -die() -{ - echo $@ 1>&2 - exit 1 -} - -test -d m4 || mkdir m4 -test -d lib || mkdir lib - -git submodule update --init || echo "Failed to update Gnulib sources from git." -if test -x gnulib/gnulib-tool; then - gnulib/gnulib-tool --update || die "Failed to update gnulib." -else - die "Gnulib sources are not properly installed in gnulib/" -fi - -aclocal -I m4 || die "Failed to run aclocal." -autoheader || die "Failed to run autoheader." -libtoolize --copy || die "Failed to run libtoolize." -automake --add-missing || die "Failed to run automake." -autoconf || die "Failed to run autoconf." diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..460094f --- /dev/null +++ b/bootstrap @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Copyright © 2011-2012 Nick Bowler +# +# Simple script to get started from a fresh git checkout. +# +# License WTFPL2: Do What The Fuck You Want To Public License, version 2. +# This is free software: you are free to do what the fuck you want to. +# There is NO WARRANTY, to the extent permitted by law. + +scriptname=$0 + +err() { + printf '%s: %s\n' "$scriptname" "$@" 1>&2 +} + +die() { + err "$@" + exit 1 +} + +: ${AUTORECONF=autoreconf} +: ${GNULIB=gnulib} +: ${GIT=git} +: ${PERL=perl} + +$GIT submodule update --init || err "Failed to update submodules from git." + +if test -x $GNULIB/gnulib-tool; then + $GNULIB/gnulib-tool --update -S || die "Failed to update Gnulib." +else + die "Gnulib sources are not properly installed in gnulib/." +fi + +$PERL common/scripts/fix-gnulib.pl -o lib/gnulib.mk -i lib/gnulib.mk.in \ + || die "Failed to fixup Gnulib makefile fragment." + +# Punt some automake-generated files so that Gentoo's wrapper script doesn't +# try to detect the automake version in use. +rm -f Makefile.in aclocal.m4 +$AUTORECONF -fis diff --git a/common b/common new file mode 160000 index 0000000..3bc1572 --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit 3bc1572c6a889842c58ab9d1a7958708b2ba8a42 diff --git a/configure.ac b/configure.ac index 0403ca1..2a3ddca 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,9 @@ gl_EARLY AC_HEADER_ASSERT LT_INIT gl_INIT + +m4_include([lib/gnulib.mk]) + PKG_PROG_PKG_CONFIG AC_ARG_ENABLE([lbximg], @@ -54,7 +57,6 @@ AM_CONDITIONAL([BUILD_LBXGUI], [test x"$have_gtk" = x"yes"]) AC_CONFIG_FILES([ Makefile - lib/Makefile ]) AC_OUTPUT diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 43eb7f3..1f1f05f 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files fnmatch getopt-gnu +# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk.in --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files fnmatch getopt-gnu # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -42,7 +42,8 @@ gl_PO_BASE([]) gl_DOC_BASE([doc]) gl_TESTS_BASE([tests]) gl_LIB([libgnu]) -gl_MAKEFILE_NAME([]) +gl_MAKEFILE_NAME([gnulib.mk.in]) +gl_CONDITIONAL_DEPENDENCIES gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) diff --git a/src/Makefile.inc b/src/Makefile.inc index 1bd16f3..0200866 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -15,11 +15,13 @@ liblbx_la_LDFLAGS = -export-symbols-regex '^lbx_' bin_PROGRAMS += lbxtool lbxtool_SOURCES = src/lbxtool.c -lbxtool_LDADD = liblbx.la -lgnu +lbxtool_LDADD = liblbx.la libgnu.la +$(lbxtool_OBJECTS): $(gnulib_headers) if BUILD_LBXIMG bin_PROGRAMS += lbximg lbximg_SOURCES = src/lbximg.c -lbximg_LDADD = liblbx.la $(LIBPNG_LIBS) -lgnu +lbximg_LDADD = liblbx.la libgnu.la $(LIBPNG_LIBS) lbximg_CFLAGS = $(LIBPNG_CFLAGS) +$(lbximg_OBJECTS): $(gnulib_headers) endif -- 2.43.0