aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-05-25 21:10:14 +0200
committerDuncaen <mail@duncano.de>2017-05-25 21:10:14 +0200
commit31f0970ad6c2a7f1b3ba6e0493ff2df44888f5fb (patch)
tree51c9b05782723f16f0d21b239d2dcd6857cac5b5
parentac6721edcc59d588731a5e43156e46b01377ca47 (diff)
downloadlobase-31f0970ad6c2a7f1b3ba6e0493ff2df44888f5fb.tar.gz
configure: add checks for sys_siglist and sys_signame
-rw-r--r--config.h.in8
-rw-r--r--config.mk.in2
-rwxr-xr-xconfigure84
-rw-r--r--configure.ac6
-rw-r--r--include/signal.h15
5 files changed, 114 insertions, 1 deletions
diff --git a/config.h.in b/config.h.in
index a29e08a..ef9563e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,6 +3,14 @@
/* Define to 1 if your system has a working `chown' function. */
#undef HAVE_CHOWN
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_SIGLIST
+
+/* Define to 1 if you have the declaration of `sys_signame', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_SIGNAME
+
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
diff --git a/config.mk.in b/config.mk.in
index 4e8c820..7e16a36 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -31,4 +31,6 @@ HAVE_FGETLN=@HAVE_FGETLN@
HAVE_GETENTROPY=@HAVE_GETENTROPY@
HAVE_EXPLICIT_BZERO=@HAVE_EXPLICIT_BZERO@
HAVE_REALLOCARRAY=@HAVE_REALLOCARRAY@
+HAVE_SYS_SIGLIST=@HAVE_SYS_SIGLIST@
+HAVE_SYS_SIGNAME=@HAVE_SYS_SIGNAME@
endif
diff --git a/configure b/configure
index adc1684..50bbf97 100755
--- a/configure
+++ b/configure
@@ -624,6 +624,8 @@ ac_includes_default="\
ac_header_list=
ac_subst_vars='LTLIBOBJS
+HAVE_SYS_SIGNAME
+HAVE_SYS_SIGLIST
HAVE_REALLOCARRAY
HAVE_EXPLICIT_BZERO
HAVE_GETENTROPY
@@ -1888,6 +1890,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -4903,6 +4951,34 @@ fi
done
+ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "sys_signame" "ac_cv_have_decl_sys_signame" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_have_decl_sys_signame" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGNAME $ac_have_decl
+_ACEOF
+
+
# AC_SUBST(HAVE_STRLCAT, "$have_strlcat")
# AC_SUBST(HAVE_STRLCPY, "$have_strlcpy")
# AC_SUBST(HAVE_GETENTROPY, "$have_getentropy")
@@ -4932,6 +5008,14 @@ if test "x$ac_cv_func_reallocarray" = "xyes"; then :
HAVE_REALLOCARRAY=1
fi
+if test "x$ac_cv_have_decl_sys_siglist" = "xyes"; then :
+ HAVE_SYS_SIGLIST=1
+
+fi
+if test "x$ac_cv_have_decl_sys_signame" = "xyes"; then :
+ HAVE_SYS_SIGNAME=1
+
+fi
cat >>confdefs.h <<_ACEOF
diff --git a/configure.ac b/configure.ac
index 4642335..b1a862d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,10 @@ AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MMAP
AC_CHECK_FUNCS([strlcpy strlcat dl_iterate_phdr getentropy strptime issetugid fgetln reallocarray explicit_bzero getdtablecount])
+AC_CHECK_DECLS([sys_siglist, sys_signame], [], [], [
+#include <signal.h>
+])
+
# AC_SUBST(HAVE_STRLCAT, "$have_strlcat")
# AC_SUBST(HAVE_STRLCPY, "$have_strlcpy")
# AC_SUBST(HAVE_GETENTROPY, "$have_getentropy")
@@ -52,6 +56,8 @@ AS_IF([test "x$ac_cv_func_strlcpy" = "xyes"],[AC_SUBST(HAVE_STRLCPY, 1)],[])
AS_IF([test "x$ac_cv_func_getentropy" = "xyes"],[AC_SUBST(HAVE_GETENTROPY, 1)],[])
AS_IF([test "x$ac_cv_func_explicit_bzero" = "xyes"],[AC_SUBST(HAVE_EXPLICIT_BZERO, 1)],[])
AS_IF([test "x$ac_cv_func_reallocarray" = "xyes"],[AC_SUBST(HAVE_REALLOCARRAY, 1)],[])
+AS_IF([test "x$ac_cv_have_decl_sys_siglist" = "xyes"],[AC_SUBST(HAVE_SYS_SIGLIST, 1)],[])
+AS_IF([test "x$ac_cv_have_decl_sys_signame" = "xyes"],[AC_SUBST(HAVE_SYS_SIGNAME, 1)],[])
AC_DEFINE_UNQUOTED([_PATH_TTY], ["/dev/tty"], [Path to tty.])
AC_DEFINE_UNQUOTED([_PATH_UUCPLOCK], ["/var/spool/lock"], [Serial device lock file path.])
diff --git a/include/signal.h b/include/signal.h
index 0288cfa..23bb026 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -5,7 +5,20 @@
#define SIGINFO SIGUSR1
-extern const char *const sys_signame[_NSIG];
+#ifndef _NSIG
+# ifdef NSIG
+# define _NSIG NSIG
+# else
+# define _NSIG 128
+# endif
+#endif
+
+#if !HAVE_DECL_SYS_SIGLIST
extern const char *const sys_siglist[_NSIG];
+#endif /* !HAVE_DECL_SYS_SIGLIST */
+
+#if !HAVE_DECL_SYS_SIGNAME
+extern const char *const sys_signame[_NSIG];
+#endif /* !HAVE_DECL_SYS_SIGNAME */
#endif /* _COMPAT_SIGNAL_H_ */