mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 14:02:52 +07:00
Fix --enable-static build, only C library shared
This patch fixes regressions in --enable-static introduced with the conversion to the GNU configure and build system. The default link flag to libtool is set to -static-libtool-libs, meaning not a fully static build -- the C library will still be used as an .so which is usually what people want -- whereas libite (-lite) and libuEv are linked statically. $ ldd /sbin/finit /sbin/initctl /sbin/finit: linux-vdso.so.1 => (0x00007ffffde62000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6979ad8000) /lib64/ld-linux-x86-64.so.2 (0x000055d893e96000) /sbin/initctl: linux-vdso.so.1 => (0x00007ffed0dd6000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feb3a29c000) /lib64/ld-linux-x86-64.so.2 (0x00005556ebd2b000) Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+16
-5
@@ -4,27 +4,38 @@ finit_SOURCES = finit.c api.c client.c conf.c exec.c helpers.c pid.c \
|
||||
sig.c svc.c service.c plugin.c tty.c cond.c cond-w.c sm.c
|
||||
pkginclude_HEADERS = cond.h finit.h helpers.h inetd.h plugin.h queue.h svc.h
|
||||
if INETD
|
||||
finit_SOURCES += inetd.c
|
||||
finit_SOURCES += inetd.c
|
||||
endif
|
||||
|
||||
finit_CFLAGS = -W -Wall -Wextra -std=gnu99 $(lite_CFLAGS) $(uev_CFLAGS)
|
||||
finit_LDADD = -ldl $(lite_LIBS) $(uev_LIBS)
|
||||
finit_LDADD = $(lite_LIBS) $(uev_LIBS)
|
||||
if STATIC
|
||||
finit_LDADD += plugins/libplug.la
|
||||
else
|
||||
finit_LDADD += -ldl
|
||||
endif
|
||||
|
||||
initctl_SOURCES = initctl.c svc.c helpers.c cond.c
|
||||
initctl_CFLAGS = $(lite_CFLAGS)
|
||||
initctl_LDADD = $(lite_LIBS)
|
||||
|
||||
reboot_SOURCES = reboot.c
|
||||
|
||||
SYMLINK = telinit init
|
||||
SUBDIRS = plugins
|
||||
doc_DATA = README.md LICENSE finit.conf services
|
||||
EXTRA_DIST = README.md LICENSE ChangeLog.md finit.conf services
|
||||
AM_CPPFLAGS = -U_FORTIFY_SOURCE
|
||||
AM_CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||
AM_CPPFLAGS += -DFINIT_CONF=\"$(conf)\" -DFINIT_RCSD=\"$(rcsd)\" -DFINIT_FIFO=\"$(fifo)\" \
|
||||
-DPLUGIN_PATH=\"$(pkglibdir)\"
|
||||
AM_LDFLAGS = -export-dynamic
|
||||
AM_CPPFLAGS += -DFINIT_CONF=\"$(conf)\" -DFINIT_RCSD=\"$(rcsd)\" -DFINIT_FIFO=\"$(fifo)\"
|
||||
|
||||
if STATIC
|
||||
AM_CPPFLAGS += -DENABLE_STATIC
|
||||
AM_LDFLAGS = -static-libtool-libs
|
||||
else
|
||||
AM_CPPFLAGS += -DPLUGIN_PATH=\"$(pkglibdir)\"
|
||||
AM_LDFLAGS = -export-dynamic
|
||||
endif
|
||||
|
||||
# Compat hook
|
||||
install-dev: install-pkgincludeHEADERS
|
||||
|
||||
@@ -126,11 +126,13 @@ int main(int argc, char* argv[])
|
||||
#endif
|
||||
run_interactive(SETUP_DEVFS, "Populating device tree");
|
||||
|
||||
#ifndef ENABLE_STATIC
|
||||
/*
|
||||
* Load plugins first, finit.conf may contain references to
|
||||
* features implemented by plugins.
|
||||
*/
|
||||
plugin_load_all(&loop, PLUGIN_PATH);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Parse /etc/finit.conf, main configuration file
|
||||
|
||||
Reference in New Issue
Block a user