File: configure.ac

package info (click to toggle)
canlock 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,944 kB
  • sloc: sh: 4,561; ansic: 4,308; yacc: 643; lex: 226; makefile: 94
file content (256 lines) | stat: -rw-r--r-- 8,664 bytes parent folder | download
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
dnl ============================================================================
dnl Copyright (c) 2018-2021 Michael Baeuerle
dnl
dnl All rights reserved.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining
dnl a copy of this software and associated documentation files (the
dnl "Software"), to deal in the Software without restriction, including
dnl without limitation the rights to use, copy, modify, merge, publish,
dnl distribute, and/or sell copies of the Software, and to permit persons
dnl to whom the Software is furnished to do so, provided that the above
dnl copyright notice(s) and this permission notice appear in all copies of
dnl the Software and that both the above copyright notice(s) and this
dnl permission notice appear in supporting documentation.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
dnl SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
dnl RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
dnl CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
dnl CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Except as contained in this notice, the name of a copyright holder
dnl shall not be used in advertising or otherwise to promote the sale, use
dnl or other dealings in this Software without prior written authorization
dnl of the copyright holder.


dnl ============================================================================
dnl Source code for configure script
dnl
dnl Sequence recommended by documentation:
dnl   Autoconf requirements
dnl   AC_INIT(package, version, [bug-report], [tarname], [url])
dnl   information on the package
dnl   checks for programs
dnl   checks for libraries
dnl   checks for header files
dnl   checks for types
dnl   checks for structures
dnl   checks for compiler characteristics
dnl   checks for library functions
dnl   checks for system services
dnl   AC_CONFIG_FILES([file...])
dnl   AC_OUTPUT


dnl ============================================================================
dnl Requirements

dnl Minimum required autoconf version
AC_PREREQ([2.69])


dnl ============================================================================
dnl Init

dnl Library name and version (release version, not API/ABI)
dnl Attention: The package name must start with "lib"!
AC_INIT([libcanlock], [3.2.2],
        [michael.baeuerle@gmx.net], [],
        [https://micha.freeshell.org/libcanlock])

dnl Configuration header file to create
AC_CONFIG_HEADERS([config.h])

dnl Macro directory
AC_CONFIG_MACRO_DIR([m4])

dnl Directory for auxiliary build tools
AC_CONFIG_AUX_DIR([build-aux])

dnl File to verify source directory
AC_CONFIG_SRCDIR([src/canlock.c])

dnl Release date
AC_SUBST([RELEASE_DATE], [2021-01-07])

dnl Option "legacy-api"
AC_ARG_ENABLE([legacy_api],
              [AS_HELP_STRING([--disable-legacy-api],
                              [disable version 2 legacy API])],
              [], [enable_legacy_api=yes])
AS_IF([test "x$enable_legacy_api" = "xyes"],
      [
         AC_MSG_NOTICE([Enable version 2 legacy API])
         AC_SUBST([opt_legacy_api], [1])
      ])
AS_IF([test "x$enable_legacy_api" != "xyes"],
      [
         AC_MSG_NOTICE([Disable version 2 legacy API])
         AC_SUBST([opt_legacy_api], [0])
      ])

dnl Option "hp"
AC_ARG_ENABLE([hp],
              [AS_HELP_STRING([--disable-hp],
                              [do not build article header parsers])],
              [], [enable_hp=yes])
AS_IF([test "x$enable_hp" = "xyes"],
      [
         AC_MSG_NOTICE([Enable article header parsers])
         AC_CONFIG_SUBDIRS([hp])
      ])
AS_IF([test "x$enable_hp" != "xyes"],
      [
         AC_MSG_NOTICE([Disable article header parsers])
      ])

dnl Option "pc-files"
dnl Note Use option --with-pkgconfigdir to change the default target directory
AC_ARG_ENABLE([pc-files],
              [AS_HELP_STRING([--enable-pc-files],
                              [generate and install .pc files for pkg-config])],
              [], [enable_pc_files=no])
AS_IF([test "x$enable_pc_files" = "xyes"],
      [
         AC_MSG_NOTICE([Enable .pc files for pkg-config])
         PKG_PREREQ([0.29])
         PKG_INSTALLDIR
      ])
AS_IF([test "x$enable_pc_files" != "xyes"],
      [
         AC_MSG_NOTICE([Disable .pc files for pkg-config])
      ])


dnl ============================================================================
dnl Programs

dnl Check for BSD style install program
AC_PROG_INSTALL

dnl Check for (static library) archiver
AM_PROG_AR

dnl Required for test suite only
AC_PROG_GREP

dnl Check for POSIX compliant sed (required for man page processing)
AC_PROG_SED


dnl ============================================================================
dnl Header files

dnl Obsolete (still present for old compilers)
AC_HEADER_STDC

dnl Abort if some header files are missing
dnl Any header file that is used unconditionally by the code should be listed
dnl here.
dnl Note: "stdint.h" is indirectly included by "include/sha.h"!
AC_CHECK_HEADERS([ctype.h limits.h stdint.h stdio.h stdlib.h string.h],
                 [], [AC_MSG_ERROR([Required header file not found.])])


dnl ============================================================================
dnl Types

dnl We need 'int' to be at least 32 bit wide
AC_CHECK_SIZEOF([int])
AS_IF([test $ac_cv_sizeof_int -lt 4],
      [
         AC_MSG_ERROR([Type int must be at least 32 bits wide!])
      ])

dnl ============================================================================
dnl Init libtool

dnl Minimum required libtool version
LT_PREREQ([2.4.2])
LT_INIT


dnl ============================================================================
dnl Compiler

dnl Check for C compiler
AC_PROG_CC

dnl Try to get C99 mode if available
AC_PROG_CC_C99


dnl ============================================================================
dnl Functions

dnl Check whether 'memset_s()' from C11 Annex K is usable
dnl Use function pointer to check return value and parameter types
dnl Link to verify that no additional library is required
dnl Do not execute test program because this would break cross builds
dnl (See Debian Bug Report #914375)
dnl Double quoting is used to protect square brackets of source code
AC_MSG_CHECKING([for memset_s])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
                                   /* Request C11 Annex K */
                                   #define __STDC_WANT_LIB_EXT1__ 1
                                   #include <string.h>
                                   char buf[10] = { 1 };
                                ]],
                                [
                                   errno_t (*memset_s_ptr)(void*, rsize_t,
                                                           int, rsize_t);
                                   memset_s_ptr = &memset_s;
                                   memset_s_ptr((void*) buf, (size_t) 100,
                                                0, (size_t) 1);
                                ])],
              [
                 AC_MSG_RESULT([yes])
                 AC_DEFINE([HAVE_MEMSET_S], [1],
                           [Define to 1 if you have the `memset_s' function.])
              ],
              [AC_MSG_RESULT([no])])

dnl Check for nonstandard functions that provide explicit memory access
AC_CHECK_FUNCS([explicit_memset explicit_bzero])


dnl ============================================================================
dnl Create files

dnl Init automake
dnl - Minimum required automake version (security vulnerability in 1.11.5)
dnl   and options
dnl - bzip2 compressed tar archive as distribution file
dnl - No info pages
dnl - "foreign" mode to relax GNU rules we don't follow
AM_INIT_AUTOMAKE([1.11.6 dist-bzip2 no-dist-gzip tar-ustar no-installinfo
                  foreign])
AM_SILENT_RULES([yes])

dnl Conditional build hp subdirectory
AM_CONDITIONAL([COND_HP], [test "x$enable_hp" = "xyes"])

dnl Makefiles that automake will create
AC_CONFIG_FILES([Makefile src/Makefile util/Makefile test/Makefile
                 include/Makefile doc/Makefile])

dnl Header file
AC_CONFIG_FILES([include/canlock.h])

dnl Create pkg-config information file
AC_CONFIG_FILES([libcanlock-3.pc])


dnl ============================================================================
dnl Create configure script

AC_OUTPUT


dnl EOF