# For cpu modules
AC_CHECK_HEADERS([sys/dkstat.h])
-if test "x$ac_system" = "xDarwin"
-then
+if test "x$ac_system" = "xDarwin"; then
AC_CHECK_HEADERS(
[[ \
mach/mach_init.h \
]]
)
-if test "x$ac_system" = "xLinux"
-then
+if test "x$ac_system" = "xLinux"; then
# For hddtemp module
AC_CHECK_HEADERS([linux/major.h])
[have_clock_gettime="no"]
)
-if test "x$have_clock_gettime" = "xno"
-then
+if test "x$have_clock_gettime" = "xno"; then
AC_CHECK_LIB([rt], [clock_gettime],
[
clock_gettime_needs_rt="yes"
)
fi
-if test "x$have_clock_gettime" = "xno"
-then
+if test "x$have_clock_gettime" = "xno"; then
AC_CHECK_LIB([posix4], [clock_gettime],
[
clock_gettime_needs_posix4="yes"
)
fi
-if test "x$have_clock_gettime" = "xyes"
-then
+if test "x$have_clock_gettime" = "xyes"; then
AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if the clock_gettime(2) function is available.])
fi
AC_CHECK_FUNCS([thread_info], [have_thread_info="yes"], [have_thread_info="no"])
# Check for strptime {{{
-if test "x$GCC" = "xyes"
-then
+if test "x$GCC" = "xyes"; then
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Wextra -Werror"
fi
AC_CHECK_FUNCS([strptime], [have_strptime="yes"], [have_strptime="no"])
-if test "x$have_strptime" = "xyes"
-then
+if test "x$have_strptime" = "xyes"; then
AC_CACHE_CHECK([whether strptime is exported by default],
[c_cv_have_strptime_default],
[
)
fi
-if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"
-then
+if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno"; then
AC_CACHE_CHECK([whether strptime needs standards mode],
[c_cv_have_strptime_standards],
[
fi
fi
-if test "x$GCC" = "xyes"
-then
+if test "x$GCC" = "xyes"; then
CFLAGS="$SAVE_CFLAGS"
fi
# }}} Check for strptime
AC_MSG_CHECKING([for sysctl kern.cp_times])
-if test -x /sbin/sysctl
-then
+if test -x /sbin/sysctl; then
/sbin/sysctl kern.cp_times >/dev/null 2>&1
if test $? -eq 0; then
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([for sysctl kern.cp_time])
-if test -x /sbin/sysctl
-then
+if test -x /sbin/sysctl; then
/sbin/sysctl kern.cp_time >/dev/null 2>&1
if test $? -eq 0
then
)
if test "x$fp_layout_type" = "xunknown"; then
-AC_CACHE_CHECK([if doubles are stored in x86 representation],
- [c_cv_fp_layout_need_nothing],
- [
- AC_RUN_IFELSE(
- [
- AC_LANG_PROGRAM(
- [[
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdint.h>
- #include <inttypes.h>
- #include <stdbool.h>
- ]],
- [[
- uint64_t i0;
- uint64_t i1;
- uint8_t c[8];
- double d;
-
- d = 8.642135e130;
- memcpy ((void *) &i0, (void *) &d, 8);
-
- i1 = i0;
- memcpy ((void *) c, (void *) &i1, 8);
-
- if ((c[0] == 0x2f) && (c[1] == 0x25)
- && (c[2] == 0xc0) && (c[3] == 0xc7)
- && (c[4] == 0x43) && (c[5] == 0x2b)
- && (c[6] == 0x1f) && (c[7] == 0x5b))
- return (0);
- return (1);
- ]]
- )
- ],
- [c_cv_fp_layout_need_nothing="yes"],
- [c_cv_fp_layout_need_nothing="no"]
- )
- ]
-)
+ AC_CACHE_CHECK([if doubles are stored in x86 representation],
+ [c_cv_fp_layout_need_nothing],
+ [
+ AC_RUN_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdint.h>
+ #include <inttypes.h>
+ #include <stdbool.h>
+ ]],
+ [[
+ uint64_t i0;
+ uint64_t i1;
+ uint8_t c[8];
+ double d;
+
+ d = 8.642135e130;
+ memcpy ((void *) &i0, (void *) &d, 8);
+
+ i1 = i0;
+ memcpy ((void *) c, (void *) &i1, 8);
+
+ if ((c[0] == 0x2f) && (c[1] == 0x25)
+ && (c[2] == 0xc0) && (c[3] == 0xc7)
+ && (c[4] == 0x43) && (c[5] == 0x2b)
+ && (c[6] == 0x1f) && (c[7] == 0x5b))
+ return (0);
+ return (1);
+ ]]
+ )
+ ],
+ [c_cv_fp_layout_need_nothing="yes"],
+ [c_cv_fp_layout_need_nothing="no"]
+ )
+ ]
+ )
fi
if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
LDFLAGS="$LDFLAGS -lpthread"
AC_MSG_CHECKING([for pthread_setname_np])
- have_pthread_setname_np="no"
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
-[[
-#define _GNU_SOURCE
-#include <pthread.h>
-]],
-[[
- pthread_setname_np((pthread_t) {0}, "conftest");
-]]
- )], [
- have_pthread_setname_np="yes"
- AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
- ])
+have_pthread_setname_np="no"
+AC_LINK_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[
+ #define _GNU_SOURCE
+ #include <pthread.h>
+ ]],
+ [[pthread_setname_np((pthread_t) {0}, "conftest");]]
+ )
+ ],
+ [
+ have_pthread_setname_np="yes"
+ AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [pthread_setname_np() is available.])
+ ]
+)
AC_MSG_RESULT([$have_pthread_setname_np])
# check for pthread_set_name_np(3) (FreeBSD)
AC_MSG_CHECKING([for pthread_set_name_np])
- have_pthread_set_name_np="no"
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <pthread_np.h>
-]],
-[[
- pthread_set_name_np((pthread_t) {0}, "conftest");
-]]
- )], [
- have_pthread_set_name_np="yes"
- AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
- ])
+have_pthread_set_name_np="no"
+AC_LINK_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[#include <pthread_np.h>]],
+ [[pthread_set_name_np((pthread_t) {0}, "conftest");]]
+ )
+ ],
+ [
+ have_pthread_set_name_np="yes"
+ AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [pthread_set_name_np() is available.])
+ ]
+)
AC_MSG_RESULT([$have_pthread_set_name_np])
LDFLAGS="$SAVE_LDFLAGS"
with_libmicrohttpd_ldflags=""
AC_ARG_WITH([libmicrohttpd], [AS_HELP_STRING([--with-libmicrohttpd@<:@=PREFIX@:>@], [Path to libmicrohttpd.])],
[
- if test "x$withval" != "xno" && test "x$withval" != "xyes"
- then
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
with_libmicrohttpd_cppflags="-I$withval/include"
with_libmicrohttpd_ldflags="-L$withval/lib"
with_libmicrohttpd="yes"
fi
- if test "x$withval" = "xno"
- then
+ if test "x$withval" = "xno"; then
with_libmicrohttpd="no (disabled on command line)"
fi
],
[withval="yes"]
)
-if test "x$withval" = "xyes"
-then
-PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
- [with_libmicrohttpd="yes"],
- [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
-)
+if test "x$withval" = "xyes"; then
+ PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd],
+ [with_libmicrohttpd="yes"],
+ [with_libmicrohttpd="no (pkg-config could not find libmicrohttpd)"]
+ )
fi
-if test "x$MICROHTTPD_LIBS" = "x"
-then
+if test "x$MICROHTTPD_LIBS" = "x"; then
MICROHTTPD_LIBS="-lmicrohttpd"
fi
LDFLAGS="$with_libmicrohttpd_ldflags $LDFLAGS"
LIBS="$LIBS $MICROHTTPD_LIBS"
-if test "x$with_libmicrohttpd" = "xyes"
-then
+if test "x$with_libmicrohttpd" = "xyes"; then
AC_CHECK_HEADERS([microhttpd.h],
- [with_libmicrohttpd="yes"],
- [with_libmicrohttpd="no (<microhttpd.h> not found)"])
+ [with_libmicrohttpd="yes"],
+ [with_libmicrohttpd="no (<microhttpd.h> not found)"]
+ )
fi
-if test "x$with_libmicrohttpd" = "xyes"
-then
+if test "x$with_libmicrohttpd" = "xyes"; then
AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
- [with_libmicrohttpd="yes"],
- [with_libmicrohttpd="no (libmicrohttpd not found)"])
+ [with_libmicrohttpd="yes"],
+ [with_libmicrohttpd="no (libmicrohttpd not found)"]
+ )
fi
CPPFLAGS="$SAVE_CPPFLAGS"
fi
with_libmodbus_libs="`$PKG_CONFIG --libs 'libmodbus'`"
- if test $? -ne 0
- then
+ if test $? -ne 0; then
with_libmodbus="no ($PKG_CONFIG failed)"
fi
fi