~m-grant-prg/agmaint/bionic

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Mark Grant
  • Date: 2019-09-22 09:19:27 UTC
  • mfrom: (1.1.24)
  • Revision ID: m.grant.prg@gmail.com-20190922091927-njwuvd39ainpj3hw
Merge new upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#########################################################################
2
2
#                                                                       #
3
3
# Script ID: ./configure.ac                                             #
4
 
# Author: Copyright (C) 2014-2018  Mark Grant                           #
 
4
# Author: Copyright (C) 2014-2019  Mark Grant                           #
5
5
#                                                                       #
6
6
# Released under the GPLv3 only.                                        #
7
7
# SPDX-License-Identifier: GPL-3.0                                      #
9
9
# Purpose:                                                              #
10
10
# Autoconfigure script file to configure agmaint project.               #
11
11
#                                                                       #
12
 
# configure cmd line syntax: ./configure                                #
 
12
# configure cmd line syntax:-                                           #
 
13
# ./configure                                                           #
13
14
#                                                                       #
 
15
# Layout: (Only relevant sections will exist).                          #
 
16
# ChangeLog : High level ChangeLog                                      #
 
17
# SECTION  1: Initialisation & Setup                                    #
 
18
# SECTION  2: Architecture, target and host checks                      #
 
19
# SECTION  3: Command line arguments                                    #
 
20
# SECTION  4: Compiler setup                                            #
 
21
# SECTION  5: Check for programs                                        #
 
22
# SECTION  6: Check for libraries                                       #
 
23
# SECTION  7: Check for header files                                    #
 
24
# SECTION  8: Check for types                                           #
 
25
# SECTION  9: Check for structures                                      #
 
26
# SECTION 10: Check for compiler characteristics                        #
 
27
# SECTION 11: Check for library functions                               #
 
28
# SECTION 12: Check for pkg-config files                                #
 
29
# SECTION 13: Check for system services                                 #
 
30
# SECTION 14: Additional checks & variables                             #
 
31
# SECTION 15: Specify the output files                                  #
14
32
#                                                                       #
15
33
#########################################################################
16
34
 
54
72
#                               Because of this, other packaging should #
55
73
#                               probably use the source tarball rather  #
56
74
#                               than a dist tarball.                    #
 
75
# 22/09/2019    MG      1.1.0   Re-vamp to new standard layout.         #
 
76
#                               Remove v from package version string.   #
57
77
#                                                                       #
58
78
#########################################################################
59
79
 
60
 
AC_REVISION([$Revision: 1.0.11 $])
 
80
 
 
81
#########################################
 
82
#                                       #
 
83
# SECTION  1: Initialisation & Setup    #
 
84
#                                       #
 
85
#########################################
 
86
 
 
87
AC_REVISION([$Revision: 1.1.0 $])
61
88
 
62
89
AC_PREREQ([2.69])
63
90
 
64
 
 
65
 
########################
66
91
#
67
92
# The package version in ac init will be used to create an output variable which
68
93
# can be used by ac output and / or the sed setup below to substitute bookmarks
69
94
# in source files.
70
95
#
71
 
########################
72
 
 
73
 
AC_INIT(apt-get Maintenance Commands Script, v1.0.21,
 
96
AC_INIT(apt-get Maintenance Commands Script, 1.0.21+rc1,
74
97
        m.grant.prg@gmail.com, agmaint)
75
98
 
 
99
AC_MSG_NOTICE(initialisation and setup)
 
100
 
76
101
AC_SUBST(pkgversion, $PACKAGE_VERSION)
77
102
 
78
 
 
79
 
########################
 
103
#
 
104
# Passes the options to all am files. Puts objects in the sub-directory
 
105
# containing the source. Forces tar to use --format=posix in make dist.
 
106
# This also checks :-   BSD install     make variable set       mkdir -p
 
107
#                       gawk
 
108
#
 
109
AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects tar-pax])
 
110
 
 
111
#
 
112
# Standard macros will be automatically placed in m4.
 
113
# Programmer defined macros should be placed in, say, m4extra which allows us
 
114
# to exclude the standard macros from being git tracked. This other directory
 
115
# must be specified as an include option in the Makefile.am ACLOCAL_AMFLAGS
 
116
# e.g.
 
117
# ACLOCAL_AMFLAGS = -I m4 -I m4extra
 
118
#
 
119
AC_CONFIG_MACRO_DIR([m4])
 
120
 
 
121
 
 
122
#########################################
 
123
#                                       #
 
124
# SECTION  5: Check for programs        #
 
125
#                                       #
 
126
#########################################
 
127
 
 
128
AC_MSG_NOTICE(checking for basic programs that have AutoConf checks)
 
129
 
 
130
#
 
131
# The small set of tools you can expect to find on any machine.
 
132
#
 
133
# awk           date            grep            od
 
134
# basename      diff            join            rm
 
135
# cat           dirname         ln              rmdir
 
136
# cc            egrep           ls              sed
 
137
# chgrp         expr            mkdir           sleep
 
138
# chown         expr (‘|’)      mkfifo          sort
 
139
# chmod         expr (‘:’)      mknod           tar
 
140
# cmp           fgrep           mktemp          touch
 
141
# cp            find            mv              tr
 
142
#
 
143
# (For further information including limitations to the above, see Section 11.15
 
144
# in the GNU AutoConf Manual).
 
145
#
 
146
# If using am init automake, gl early or lt init the following programs are
 
147
# automatically checked:-
 
148
#
 
149
# am init automake
 
150
#       BSD install     mkdir -p        gawk
 
151
#
 
152
# gl early
 
153
#       ar      grep    egrep   ranlib
 
154
#
 
155
# lt init
 
156
#       fgrep   ranlib  sed
 
157
#
 
158
# Basic and AutoTools program checks.
 
159
#
 
160
AC_PROG_AWK
 
161
AC_PROG_EGREP
 
162
AC_PROG_FGREP
 
163
AC_PROG_GREP
 
164
AC_PROG_LN_S
 
165
AC_PROG_MKDIR_P
 
166
AC_PROG_SED
 
167
 
 
168
AC_MSG_NOTICE(checking for some standard AutoTools required programs)
 
169
AC_PROG_INSTALL
 
170
 
 
171
AC_MSG_NOTICE(checking for particular programs required by this build)
 
172
AC_CHECK_PROG([TAR], [tar], [yes], [no])
 
173
if test "x$TAR" = "xno" ; then
 
174
        AC_MSG_ERROR([tar not found])
 
175
fi
 
176
 
 
177
AC_CHECK_PROG([TXT2MAN], [txt2man], [yes], [no])
 
178
if test "x$TXT2MAN" = "xno" ; then
 
179
        AC_MSG_ERROR([txt2man not found])
 
180
fi
 
181
 
 
182
AC_CHECK_PROG([TXT2MANWRAP], [txt2manwrap], [yes], [no])
 
183
if test "x$TXT2MANWRAP" = "xno" ; then
 
184
        AC_MSG_ERROR([txt2manwrap not found])
 
185
fi
 
186
 
 
187
AC_MSG_NOTICE(checking for particular programs required at build and run time)
 
188
AC_PATH_PROG([BASH], [bash], [no])
 
189
if test "x$BASH" = "xno" ; then
 
190
        AC_MSG_ERROR([bash not found])
 
191
fi
 
192
 
 
193
AC_MSG_NOTICE(checking for particular programs required at run time)
 
194
AC_CHECK_PROG(ECHO, echo, yes, no)
 
195
if test "x$ECHO" = "xno" ; then
 
196
        AC_MSG_WARN(echo not found - needed at run time)
 
197
fi
 
198
 
 
199
AC_CHECK_PROG(PRINTF, printf, yes, no)
 
200
if test "x$PRINTF" = "xno" ; then
 
201
        AC_MSG_WARN(printf not found - needed at run time)
 
202
fi
 
203
 
 
204
AC_CHECK_PROG([GETOPT], [getopt], [yes], [no])
 
205
if test "x$GETOPT" = "xno" ; then
 
206
        AC_MSG_WARN(getopt not found - needed at run time)
 
207
fi
 
208
 
 
209
AC_CHECK_PROG(APT_GET, apt-get, yes, no)
 
210
if test "x$APT_GET" = "xno" ; then
 
211
        AC_MSG_WARN([apt-get not found])
 
212
fi
 
213
 
 
214
 
 
215
#################################################
 
216
#                                               #
 
217
# SECTION 14: Additional checks & variables     #
 
218
#                                               #
 
219
#################################################
 
220
 
 
221
AC_MSG_NOTICE(processing additional checks and variables)
 
222
 
80
223
#
81
224
# Now set up a sed sequence to substitute bookmarks in script files with either
82
225
# standard GNU Directory Variables, or with programmer-defined variables set up
112
255
#       pkglibdir       ${libdir}/${PACKAGE}
113
256
#       pkglibexecdir   ${libexecdir}/${PACKAGE}
114
257
#
115
 
########################
116
 
 
117
258
AC_SUBST([edit], ["sed \
 
259
                -e 's|@bashlocation[@]|\$(BASH)|g' \
118
260
                -e 's|@pkgversion[@]|\$(pkgversion)|g' \
119
261
                -e 's|@prefix[@]|\$(prefix)|g' \
120
262
                -e 's|@exec_prefix[@]|\$(exec_prefix)|g' \
145
287
                -e 's|@pkglibexecdir[@]|\$(pkglibexecdir)|g'"])
146
288
 
147
289
 
148
 
# Passes the options to all am files. Puts objects in the sub-directory
149
 
# containing the source. Forces tar to use --format=posix in make dist.
150
 
# This also checks :-   BSD install     make variable set       mkdir -p
151
 
#                       gawk
152
 
AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects tar-pax])
153
 
 
154
 
 
155
 
########################
156
 
#
157
 
# Standard macros will be automatically placed in m4.
158
 
# Programmer defined macros should be placed in, say, m4extra which allows us
159
 
# to exclude the standard macros from being git tracked. This other directory
160
 
# must be specified as an include option in the Makefile.am ACLOCAL_AMFLAGS
161
 
# e.g.
162
 
# ACLOCAL_AMFLAGS = -I m4 -I m4extra
163
 
#
164
 
########################
165
 
 
166
 
AC_CONFIG_MACRO_DIR([m4])
167
 
 
168
 
 
169
 
########################
170
 
#
171
 
# Checks for programs.
172
 
# If using am init automake, gl early or lt init the following programs are
173
 
# automatically checked:-
174
 
#
175
 
# am init automake
176
 
#       BSD install     mkdir -p        gawk
177
 
#
178
 
# gl early
179
 
#       ar      grep    egrep   ranlib
180
 
#
181
 
# lt init
182
 
#       fgrep   ranlib  sed
183
 
#
184
 
# Particular and generic program checks follow:
185
 
#
186
 
########################
187
 
 
188
 
AC_MSG_NOTICE([checking for particular programs required by this application])
189
 
AC_PROG_SED
190
 
 
191
 
AC_MSG_NOTICE([checking for generic programs required by this application])
192
 
AC_CHECK_PROG([TAR], [tar], [yes], [no])
193
 
if test "x$TAR" = "xno" ; then
194
 
        AC_MSG_ERROR([tar not found])
195
 
fi
196
 
 
197
 
AC_CHECK_PROG(APT_GET, apt-get, yes, no)
198
 
if test "x$APT_GET" = "xno" ; then
199
 
        AC_MSG_ERROR([apt-get not found])
200
 
fi
201
 
 
202
 
AC_CHECK_PROG([GETOPT], [getopt], [yes], [no])
203
 
if test "x$GETOPT" = "xno" ; then
204
 
        AC_MSG_ERROR([getopt not found])
205
 
fi
206
 
 
207
 
AC_CHECK_PROG([BASH], [bash], [yes], [no])
208
 
if test "x$BASH" = "xno" ; then
209
 
        AC_MSG_ERROR([bash not found])
210
 
fi
211
 
 
212
 
AC_CHECK_PROG([TXT2MAN], [txt2man], [yes], [no])
213
 
if test "x$TXT2MAN" = "xno" ; then
214
 
        AC_MSG_ERROR([txt2man not found])
215
 
fi
216
 
 
217
 
AC_CHECK_PROG([TXT2MANWRAP], [txt2manwrap], [yes], [no])
218
 
if test "x$TXT2MANWRAP" = "xno" ; then
219
 
        AC_MSG_ERROR([txt2manwrap not found])
220
 
fi
221
 
 
222
 
# Checks for libraries.
223
 
 
224
 
# Checks for C header files.
225
 
 
226
 
# Checks for C++ header files.
227
 
 
228
 
# Checks for typedefs, structures, and compiler characteristics.
229
 
 
230
 
# Checks for library functions.
231
 
 
232
 
# Checks for pkg-config files.
 
290
#########################################
 
291
#                                       #
 
292
# SECTION 15: Specify the output files  #
 
293
#                                       #
 
294
#########################################
 
295
 
 
296
AC_MSG_NOTICE(processing output files)
 
297
 
 
298
#
 
299
# Non-Makefile files to generate.
 
300
# AC_CONFIG_FILES should not be used to substitute AutoConf Installation
 
301
# Directory Variables, (bindir and friends), except in Makefiles and pkg-config
 
302
# files. See GNU AutoConf manual section 4.8.2 Installation Directory Variables.
 
303
#
233
304
 
234
305
# Project Makefiles to create.
235
306
AC_CONFIG_FILES([Makefile