]> git.draconx.ca Git - liblbx.git/commitdiff
gnulib: Use getopt-gnu module for increased tool portability.
authorNick Bowler <nbowler@draconx.ca>
Thu, 4 Feb 2010 02:28:29 +0000 (21:28 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 4 Feb 2010 05:16:21 +0000 (00:16 -0500)
.gitignore
.gitmodules [new file with mode: 0644]
Makefile.am
autogen.sh
configure.ac
gnulib [new submodule]
m4/.gitignore
m4/gnulib-cache.m4 [new file with mode: 0644]
src/Makefile.inc
src/lbximg.c
src/lbxtool.c

index 553713130c3b909a73e4197adda63faeab8177aa..fbef22223a4cf2ce56136147e1d70cf46c92778d 100644 (file)
@@ -26,6 +26,10 @@ ltmain.sh
 aclocal.m4
 autom4te.cache
 
+arg-nonnull.h
+warn-on-use.h
+lib
+
 missing
 depcomp
 install-sh
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..009ae43
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "gnulib"]
+       path = gnulib
+       url = git://git.savannah.gnu.org/gnulib.git
index 6830ab59cc3139c7a36fff1af07a84e250bbd1cb..13f63546de23620463e9e1752163b765335e2f79 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Nick Bowler
+# Copyright (C) 2009-2010 Nick Bowler
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
 # notice and this notice are preserved.  This file is offered as-is,
@@ -6,6 +6,11 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
+EXTRA_DIST = m4/gnulib-cache.m4
+
+AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
+AM_LDFLAGS  = -L$(top_builddir)/lib
+
 dist_man_MANS   =
 dist_doc_DATA   =
 noinst_HEADERS  =
@@ -14,3 +19,5 @@ bin_PROGRAMS    =
 
 include doc/Makefile.inc
 include src/Makefile.inc
+
+SUBDIRS = lib .
index 9db4e70f6a7ba547e6031717d65d5ef3568330dd..66a90e88d02770067bb6940ee7d0584ebe679c15 100755 (executable)
@@ -6,7 +6,15 @@ die()
        exit 1
 }
 
-test -d m4 || mkdir m4
+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."
index 758b1c86979cca697b66d1c1900205cb13b96ff1..eb4ff46ad35852b96fe770c4a4ccf0a24426492a 100644 (file)
@@ -14,16 +14,21 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 AC_PROG_CC_C99
+gl_EARLY
+
 AC_HEADER_ASSERT
 AC_C_BIGENDIAN
 
 LT_INIT
 
+gl_INIT
+
 CHECK_LIBPNG([1.2], [have_libpng=yes], [have_libpng=no])
 AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"])
 
 AC_CONFIG_FILES([
        Makefile
+       lib/Makefile
 ])
 
 AC_OUTPUT
diff --git a/gnulib b/gnulib
new file mode 160000 (submodule)
index 0000000..9d0ad65
--- /dev/null
+++ b/gnulib
@@ -0,0 +1 @@
+Subproject commit 9d0ad652de159d08e5f679842f8a2a5658196361
index f6749fb0986c78b6844f2118e2c6944f89d1c5f4..f8a49976e4f9c5db1923b7216c6af2cabe2bb463 100644 (file)
@@ -3,3 +3,15 @@ ltoptions.m4
 ltsugar.m4
 ltversion.m4
 libtool.m4
+00gnulib.m4
+argz.m4
+extensions.m4
+getopt.m4
+gnulib-common.m4
+gnulib-comp.m4
+gnulib-tool.m4
+include_next.m4
+stddef_h.m4
+unistd_h.m4
+warn-on-use.m4
+wchar_t.m4
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
new file mode 100644 (file)
index 0000000..f2f0300
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the specification of how gnulib-tool is used.
+# It acts as a cache: It is written and read by gnulib-tool.
+# In projects using CVS, this file is meant to be stored in CVS,
+# like the configure.ac and various Makefile.am files.
+
+
+# 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=. --libtool --macro-prefix=gl --no-vc-files getopt-gnu
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([
+  getopt-gnu
+])
+gl_AVOID([])
+gl_SOURCE_BASE([lib])
+gl_M4_BASE([m4])
+gl_PO_BASE([])
+gl_DOC_BASE([doc])
+gl_TESTS_BASE([tests])
+gl_LIB([libgnu])
+gl_MAKEFILE_NAME([])
+gl_LIBTOOL
+gl_MACRO_PREFIX([gl])
+gl_PO_DOMAIN([])
+gl_VC_FILES([false])
index dee29587b63e97238ff2a171eeb6e22c329d7580..1c109f668ca7e7a412fd8649ed50c63c885fa496 100644 (file)
@@ -14,11 +14,11 @@ liblbx_la_SOURCES = src/misc.c src/lbx.c src/fops.c src/image.c src/pack.c
 
 bin_PROGRAMS    += lbxtool
 lbxtool_SOURCES  = src/lbxtool.c
-lbxtool_LDADD    = liblbx.la
+lbxtool_LDADD    = liblbx.la -lgnu
 
 if BUILD_LBXIMG
 bin_PROGRAMS   += lbximg
 lbximg_SOURCES  = src/lbximg.c
-lbximg_LDADD    = liblbx.la $(LIBPNG_LIBS)
+lbximg_LDADD    = liblbx.la $(LIBPNG_LIBS) -lgnu
 lbximg_CFLAGS   = $(LIBPNG_CFLAGS)
 endif
index 64f5a5a3bfd59f811adc45b94e2f9af075a72a80..50dff078f7050588c595c60ad179a52785942706 100644 (file)
@@ -17,6 +17,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _GNU_SOURCE
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index d070e8f188feb04e0fd26b9bdc9a32c268aef569..e702587057082770eb3651add0684a689d330ab1 100644 (file)
@@ -17,6 +17,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define _GNU_SOURCE
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>