DISTCLEANFILES =
-CLEANFILES = $(EXTRA_LTLIBRARIES)
+CLEANFILES = $(EXTRA_LTLIBRARIES) $(EXTRA_LIBRARIES)
EXTRA_DIST = bootstrap $(DX_BASEDIR)/scripts/fix-gnulib.pl m4/gnulib-cache.m4 \
src/types.lst src/parse.y src/parse.stamp src/scan.l \
noinst_DATA = $(MOFILES)
+shared_gl_objects = $(gnulib_symfiles:.glsym=.lo)
+static_gl_objects = $(gnulib_extra_objects:.lo=.@OBJEXT@)
+
lib_LTLIBRARIES = libcdecl.la
-libcdecl_la_LDFLAGS = -export-symbols-regex '^cdecl_[[:lower:]]' \
+libcdecl_la_LDFLAGS = -export-symbols-regex '^cdecl_([[:lower:]]|_gl_)' \
-no-undefined -version-info 1:0:0
libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.c src/output.c \
src/explain.c src/declare.c src/error.c src/normalize.c \
src/cdecl-internal.h
-libcdecl_la_LIBADD = libgnu.la $(LTLIBINTL) $(LTLIBTHREAD)
+libcdecl_la_LIBADD = $(shared_gl_objects) $(LTLIBINTL) $(LIBTHREAD)
+EXTRA_libcdecl_la_DEPENDENCIES = $(shared_gl_objects)
$(libcdecl_la_OBJECTS): $(gnulib_headers)
if USE_NLS
libcdecl_la_SOURCES += src/i18n.c
endif
+EXTRA_LIBRARIES = libgnu.a
+libgnu_a_SOURCES =
+libgnu_a_LIBADD = $(static_gl_objects)
+EXTRA_libgnu_a_DEPENDENCIES = $(static_gl_objects)
+dummy $(static_gl_objects): $(gnulib_headers)
+
bin_PROGRAMS = cdecl99
cdecl99_SOURCES = common/src/help.c src/commands.c src/cdecl99.h
cdecl99_LDADD = $(libmain_a_OBJECTS) $(libexec_a_OBJECTS) libcdecl.la \
- libgnu.la $(LTLIBICONV) $(LTLIBINTL) $(LTLIBREADLINE)
+ libgnu.a $(LTLIBICONV) $(LTLIBINTL) $(LTLIBREADLINE)
$(cdecl99_OBJECTS): $(gnulib_headers)
-EXTRA_LIBRARIES = libexec.a
+EXTRA_LIBRARIES += libexec.a
libexec_a_SOURCES = src/execute.c src/commands.h
$(libexec_a_OBJECTS): $(gnulib_headers)
$(libexec_a_OBJECTS): src/commands.h src/cmdlist.h
check_PROGRAMS = test/crossparse test/normalize test/randomdecl
check_LIBRARIES = libtest.a
-libtest_a_SOURCES = test/testlib.c common/src/help.c
+libtest_a_SOURCES = test/testlib.c test/rng.c common/src/help.c
$(libtest_a_OBJECTS): $(gnulib_headers)
-test_randomdecl_SOURCES = test/randomdecl.c test/declgen.c test/rng.c
-test_randomdecl_LDADD = libtest.a libcdecl.la libgnu.la $(LDEXP_LIBM)
+TEST_LIBS = libtest.a libcdecl.la libgnu.a $(LDEXP_LIBM)
+
+test_randomdecl_SOURCES = test/randomdecl.c test/declgen.c
+test_randomdecl_LDADD = $(TEST_LIBS)
$(test_randomdecl_OBJECTS): $(gnulib_headers)
-test_crossparse_LDADD = libtest.a libcdecl.la libgnu.la
+test_crossparse_LDADD = $(TEST_LIBS)
$(test_crossparse_OBJECTS): $(gnulib_headers)
-test_normalize_LDADD = libtest.a src/output.lo src/normalize.lo \
- libcdecl.la libgnu.la
+
+test_normalize_LDADD = src/output.lo src/normalize.lo $(TEST_LIBS)
$(test_normalize_OBJECTS): $(gnulib_headers)
src/parse.lo: src/scan.h
#!/bin/sh
#
-# Copyright © 2011-2012, 2021 Nick Bowler
+# Copyright © 2011-2012, 2021-2022 Nick Bowler
#
# Simple script to get started from a fresh git checkout.
#
$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."
+ $GNULIB/gnulib-tool --update -S || die "Failed to update Gnulib."
+
+ exec 3>lib/symfiles.tmp 4<lib/symfiles.tmp
+ rm -f lib/symfiles.tmp
+
+ shared_modules='lock tls flexmember snprintf'
+ set x --extract-recursive-dependencies $shared_modules; shift
+ (set -x; $GNULIB/gnulib-tool "$@" >&3 ) || die "gnulib-tool failed"
+ shared_modules=`LC_ALL=C sort -u <&4`
+
+ set x --extract-filelist $shared_modules; shift
+ ( set -x; $GNULIB/gnulib-tool "$@" >&3 ) || die "gnulib-tool failed"
+ <&4 grep '^lib/.*[.][^vh][^.]*$' | LC_ALL=C sort -u >lib/symfiles
else
err "Gnulib sources are not properly installed in $GNULIB/"
cat >&2 <<'EOF'
-Subproject commit afc0149dd2e0393d529c5322f25396039872f787
+Subproject commit e7d29006d05055ab5b7af44078668c1915d35262
[Define to 1 if readline supports add_history.])])
m4_include([lib/gnulib.mk])
-DX_GLSYM_PREFIX([cdecl__])
+DX_GLSYM_PREFIX([cdecl__gl_])
+DX_GNULIB_SYMFILES([lib/symfiles])
+AM_CONDITIONAL([BUILD_STATIC], [test x"$enable_static" = x"yes"])
dnl We provide our own makefile rules for gettext. Disable tracing of
dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and to
/*
* Command line utility for making sense of C declarations.
- * Copyright © 2011-2012, 2020-2021 Nick Bowler
+ * Copyright © 2011-2012, 2020-2022 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
puts(PACKAGE_STRING);
- printf("Copyright %s 2021 Nick Bowler.\n", copysign);
+ printf("Copyright %s 2022 Nick Bowler.\n", copysign);
puts("License GPLv3+: GNU GPL version 3 or any later version.");
puts("This is free software: you are free to change and redistribute it.");
puts("There is NO WARRANTY, to the extent permitted by law.");
/*
* Miscellaneous functions used by the cdecl99 test suite.
- * Copyright © 2011-2012, 2021 Nick Bowler
+ * Copyright © 2011-2012, 2021-2022 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void test_print_version(const char *program)
{
printf("%s (%s) %s\n", program, PACKAGE_NAME, PACKAGE_VERSION);
- puts("Copyright (C) 2021 Nick Bowler.");
+ puts("Copyright (C) 2022 Nick Bowler.");
puts("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.");
puts("This is free software: you are free to change and redistribute it.");
puts("There is NO WARRANTY, to the extent permitted by law.");