1#
2#  Copyright 2020 Northern.tech AS
3#
4#  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5#
6#  This program is free software; you can redistribute it and/or modify it
7#  under the terms of the GNU General Public License as published by the
8#  Free Software Foundation; version 3.
9#
10#  This program is distributed in the hope that it will be useful,
11#  but WITHOUT ANY WARRANTY; without even the implied warranty of
12#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#  GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
18#
19# To the extent this program is licensed as part of the Enterprise
20# versions of CFEngine, the applicable Commercial Open Source License
21# (COSL) may apply to this file if you as a licensee so wish it. See
22# included file COSL.txt.
23#
24noinst_LTLIBRARIES = libutils.la
25
26# TODO remove the openssl dependency! It's only there for base64 encoding.
27AM_CFLAGS   = $(CORE_CFLAGS)   $(PCRE_CFLAGS)   $(OPENSSL_CFLAGS)
28AM_CPPFLAGS = $(CORE_CPPFLAGS) $(PCRE_CPPFLAGS) $(OPENSSL_CPPFLAGS)
29AM_LDFLAGS  = $(CORE_LDFLAGS)  $(PCRE_LDFLAGS)  $(OPENSSL_LDFLAGS)
30
31libutils_la_LIBADD = ../libcompat/libcompat.la
32libutils_la_LIBS   = $(PCRE_LIBS) $(OPENSSL_LIBS)
33
34libutils_la_SOURCES = \
35	alloc.c alloc.h \
36	array_map.c array_map_priv.h \
37	buffer.c buffer.h \
38	cleanup.c cleanup.h \
39	compiler.h \
40	csv_writer.c csv_writer.h \
41	csv_parser.c csv_parser.h \
42	definitions.h \
43	deprecated.h \
44	dir.h dir_priv.h \
45	file_lib.c file_lib.h \
46	hash_map.c hash_map_priv.h \
47	hash_method.h \
48	ip_address.c ip_address.h \
49	json.c json.h json-priv.h \
50	json-utils.c json-utils.h \
51	json-yaml.c json-yaml.h \
52	known_dirs.c known_dirs.h \
53	list.c list.h \
54	logging.c logging.h logging_priv.h \
55	man.c man.h \
56	map.c map.h map_common.h \
57	misc_lib.c misc_lib.h \
58	mustache.c mustache.h \
59	mutex.c mutex.h \
60	passopenfile.c passopenfile.h \
61	path.c path.h \
62	platform.h condition_macros.h \
63	printsize.h \
64	proc_keyvalue.c proc_keyvalue.h \
65	queue.c queue.h \
66	rb-tree.c rb-tree.h \
67	refcount.c refcount.h \
68	ring_buffer.c ring_buffer.h \
69	sequence.c sequence.h \
70	string_sequence.c string_sequence.h \
71	set.c set.h \
72	stack.c stack.h \
73	threaded_stack.c threaded_stack.h \
74	statistics.c statistics.h \
75	string_lib.c string_lib.h \
76	threaded_deque.c threaded_deque.h \
77	threaded_queue.c threaded_queue.h \
78	unicode.c unicode.h \
79	version_comparison.c version_comparison.h \
80	writer.c writer.h \
81	xml_writer.c xml_writer.h
82
83EXTRA_DIST = stack_base.c
84
85if WITH_OPENSSL
86libutils_la_SOURCES += \
87	encode.c encode.h \
88	libcrypto-compat.c libcrypto-compat.h \
89	hash.c hash.h
90endif
91
92if WITH_PCRE
93libutils_la_SOURCES += \
94	pcre_wrap.c pcre_wrap.h \
95	regex.c regex.h
96endif
97
98if !NT
99libutils_la_SOURCES += unix_dir.c
100endif
101if CYGWIN
102libutils_la_SOURCES += unix_dir.c
103endif
104
105CLEANFILES = *.gcno *.gcda
106
107#
108# Some basic clean ups
109#
110MOSTLYCLEANFILES = *~ *.orig *.rej
111
112#
113# Get everything removed down to where rebuilding requires:
114# "aclocal; autoconf; autoheader; automake --add-missing"
115# "configure; make; make install"
116#
117MAINTAINERCLEANFILES = config.h.in
118