Skip to content
Browse files

Enable gnulib (again) so we can use non-broken FTS.

  • Loading branch information...
1 parent bc8b1b0 commit 62efd3014f27d2fcf9cfa17127ea2cf4d484a9a4 @rwmjones rwmjones committed Mar 1, 2014
Showing with 182 additions and 17 deletions.
  1. +0 −13 .gitignore
  2. +3 −0 .gitmodules
  3. +1 −0 .gnulib
  4. +4 −1 Makefile.am
  5. +14 −0 README
  6. +12 −0 autogen.sh
  7. +6 −0 bootstrap
  8. +5 −0 configure.ac
  9. +8 −0 lib/.gitignore
  10. +76 −0 m4/.gitignore
  11. +47 −0 m4/gnulib-cache.m4
  12. +3 −2 src/Makefile.am
  13. +3 −1 src/ext2fs-c.c
View
13 .gitignore
@@ -35,19 +35,6 @@ pod2htm?.tmp
/helper/init
/html/supermin-helper.1.html
/html/supermin.1.html
-/lib/alloca.h
-/lib/arg-nonnull.h
-/lib/c++defs.h
-/lib/dirent.h
-/lib/fcntl.h
-/lib/stdio.h
-/lib/stdlib.h
-/lib/string.h
-/lib/sys/
-/lib/time.h
-/lib/unistd.h
-/lib/warn-on-use.h
-/lib/wchar.h
/local*
/INSTALL
/install-sh
View
3 .gitmodules
@@ -0,0 +1,3 @@
+[submodule ".gnulib"]
+ path = .gnulib
+ url = git://git.sv.gnu.org/gnulib.git
1 .gnulib
@@ -0,0 +1 @@
+Subproject commit a10acfb1d2118f9a180181d3fed5399dbbe1df3c
View
5 Makefile.am
@@ -19,12 +19,15 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src examples tests
+SUBDIRS = lib src examples tests
EXTRA_DIST = \
.gitignore \
+ autogen.sh \
+ bootstrap \
HACKING \
html/pod.css \
+ m4/gnulib-cache.m4 \
README \
TODO \
$(SOURCES)
View
14 README
@@ -78,8 +78,22 @@ are building:
Building and installing
-----------------------
+If you're cloning this from git the first time, do:
+
+ ./bootstrap
+ ./autogen.sh
+
+For normal builds, and building from the tarball:
+
./configure
make
+
+You can run supermin without installing:
+
+ ./src/supermin --help
+
+To install the software:
+
sudo make install
Tests
View
12 autogen.sh
@@ -0,0 +1,12 @@
+#!/bin/bash -
+
+set -e
+
+# If no arguments were specified and configure has run before, use the previous
+# arguments
+if test $# -eq 0 && test -x ./config.status; then
+ ./config.status --recheck
+else
+ autoreconf -i
+ ./configure "$@"
+fi
View
6 bootstrap
@@ -0,0 +1,6 @@
+#!/bin/bash -
+
+set -e
+
+git submodule update --init .gnulib
+.gnulib/gnulib-tool --update
View
5 configure.ac
@@ -22,6 +22,7 @@ AM_INIT_AUTOMAKE(foreign)
dnl Check for basic C environment.
AC_PROG_CC_STDC
+gl_EARLY
AC_PROG_INSTALL
AC_PROG_CPP
@@ -31,6 +32,9 @@ test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
AM_PROG_CC_C_O
+dnl Gnulib
+gl_INIT
+
dnl Check support for 64 bit file offsets.
AC_SYS_LARGEFILE
@@ -232,6 +236,7 @@ AC_CONFIG_FILES([src/supermin-link.sh],
[chmod +x,-w src/supermin-link.sh])
AC_CONFIG_FILES([Makefile
examples/Makefile
+ lib/Makefile
src/config.ml
src/Makefile
tests/Makefile])
View
8 lib/.gitignore
@@ -0,0 +1,8 @@
+/*.c
+/*.h
+/*.h.in
+/*.valgrind
+
+/Makefile.am
+
+/sys
View
76 m4/.gitignore
@@ -0,0 +1,76 @@
+/00gnulib.m4
+/absolute-header.m4
+/chdir-long.m4
+/close.m4
+/closedir.m4
+/cycle-check.m4
+/d-ino.m4
+/d-type.m4
+/dirent-safer.m4
+/dirent_h.m4
+/dirfd.m4
+/dirname.m4
+/double-slash-root.m4
+/dup.m4
+/dup2.m4
+/errno_h.m4
+/error.m4
+/extensions.m4
+/extern-inline.m4
+/fchdir.m4
+/fcntl-o.m4
+/fcntl-safer.m4
+/fcntl.m4
+/fcntl_h.m4
+/fdopendir.m4
+/filenamecat.m4
+/fstat.m4
+/fts.m4
+/getcwd.m4
+/getdtablesize.m4
+/gettimeofday.m4
+/gnulib-common.m4
+/gnulib-comp.m4
+/gnulib-tool.m4
+/i-ring.m4
+/include_next.m4
+/largefile.m4
+/longlong.m4
+/lstat.m4
+/malloc.m4
+/memchr.m4
+/mempcpy.m4
+/memrchr.m4
+/mmap-anon.m4
+/mode_t.m4
+/msvc-inval.m4
+/msvc-nothrow.m4
+/multiarch.m4
+/off_t.m4
+/onceonly.m4
+/open.m4
+/openat.m4
+/opendir.m4
+/pathmax.m4
+/readdir.m4
+/realloc.m4
+/save-cwd.m4
+/ssize_t.m4
+/stat.m4
+/stdbool.m4
+/stddef_h.m4
+/stdint.m4
+/stdio_h.m4
+/stdlib_h.m4
+/strdup.m4
+/strerror.m4
+/string_h.m4
+/sys_socket_h.m4
+/sys_stat_h.m4
+/sys_time_h.m4
+/sys_types_h.m4
+/time_h.m4
+/unistd-safer.m4
+/unistd_h.m4
+/warn-on-use.m4
+/wchar_t.m4
View
47 m4/gnulib-cache.m4
@@ -0,0 +1,47 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <http://www.gnu.org/licenses/>.
+#
+# 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 that use version control, this file is meant to be put under
+# version control, 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=. --no-conditional-dependencies --no-libtool --macro-prefix=gl fts
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([
+ fts
+])
+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_MACRO_PREFIX([gl])
+gl_PO_DOMAIN([])
+gl_WITNESS_C_MACRO([])
View
5 src/Makefile.am
@@ -98,7 +98,8 @@ bin_PROGRAMS = supermin
supermin_SOURCES = $(SOURCES_C)
supermin_CFLAGS = \
-I$(shell $(OCAMLC) -where) \
- $(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS)
+ $(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS) \
+ -I$(srcdir)/lib -I../lib
BOBJECTS = $(SOURCES_ML:.ml=.cmo)
XOBJECTS = $(SOURCES_ML:.ml=.cmx)
@@ -116,7 +117,7 @@ OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
supermin_DEPENDENCIES = $(OBJECTS) ext2init-bin.o
-supermin_LDADD = ext2init-bin.o
+supermin_LDADD = ext2init-bin.o ../lib/libgnu.a
supermin_LINK = \
./supermin-link.sh \
View
4 src/ext2fs-c.c
@@ -26,7 +26,6 @@
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fts.h>
#include <limits.h>
#include <errno.h>
#include <assert.h>
@@ -48,6 +47,9 @@
#include <caml/mlvalues.h>
#include <caml/unixsupport.h>
+/* fts.h in glibc is broken, forcing us to use the GNUlib alternative. */
+#include "fts_.h"
+
static void initialize (void) __attribute__((constructor));
static void

0 comments on commit 62efd30

Please sign in to comment.
Something went wrong with that request. Please try again.