Skip to content

Commit

Permalink
Additional fixes for VPATH build(#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
saitoha committed Jan 10, 2020
1 parent 3df369a commit 1bad200
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 499 deletions.
25 changes: 14 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
#
# @configure_input@
#
SUBDIRS = include src converters tools python
DIST_SUBDIRS = $(SUBDIRS)

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

srcdir=@srcdir@
VPATH=@VPATH@
srcdir = @srcdir@
VPATH = @srcdir@

# pkgconfig
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libsixel.pc
pkgconfig_DATA = $(builddir)/libsixel.pc

CLEANFILES = valgrind.log test.log unittest.log test-output.png
CLEANFILES = $(builddir)/valgrind.log $(builddir)/test.log $(builddir)/unittest.log

all-am:
cp package.json.in package.json
cp $(builddir)/package.json.in $(builddir)/package.json

check-am:

unittest: all
cd src && $(MAKE) unittest 2>&1 |tee unittest.log
cd $(srcdir)/src && $(MAKE) unittest 2>&1 |tee $(builddir)/unittest.log

test: all
cd src && $(MAKE) unittest 2>&1 |tee ../test.log
cd converters && $(MAKE) test 2>&1 |tee -a ../test.log
cd src && $(MAKE) unittest 2>&1 |tee $(builddir)/test.log
cd converters && $(MAKE) test 2>&1 |tee -a $(builddir)/test.log

winetest: all
cd converters && $(MAKE) winetest

valgrind: all
valgrind --leak-check=full --show-reachable=no --error-limit=no img2sixel images/snake.jpg -dfs 2>&1 \
| grep ^== \
| tee valgrind.log
grep "All heap blocks were freed" valgrind.log || \
| tee $(builddir)/valgrind.log
grep "All heap blocks were freed" $(builddir)/valgrind.log || \
grep "definitely lost: 0 bytes in 0 blocks" valgrind.log
grep "All heap blocks were freed" valgrind.log || \
grep "All heap blocks were freed" $(builddir)/valgrind.log || \
grep "indirectly lost: 0 bytes in 0 blocks" valgrind.log

coveralls:
Expand Down
28 changes: 16 additions & 12 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ CTAGS = ctags
CSCOPE = cscope
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/libsixel.pc.in $(srcdir)/package.json.in.in \
ChangeLog NEWS compile config.guess config.sub depcomp \
install-sh ltmain.sh missing py-compile
ChangeLog NEWS compile config.guess config.sub install-sh \
ltmain.sh missing py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
Expand Down Expand Up @@ -236,7 +236,7 @@ distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
VPATH = @VPATH@
VPATH = @srcdir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
Expand Down Expand Up @@ -386,11 +386,15 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
zshcompletiondir = @zshcompletiondir@

#
# @configure_input@
#
SUBDIRS = include src converters tools python
DIST_SUBDIRS = $(SUBDIRS)
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
pkgconfig_DATA = libsixel.pc
CLEANFILES = valgrind.log test.log unittest.log test-output.png
pkgconfig_DATA = $(builddir)/libsixel.pc
CLEANFILES = $(builddir)/valgrind.log $(builddir)/test.log $(builddir)/unittest.log
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

Expand Down Expand Up @@ -907,27 +911,27 @@ uninstall-am: uninstall-pkgconfigDATA


all-am:
cp package.json.in package.json
cp $(builddir)/package.json.in $(builddir)/package.json

check-am:

unittest: all
cd src && $(MAKE) unittest 2>&1 |tee unittest.log
cd $(srcdir)/src && $(MAKE) unittest 2>&1 |tee $(builddir)/unittest.log

test: all
cd src && $(MAKE) unittest 2>&1 |tee ../test.log
cd converters && $(MAKE) test 2>&1 |tee -a ../test.log
cd src && $(MAKE) unittest 2>&1 |tee $(builddir)/test.log
cd converters && $(MAKE) test 2>&1 |tee -a $(builddir)/test.log

winetest: all
cd converters && $(MAKE) winetest

valgrind: all
valgrind --leak-check=full --show-reachable=no --error-limit=no img2sixel images/snake.jpg -dfs 2>&1 \
| grep ^== \
| tee valgrind.log
grep "All heap blocks were freed" valgrind.log || \
| tee $(builddir)/valgrind.log
grep "All heap blocks were freed" $(builddir)/valgrind.log || \
grep "definitely lost: 0 bytes in 0 blocks" valgrind.log
grep "All heap blocks were freed" valgrind.log || \
grep "All heap blocks were freed" $(builddir)/valgrind.log || \
grep "indirectly lost: 0 bytes in 0 blocks" valgrind.log

coveralls:
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AC_SUBST([PACKAGE_DESCRIPTION],

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign])
AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT
AC_CONFIG_SRCDIR([src/fromsixel.c])
AC_CONFIG_HEADERS([config.h])
Expand Down
336 changes: 169 additions & 167 deletions converters/Makefile.am

Large diffs are not rendered by default.

411 changes: 207 additions & 204 deletions converters/Makefile.in

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python/libsixel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
SIXEL_BAD_ALLOCATION = (SIXEL_RUNTIME_ERROR | 0x0001) # malloc() failed
SIXEL_BAD_ARGUMENT = (SIXEL_RUNTIME_ERROR | 0x0002) # bad argument detected
SIXEL_BAD_INPUT = (SIXEL_RUNTIME_ERROR | 0x0003) # bad input detected
SIXEL_BAD_INTEGER_OVERFLOW = (SIXEL_RUNTIME_ERROR | 0x0004) /* integer overflow */
SIXEL_BAD_INTEGER_OVERFLOW = (SIXEL_RUNTIME_ERROR | 0x0004) # integer overflow

SIXEL_NOT_IMPLEMENTED = (SIXEL_FEATURE_ERROR | 0x0001) # feature not implemented

Expand Down
21 changes: 13 additions & 8 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

srcdir=@srcdir@
VPATH=@VPATH@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
top_builddir = @top_builddir@
builddir = @builddir@

if COND_GCOV
MAYBE_COVERAGE = --coverage
Expand Down Expand Up @@ -66,24 +71,24 @@ libsixel_la_LIBADD = -lm \

if COND_TESTS
noinst_PROGRAMS = tests
tests_SOURCES = tests.c
tests_SOURCES = $(srcdir)/tests.c
tests_CPPFLAGS = -I$(top_builddir)/include/ \
-I$(top_builddir)/src/ $(AM_CPPFLAGS)
tests_CFLAGS = $(CFLAGS) $(AM_CFLAGS) $(MAYBE_COVERAGE)
tests_LDADD = libsixel.la
tests_LDADD = $(top_builddir)/src/libsixel.la
endif

dist_man_MANS = $(srcdir)/sixel.5
EXTRA_DIST = rgblookup.gperf
EXTRA_DIST = $(srcdir)/rgblookup.gperf

unittest: all
if COND_TESTS
./tests
$(srcdir)/tests
endif

gen-rgblookup: rgblookup.gperf
gen-rgblookup: $(srcdir)/rgblookup.gperf
gperf -C -N lookup_rgb --ignore-case $< |\
sed 's/{""}/\{"", 0, 0, 0\}/g' |\
astyle > rgblookup.h
astyle > $(srcdir)/rgblookup.h


Loading

0 comments on commit 1bad200

Please sign in to comment.