From: Nick Bowler Date: Thu, 10 May 2012 02:18:37 +0000 (-0400) Subject: build: Integrate Gnulib non-recursively using fix-gnulib. X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/commitdiff_plain/d2aa316f6b44d403eec7d010a55ac824fd83662b build: Integrate Gnulib non-recursively using fix-gnulib. --- diff --git a/.gitmodules b/.gitmodules index 009ae43..13c6889 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://git.draconx.ca/dxcommon.git diff --git a/Makefile.am b/Makefile.am index eb605df..8f5aac9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,14 +7,17 @@ AUTOMAKE_OPTIONS = parallel-tests color-tests ACLOCAL_AMFLAGS = -I m4 +MOSTLYCLEANFILES = +noinst_LTLIBRARIES = + AM_CPPFLAGS = -I$(top_srcdir)/src EXTRA_DIST = m4/gnulib-cache.m4 dist_man_MANS = doc/man/upkg.1 -DIST_SUBDIRS = libltdl lib src -SUBDIRS = lib +DIST_SUBDIRS = libltdl src +SUBDIRS = . if BUNDLED_LIBLTDL SUBDIRS += libltdl @@ -23,7 +26,7 @@ endif SUBDIRS += src check_PROGRAMS = test/decodeindex -test_decodeindex_LDADD = src/libupkg.la lib/libgnu.la +test_decodeindex_LDADD = src/libupkg.la libgnu.la TESTS_ENVIRONMENT = SHELL='$(SHELL)' EXEEXT='$(EXEEXT)' TEST_EXTENSIONS = .sh @@ -31,3 +34,5 @@ SH_LOG_COMPILER = $(SHELL) TESTS = tests/libupkg-index-decode.sh EXTRA_DIST += $(TESTS) + +include $(top_srcdir)/lib/gnulib.mk diff --git a/bootstrap b/bootstrap index abdb256..557a9a4 100755 --- a/bootstrap +++ b/bootstrap @@ -1,19 +1,38 @@ #!/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. -die() -{ - echo $@ 1>&2 +scriptname=$0 + +err() { + printf '%s: %s\n' "$scriptname" "$@" 1>&2 +} + +die() { + err "$@" exit 1 } -test -d m4 || mkdir m4 -test -d lib || mkdir lib +: ${AUTORECONF=autoreconf} +: ${GNULIB=gnulib} +: ${GIT=git} +: ${PERL=perl} -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." +$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/" + die "Gnulib sources are not properly installed in gnulib/." fi -autoreconf -fis +$PERL common/scripts/fix-gnulib.pl -o lib/gnulib.mk -i lib/gnulib.mk.in \ + || die "Failed to fixup Gnulib makefile fragment." + +$AUTORECONF -fis diff --git a/common b/common new file mode 160000 index 0000000..bfc45d6 --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit bfc45d64ca8ad53b1ac7c446b066699fecb7d2c3 diff --git a/configure.ac b/configure.ac index fa51318..3066977 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,8 @@ AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x]) gl_INIT +m4_include([lib/gnulib.mk]) + CHECK_GLIB_2([], [gobject]) AC_ARG_WITH([modlib], @@ -64,7 +66,6 @@ GOB2_CHECK([2.0.0]) AC_CONFIG_FILES([ Makefile libltdl/Makefile - lib/Makefile src/Makefile libuobject.pc ]) diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 1869e41..78b24d9 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 getopt-gnu strcase +# 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 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files getopt-gnu strcase # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -42,7 +42,7 @@ gl_PO_BASE([]) gl_DOC_BASE([doc]) gl_TESTS_BASE([tests]) gl_LIB([libgnu]) -gl_MAKEFILE_NAME([]) +gl_MAKEFILE_NAME([gnulib.mk.in]) gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) diff --git a/src/Makefile.am b/src/Makefile.am index 0ed7064..5a0b682 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,7 @@ bin_PROGRAMS = upkg upkg_SOURCES = upkg.c upkg_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) upkg_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -upkg_LDADD = libuobject.la libupkg.la $(GLIB_LIBS) -lgnu +upkg_LDADD = libuobject.la libupkg.la $(GLIB_LIBS) $(top_builddir)/libgnu.la GOB_V = $(GOB_V_$(V)) GOB_V_ = $(GOB_V_$(AM_DEFAULT_VERBOSITY)) diff --git a/src/uobject/Makefile.inc b/src/uobject/Makefile.inc index 1a436bd..f3e4cbd 100644 --- a/src/uobject/Makefile.inc +++ b/src/uobject/Makefile.inc @@ -17,4 +17,4 @@ libuobject_la_SOURCES = uobject/uobject.c uobject/module.c uobject/avl.c \ libuobject_la_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(LTDLINCL) \ -DPKGLIBDIR=\"$(pkglibdir)\" -DPKGDATADIR=\"$(pkgdatadir)\" libuobject_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^u_' -libuobject_la_LIBADD = $(LIBLTDL) $(GLIB_LIBS) -lgnu +libuobject_la_LIBADD = $(LIBLTDL) $(GLIB_LIBS) $(top_builddir)/libgnu.la