Browse Source

[build] meson crypt and dl detection on *BSD (fixes #3133)

(thx devnexen)

x-ref:
  "netbsd meson build fix"
  https://redmine.lighttpd.net/issues/3133
master
Glenn Strauss 4 months ago
parent
commit
94a16b2b53
  1. 12
      src/meson.build
  2. 3
      src/mod_authn_dbi.c
  3. 10
      src/mod_authn_file.c

12
src/meson.build

@ -86,6 +86,16 @@ if conf_data.get('HAVE_CRYPT_H')
libcrypt = [ compiler.find_library('crypt') ]
conf_data.set('HAVE_CRYPT', 1)
endif
elif conf_data.get('HAVE_UNISTD_H')
# crypt in default libs?
if compiler.has_function('crypt', args: defs, prefix: '#include <unistd.h>')
libcrypt = []
conf_data.set('HAVE_CRYPT', 1)
# crypt in -lcrypt ?
elif compiler.has_function('crypt', args: defs + ['-lcrypt'], prefix: '#include <unistd.h>')
libcrypt = [ compiler.find_library('crypt') ]
conf_data.set('HAVE_CRYPT', 1)
endif
endif
conf_data.set('HAVE_SOCKLEN_T', compiler.has_type('socklen_t', args: defs, prefix: '#include <sys/socket.h>'))
@ -219,7 +229,7 @@ conf_data.set('LIGHTTPD_STATIC', get_option('build_static'))
libdl = []
if not(get_option('build_static'))
if target_machine.system() != 'windows'
libdl = [ compiler.find_library('dl') ]
libdl = [ compiler.find_library('dl', required: false) ]
if not(compiler.has_function('dlopen', args: defs, dependencies: libdl, prefix: '#include <dlfcn.h>'))
error('Couldn\'t find dlfcn.h or dlopen in lib dl')
endif

3
src/mod_authn_dbi.c

@ -24,6 +24,9 @@
#include "first.h"
#if defined(HAVE_CRYPT_R) || defined(HAVE_CRYPT)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif
#ifndef _XOPEN_CRYPT
#define _XOPEN_CRYPT 1
#endif

10
src/mod_authn_file.c

@ -6,8 +6,16 @@
# include <crypt.h>
#elif defined(__linux__)
/* linux needs _XOPEN_SOURCE */
# define _XOPEN_SOURCE
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif
#elif !defined(_MSC_VER)
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif
#ifndef _XOPEN_CRYPT
#define _XOPEN_CRYPT 1
#endif
#include <unistd.h>
#endif

Loading…
Cancel
Save