Add --with-libite=PATH to configure script to use external libite

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

With an external libite we make sure to set the SONAME to libite.so.2
to prevent runtime ABI issues with older libite versions.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-09-17 11:59:46 +02:00
1 parent c354d0e7e6
commit 1f84edfb8c
2 files changed
+40 -6

No files matched your search

+14 -4
View File
@@ -52,9 +52,9 @@ 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)/libite -L$(TOPDIR)/libuev LDFLAGS += -L$(TOPDIR)/libuev
DEPLIBS = libite/libite.a libuev/libuev.a DEPLIBS += libuev/libuev.a
LDLIBS += -lite -luev LDLIBS += -luev
include common.mk include common.mk
@@ -86,7 +86,9 @@ install-exec: all
done done
printf " INSTALL $(DESTDIR)$(sbindir)/telinit\n" printf " INSTALL $(DESTDIR)$(sbindir)/telinit\n"
@ln -sf finit $(DESTDIR)$(sbindir)/telinit @ln -sf finit $(DESTDIR)$(sbindir)/telinit
ifndef LIBITE
$(MAKE) -C libite install-exec $(MAKE) -C libite install-exec
endif
$(MAKE) -C plugins install $(MAKE) -C plugins install
install-data: install-data:
@@ -103,7 +105,9 @@ install-dev:
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \ printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \ $(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
done done
ifndef LIBITE
$(MAKE) -C libite install-dev $(MAKE) -C libite install-dev
endif
$(MAKE) -C libuev install-dev $(MAKE) -C libuev install-dev
install: install-exec install-data install-dev install: install-exec install-data install-dev
@@ -116,7 +120,9 @@ uninstall-exec:
-@rm $(DESTDIR)$(sbindir)/initctl -@rm $(DESTDIR)$(sbindir)/initctl
-@rmdir $(DESTDIR)$(sbindir) 2>/dev/null -@rmdir $(DESTDIR)$(sbindir) 2>/dev/null
-@rmdir $(DESTDIR)$(FINIT_RCSD) 2>/dev/null -@rmdir $(DESTDIR)$(FINIT_RCSD) 2>/dev/null
ifndef LIBITE
$(MAKE) -C libite uninstall $(MAKE) -C libite uninstall
endif
$(MAKE) -C plugins uninstall $(MAKE) -C plugins uninstall
uninstall-data: uninstall-data:
@@ -134,18 +140,22 @@ uninstall: uninstall-exec uninstall-data uninstall-dev
clean: clean:
+$(MAKE) -C plugins $@ +$(MAKE) -C plugins $@
ifndef LIBITE
+$(MAKE) -C libite $@ +$(MAKE) -C libite $@
endif
+$(MAKE) -C libuev $@ +$(MAKE) -C libuev $@
-@$(RM) $(OBJS) $(DEPS) $(EXEC) -@$(RM) $(OBJS) $(DEPS) $(EXEC)
distclean: clean distclean: clean
+$(MAKE) -C plugins $@ +$(MAKE) -C plugins $@
ifndef LIBITE
+$(MAKE) -C libite $@ +$(MAKE) -C libite $@
endif
+$(MAKE) -C libuev $@ +$(MAKE) -C libuev $@
-@$(RM) $(JUNK) config.mk config.h unittest *.o *.html -@$(RM) $(JUNK) config.mk config.h unittest *.o *.html
check: check:
$(CHECK) *.c plugins/*.c libite/*.c $(CHECK) *.c plugins/*.c
dist: dist:
@if [ x"$(ARCHTOOL)" = x"" ]; then \ @if [ x"$(ARCHTOOL)" = x"" ]; then \
Vendored
+26 -2
View File
@@ -91,6 +91,12 @@ result()
echo "Inetd : DISABLED" echo "Inetd : DISABLED"
fi fi
if [ x"$libite" = x"" ]; then
echo "Libite (LITE) : Built-in"
else
echo "Libite (LITE) : $libite + {/lib, /include}"
fi
if [ $verbose -ne 1 ]; then if [ $verbose -ne 1 ]; then
echo "Quiet Finit : YES" echo "Quiet Finit : YES"
else else
@@ -151,6 +157,8 @@ 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 " This is for disabling the use of built-in libite."
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!"
@@ -251,6 +259,10 @@ while [ "$*" != "" ]; do
runlevel="$arg" runlevel="$arg"
;; ;;
with-libite)
libite="$arg"
;;
enable-debug) enable-debug)
debug=1 debug=1
;; ;;
@@ -349,8 +361,20 @@ else
fi fi
fi fi
echo >> config.mk if [ x"$libite" != x"" ]; then
echo "export libdir plugindir incdir CPPFLAGS LDFLAGS LDLIBS STATIC" >> config.mk echo "LIBITE = $libite" >> config.mk
echo "CFLAGS += -I\$(LIBITE)/include" >> config.mk
echo "LDFLAGS += -L\$(LIBITE)/lib" >> config.mk
echo "LDLIBS += -l:libite.so.2" >> config.mk
else
echo "LDFLAGS += -L\$(TOPDIR)/libite" >> config.mk
echo "LDLIBS += -lite" >> config.mk
echo "DEPLIBS = libite/libite.a" >> config.mk
fi
echo >> config.mk
echo "export libdir plugindir incdir" >> config.mk
echo "export CPPFLAGS LDFLAGS LDLIBS STATIC" >> config.mk
############################################################################## ##############################################################################
echo "/* Generated by finit configure script. */" > config.h echo "/* Generated by finit configure script. */" > config.h