aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-16 13:49:00 +0000
committerRoy Marples <roy@marples.name>2007-10-16 13:49:00 +0000
commita28dd2d4ef7e55b0f6ddfbc80a371c6967c99a2b (patch)
tree4723527271b1776ccdbf4e8532def6b3a61a2bd6
parent068b4798c2af45260a1720158ba647fbab2e94e0 (diff)
We now build and optionally work with static libraries.
-rw-r--r--ChangeLog4
-rw-r--r--src/Makefile11
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bdb1db4a..07ce57d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
+ 16 Oct 2007; Roy Marples <uberlord@gentoo.org>:
+
+ We now build and optionally work with static libraries.
+
15 Oct 2007; Roy Marples <uberlord@gentoo.org>:
rc-status now orders services in start order, #195630
diff --git a/src/Makefile b/src/Makefile
index 6dddafe0..a0c7f5fb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -62,6 +62,7 @@ RCOBJS = checkown.o env-update.o fstabinfo.o mountinfo.o \
LDLIBS_RC = -leinfo -lrc -lutil
LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO)
+ULIB_TARGETS = libeinfo.a librc.a
SBIN_TARGETS = rc
SYS_WHITELIST = env_whitelist
@@ -114,6 +115,8 @@ $(LIBEINFOSO): einfo.map $(LIBEINFOOBJS)
-Wl,-version-script einfo.map \
-o $(LIBEINFOSO) $(LIBEINFOOBJS) $(LDLIBS) $(LDLIBS_LIBEINFO)
ln -sf $(LIBEINFOSO) libeinfo.so
+ ar rc libeinfo.a $(LIBEINFOOBJS)
+ ranlib libeinfo.a
$(LIBRCOBJS):
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
@@ -123,11 +126,13 @@ $(LIBRCSO): rc.map $(LIBRCOBJS)
-Wl,-version-script rc.map \
-o $(LIBRCSO) $(LIBRCOBJS) $(LDLIBS) $(LDLIBS_LIBRC)
ln -sf $(LIBRCSO) librc.so
+ ar rc librc.a $(LIBRCOBJS)
+ ranlib librc.a
$(RCOBJS):
$(CC) $(CPPFLAGS) $(CPPFLAGS_SSD) $(CFLAGS) -c $<
rc: $(LIBEINFOSO) $(LIBRCSO) $(RCOBJS)
- $(CC) $(LDFLAGS) -o rc $(RCOBJS) $(LDLIBS) $(LDLIBS_RC)
+ $(CC) $(LDFLAGS) -o rc $(RCOBJS) $(LDLIBS) $(LDLIBS_RC) $(LDLIBS_LIBEINFO) $(LDLIBS_LIBRC)
$(ALL_LINKS): rc
ln -sf rc $@
@@ -138,6 +143,8 @@ install: $(TARGET)
install -m 0755 $(LIB_TARGETS) $(DESTDIR)/$(LIB)
ln -sf $(LIBEINFOSO) $(DESTDIR)/$(LIB)/libeinfo.so
ln -sf $(LIBRCSO) $(DESTDIR)/$(LIB)/librc.so
+ install -m 0755 -d $(DESTDIR)/usr/$(LIB)
+ install -m 0644 $(ULIB_TARGETS) $(DESTDIR)/usr/$(LIB)
install -m 0755 -d $(DESTDIR)/usr/include
install -m 0644 einfo.h rc.h $(DESTDIR)/usr/include
install -m 0755 -d $(DESTDIR)/bin
@@ -161,7 +168,7 @@ clean-links:
rm -f $(ALL_LINKS)
clean: clean-links
rm -f $(TARGET)
- rm -f *.o *~ *.core *.so .depend
+ rm -f *.o *~ *.core *.so *.a .depend
check:
$(MAKE) -C test $@