Debian Codegraph @

liblastlog2/src/Makemodule.am

raw
1 # lastlog2.h is generated, so it's stored in builddir!
2 lastlog2incdir = $(includedir)/liblastlog2
3 nodist_lastlog2inc_HEADERS = liblastlog2/src/lastlog2.h
4
5 usrlib_exec_LTLIBRARIES += liblastlog2.la
6
7 liblastlog2_la_SOURCES = \
8 liblastlog2/src/lastlog2.c \
9 liblastlog2/src/lastlog2P.h
10
11 EXTRA_liblastlog2_la_DEPENDENCIES = \
12 liblastlog2/src/liblastlog2.sym
13
14 liblastlog2_la_LIBADD = $(SQLITE3_LIBS)
15
16 liblastlog2_la_CFLAGS = \
17 $(AM_CFLAGS) \
18 $(SOLIB_CFLAGS) \
19 -I$(ul_liblastlog2_incdir) \
20 -I$(top_srcdir)/liblastlog2/src
21
22 liblastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS)
23 if HAVE_VSCRIPT
24 liblastlog2_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(top_srcdir)/liblastlog2/src/liblastlog2.sym
25 endif
26 liblastlog2_la_LDFLAGS += -version-info $(LIBLASTLOG2_VERSION_INFO)
27
28 EXTRA_DIST += liblastlog2/src/liblastlog2.sym
29
30
31 if BUILD_LIBLASTLOG2_TESTS
32 check_PROGRAMS += \
33 test_lastlog2_dlopen \
34 test_lastlog2_pam_lastlog2_output \
35 test_lastlog2_remove_entry \
36 test_lastlog2_rename_user \
37 test_lastlog2_write_read_user \
38 test_lastlog2_y2038_ll2_read_all \
39 test_lastlog2_y2038_sqlite3_time
40
41 lastlog2_tests_cflags = -DTEST_PROGRAM $(liblastlog2_la_CFLAGS)
42 lastlog2_tests_ldflags = -static
43 lastlog2_tests_ldadd = $(LDADD) liblastlog2.la $(SOLIB_LDFLAGS) $(SQLITE3_LIBS)
44
45 test_lastlog2_dlopen_SOURCES = liblastlog2/src/tests/tst_dlopen.c
46 test_lastlog2_dlopen_CFLAGS = $(lastlog2_tests_cflags)
47 test_lastlog2_dlopen_LDFLAGS = $(lastlog2_tests_ldflags) -ldl
48 test_lastlog2_dlopen_LDADD = $(lastlog2_tests_ldadd)
49
50 test_lastlog2_pam_lastlog2_output_SOURCES = liblastlog2/src/tests/tst_pam_lastlog2_output.c
51 test_lastlog2_pam_lastlog2_output_CFLAGS = $(lastlog2_tests_cflags)
52 test_lastlog2_pam_lastlog2_output_LDFLAGS = $(lastlog2_tests_ldflags)
53 test_lastlog2_pam_lastlog2_output_LDADD = $(lastlog2_tests_ldadd)
54
55 test_lastlog2_remove_entry_SOURCES = liblastlog2/src/tests/tst_remove_entry.c
56 test_lastlog2_remove_entry_CFLAGS = $(lastlog2_tests_cflags)
57 test_lastlog2_remove_entry_LDFLAGS = $(lastlog2_tests_ldflags)
58 test_lastlog2_remove_entry_LDADD = $(lastlog2_tests_ldadd)
59
60 test_lastlog2_rename_user_SOURCES = liblastlog2/src/tests/tst_rename_user.c
61 test_lastlog2_rename_user_CFLAGS = $(lastlog2_tests_cflags)
62 test_lastlog2_rename_user_LDFLAGS = $(lastlog2_tests_ldflags)
63 test_lastlog2_rename_user_LDADD = $(lastlog2_tests_ldadd)
64
65 test_lastlog2_write_read_user_SOURCES = liblastlog2/src/tests/tst_write_read_user.c
66 test_lastlog2_write_read_user_CFLAGS = $(lastlog2_tests_cflags)
67 test_lastlog2_write_read_user_LDFLAGS = $(lastlog2_tests_ldflags)
68 test_lastlog2_write_read_user_LDADD = $(lastlog2_tests_ldadd)
69
70 test_lastlog2_y2038_ll2_read_all_SOURCES = liblastlog2/src/tests/tst_y2038_ll2_read_all.c
71 test_lastlog2_y2038_ll2_read_all_CFLAGS = $(lastlog2_tests_cflags)
72 test_lastlog2_y2038_ll2_read_all_LDFLAGS = $(lastlog2_tests_ldflags)
73 test_lastlog2_y2038_ll2_read_all_LDADD = $(lastlog2_tests_ldadd)
74
75 test_lastlog2_y2038_sqlite3_time_SOURCES = liblastlog2/src/tests/tst_y2038_sqlite3_time.c
76 test_lastlog2_y2038_sqlite3_time_CFLAGS = $(lastlog2_tests_cflags)
77 test_lastlog2_y2038_sqlite3_time_LDFLAGS = $(lastlog2_tests_ldflags)
78 test_lastlog2_y2038_sqlite3_time_LDADD = $(lastlog2_tests_ldadd)
79
80 endif #BUILD_LIBLIBLASTLOG2_TESTS
81
82
83 # move lib from $(usrlib_execdir) to $(libdir) if needed
84 install-exec-hook-liblastlog2:
85 if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/liblastlog2.so"; then \
86 $(MKDIR_P) $(DESTDIR)$(libdir); \
87 mv $(DESTDIR)$(usrlib_execdir)/liblastlog2.so.* $(DESTDIR)$(libdir); \
88 so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/liblastlog2.so); \
89 so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
90 (cd $(DESTDIR)$(usrlib_execdir) && \
91 rm -f liblastlog2.so && \
92 $(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name liblastlog2.so); \
93 fi
94
95 uninstall-hook-liblastlog2:
96 rm -f $(DESTDIR)$(libdir)/liblastlog2.so*
97
98 INSTALL_EXEC_HOOKS += install-exec-hook-liblastlog2
99 UNINSTALL_HOOKS += uninstall-hook-liblastlog2