summaryrefslogtreecommitdiffstats
path: root/pki/base/native-tools/Makefile.am
blob: 623b46c78ebc6d7350ab6236b16ace49cb58fa8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# --- BEGIN COPYRIGHT BLOCK ---
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# 
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# --- END COPYRIGHT BLOCK ---

# look for included m4 files in the ./m4/ directory
ACLOCAL_AMFLAGS = -I m4

#------------------------
# Compiler Flags
#------------------------
DEBUG_DEFINES = @debug_defs@
# These paths are dependent on the settings of prefix and exec_prefix
# which may be specified at make time.  So we cannot use AC_DEFINE in
# the configure.ac because that would set the values prior to their
# being defined.  Defining them here ensures that they are properly
# expanded before use.  See create_instance.h for more details. The
# quoting ensures that the values are # quoted for the shell command,
# and the value expands to a quoted string value in the header file
# (e.g. - #define LOCALSTATEDIR "/var"; without the quotes, it would
#         be #define LOCALSTATEDIR /var which would be an error).
PATH_DEFINES = -DLOCALSTATEDIR="\"$(localstatedir)\"" \
	-DSYSCONFDIR="\"$(sysconfdir)\"" -DLIBDIR="\"$(libdir)\"" \
	-DBINDIR="\"$(bindir)\"" -DDATADIR="\"$(datadir)\"" \
	-DDOCDIR="\"$(docdir)\"" -DLIBEXECDIR="\"$(libexecdir)\""
AM_CPPFLAGS = $(DEBUG_DEFINES) $(PATH_DEFINES)
# We need to make sure that libpthread is linked before libc on HP-UX.
if HPUX
AM_LDFLAGS = -lpthread
endif

#------------------------
# Linker Flags
#------------------------
LDAPSDK_LINK = @ldapsdk_lib@ -lldap -lldap_r -llber
SVRCORE_LINK = @svrcore_lib@ -lsvrcore
SASL_LINK = @sasl_lib@ -lsasl2
NSS_LINK = @nss_lib@ -lnss3 -lssl3 -lsmime3 -lsoftokn3
NSPR_LINK = @nspr_lib@ -lplc4 -lplds4 -lnspr4

LIBSOCKET=@LIBSOCKET@
LIBNSL=@LIBNSL@
LIBDL=@LIBDL@
LIBCSTD=@LIBCSTD@
LIBCRUN=@LIBCRUN@

#------------------------
# Install Paths
#------------------------
confdir = $(prefix)@confdir@
readmedir = $(prefix)@readmedir@
samplesdir = $(prefix)@samplesdir@
templatesdir = $(prefix)@templatesdir@

#------------------------
# Build Products
#------------------------
libexec_PROGRAMS =	bulkissuance \
					p7tool       \
					revoker      \
					setpin       \
					sslget       \
					tkstool


#------------------------
# Installed Files
#------------------------
bin_SCRIPTS =	wrappers/bulkissuance \
				wrappers/p7tool       \
				wrappers/revoker      \
				wrappers/setpin       \
				wrappers/sslget       \
				wrappers/tkstool

conf_DATA =	$(srcdir)/src/setpin/setpin.conf

readme_DATA =	$(srcdir)/LICENSE \
				$(srcdir)/doc/README

samples_DATA =	$(srcdir)/src/bulkissuance/bulkissuance.data

templates_DATA =	$(srcdir)/templates/pki_instance_command_wrapper \
					$(srcdir)/templates/pki_subsystem_command_wrapper


#////////////////////////////////////////////////////////////////
#
#   Dynamic Libraries
#
#////////////////////////////////////////////////////////////////



#////////////////////////////////////////////////////////////////
#
#   Programs
#
#////////////////////////////////////////////////////////////////

#------------------------
# bulkissuance
#------------------------
#
# REMINDER:  Link order is significant!
#
bulkissuance_SOURCES =	src/bulkissuance/bulkissuance.c \
						src/bulkissuance/getopt.c

bulkissuance_CPPFLAGS = $(AM_CPPFLAGS) @nss_inc@ @nspr_inc@
bulkissuance_LDADD = $(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) \
	$(LIBCSTD) $(LIBCRUN)


#------------------------
# p7tool
#------------------------
#
# REMINDER:  Link order is significant!
#
p7tool_SOURCES =	src/p7tool/secerror.c \
					src/p7tool/secpwd.c   \
					src/p7tool/secutil.c  \
					src/p7tool/pppolicy.c \
					src/p7tool/p7tool.c

p7tool_CPPFLAGS = $(AM_CPPFLAGS) @nss_inc@ @nspr_inc@
p7tool_LDADD = $(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) \
	$(LIBCSTD) $(LIBCRUN)


#------------------------
# revoker
#------------------------
#
# REMINDER:  Link order is significant!
#
revoker_SOURCES =	src/revoker/revoker.c \
					src/revoker/getopt.c

revoker_CPPFLAGS = $(AM_CPPFLAGS) @nss_inc@ @nspr_inc@
revoker_LDADD = $(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) \
	$(LIBCSTD) $(LIBCRUN)


#------------------------
# setpin
#------------------------
#
# REMINDER:  Link order is significant!
#
setpin_SOURCES =	src/setpin/b64.c     \
					src/setpin/options.c \
					src/setpin/setpin.c  \
					src/setpin/setpin_options.c

setpin_CPPFLAGS = $(AM_CPPFLAGS) @ldapsdk_inc@ @svrcore_inc@ \
	@sasl_inc@ @nss_inc@ @nspr_inc@
setpin_LDADD = $(LDAPSDK_LINK) $(SVRCORE_LINK) $(SASL_LINK)  \
	$(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) \
	$(LIBCSTD) $(LIBCRUN)


#------------------------
# sslget
#------------------------
#
# REMINDER:  Link order is significant!
#
sslget_SOURCES =	src/sslget/sslget.c \
					src/sslget/getopt.c

sslget_CPPFLAGS = $(AM_CPPFLAGS) @nss_inc@ @nspr_inc@
sslget_LDADD = $(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) \
	$(LIBCSTD) $(LIBCRUN)


#------------------------
# tkstool
#------------------------
#
# REMINDER:  Link order is significant!
#
tkstool_SOURCES =	src/tkstool/delete.c   \
					src/tkstool/file.c     \
					src/tkstool/find.c     \
					src/tkstool/help.c     \
					src/tkstool/key.c      \
					src/tkstool/list.c     \
					src/tkstool/modules.c  \
					src/tkstool/random.c   \
					src/tkstool/retrieve.c \
					src/tkstool/util.c     \
					src/tkstool/version.c  \
					src/tkstool/tkstool.c  \
					src/tkstool/secutil.c  \
					src/tkstool/secpwd.c   \
					src/tkstool/secerror.c \
					src/tkstool/pppolicy.c

tkstool_CPPFLAGS = $(AM_CPPFLAGS) @ldapsdk_inc@ @svrcore_inc@ \
	@sasl_inc@ @nss_inc@ @nspr_inc@
tkstool_LDADD = $(LDAPSDK_LINK) $(SVRCORE_LINK) $(SASL_LINK)  \
	$(NSS_LINK) $(NSPR_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL)  \
	$(LIBCSTD) $(LIBCRUN)


#////////////////////////////////////////////////////////////////
#
#   Wrappers
#
#////////////////////////////////////////////////////////////////

create_wrapper = sed                              \
	-e "s|\@ldapsdk_libdir\@|$(ldapsdk_libdir)|g" \
	-e "s|\@libexecdir\@|$(libexecdir)|g"         \
	-e "s|\@nspr_libdir\@|$(nspr_libdir)|g"       \
	-e "s|\@nss_libdir\@|$(nss_libdir)|g"         \
	-e "s|\@sasl_libdir\@|$(sasl_libdir)|g"

%: %.in
	mkdir -p $(dir $@)
	$(create_wrapper) $^ > $@