~m-grant-prg/vm-container-utils/focal-trunk

1 by Mark Grant
Import upstream version 1.0.0+rc1
1
#########################################################################
2
#									#
3
# Script ID: ./configure.ac						#
4
# Author: Copyright (C) 2020  Mark Grant				#
5
#									#
6
# Released under the GPLv3 only.					#
7
# SPDX-License-Identifier: GPL-3.0					#
8
#									#
9
# Purpose:								#
10
# AutoConf script file to configure vm-container-utils project.		#
11
#									#
12
# configure cmd line syntax:						#
13
# ./configure	[--enable-distcheckfake=<yes|no> [default: no]]		#
14
#									#
15
# Parameters generic description. For specifics to this configure.ac	#
16
# please see inline comments at the point of definition:-		#
17
# --enable-distcheckfake						#
18
#	Enables the replacement of an absolute directory path specified	#
19
#	in a variable, with a value based on AutoTools standard		#
20
#	directories. This enables the Makefile.am to use the AT		#
21
#	variable based value when running distcheck and the absolute	#
22
#	path for all else. Hence distcheck can now succeed when it	#
23
#	would normally fail.						#
24
#									#
25
# Layout: (Only relevant sections will exist).				#
26
# ChangeLog : High level ChangeLog					#
27
# SECTION  1: Initialisation & Setup					#
28
# SECTION  2: Architecture, target and host checks			#
29
# SECTION  3: Command line arguments					#
30
# SECTION  4: Compiler setup						#
31
# SECTION  5: Check for programs					#
32
# SECTION  6: Check for libraries					#
33
# SECTION  7: Check for header files					#
34
# SECTION  8: Check for types						#
35
# SECTION  9: Check for structures					#
36
# SECTION 10: Check for compiler characteristics			#
37
# SECTION 11: Check for library functions				#
38
# SECTION 12: Check for pkg-config files				#
39
# SECTION 13: Check for system services					#
40
# SECTION 14: Additional checks & variables				#
41
# SECTION 15: Specify the output files					#
42
#									#
43
#########################################################################
44
45
#########################################################################
46
#									#
47
# Changelog								#
48
#									#
49
# Date		Author	Version	Description				#
50
#									#
51
# 19/08/2020	MG	1.0.1	Initial release.			#
1.1.2 by Mark Grant
Import upstream version 1.0.1+rc1
52
# 22/09/2020	MG	1.0.2	Separate lqvm and lxcu under conf and	#
53
#				man.					#
1 by Mark Grant
Import upstream version 1.0.0+rc1
54
#									#
55
#########################################################################
56
57
58
#########################################
59
#					#
60
# SECTION  1: Initialisation & Setup	#
61
#					#
62
#########################################
63
1.1.2 by Mark Grant
Import upstream version 1.0.1+rc1
64
AC_REVISION([$Revision: 1.0.2 $])
1 by Mark Grant
Import upstream version 1.0.0+rc1
65
66
AC_PREREQ([2.69])
67
68
#
69
# The package version in ac init will be used to create an output variable which
70
# can be used by ac output and / or the sed setup below to substitute bookmarks
71
# in source files.
72
#
1.1.6 by Mark Grant
Import upstream version 1.0.3
73
AC_INIT([Utility scripts for containers and VMs], 1.0.3,
1 by Mark Grant
Import upstream version 1.0.0+rc1
74
	[m.grant.prg@gmail.com], [vm-container-utils])
75
76
AC_MSG_NOTICE(initialisation and setup)
77
78
AC_SUBST(pkgversion, $PACKAGE_VERSION)
79
80
#
81
# Passes the options to all am files. Puts objects in the sub-directory
82
# containing the source. Forces tar to use --format=posix in make dist.
83
# This also checks :-	BSD install	make variable set	mkdir -p
84
#			gawk
85
#
86
AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects tar-pax])
87
88
#
89
# Standard macros will be automatically placed in m4.
90
# Programmer defined macros should be placed in, say, m4extra which allows us
91
# to exclude the standard macros from being git tracked. This other directory
92
# must be specified as an include option in the Makefile.am ACLOCAL_AMFLAGS
93
# e.g.
94
# ACLOCAL_AMFLAGS = -I m4 -I m4extra
95
#
96
AC_CONFIG_MACRO_DIR([m4])
97
98
99
#########################################
100
#					#
101
# SECTION  3: Command line arguments	#
102
#					#
103
#########################################
104
105
AC_MSG_NOTICE(processing command line arguments)
106
107
#
108
# If a file location has to be fixed, e.g. /etc/foo.conf and never
109
# /usr/local/etc/foo.conf, then make distcheck will fail. Setting this flag
110
# allows make distcheck to locate the file in an AT standard directory-based
111
# location.
112
# eg /usr/local/etc/foo.conf.
113
# and hence succeed.
114
#
115
AC_ARG_ENABLE([distcheckfake],
116
	AS_HELP_STRING([--enable-distcheckfake], [enable running of distcheck]),
117
	[case "${enableval}" in
118
		yes) distcheckfake=true ;;
119
		no)  distcheckfake=false ;;
120
		*) AC_MSG_ERROR([bad value ${enableval} for \
121
			--enable-distcheckfake]) ;;
122
	esac],[distcheckfake=false])
123
AM_CONDITIONAL([DISTCHECKFAKE], [test x$distcheckfake = xtrue])
124
125
if test "x${distcheckfake}" = xtrue; then
126
	AC_SUBST([logrotateloc], ["$sysconfdir/logrotate.d"])
127
	AC_MSG_NOTICE([using substitute paths to facilitate distcheck])
128
else
129
	AC_SUBST([logrotateloc], ["/etc/logrotate.d"])
130
	AC_MSG_NOTICE([using distcheck incompatible absolute based paths])
131
fi
132
133
134
#########################################
135
#					#
136
# SECTION  5: Check for programs	#
137
#					#
138
#########################################
139
140
AC_MSG_NOTICE(checking for basic programs that have AutoConf checks)
141
142
#
143
# The small set of tools you can expect to find on any machine.
144
#
145
# awk		date		grep		od
146
# basename	diff		join		rm
147
# cat		dirname		ln		rmdir
148
# cc		egrep		ls		sed
149
# chgrp		expr		mkdir		sleep
150
# chown		expr (|)	mkfifo		sort
151
# chmod		expr (‘:’)	mknod		tar
152
# cmp		fgrep		mktemp		touch
153
# cp		find		mv		tr
154
#
155
# (For further information including limitations to the above, see Section 11.15
156
# in the GNU AutoConf Manual).
157
#
158
# If using am init automake, gl early or lt init the following programs are
159
# automatically checked:-
160
#
161
# am init automake
162
#	BSD install	mkdir -p	gawk
163
#
164
# gl early
165
#	ar	grep	egrep	ranlib
166
#
167
# lt init
168
#	fgrep	ranlib	sed
169
#
170
# Basic and AutoTools program checks.
171
#
172
AC_PROG_AWK
173
AC_PROG_EGREP
174
AC_PROG_FGREP
175
AC_PROG_GREP
176
AC_PROG_LN_S
177
AC_PROG_MKDIR_P
178
AC_PROG_SED
179
180
AC_MSG_NOTICE(checking for some standard AutoTools required programs)
181
AC_PROG_INSTALL
182
183
AC_MSG_NOTICE(checking for particular programs required by this build)
184
AC_CHECK_PROG(TXT2MAN, txt2man, yes, no)
185
if test "x$TXT2MAN" = "xno" ; then
186
	AC_MSG_ERROR(txt2man not found)
187
fi
188
189
AC_CHECK_PROG(TXT2MANWRAP, txt2manwrap, yes, no)
190
if test "x$TXT2MANWRAP" = "xno" ; then
191
	AC_MSG_ERROR(txt2manwrap not found)
192
fi
193
194
AC_MSG_NOTICE(checking for particular programs required at build and run time)
195
AC_CHECK_PROG(BASH, bash, yes, no)
196
if test "x$BASH" = "xno" ; then
197
	AC_MSG_ERROR(bash not found)
198
fi
199
200
AC_CHECK_PROG(TAR, tar, yes, no)
201
if test "x$TAR" = "xno" ; then
202
	AC_MSG_ERROR(tar not found)
203
fi
204
205
AC_MSG_NOTICE(checking for particular programs required at run time)
206
AC_CHECK_PROG(CHMOD, chmod, yes, no)
207
if test "x$CHMOD" = "xno" ; then
208
	AC_MSG_WARN(chmod not found - needed at run time)
209
fi
210
211
AC_CHECK_PROG(CHOWN, chown, yes, no)
212
if test "x$CHOWN" = "xno" ; then
213
	AC_MSG_WARN(chown not found - needed at run time)
214
fi
215
216
AC_CHECK_PROG(DF, df, yes, no)
217
if test "x$DF" = "xno" ; then
218
	AC_MSG_WARN(df not found - needed at run time)
219
fi
220
221
AC_CHECK_PROG(ECHO, echo, yes, no)
222
if test "x$ECHO" = "xno" ; then
223
	AC_MSG_WARN(echo not found - needed at run time)
224
fi
225
226
AC_CHECK_PROG(FIND, find, yes, no)
227
if test "x$FIND" = "xno" ; then
228
	AC_MSG_WARN(find not found - needed at run time)
229
fi
230
231
AC_CHECK_PROG(GETOPT, getopt, yes, no)
232
if test "x$GETOPT" = "xno" ; then
233
	AC_MSG_WARN(getopt not found - needed at run time)
234
fi
235
236
AC_CHECK_PROG(LOGGER, logger, yes, no)
237
if test "x$LOGGER" = "xno" ; then
238
	AC_MSG_WARN(logger not found - needed at run time)
239
fi
240
241
AC_CHECK_PROG(LSOF, lsof, yes, no)
242
if test "x$LSOF" = "xno" ; then
243
	AC_MSG_WARN(lsof not found - needed at run time)
244
fi
245
246
AC_CHECK_PROG(MAILX, mailx, yes, no)
247
if test "x$MAILX" = "xno" ; then
248
	AC_MSG_WARN(mailx not found - needed at run time)
249
fi
250
251
AC_CHECK_PROG(MOUNT, mount, yes, no)
252
if test "x$MOUNT" = "xno" ; then
253
	AC_MSG_WARN(mount not found - needed at run time)
254
fi
255
256
AC_CHECK_PROG(PASSWD, passwd, yes, no)
257
if test "x$PASSWD" = "xno" ; then
258
	AC_MSG_WARN(passwd not found - needed at run time)
259
fi
260
261
AC_CHECK_PROG(PRINTF, printf, yes, no)
262
if test "x$PRINTF" = "xno" ; then
263
	AC_MSG_WARN(printf not found - needed at run time)
264
fi
265
266
267
#################################################
268
#						#
269
# SECTION 14: Additional checks & variables	#
270
#						#
271
#################################################
272
273
AC_MSG_NOTICE(processing additional checks and variables)
274
275
#
276
# Now set up an awk sequence to substitute bookmarks in script files with either
277
# standard GNU Directory Variables, or with programmer-defined variables set up
278
# using an AC_SUBST macro above. This awk sequence will be invoked at programmer
279
# discretion at sub-directory Makefile.am level.
280
# ----------------------
281
#
282
# prefix	/usr/local (typically)
283
#	exec_prefix	${prefix}
284
#		bindir	${exec_prefix}/bin	user executables
285
#		sbindir	${exec_prefix}/sbin	system admin executables
286
#		libexecdir	${exec_prefix}/libexec	program executables
287
#		libdir	${exec_prefix}/lib	object code libraries
288
#	sysconfdir	 ${prefix}/etc	read-only single-machine data
289
#	sharedstatedir	${prefix}/com	modifiable architecture-independent data
290
#	localstatedir	${prefix}/var	modifiable single-machine data
291
#	runstatedir	${localstatedir}/run
292
#	includedir	${prefix}/include	C header files
293
#	oldincludedir	$usr/include	C header files
294
#	datarootdir	${prefix}/share	read-only arch.-independent data root
295
#		localedir	${datarootdir}/locale	locale-dependent data
296
#		datadir	${datarootdir}	read-only architecture-independent data
297
#		mandir	${datarootdir}/man	man documentation
298
#		infodir	${datarootdir}/info	info documentation
299
#		docdir	${datarootdir}/doc/${PACKAGE}	documentation root
300
#			htmldir	${docdir}	html documentation
301
#			dvidir	${docdir}	dvi documentation
302
#			pdfdir	${docdir}	pdf documentation
303
#			psdir	${docdir}	ps documentation
304
#		lispdir	${datarootdir}/emacs/site-lisp **Often empty, no check**
305
#	pkgdatadir	${datarootdir}/${PACKAGE}
306
#	pkgincludedir	${includedir}/${PACKAGE}
307
#	pkglibdir	${libdir}/${PACKAGE}
308
#	pkglibexecdir	${libexecdir}/${PACKAGE}
309
#
310
AC_SUBST([edit], ["$AWK \
311
		'{ \
312
		gsub(/@bashlocation[@]/,"'"$(BASH)"'"); \
313
		gsub(/@pkgversion[@]/,"'"$(pkgversion)"'"); \
314
		gsub(/@prefix[@]/,"'"$(prefix)"'"); \
315
		gsub(/@exec_prefix[@]/,"'"$(exec_prefix)"'"); \
316
		gsub(/@bindir[@]/,"'"$(bindir)"'"); \
317
		gsub(/@sbindir[@]/,"'"$(sbindir)"'"); \
318
		gsub(/@libexecdir[@]/,"'"$(libexecdir)"'"); \
319
		gsub(/@libdir[@]/,"'"$(libdir)"'"); \
320
		gsub(/@sysconfdir[@]/,"'"$(sysconfdir)"'"); \
321
		gsub(/@sharedstatedir[@]/,"'"$(sharedstatedir)"'"); \
322
		gsub(/@localstatedir[@]/,"'"$(localstatedir)"'"); \
323
		gsub(/@runstatedir[@]/,"'"$(runstatedir)"'"); \
324
		gsub(/@includedir[@]/,"'"$(includedir)"'"); \
325
		gsub(/@oldincludedir[@]/,"'"$(oldincludedir)"'"); \
326
		gsub(/@datarootdir[@]/,"'"$(datarootdir)"'"); \
327
		gsub(/@localedir[@]/,"'"$(localedir)"'"); \
328
		gsub(/@datadir[@]/,"'"$(datadir)"'"); \
329
		gsub(/@mandir[@]/,"'"$(mandir)"'"); \
330
		gsub(/@infodir[@]/,"'"$(infodir)"'"); \
331
		gsub(/@docdir[@]/,"'"$(docdir)"'"); \
332
		gsub(/@htmldir[@]/,"'"$(htmldir)"'"); \
333
		gsub(/@dvidir[@]/,"'"$(dvidir)"'"); \
334
		gsub(/@pdfdir[@]/,"'"$(pdfdir)"'"); \
335
		gsub(/@psdir[@]/,"'"$(psdir)"'"); \
336
		gsub(/@pkgdatadir[@]/,"'"$(pkgdatadir)"'"); \
337
		gsub(/@pkgincludedir[@]/,"'"$(pkgincludedir)"'"); \
338
		gsub(/@pkglibdir[@]/,"'"$(pkglibdir)"'"); \
339
		gsub(/@pkglibexecdir[@]/,"'"$(pkglibexecdir)"'"); \
340
		print ; }'"])
341
342
343
#########################################
344
#					#
345
# SECTION 15: Specify the output files	#
346
#					#
347
#########################################
348
349
AC_MSG_NOTICE(processing output files)
350
351
#
352
# Non-Makefile files to generate.
353
# AC_CONFIG_FILES should not be used to substitute AutoConf Installation
354
# Directory Variables, (bindir and friends), except in Makefiles and pkg-config
355
# files. See GNU AutoConf manual section 4.8.2 Installation Directory Variables.
356
#
357
358
# Project Makefiles to create.
359
AC_CONFIG_FILES([Makefile
1.1.2 by Mark Grant
Import upstream version 1.0.1+rc1
360
		src/conf/etc/lqvm/Makefile
361
		src/man/1/lqvm/Makefile
362
		src/man/5/lqvm/Makefile
363
		src/man/1/lxcu/Makefile
364
		src/man/5/lxcu/Makefile
365
		src/prg/bash/lqvm/Makefile
366
		src/conf/etc/lxcu/Makefile
367
		src/conf/etc/lxcu/debian/apt/Makefile
368
		src/conf/etc/lxcu/debian/apt/sources.list.d/Makefile
369
		src/conf/etc/lxcu/debian/apt/trusted.gpg.d/Makefile
370
		src/conf/etc/lxcu/debian/basic/Makefile
371
		src/conf/etc/lxcu/debian/dev/Makefile
372
		src/conf/etc/lxcu/debian/dosab/Makefile
373
		src/conf/etc/lxcu/ubuntu/apt/Makefile
374
		src/conf/etc/lxcu/ubuntu/apt/sources.list.d/Makefile
375
		src/conf/etc/lxcu/ubuntu/apt/trusted.gpg.d/Makefile
376
		src/conf/etc/lxcu/ubuntu/basic/Makefile
377
		src/conf/etc/lxcu/ubuntu/dev/Makefile
378
		src/conf/etc/lxcu/ubuntu/dosab/Makefile
379
		src/prg/bash/lxcu/Makefile])
1 by Mark Grant
Import upstream version 1.0.0+rc1
380
381
AC_OUTPUT
382