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-pcre.h \
51	json-utils.c json-utils.h \
52	json-yaml.c json-yaml.h \
53	known_dirs.c known_dirs.h \
54	list.c list.h \
55	logging.c logging.h logging_priv.h \
56	man.c man.h \
57	map.c map.h map_common.h \
58	misc_lib.c misc_lib.h \
59	mustache.c mustache.h \
60	mutex.c mutex.h \
61	passopenfile.c passopenfile.h \
62	path.c path.h \
63	platform.h condition_macros.h \
64	printsize.h \
65	proc_keyvalue.c proc_keyvalue.h \
66	queue.c queue.h \
67	rb-tree.c rb-tree.h \
68	refcount.c refcount.h \
69	ring_buffer.c ring_buffer.h \
70	sequence.c sequence.h \
71	string_sequence.c string_sequence.h \
72	set.c set.h \
73	stack.c stack.h \
74	threaded_stack.c threaded_stack.h \
75	statistics.c statistics.h \
76	string_lib.c string_lib.h \
77	threaded_deque.c threaded_deque.h \
78	threaded_queue.c threaded_queue.h \
79	unicode.c unicode.h \
80	version_comparison.c version_comparison.h \
81	writer.c writer.h \
82	xml_writer.c xml_writer.h
83
84EXTRA_DIST = stack_base.c
85
86if WITH_OPENSSL
87libutils_la_SOURCES += \
88	encode.c encode.h \
89	libcrypto-compat.c libcrypto-compat.h \
90	hash.c hash.h
91endif
92
93if WITH_PCRE
94libutils_la_SOURCES += \
95	pcre_wrap.c pcre_wrap.h \
96	regex.c regex.h
97endif
98
99if !NT
100libutils_la_SOURCES += unix_dir.c
101endif
102if CYGWIN
103libutils_la_SOURCES += unix_dir.c
104endif
105
106CLEANFILES = *.gcno *.gcda
107
108#
109# Some basic clean ups
110#
111MOSTLYCLEANFILES = *~ *.orig *.rej
112
113#
114# Get everything removed down to where rebuilding requires:
115# "aclocal; autoconf; autoheader; automake --add-missing"
116# "configure; make; make install"
117#
118MAINTAINERCLEANFILES = config.h.in
119