]> git.ipfire.org Git - thirdparty/tvheadend.git/commit
configure: check for strlcat & strlcpy
authorBernd Kuhls <bernd.kuhls@t-online.de>
Sat, 23 Jun 2018 18:47:26 +0000 (20:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 1 Jul 2018 09:50:30 +0000 (11:50 +0200)
commite26ce3390a5ca88f3fcee8a7fa0e4bb1b078e538
tree10dff21aaebeb36fbb49433bf1524a556d5f5785
parent30f9f7f2a62cab74f7c508849b8ccc4126791811
configure: check for strlcat & strlcpy

Building tvheadend with uclibc and musl fails:

src/tvh_string.h:50:22: error: static declaration of 'strlcpy' follows non-static declaration
 static inline size_t strlcpy(char *dst, const char *src, size_t size)

src/tvh_string.h:61:22: error: static declaration of 'strlcat' follows non-static declaration
 static inline size_t strlcat(char *dst, const char *src, size_t count)

because they provide strlcat & strlcpy:
https://sourceware.org/glibc/wiki/strlcpy

This patch adds configure checks and makes the implementation in
tvh_string.h optional, the configure log looks like this:

glibc
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail

musl
  checking for cc strlcat ...                       ok
  checking for cc strlcpy ...                       ok

uclibc
  checking for cc strlcat ...                       ok
  checking for cc strlcpy ...                       ok
configure
src/tvh_string.h