-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
230 lines (182 loc) · 7.2 KB
/
configure.ac
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
################################################################################
# libshmeram: A library for acessing SH-Mobile MERAM hardware #
# Copyright (C) 2011 Renesas Electronics Corporation #
# #
# This library is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Library General Public #
# License as published by the Free Software Foundation; either #
# version 2 of the License, or (at your option) any later version. #
# #
# This library 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 #
# Library General Public License for more details. #
# #
# You should have received a copy of the GNU Library General Public #
# License along with this library; if not, write to the Free Software #
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA #
################################################################################
# Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([src/libshmeram/meram.c])
AC_PREREQ(2.53)
AM_INIT_AUTOMAKE(libshmeram, 0.9.4)
AM_CONFIG_HEADER(config.h)
################################################################################
# Set the shared versioning info, according to section 6.3 of the libtool info #
# pages. CURRENT:REVISION:AGE must be updated immediately before each release: #
# #
# * If the library source code has changed at all since the last #
# update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). #
# #
# * If any interfaces have been added, removed, or changed since the #
# last update, increment CURRENT, and set REVISION to 0. #
# #
# * If any interfaces have been added since the last public release, #
# then increment AGE. #
# #
# * If any interfaces have been removed since the last public release, #
# then set AGE to 0. #
# #
################################################################################
SHARED_VERSION_INFO="3:0:2"
SHLIB_VERSION_ARG=""
# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_C_CONST
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_REALLOC
AC_CHECK_FUNCS([])
# Check for pkg-config
AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
# Check for doxygen
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
if test $HAVE_DOXYGEN = "false"; then
AC_MSG_WARN([*** doxygen not found, docs will not be built])
fi
# Check for valgrind
VALGRIND_ENVIRONMENT=""
ac_enable_valgrind=no
AC_ARG_ENABLE(valgrind-testing,
[ --enable-valgrind-testing enable running of tests inside Valgrind ],
[ ac_enable_valgrind=yes ], [ ac_enable_valgrind=no] )
if test "x${ac_enable_valgrind}" = xyes ; then
if test "x${enable_shared}" = xyes ; then
VALGRIND_ENVIRONMENT="libtool --mode=execute "
fi
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
if test "x$HAVE_VALGRIND" = xyes ; then
VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
AC_SUBST(VALGRIND_ENVIRONMENT)
TESTS_INFO="Test suite will be run under:
${VALGRIND_ENVIRONMENT}"
else
TESTS_INFO="(Valgrind not found)"
fi
else
TESTS_INFO="(Valgrind testing not enabled)"
fi
dnl Checks for libraries.
LIBS=""
dnl
dnl Check for libuiomux
dnl
PKG_CHECK_MODULES(UIOMUX, uiomux >= 1.7.0)
dnl Overall configuration success flag
meram_config_ok=yes
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
dnl Add some useful warnings if we have gcc.
dnl changequote(,)dnl
if test "x$ac_cv_prog_gcc" = xyes ; then
CFLAGS="$CFLAGS -Wall -Wextra -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused"
fi
dnl changequote([,])dnl
dnl
dnl Configuration option to add -Werror to all Makefiles
dnl
AC_ARG_ENABLE(gcc-werror,
AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
[ ac_enable_gcc_werror=yes ], [ ac_enable_gcc_werror=no] )
if test "x${ac_enable_gcc_werror}" = xyes ; then
CFLAGS="-Werror $CFLAGS"
fi
dnl
dnl Shared library symbol versioning and hiding
dnl
case "$target_os" in
linux* | solaris*)
SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
;;
*)
;;
esac
# Checks for library functions.
if test $meram_config_ok = no ; then
AC_MSG_RESULT([
**************************************************************
*** $PACKAGE $VERSION: Automatic configuration FAILED.
*** The file config.log has full details.
*** The following required libraries are missing or
*** misconfigured on your system:
])
dnl ...
AC_MSG_RESULT(
[*** If you install the required libraries from source, you
*** need to inform the dynamic linker of their location. If
*** you install them in a system-wide directory such as
*** /usr/local (the default), you must ensure that
*** /usr/local/lib is listed in /etc/ld.so.conf, then run
*** ldconfig to update the dynamic linking system.
*** Alternatively, you can set your LD_LIBRARY_PATH environment
*** variable to include the library installation directory.
])
AC_MSG_RESULT(
[**************************************************************
])
AC_MSG_ERROR([
***
*** After fixing the above problems, you must run ./configure again.
***
])
else
AC_SUBST(SHLIB_VERSION_ARG)
AC_SUBST(SHARED_VERSION_INFO)
AC_OUTPUT([
Makefile
doc/Makefile
doc/Doxyfile
include/Makefile
include/meram/Makefile
src/Makefile
src/libshmeram/Version_script
src/libshmeram/Makefile
config_data/Makefile
meram.pc
meram-uninstalled.pc
])
AC_MSG_RESULT([
------------------------------------------------------------------------
$PACKAGE $VERSION: Automatic configuration OK.
Building:
Type 'make' to compile $PACKAGE.
Type 'make install' to install $PACKAGE.
Type 'make check' to test $PACKAGE using the unit and functional tests
contained in the src/tests directory.
${TESTS_INFO}
Example programs will be built but not installed.
------------------------------------------------------------------------
])
fi