]> git.draconx.ca Git - upkg.git/commitdiff
build: Integrate Gnulib non-recursively using fix-gnulib.
authorNick Bowler <nbowler@draconx.ca>
Thu, 10 May 2012 02:18:37 +0000 (22:18 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 10 May 2012 02:32:04 +0000 (22:32 -0400)
.gitmodules
Makefile.am
bootstrap
common [new submodule]
configure.ac
m4/gnulib-cache.m4
src/Makefile.am
src/uobject/Makefile.inc

index 009ae439e17f5a7d068ab9c2eeb06851c175f255..13c6889c31de538944a21e573883bce870286538 100644 (file)
@@ -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
index eb605df6ffd6d46e98a9deaabe4e5ee558fd95da..8f5aac96c0828c133c7900327021ae43ab5b5cff 100644 (file)
@@ -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
index abdb256c82bf75716ea9274a3e724b03dad5c6d0..557a9a46c8a8f22e5c78ff6089cd109276a80b57 100755 (executable)
--- 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 (submodule)
index 0000000..bfc45d6
--- /dev/null
+++ b/common
@@ -0,0 +1 @@
+Subproject commit bfc45d64ca8ad53b1ac7c446b066699fecb7d2c3
index fa51318f6711a61d08a41a68b4d71b7494b15be9..3066977395b98845081a36322e6ec6faa7a8cc79 100644 (file)
@@ -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
 ])
index 1869e41d18451ec777a9c3df7055c277fc8301e2..78b24d9aabf42f8cbb0eb71a587a17afd55cce92 100644 (file)
@@ -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([])
index 0ed706444898abb7feda2446367ba1fe7d2d2d0b..5a0b6826769b33fb7e45e0241918b0bae3e6d507 100644 (file)
@@ -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))
index 1a436bd6d3b606f0ea372c2c5593279a55595638..f3e4cbdedc4213632c9d54cf7bbbee090e99514a 100644 (file)
@@ -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