Skip to content

Commit

Permalink
Restructure source tree
Browse files Browse the repository at this point in the history
Some simple code-moves:
  shl => src/shared/
  tsm => src/tsm/
..and also move the ./docs/ files into the source tree.

This will make the tree much easier to grasp once we add more tools like
gtktsm.

Signed-off-by: David Herrmann <[email protected]>
  • Loading branch information
David Herrmann committed Apr 1, 2014
1 parent f850123 commit fb3cfd4
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ config.h.in~
config.log
config.status
configure
docs/libtsm.pc
libtool
m4/
src/tsm/libtsm.pc
stamp-h1
test-suite.log
test_htable
Expand Down
50 changes: 27 additions & 23 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ EXTRA_DIST = \
README \
COPYING \
LICENSE_htable \
NEWS \
docs/libtsm.pc.in \
docs/libtsm.sym
NEWS
CLEANFILES =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
Expand Down Expand Up @@ -69,7 +67,8 @@ AM_CFLAGS = \
-fdata-sections
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I $(srcdir)/src
-I $(srcdir)/src \
-I $(srcdir)/src/shared
AM_LDFLAGS =

if BUILD_HAVE_GNU_LD
Expand Down Expand Up @@ -106,10 +105,10 @@ endif
noinst_LTLIBRARIES += libshl.la

libshl_la_SOURCES = \
src/shl_array.h \
src/shl_htable.h \
src/shl_htable.c \
src/shl_llog.h
src/shared/shl_array.h \
src/shared/shl_htable.h \
src/shared/shl_htable.c \
src/shared/shl_llog.h
libshl_la_CPPFLAGS = $(AM_CPPFLAGS)
libshl_la_LDFLAGS = $(AM_LDFLAGS)
libshl_la_LIBADD = $(AM_LIBADD)
Expand All @@ -120,19 +119,22 @@ libshl_la_LIBADD = $(AM_LIBADD)
#

lib_LTLIBRARIES += libtsm.la
noinst_LTLIBRARIES += libtsm_test.la
include_HEADERS += src/libtsm.h
pkgconfig_DATA += docs/libtsm.pc
noinst_LTLIBRARIES += libtsm-test.la
include_HEADERS += src/tsm/libtsm.h
pkgconfig_DATA += src/tsm/libtsm.pc
EXTRA_DIST += \
src/tsm/libtsm.pc.in \
src/tsm/libtsm.sym

libtsm_la_SOURCES = \
src/libtsm.h \
src/libtsm_int.h \
src/tsm_unicode.c \
src/tsm_screen.c \
src/tsm_selection.c \
src/tsm_render.c \
src/tsm_vte.c \
src/tsm_vte_charsets.c \
src/tsm/libtsm.h \
src/tsm/libtsm-int.h \
src/tsm/tsm-render.c \
src/tsm/tsm-screen.c \
src/tsm/tsm-selection.c \
src/tsm/tsm-unicode.c \
src/tsm/tsm-vte.c \
src/tsm/tsm-vte-charsets.c \
external/wcwidth.h \
external/wcwidth.c \
external/xkbcommon-keysyms.h
Expand All @@ -144,15 +146,15 @@ libtsm_test_la_CPPFLAGS = $(AM_CPPFLAGS)
libtsm_la_LIBADD = libshl.la
libtsm_test_la_LIBADD = libshl.la

EXTRA_libtsm_la_DEPENDENCIES = $(top_srcdir)/docs/libtsm.sym
EXTRA_libtsm_la_DEPENDENCIES = $(top_srcdir)/src/tsm/libtsm.sym

libtsm_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBTSM_CURRENT):$(LIBTSM_REVISION):$(LIBTSM_AGE)

if BUILD_HAVE_GNU_LD
libtsm_la_LDFLAGS += \
-Wl,--version-script="$(top_srcdir)/docs/libtsm.sym"
-Wl,--version-script="$(top_srcdir)/src/tsm/libtsm.sym"
endif

libtsm_test_la_LDFLAGS = \
Expand Down Expand Up @@ -191,7 +193,7 @@ test_sources = \
test/test_common.h
test_libs = \
libshl.la \
libtsm_test.la \
libtsm-test.la \
$(CHECK_LIBS)
test_cflags = \
$(AM_CPPFLAGS) \
Expand All @@ -214,7 +216,9 @@ test_valgrind_CPPFLAGS = $(test_cflags)
test_valgrind_LDADD = $(test_libs)
test_valgrind_LDFLAGS = $(test_lflags)

VALGRIND = CK_FORK=no valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --error-exitcode=1
EXTRA_DIST += test.supp

VALGRIND = CK_FORK=no valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --leak-resolution=high --error-exitcode=1 --suppressions=$(top_builddir)/test.supp

# verify that test_valgrind actually leaks data
memcheck-verify: check
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AC_INIT([libtsm],
[http://bugs.freedesktop.org/enter_bug.cgi?product=kmscon],
[libtsm],
[http://www.freedesktop.org/wiki/Software/kmscon/libtsm])
AC_CONFIG_SRCDIR([src/tsm_vte.c])
AC_CONFIG_SRCDIR([src/tsm/libtsm.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER(config.h)
Expand Down Expand Up @@ -141,7 +141,7 @@ AM_CONDITIONAL([BUILD_IS_DARWIN],
#

AC_CONFIG_FILES([Makefile
docs/libtsm.pc])
src/tsm/libtsm.pc])
AC_OUTPUT

#
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/tsm_render.c → src/tsm/tsm-render.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#include <stdlib.h>
#include <string.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"
#include "shl_llog.h"

#define LLOG_SUBSYSTEM "tsm_render"
#define LLOG_SUBSYSTEM "tsm-render"

SHL_EXPORT
tsm_age_t tsm_screen_draw(struct tsm_screen *con, tsm_screen_draw_cb draw_cb,
Expand Down
4 changes: 2 additions & 2 deletions src/tsm_screen.c → src/tsm/tsm-screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
#include <stdlib.h>
#include <string.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"
#include "shl_llog.h"

#define LLOG_SUBSYSTEM "tsm_screen"
#define LLOG_SUBSYSTEM "tsm-screen"

static struct cell *get_cursor_cell(struct tsm_screen *con)
{
Expand Down
4 changes: 2 additions & 2 deletions src/tsm_selection.c → src/tsm/tsm-selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
#include <stdlib.h>
#include <string.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"
#include "shl_llog.h"

#define LLOG_SUBSYSTEM "tsm_selection"
#define LLOG_SUBSYSTEM "tsm-selection"

static void selection_set(struct tsm_screen *con, struct selection_pos *sel,
unsigned int x, unsigned int y)
Expand Down
2 changes: 1 addition & 1 deletion src/tsm_unicode.c → src/tsm/tsm-unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include <string.h>
#include "external/wcwidth.h"
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"
#include "shl_array.h"
#include "shl_htable.h"

Expand Down
2 changes: 1 addition & 1 deletion src/tsm_vte_charsets.c → src/tsm/tsm-vte-charsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include <stdlib.h>
#include <string.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"

/*
* Lower Unicode character set. This maps the characters to the basic ASCII
Expand Down
4 changes: 2 additions & 2 deletions src/tsm_vte.c → src/tsm/tsm-vte.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <stdlib.h>
#include <string.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "libtsm-int.h"
#include "shl_llog.h"

#ifdef BUILD_HAVE_XKBCOMMON
Expand All @@ -59,7 +59,7 @@
# include "external/xkbcommon-keysyms.h"
#endif

#define LLOG_SUBSYSTEM "tsm_vte"
#define LLOG_SUBSYSTEM "tsm-vte"

/* Input parser states */
enum parser_state {
Expand Down
15 changes: 15 additions & 0 deletions test.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Some suppression rules for our test-suite to work correctly.
# libcheck has some weird errors, so lets ignore them.
#

{
libcheck timer_create warnings
Memcheck:Param
timer_create(evp)
fun:timer_create
obj:/usr/lib/libcheck.so.0.0.0
obj:/usr/lib/libcheck.so.0.0.0
fun:srunner_run
fun:main
}
4 changes: 2 additions & 2 deletions test/test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include "libtsm.h"
#include "libtsm_int.h"
#include "tsm/libtsm.h"
#include "tsm/libtsm-int.h"
#include "shl_htable.h"

/* lower address-space is protected from user-allocation, so this is invalid */
Expand Down

0 comments on commit fb3cfd4

Please sign in to comment.