mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
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:
@@ -52,9 +52,9 @@ CPPFLAGS += -U_FORTIFY_SOURCE
|
||||
CPPFLAGS += -I$(TOPDIR)
|
||||
CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
||||
LDFLAGS += -L$(TOPDIR)/libite -L$(TOPDIR)/libuev
|
||||
DEPLIBS = libite/libite.a libuev/libuev.a
|
||||
LDLIBS += -lite -luev
|
||||
LDFLAGS += -L$(TOPDIR)/libuev
|
||||
DEPLIBS += libuev/libuev.a
|
||||
LDLIBS += -luev
|
||||
|
||||
include common.mk
|
||||
|
||||
@@ -86,7 +86,9 @@ install-exec: all
|
||||
done
|
||||
printf " INSTALL $(DESTDIR)$(sbindir)/telinit\n"
|
||||
@ln -sf finit $(DESTDIR)$(sbindir)/telinit
|
||||
ifndef LIBITE
|
||||
$(MAKE) -C libite install-exec
|
||||
endif
|
||||
$(MAKE) -C plugins install
|
||||
|
||||
install-data:
|
||||
@@ -103,7 +105,9 @@ install-dev:
|
||||
printf " INSTALL $(DESTDIR)$(incdir)/$$file\n"; \
|
||||
$(INSTALL) -m 0644 $$file $(DESTDIR)$(incdir)/$$file; \
|
||||
done
|
||||
ifndef LIBITE
|
||||
$(MAKE) -C libite install-dev
|
||||
endif
|
||||
$(MAKE) -C libuev install-dev
|
||||
|
||||
install: install-exec install-data install-dev
|
||||
@@ -116,7 +120,9 @@ uninstall-exec:
|
||||
-@rm $(DESTDIR)$(sbindir)/initctl
|
||||
-@rmdir $(DESTDIR)$(sbindir) 2>/dev/null
|
||||
-@rmdir $(DESTDIR)$(FINIT_RCSD) 2>/dev/null
|
||||
ifndef LIBITE
|
||||
$(MAKE) -C libite uninstall
|
||||
endif
|
||||
$(MAKE) -C plugins uninstall
|
||||
|
||||
uninstall-data:
|
||||
@@ -134,18 +140,22 @@ uninstall: uninstall-exec uninstall-data uninstall-dev
|
||||
|
||||
clean:
|
||||
+$(MAKE) -C plugins $@
|
||||
ifndef LIBITE
|
||||
+$(MAKE) -C libite $@
|
||||
endif
|
||||
+$(MAKE) -C libuev $@
|
||||
-@$(RM) $(OBJS) $(DEPS) $(EXEC)
|
||||
|
||||
distclean: clean
|
||||
+$(MAKE) -C plugins $@
|
||||
ifndef LIBITE
|
||||
+$(MAKE) -C libite $@
|
||||
endif
|
||||
+$(MAKE) -C libuev $@
|
||||
-@$(RM) $(JUNK) config.mk config.h unittest *.o *.html
|
||||
|
||||
check:
|
||||
$(CHECK) *.c plugins/*.c libite/*.c
|
||||
$(CHECK) *.c plugins/*.c
|
||||
|
||||
dist:
|
||||
@if [ x"$(ARCHTOOL)" = x"" ]; then \
|
||||
|
||||
@@ -91,6 +91,12 @@ result()
|
||||
echo "Inetd : DISABLED"
|
||||
fi
|
||||
|
||||
if [ x"$libite" = x"" ]; then
|
||||
echo "Libite (LITE) : Built-in"
|
||||
else
|
||||
echo "Libite (LITE) : $libite + {/lib, /include}"
|
||||
fi
|
||||
|
||||
if [ $verbose -ne 1 ]; then
|
||||
echo "Quiet Finit : YES"
|
||||
else
|
||||
@@ -151,6 +157,8 @@ usage()
|
||||
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-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 " --enable-embedded Embedded defaults, BusBox getty, mdev etc."
|
||||
echo " --enable-dbus Enable D-Bus plugin. Note: install plugin as well!"
|
||||
@@ -251,6 +259,10 @@ while [ "$*" != "" ]; do
|
||||
runlevel="$arg"
|
||||
;;
|
||||
|
||||
with-libite)
|
||||
libite="$arg"
|
||||
;;
|
||||
|
||||
enable-debug)
|
||||
debug=1
|
||||
;;
|
||||
@@ -349,8 +361,20 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
echo >> config.mk
|
||||
echo "export libdir plugindir incdir CPPFLAGS LDFLAGS LDLIBS STATIC" >> config.mk
|
||||
if [ x"$libite" != x"" ]; then
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user