lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit 001ede194aac0f07a8078332fe7b5eca36c52f8f
parent 2be5a2a18f2bd36fbf2675fb81329bedd5a07168
Author: Duncaen <mail@duncano.de>
Date:   Mon,  6 Mar 2017 20:55:00 +0100

lib/libopenbsd: fix optional functions

Diffstat:
config.h.in | 6++++++
config.mk.in | 2++
configure | 15++++++++++++---
configure.ac | 6++++--
lib/libopenbsd/Makefile | 16++++++++--------
5 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/config.h.in b/config.h.in @@ -10,6 +10,9 @@ /* Define to 1 if you have the `dl_iterate_phdr' function. */ #undef HAVE_DL_ITERATE_PHDR +/* Define to 1 if you have the `explicit_bzero' function. */ +#undef HAVE_EXPLICIT_BZERO + /* Define to 1 if you have the `fgetln' function. */ #undef HAVE_FGETLN @@ -46,6 +49,9 @@ /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `reallocarray' function. */ +#undef HAVE_REALLOCARRAY + /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H diff --git a/config.mk.in b/config.mk.in @@ -25,3 +25,5 @@ HAVE_STRLCAT=@HAVE_STRLCAT@ HAVE_STRLCPY=@HAVE_STRLCPY@ HAVE_FGETLN=@HAVE_FGETLN@ HAVE_GETENTROPY=@HAVE_GETENTROPY@ +HAVE_EXPLICIT_BZERO=@HAVE_EXPLICIT_BZERO@ +HAVE_REALLOCARRAY=@HAVE_REALLOCARRAY@ diff --git a/configure b/configure @@ -624,6 +624,8 @@ ac_includes_default="\ ac_header_list= ac_subst_vars='LTLIBOBJS +HAVE_REALLOCARRAY +HAVE_EXPLICIT_BZERO HAVE_GETENTROPY HAVE_STRLCPY HAVE_STRLCAT @@ -4888,7 +4890,7 @@ $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt -for ac_func in strlcpy strlcat dl_iterate_phdr getentropy strptime issetugid fgetln +for ac_func in strlcpy strlcat dl_iterate_phdr getentropy strptime issetugid fgetln reallocarray explicit_bzero do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -4922,6 +4924,14 @@ if test "x$ac_cv_func_getentropy" = "xyes"; then : HAVE_GETENTROPY=1 fi +if test "x$ac_cv_func_explicit_bzero" = "xyes"; then : + HAVE_EXPLICIT_BZERO=1 + +fi +if test "x$ac_cv_func_reallocarray" = "xyes"; then : + HAVE_REALLOCARRAY=1 + +fi cat >>confdefs.h <<_ACEOF @@ -4934,7 +4944,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF -ac_config_files="$ac_config_files config.mk libopenbsd/config.mk" +ac_config_files="$ac_config_files config.mk" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5628,7 +5638,6 @@ do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;; - "libopenbsd/config.mk") CONFIG_FILES="$CONFIG_FILES libopenbsd/config.mk" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.ac b/configure.ac @@ -39,7 +39,7 @@ AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MMAP -AC_CHECK_FUNCS([strlcpy strlcat dl_iterate_phdr getentropy strptime issetugid fgetln]) +AC_CHECK_FUNCS([strlcpy strlcat dl_iterate_phdr getentropy strptime issetugid fgetln reallocarray explicit_bzero getdtablecount]) # AC_SUBST(HAVE_STRLCAT, "$have_strlcat") # AC_SUBST(HAVE_STRLCPY, "$have_strlcpy") @@ -50,9 +50,11 @@ AS_IF([test "x$ac_cv_func_fgetln" = "xyes"],[AC_SUBST(HAVE_FGETLN, 1)],[]) AS_IF([test "x$ac_cv_func_strlcat" = "xyes"],[AC_SUBST(HAVE_STRLCAT, 1)],[]) 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)],[]) AC_DEFINE_UNQUOTED([_PATH_TTY], ["/dev/tty"], [Path to tty.]) AC_DEFINE_UNQUOTED([_PATH_UUCPLOCK], ["/var/spool/lock"], [Serial device lock file path.]) -AC_CONFIG_FILES([config.mk libopenbsd/config.mk]) +AC_CONFIG_FILES([config.mk]) AC_OUTPUT diff --git a/lib/libopenbsd/Makefile b/lib/libopenbsd/Makefile @@ -18,36 +18,36 @@ SRCS = base64.c closefrom.c \ SRCS += gen/errc.c gen/fts.c gen/warnc.c gen/verrc.c gen/vwarnc.c gen/setmode.c\ SRCS += stdio/fgetwln.c -ifndef HAVE_EXPLICIT_BZERO +ifneq (1,$(HAVE_EXPLICIT_BZERO)) SRCS += string/explicit_bzero.c endif -ifndef HAVE_REALLOCARRAY +ifndef (1,$(HAVE_REALLOCARRAY)) SRCS += stdlib/reallocarray.c endif -ifndef HAVE_STRLCPY +ifndef (1,$(HAVE_STRLCPY)) SRCS += string/strlcpy.c endif -ifndef HAVE_STRLCAT +ifndef (1,$(HAVE_STRLCAT)) SRCS += string/strlcat.c endif -ifndef HAVE_ISSETUGID +ifndef (1,$(HAVE_ISSETUGID)) SRCS += issetugid.c endif -ifndef HAVE_FGETLN +ifndef (1,$(HAVE_FGETLN)) SRCS += stdio/fgetln.c endif -ifndef HAVE_GETENTROPY +ifndef (1,$(HAVE_GETENTROPY)) SRCS += getentropy_linux.c getentropy_linux.o : CPPFLAGS += -D_GNU_SOURCE endif -ifndef HAVE_GETDTABLECOUNT +ifndef (1,$(HAVE_GETDTABLECOUNT)) SRCS += sys/getdtablecount.c endif