Commit b4c2f038 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Reunite library and program

parent b73c0b40
......@@ -16,7 +16,10 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
SUBDIRS = lib
SUBDIRS = po lib-library lib-program
if NEED_LIBOPTS
SUBDIRS += $(LIBOPTS_DIR)
endif # NEED_LIBOPTS
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS =
......@@ -27,19 +30,26 @@ noinst_LTLIBRARIES =
include_HEADERS =
check_PROGRAMS =
info_TEXINFOS =
dist_man_MANS =
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA =
pkgdatadir = $(datadir)/@PACKAGE@
pkgdata_SCRIPTS =
sysconf_DATA =
dist_sysconf_DATA =
tarotsysconfdir = $(sysconfdir)/tarot
tarotsysconf_DATA =
dist_tarotsysconf_DATA =
dist_pkgdata_DATA = COPYING
INDENTED =
SUFFIXES =
dist_noinst_SCRIPTS = \
autogen.sh \
run-tarot.sh \
build-aux/git-version-gen
nodist_noinst_DATA =
ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4 -I lib-library/m4 -I lib-program/m4
EXTRA_DIST = \
tarot.org \
setup.el \
......@@ -48,14 +58,19 @@ EXTRA_DIST = \
$(top_srcdir)/.version
BUILT_SOURCES = \
$(top_srcdir)/.version
CLEANFILES =
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-silent-rules=yes
AM_CPPFLAGS = \
-DLOCALEDIR="\"$(localedir)\"" \
-DSYSCONFDIR="\"$(sysconfdir)\"" \
-I. -I$(srcdir) \
-Ilib -I$(srcdir)/lib
-Ilib-library -I$(srcdir)/lib-library \
-Ilib-program -I$(srcdir)/lib-program
AM_CFLAGS =
AM_YFLAGS = -d
AM_LIBS =
AM_LDADD =
AM_LDADD = $(LTLIBINTL) $(LTLIBTHREAD) @INTL_MACOSX_LIBS@
# Texinfo -> html flags, overriden in doc/Makefile.am
AM_MAKEINFOHTMLFLAGS =
TESTS =
......@@ -64,8 +79,13 @@ if HAVE_VALGRIND
AM_TESTS_ENVIRONMENT += $(VALGRIND) --tool=memcheck
endif # HAVE_VALGRIND
TEST_EXTENSIONS = .tarot
TAROT_LOG_COMPILER = $(SHELL) $(top_srcdir)/run-tarot.sh
AM_TAROT_LOG_FLAGS =
include doc/Makefile.am
include src/Makefile.am
include games/Makefile.am
TESTS += $(check_PROGRAMS)
indent_verbose = $(indent_verbose_@AM_V@)
......
......@@ -20,14 +20,23 @@
(echo "@setfilename tarot.info" \
&& echo '\bye') > doc/tarot.texi || exit 1
gnulib-tool --libtool \
--lib=libgnulibrary \
--source-base=lib-library \
--m4-base=lib-library/m4 \
--macro-prefix=gl_lib \
--import assert || exit 1
gnulib-tool --libtool \
--lib=libgnuprogram \
--source-base=lib-program \
--m4-base=lib-program/m4 \
--macro-prefix=gl_prog \
--import malloc-gnu getopt-gnu gettext-h setlocale xalloc \
stdnoreturn readline libunistring \
|| exit 1
rm -rf libopts || exit 1
(gunzip -c `autoopts-config libsrc` | tar -xvf -) || exit 1
mv libopts-*.*.* libopts || exit 1
cp -fp libopts/m4/*.m4 m4/ || exit 1
cp -fp snippet/_Noreturn.h libopts/ || exit 1
autoreconf -vif || exit 1
cp snippet/_Noreturn.h libopts || exit 1
rm doc/tarot.texi || exit 1
......@@ -2,7 +2,7 @@
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends texlive-base texlive-latex-base git ca-certificates texlive-fonts-recommended texlive-generic-recommended autoconf automake gettext autopoint libtool texinfo gnulib autoconf-archive make gcc flex bison gperf emacs org-mode indent check gengetopt help2man libreadline-dev libunistring-dev valgrind autogen
apt-get install -y --no-install-recommends texlive-base texlive-latex-base git ca-certificates texlive-fonts-recommended texlive-generic-recommended autoconf automake gettext autopoint libtool texinfo gnulib autoconf-archive make gcc flex bison gperf emacs org-mode indent check gengetopt help2man libreadline-dev libunistring-dev valgrind autogen libuile-2.0-dev guile-2.0
SOURCE_TOP=$(pwd)
CLEAN_TOP=$(cd .. && pwd)/clean
......@@ -14,57 +14,9 @@ mkdir -p ../clean || exit 1
cd $CLEAN_TOP
git clone $SOURCE_TOP . || exit 1
## Distribution of the library
cd $SOURCE_TOP || exit 1
cd library || exit 1
rm -rf ../../libtarot-*.tar.gz ../../libtarot-*/ libtarot-*.tar.gz
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
sh autogen.sh || exit 1
./configure \
CFLAGS="-Wall -Wextra -g -O0 -Wno-unused-function" \
--prefix="$SOURCE_TOP/root" \
|| (cat config.log ; exit 1) \
|| exit 1
make indent || exit 1
(cd lib && make -j 16) || exit 1
make -j 16 distcheck || exit 1
make -j 16 check || exit 1
make -j 16 install install-html || exit 1not ignored
cp libtarot-*.tar.gz ../../ || exit 1
cd ../../ || exit 1
tar xf libtarot-*.tar.gz || exit 1
cd libtarot-* || exit 1
DIST_TOP=$(pwd)
cd $CLEAN_TOP/library || exit 1
OK="yes"
for source in $(find . -type f)
do
case $source in
*.po | *.pot)
echo "Ignoring PO file $source, as it has a date in it.";;
*.md)
echo "Ignoring Markdown file $source, as it may be non-reproducibly generated by org-mode.";;
*)
if ! $(diff $source $DIST_TOP/$source)
then
echo "ERROR: $source has been modified since check-in, or ignored from the distribution. Is it automatically generated? Did you forget to indent it? Did you forget to include it as distributed in Automake?"
OK="no"
fi;;
esac
done;
if test "$OK" = "no"
then
echo "Failure."
exit 1
fi
## Distribution of the program
cd $SOURCE_TOP || exit 1
cd program || exit 1
rm -rf ../../tarot-*.tar.gz ../../tarot-*/ tarot-*.tar.gz
sh autogen.sh || exit 1
export PKG_CONFIG_PATH="$SOURCE_TOP/root/share/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$SOURCE_TOP/root/lib:$LD_LIBRARY_PATH"
echo "Looking for libtarot.pc in $PKG_CONFIG_PATH"
./configure \
CFLAGS="-Wall -Wextra -g -O0" \
--prefix="$SOURCE_TOP/public" \
......@@ -107,9 +59,6 @@ fi
## Nice!
cd $SOURCE_TOP || exit 1
mkdir -p $SOURCE_TOP/public || exit 1
cp $SOURCE_TOP/library/.version \
$SOURCE_TOP/public/library-version || exit 1
cp $SOURCE_TOP/program/.version \
$SOURCE_TOP/public/program-version || exit 1
cp ../libtarot-*.tar.gz $SOURCE_TOP/public/ || exit 1
$SOURCE_TOP/public/version || exit 1
cp ../tarot-*.tar.gz $SOURCE_TOP/public/ || exit 1
#!/bin/sh
LIBRARY_VERSION=$(cat public/library-version)
PROGRAM_VERSION=$(cat public/program-version)
VERSION=$(cat public/version)
apt-get update
apt-get upgrade -y
......@@ -10,21 +9,13 @@ apt-get install -y --no-install-recommends \
libreadline-dev \
libunistring-dev \
texinfo \
pkg-config
cp public/libtarot-$LIBRARY_VERSION.tar.gz . || exit 1
cp public/tarot-$PROGRAM_VERSION.tar.gz . || exit 1
tar xf libtarot-$LIBRARY_VERSION.tar.gz || exit 1
tar xf tarot-$PROGRAM_VERSION.tar.gz || exit 1
pkg-config \
libuile-2.0-dev guile-2.0
cp public/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../libtarot-$LIBRARY_VERSION/configure \
--prefix="$PWD/root" \
--enable-silent-rules=yes \
|| (cat config.log; exit 1)
make -j 16 install || exit 1
make distclean || exit 1
export PKG_CONFIG_PATH="$PWD/root/share/pkgconfig:$PKG_CONFIG_PATH"
../tarot-$PROGRAM_VERSION/configure \
../tarot-$VERSION/configure \
--prefix="$PWD/../public" \
--enable-silent-rules=yes \
|| (cat config.log; exit 1)
......
......@@ -6,15 +6,17 @@ AC_INIT([tarot],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[vivien@planete-kraus.eu])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_MACRO_DIRS([m4 lib-library/m4 lib-program/m4])
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_STDC
gl_EARLY
gl_lib_EARLY
gl_prog_EARLY
AM_INIT_AUTOMAKE
AM_PROG_AR
LT_INIT
AM_MISSING_PROG([GPERF], [gperf])
AM_MISSING_PROG([INDENT], [indent])
AM_MISSING_PROG([EMACS], [emacs])
AM_MISSING_PROG([AUTOGEN], [autogen])
......@@ -38,7 +40,8 @@ AC_PROG_LEX
AC_PROG_YACC
# Checks for libraries.
gl_INIT
gl_lib_INIT
gl_prog_INIT
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19])
LIBOPTS_CHECK
......@@ -54,17 +57,7 @@ AC_SEARCH_LIBS([add_history], [history], [
AC_CHECK_HEADERS_ONCE([readline/history.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
......@@ -73,9 +66,11 @@ AC_DEFINE([FIRST_COLUMN], [1], [First column in a line, for the lexer])
AC_DEFINE([TAB_WIDTH], [8], [Number of columns in a tab])
AC_CONFIG_FILES([
po/Makefile.in
Makefile
lib/Makefile
po/Makefile.in
lib-library/Makefile
lib-program/Makefile
src/libtarot.pc
])
AC_OUTPUT
......@@ -26,9 +26,10 @@ EXTRA_DIST += \
%reldir%/style.css \
%reldir%/ChangeLog \
%reldir%/tarot.org \
%reldir%/setup.el
%reldir%/setup.el \
%reldir%/invoke-tarot.texi
%reldir%/tarot.texi: %reldir%/tarot.org %reldir%/setup.el .version
%reldir%/tarot.texi: %reldir%/tarot.org %reldir%/setup.el %reldir%/invoke-tarot.texi .version
$(AM_V_GEN) (cd $(srcdir)/%reldir% && \
LIBTAROT_VERSION="$(VERSION)" \
$(EMACS) --batch -q \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment