Commit e8d3d041 authored by Guillem Jover's avatar Guillem Jover

build: Remove hard requirement for GNU .init_array section support

In case the support is not available, just stop building the
libbsd-ctor.a library, which is a nice to have thing, but should not
have been a hard requirement from the start. This should allow to
build libbsd on non-glibc based systems using another libc.
parent faa005cb
......@@ -101,9 +101,8 @@ int main() { return rc; }
]
)]
)
if test "$libbsd_cv_gnu_init_array_support" = no; then
AC_MSG_ERROR([missing required GNU .init_array section support])
fi
AM_CONDITIONAL([BUILD_LIBBSD_CTOR],
[test "$libbsd_cv_gnu_init_array_support" = yes])
# Checks for library functions.
AC_MSG_CHECKING([for program_invocation_short_name])
......
......@@ -22,12 +22,17 @@ CLEANFILES = \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
libbsd.pc \
libbsd-ctor.pc \
libbsd-overlay.pc \
$(nil)
lib_LTLIBRARIES = libbsd.la
lib_LIBRARIES = libbsd-ctor.a
lib_LIBRARIES =
if BUILD_LIBBSD_CTOR
pkgconfig_DATA += libbsd-ctor.pc
lib_LIBRARIES += libbsd-ctor.a
endif
hash/md5hl.c: $(srcdir)/hash/helper.c
$(AM_V_at) $(MKDIR_P) hash
......
......@@ -4,4 +4,5 @@ funopen
headers
humanize
overlay
proctitle-init
proctitle
......@@ -14,12 +14,19 @@ check_PROGRAMS = \
humanize \
fgetln \
funopen \
proctitle \
proctitle-init \
$(nil)
if BUILD_LIBBSD_CTOR
check_PROGRAMS += proctitle
endif
humanize_LDFLAGS = $(top_builddir)/src/libbsd.la
fgetln_LDFLAGS = $(top_builddir)/src/libbsd.la
funopen_LDFLAGS = $(top_builddir)/src/libbsd.la
proctitle_init_SOURCES = proctitle.c
proctitle_init_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_USE_SETPROCTITLE_INIT=1
proctitle_init_LDFLAGS = $(top_builddir)/src/libbsd.la
proctitle_LDFLAGS = \
-Wl,-u,libbsd_init_func \
$(top_builddir)/src/libbsd-ctor.a \
......
......@@ -31,12 +31,16 @@
#include <string.h>
int
main(int argc, char **argv)
main(int argc, char **argv, char **envp)
{
const char newtitle_base[] = "test arg1 arg2";
char *newtitle_full;
char *envvar;
#ifdef TEST_USE_SETPROCTITLE_INIT
setproctitle_init(argc, argv, envp);
#endif
setproctitle("-test %s arg2", "arg1");
assert(strcmp(argv[0], newtitle_base) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment