Skip to content

Commit 5df8216

Browse files
committed
configure.ac: clean up tabs, use AS_IF for all conditionals
1 parent 18584cd commit 5df8216

File tree

1 file changed

+82
-100
lines changed

1 file changed

+82
-100
lines changed

configure.ac

+82-100
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,22 @@ AC_SEARCH_LIBS(socket, socket)
8787
AC_SEARCH_LIBS(inet_aton, resolv)
8888
AC_SEARCH_LIBS(inet_pton, resolv,
8989
AC_DEFINE(HAVE_INET_PTON, 1,
90-
[Define to 1 if you have the `inet_pton()' function.]))
90+
[Define to 1 if you have the inet_pton() function.]))
9191
AC_SEARCH_LIBS(inet_ntop, resolv nsl,
9292
AC_DEFINE(HAVE_INET_NTOP, 1,
93-
[Define to 1 if you have the `inet_ntop()' function.]))
93+
[Define to 1 if you have the inet_ntop() function.]))
9494
AC_SEARCH_LIBS(getaddrinfo, resolv,
9595
AC_DEFINE(HAVE_GETADDRINFO, 1,
96-
[Define to 1 if you have the `getaddrinfo()' function.]))
96+
[Define to 1 if you have the getaddrinfo() function.]))
9797
AC_SEARCH_LIBS(res_ninit, resolv,
9898
AC_DEFINE(HAVE_RES_NINIT, 1,
99-
[Define to 1 if you have the `res_ninit()' function.]))
99+
[Define to 1 if you have the res_ninit() function.]))
100100
AC_SEARCH_LIBS(res_sertservers, resolv bind,
101101
AC_DEFINE(HAVE_RES_SETSERVERS, 1,
102-
[Define to 1 if you have the `res_setservers()' function.]))
102+
[Define to 1 if you have the res_setservers() function.]))
103103
AC_SEARCH_LIBS(getopt_long, iberty,
104104
AC_DEFINE(HAVE_GETOPT_LONG, 1,
105-
[Define to 1 if you have the `getopt_long()' function.]))
105+
[Define to 1 if you have the getopt_long() function.]))
106106

107107
AC_HEADER_RESOLV
108108

@@ -132,23 +132,23 @@ AC_MSG_CHECKING([whether the resolver works without -lresolv])
132132
LIBRESOLV=
133133
AC_LINK_IFELSE([AC_LANG_SOURCE([
134134
$dnscheck
135-
])] , [
136-
AC_MSG_RESULT(yes)
137-
] , [
138-
AC_MSG_RESULT(no)
139-
AC_MSG_CHECKING([whether the resolver works with -lresolv])
140-
saved_LIBS="$LIBS"
141-
LIBS="$outer_LIBS -lresolv"
142-
AC_LINK_IFELSE([AC_LANG_SOURCE([
135+
])], [
136+
AC_MSG_RESULT(yes)
137+
], [
138+
AC_MSG_RESULT(no)
139+
AC_MSG_CHECKING([whether the resolver works with -lresolv])
140+
saved_LIBS="$LIBS"
141+
LIBS="$outer_LIBS -lresolv"
142+
AC_LINK_IFELSE([AC_LANG_SOURCE([
143143
$dnscheck
144-
])] , [
145-
AC_MSG_RESULT(yes)
146-
LIBRESOLV=-lresolv
147-
] , [
148-
AC_MSG_RESULT(no)
149-
AC_MSG_ERROR([need workable resolver library])
150-
])
151-
LIBS="$saved_LIBS"
144+
])], [
145+
AC_MSG_RESULT(yes)
146+
LIBRESOLV=-lresolv
147+
], [
148+
AC_MSG_RESULT(no)
149+
AC_MSG_ERROR([need workable resolver library])
150+
])
151+
LIBS="$saved_LIBS"
152152
])
153153
AC_SUBST([LIBRESOLV])
154154

@@ -191,98 +191,83 @@ AC_CHECK_HEADERS([bsd/string.h], [bsdstrl_h_found="yes"])
191191

192192
AC_CHECK_FUNCS([strlcat strlcpy], [strl_found="yes"],
193193
[
194-
saved_LIBS="$LIBS"
195-
LIBS="$outer_LIBS"
196-
AC_SEARCH_LIBS([strlcat],
197-
[bsd strl],
198-
[libstrl_found="yes"],
199-
[strl_found="no"])
200-
AC_SEARCH_LIBS([strlcpy],
201-
[bsd strl],
202-
[libstrl_found="yes"],
203-
[strl_found="no"])
204-
STRL_LIBS="$LIBS"
205-
LIBS="$saved_LIBS"
194+
saved_LIBS="$LIBS"
195+
LIBS="$outer_LIBS"
196+
AC_SEARCH_LIBS([strlcat],
197+
[bsd strl],
198+
[libstrl_found="yes"],
199+
[strl_found="no"])
200+
AC_SEARCH_LIBS([strlcpy],
201+
[bsd strl],
202+
[libstrl_found="yes"],
203+
[strl_found="no"])
204+
STRL_LIBS="$LIBS"
205+
LIBS="$saved_LIBS"
206206
])
207207

208-
if test x"$libstrl_found" = x"yes"
209-
then
210-
LIBS="$LIBS $STRL_LIBS"
211-
fi
208+
AS_IF([test "x$libstrl_found" = xyes], [LIBS="$LIBS $STRL_LIBS"])
212209

213210
# we need something above to have worked
214-
if test x"$strl_found" != x"yes" -a x"$libstrl_found" != x"yes"
215-
then
216-
AC_MSG_ERROR(no strlcpy/strlcat found)
217-
fi
211+
AS_IF([test "x$strl_found" != xyes -a "x$libstrl_found" != xyes], [
212+
AC_MSG_ERROR(no strlcpy/strlcat found)
213+
])
218214

219215
AC_SUBST(STRL_LIBS)
220216

221217
AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
222-
if test x"$strl_h_found" != x"yes"
223-
then
224-
strldirs="/usr/local/include /usr/include"
225-
226-
for d in $strldirs
227-
do
228-
AC_MSG_CHECKING([for strl.h in $d/strl])
229-
if test -f $d/strl/strl.h
230-
then
231-
unset ac_cv_header_strl_h
232-
saved_CPPFLAGS="$CPPFLAGS"
233-
CPPFLAGS="$CPPFLAGS -I$d/strl"
234-
AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
235-
CPPFLAGS="$saved_CPPFLAGS"
236-
fi
237-
238-
if test x"$strl_h_found" = x"yes"
239-
then
240-
CPPFLAGS="$CPPFLAGS -I$d/strl"
241-
break
242-
fi
243-
done
244-
fi
218+
AS_IF([test "x$strl_h_found" != xyes], [
219+
strldirs="/usr/local/include /usr/include"
220+
221+
for d in $strldirs
222+
do
223+
AC_MSG_CHECKING([for strl.h in $d/strl])
224+
AS_IF([test -f "$d/strl/strl.h"], [
225+
unset ac_cv_header_strl_h
226+
saved_CPPFLAGS="$CPPFLAGS"
227+
CPPFLAGS="$CPPFLAGS -I$d/strl"
228+
AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
229+
CPPFLAGS="$saved_CPPFLAGS"
230+
])
231+
232+
AS_IF([test "x$strl_h_found" = xyes], [
233+
CPPFLAGS="$CPPFLAGS -I$d/strl"
234+
break
235+
])
236+
done
237+
])
245238

246239
# we need to include <strl.h> if an installed strl.h was found and no
247240
# bsd/string.h was found
248-
if test x"$strl_h_found" = x"yes" -a x"$bsdstrl_h_found" = x"no"
249-
then
250-
AC_DEFINE([USE_STRL_H], 1,
251-
[Define to 1 if you need to include <strl.h> to get the strlcat() and strlcpy() functions.])
252-
fi
241+
AS_IF([test "x$strl_h_found" = xyes -a "x$bsdstrl_h_found" = xno], [
242+
AC_DEFINE([USE_STRL_H], 1, [Define to 1 if you need to include <strl.h> to get the strlcat() and strlcpy() functions.])
243+
])
253244

254-
if test x"$bsdstrl_h_found" = x"yes"
255-
then
256-
AC_DEFINE([USE_BSD_H], 1,
257-
[Define to 1 if you need to include <bsd/string.h> to get the strlcat() and strlcpy() functions.])
258-
fi
245+
AS_IF([test "x$bsdstrl_h_found" = xyes], [
246+
AC_DEFINE([USE_BSD_H], 1, [Define to 1 if you need to include <bsd/string.h> to get the strlcat() and strlcpy() functions.])
247+
])
259248

260249
#
261250
# use rpath at load time?
262251
#
263252

264-
AC_ARG_ENABLE(
265-
[rpath],
266-
AS_HELP_STRING([--enable-rpath],
267-
[include library load paths in binaries]),
268-
,
269-
enable_rpath="yes")
253+
AC_ARG_ENABLE([rpath],
254+
AS_HELP_STRING([--enable-rpath], [include library load paths in binaries]),
255+
[],
256+
enable_rpath="yes")
270257
AM_CONDITIONAL([RPATH], [test x"$enable_rpath" = x"yes"])
271-
if test x"$enable_rpath" != x"yes"
272-
then
273-
AC_MSG_RESULT([Suppressing -rpath use by libtool])
274-
hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "
275-
chmod 0755 libtool
276-
fi
258+
AS_IF([test "x$enable_rpath" != xyes], [
259+
AC_MSG_RESULT([Suppressing -rpath use by libtool])
260+
hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "
261+
chmod 0755 libtool
262+
])
277263

278264
#
279265
# openarc
280266
#
281267
AC_ARG_ENABLE([filter],
282-
AS_HELP_STRING([--disable-filter],
283-
[do not compile the openarc filter]),
284-
[enable_filter=$enableval],
285-
[enable_filter=yes])
268+
AS_HELP_STRING([--disable-filter], [do not compile the openarc filter]),
269+
[enable_filter=$enableval],
270+
[enable_filter=yes])
286271
AM_CONDITIONAL([BUILD_FILTER], [test x"$enable_filter" != x"no"])
287272

288273
#
@@ -292,18 +277,15 @@ AM_CONDITIONAL([BUILD_FILTER], [test x"$enable_filter" != x"no"])
292277
LIBOPENARC_FEATURE_STRING="libopenarc $PACKAGE_VERSION:"
293278

294279
AC_ARG_ENABLE([allsymbols],
295-
AS_HELP_STRING([--enable-allsymbols],
296-
[export internal-use symbols for better test coverage]))
280+
AS_HELP_STRING([--enable-allsymbols], [export internal-use symbols for better test coverage]))
297281
AM_CONDITIONAL(ALL_SYMBOLS, [test x"$enable_allsymbols" = x"yes"])
298282

299283
AC_ARG_ENABLE([debug],
300-
AS_HELP_STRING([--enable-debug],
301-
[produce debugging binaries and libraries]),
302-
AS_IF([test "x$enable_debug" = x"yes"],
303-
[
304-
LIBOPENARC_FEATURE_STRING="$LIBOPENARC_FEATURE_STRING debug"
305-
[[CFLAGS=`echo $CFLAGS | sed 's/ -O[1-9s]*//g'`]]
306-
])
284+
AS_HELP_STRING([--enable-debug], [produce debugging binaries and libraries]),
285+
AS_IF([test "x$enable_debug" = x"yes"], [
286+
LIBOPENARC_FEATURE_STRING="$LIBOPENARC_FEATURE_STRING debug"
287+
[[CFLAGS=`echo $CFLAGS | sed 's/ -O[1-9s]*//g'`]]
288+
])
307289
)
308290

309291
AM_CONDITIONAL([DEBUG], [test x"$enable_debug" = x"yes"])

0 commit comments

Comments
 (0)