Add --with-libuev=PATH to configure script to use external libuEv

This commit makes it possible to build Finit with an external libuEv.
Without this configure script option the libuev submodule is used.

With an external libuEv we make sure to set the SONAME to libuev.so.1
to prevent any future runtime ABI issues.

Fixes issue #4.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-09-17 12:59:20 +02:00
1 parent 1f84edfb8c
commit 6531b2f20a
2 files changed
+37 -7

No files matched your search

+11 -4
View File
@@ -38,7 +38,7 @@ HEADERS = finit.h plugin.h svc.h inetd.h helpers.h queue.h
DISTFILES = LICENSE README ChangeLog finit.conf services DISTFILES = LICENSE README ChangeLog finit.conf services
OBJS = finit.o api.o client.o conf.o exec.o helpers.o pid.o sig.o \ OBJS = finit.o api.o client.o conf.o exec.o helpers.o pid.o sig.o \
svc.o service.o plugin.o tty.o inetd.o event.o svc.o service.o plugin.o tty.o inetd.o event.o
DEPLIBS =
TOPDIR = $(shell pwd) TOPDIR = $(shell pwd)
-include config.mk -include config.mk
@@ -52,9 +52,6 @@ CPPFLAGS += -U_FORTIFY_SOURCE
CPPFLAGS += -I$(TOPDIR) CPPFLAGS += -I$(TOPDIR)
CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\" CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
LDFLAGS += -L$(TOPDIR)/libuev
DEPLIBS += libuev/libuev.a
LDLIBS += -luev
include common.mk include common.mk
@@ -89,7 +86,9 @@ install-exec: all
ifndef LIBITE ifndef LIBITE
$(MAKE) -C libite install-exec $(MAKE) -C libite install-exec
endif endif
ifndef LIBUEV
$(MAKE) -C plugins install $(MAKE) -C plugins install
endif
install-data: install-data:
@$(INSTALL) -d $(DESTDIR)$(datadir) @$(INSTALL) -d $(DESTDIR)$(datadir)
@@ -108,7 +107,9 @@ install-dev:
ifndef LIBITE ifndef LIBITE
$(MAKE) -C libite install-dev $(MAKE) -C libite install-dev
endif endif
ifndef LIBUEV
$(MAKE) -C libuev install-dev $(MAKE) -C libuev install-dev
endif
install: install-exec install-data install-dev install: install-exec install-data install-dev
@@ -123,7 +124,9 @@ uninstall-exec:
ifndef LIBITE ifndef LIBITE
$(MAKE) -C libite uninstall $(MAKE) -C libite uninstall
endif endif
ifndef LIBUEV
$(MAKE) -C plugins uninstall $(MAKE) -C plugins uninstall
endif
uninstall-data: uninstall-data:
@for file in $(DISTFILES); do \ @for file in $(DISTFILES); do \
@@ -143,7 +146,9 @@ clean:
ifndef LIBITE ifndef LIBITE
+$(MAKE) -C libite $@ +$(MAKE) -C libite $@
endif endif
ifndef LIBUEV
+$(MAKE) -C libuev $@ +$(MAKE) -C libuev $@
endif
-@$(RM) $(OBJS) $(DEPS) $(EXEC) -@$(RM) $(OBJS) $(DEPS) $(EXEC)
distclean: clean distclean: clean
@@ -151,7 +156,9 @@ distclean: clean
ifndef LIBITE ifndef LIBITE
+$(MAKE) -C libite $@ +$(MAKE) -C libite $@
endif endif
ifndef LIBUEV
+$(MAKE) -C libuev $@ +$(MAKE) -C libuev $@
endif
-@$(RM) $(JUNK) config.mk config.h unittest *.o *.html -@$(RM) $(JUNK) config.mk config.h unittest *.o *.html
check: check:
Vendored
+26 -3
View File
@@ -97,6 +97,12 @@ result()
echo "Libite (LITE) : $libite + {/lib, /include}" echo "Libite (LITE) : $libite + {/lib, /include}"
fi fi
if [ x"$libuev" = x"" ]; then
echo "LibuEv : Built-in"
else
echo "LibuEv : $libuev + {/lib, /include}"
fi
if [ $verbose -ne 1 ]; then if [ $verbose -ne 1 ]; then
echo "Quiet Finit : YES" echo "Quiet Finit : YES"
else else
@@ -157,8 +163,10 @@ usage()
echo " --with-username=USER User for 'startx' .conf option, default: root" echo " --with-username=USER User for 'startx' .conf option, default: root"
echo " --with-hostname=NAME Hostname, if /etc/hostname is missing, default: noname" echo " --with-hostname=NAME Hostname, if /etc/hostname is missing, default: noname"
echo " --with-runlevel=LEVEL Runlevel to switch to after bootstrap (S), default: 2" echo " --with-runlevel=LEVEL Runlevel to switch to after bootstrap (S), default: 2"
echo " --with-libite=PATH Look for libite in PATH/include and PATH/lib" echo " --with-libite=PATH Look for libite in PATH/include and PATH/lib"
echo " This is for disabling the use of built-in libite." echo " This is for disabling the use of built-in libite."
echo " --with-libuev=PATH Look for libuEv in PATH/include and PATH/lib"
echo " This is for disabling the use of built-in libuEv."
echo echo
echo " --enable-embedded Embedded defaults, BusBox getty, mdev etc." echo " --enable-embedded Embedded defaults, BusBox getty, mdev etc."
echo " --enable-dbus Enable D-Bus plugin. Note: install plugin as well!" echo " --enable-dbus Enable D-Bus plugin. Note: install plugin as well!"
@@ -263,6 +271,10 @@ while [ "$*" != "" ]; do
libite="$arg" libite="$arg"
;; ;;
with-libuev)
libuev="$arg"
;;
enable-debug) enable-debug)
debug=1 debug=1
;; ;;
@@ -369,7 +381,18 @@ if [ x"$libite" != x"" ]; then
else else
echo "LDFLAGS += -L\$(TOPDIR)/libite" >> config.mk echo "LDFLAGS += -L\$(TOPDIR)/libite" >> config.mk
echo "LDLIBS += -lite" >> config.mk echo "LDLIBS += -lite" >> config.mk
echo "DEPLIBS = libite/libite.a" >> config.mk echo "DEPLIBS += libite/libite.a" >> config.mk
fi
if [ x"$libuev" != x"" ]; then
echo "LIBUEV = $libuev" >> config.mk
echo "CFLAGS += -I\$(LIBUEV)/include" >> config.mk
echo "LDFLAGS += -L\$(LIBUEV)/lib" >> config.mk
echo "LDLIBS += -l:libuev.so.1" >> config.mk
else
echo "LDFLAGS += -L\$(TOPDIR)/libuev" >> config.mk
echo "LDLIBS += -luev" >> config.mk
echo "DEPLIBS += libuev/libuev.a" >> config.mk
fi fi
echo >> config.mk echo >> config.mk