Skip to content

Commit

Permalink
Enable gnulib (again) so we can use non-broken FTS.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmjones committed Mar 1, 2014
1 parent bc8b1b0 commit 62efd30
Show file tree
Hide file tree
Showing 13 changed files with 182 additions and 17 deletions.
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ pod2htm?.tmp
/helper/init /helper/init
/html/supermin-helper.1.html /html/supermin-helper.1.html
/html/supermin.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* /local*
/INSTALL /INSTALL
/install-sh /install-sh
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".gnulib"]
path = .gnulib
url = git://git.sv.gnu.org/gnulib.git
1 change: 1 addition & 0 deletions .gnulib
Submodule .gnulib added at a10acf
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@


ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4


SUBDIRS = src examples tests SUBDIRS = lib src examples tests


EXTRA_DIST = \ EXTRA_DIST = \
.gitignore \ .gitignore \
autogen.sh \
bootstrap \
HACKING \ HACKING \
html/pod.css \ html/pod.css \
m4/gnulib-cache.m4 \
README \ README \
TODO \ TODO \
$(SOURCES) $(SOURCES)
Expand Down
14 changes: 14 additions & 0 deletions README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,8 +78,22 @@ are building:
Building and installing 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 ./configure
make make

You can run supermin without installing:

./src/supermin --help

To install the software:

sudo make install sudo make install


Tests Tests
Expand Down
12 changes: 12 additions & 0 deletions autogen.sh
Original file line number Original file line Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions bootstrap
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -

set -e

git submodule update --init .gnulib
.gnulib/gnulib-tool --update
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AM_INIT_AUTOMAKE(foreign)


dnl Check for basic C environment. dnl Check for basic C environment.
AC_PROG_CC_STDC AC_PROG_CC_STDC
gl_EARLY


AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_CPP AC_PROG_CPP
Expand All @@ -31,6 +32,9 @@ test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])


AM_PROG_CC_C_O AM_PROG_CC_C_O


dnl Gnulib
gl_INIT

dnl Check support for 64 bit file offsets. dnl Check support for 64 bit file offsets.
AC_SYS_LARGEFILE AC_SYS_LARGEFILE


Expand Down Expand Up @@ -232,6 +236,7 @@ AC_CONFIG_FILES([src/supermin-link.sh],
[chmod +x,-w src/supermin-link.sh]) [chmod +x,-w src/supermin-link.sh])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
examples/Makefile examples/Makefile
lib/Makefile
src/config.ml src/config.ml
src/Makefile src/Makefile
tests/Makefile]) tests/Makefile])
Expand Down
8 changes: 8 additions & 0 deletions lib/.gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
/*.c
/*.h
/*.h.in
/*.valgrind

/Makefile.am

/sys
76 changes: 76 additions & 0 deletions m4/.gitignore
Original file line number Original file line Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions m4/gnulib-cache.m4
Original file line number Original file line Diff line number Diff line change
@@ -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([])
5 changes: 3 additions & 2 deletions src/Makefile.am
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ bin_PROGRAMS = supermin
supermin_SOURCES = $(SOURCES_C) supermin_SOURCES = $(SOURCES_C)
supermin_CFLAGS = \ supermin_CFLAGS = \
-I$(shell $(OCAMLC) -where) \ -I$(shell $(OCAMLC) -where) \
$(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS) $(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS) \
-I$(srcdir)/lib -I../lib


BOBJECTS = $(SOURCES_ML:.ml=.cmo) BOBJECTS = $(SOURCES_ML:.ml=.cmo)
XOBJECTS = $(SOURCES_ML:.ml=.cmx) XOBJECTS = $(SOURCES_ML:.ml=.cmx)
Expand All @@ -116,7 +117,7 @@ OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ


supermin_DEPENDENCIES = $(OBJECTS) ext2init-bin.o supermin_DEPENDENCIES = $(OBJECTS) ext2init-bin.o


supermin_LDADD = ext2init-bin.o supermin_LDADD = ext2init-bin.o ../lib/libgnu.a


supermin_LINK = \ supermin_LINK = \
./supermin-link.sh \ ./supermin-link.sh \
Expand Down
4 changes: 3 additions & 1 deletion src/ext2fs-c.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fts.h>
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
Expand All @@ -48,6 +47,9 @@
#include <caml/mlvalues.h> #include <caml/mlvalues.h>
#include <caml/unixsupport.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 initialize (void) __attribute__((constructor));


static void static void
Expand Down

0 comments on commit 62efd30

Please sign in to comment.