All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] semanage-functionality 11/17
@ 2005-09-27 12:49 Karl MacMillan
  2005-09-27 17:00 ` Ivan Gyurdiev
  0 siblings, 1 reply; 4+ messages in thread
From: Karl MacMillan @ 2005-09-27 12:49 UTC (permalink / raw)
  To: selinux; +Cc: 'Joshua Brindle'

[-- Attachment #1: Type: text/plain, Size: 121 bytes --]

Makefile changes to build a shared libsemanage library.

------
Karl MacMillan
Tresys Technology
http://www.tresys.com 


[-- Attachment #2: libsemanage_src_Makefile.diff --]
[-- Type: application/octet-stream, Size: 2240 bytes --]

diff -purN -x .svn libsemanage/src/Makefile libsemanage/src/Makefile
--- libsemanage/src/Makefile	2005-09-26 14:02:40.000000000 -0400
+++ libsemanage/src/Makefile	2005-09-19 09:11:07.000000000 -0400
@@ -4,7 +4,12 @@ LIBDIR ?= $(PREFIX)/lib
 SHLIBDIR ?= $(DESTDIR)/lib
 INCLUDEDIR ?= $(PREFIX)/include
 
-DEFAULT_SEMOD_CONF_LOCATION=/usr/share/semod/semod.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(PREFIX)/share/semanage/semanage.conf
+
+ifeq ($(DEBUG),1)
+	export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow
+	export LDFLAGS = -g
+endif
 
 LEX = flex
 LFLAGS = -s
@@ -13,19 +18,26 @@ YFLAGS = -d
 
 LIBVERSION = 1
 
-LIBA=libsemanage.a 
+LIBA=libsemanage.a
+TARGET=libsemanage.so
+LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c)) conf-scan.o conf-parse.o
+LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c)) conf-scan.lo conf-parse.lo
 CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
 
-override CFLAGS += -I. -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE \
+override CFLAGS += -Iinclude -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE \
                    -DDEFAULT_SEMOD_CONF_LOCATION='"$(DEFAULT_SEMOD_CONF_LOCATION)"'
 
-all: $(LIBA)
+all: $(LIBA) $(LIBSO)
 
 $(LIBA): $(OBJS)
 	$(AR) rcs $@ $^
 	ranlib $@
 
+$(LIBSO): $(LOBJS)
+	$(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,$(LIBSO)
+	ln -sf $@ $(TARGET)
+
 conf-scan.c: conf-scan.l conf-parse.h
 	$(LEX) $(LFLAGS) -t $< > $@
 
@@ -37,11 +49,18 @@ conf-parse.h: conf-parse.c
 %.o:  %.c 
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+%.lo:  %.c
+	$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
+
 install: all
 	test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
 	install -m 644 $(LIBA) $(LIBDIR)
-	install -m 644 -D semod.conf $(DESTDIR)/$(DEFAULT_SEMOD_CONF_LOCATION)
+	test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
+	install -m 755 $(LIBSO) $(SHLIBDIR)
+	install -m 644 -D semanage.conf $(DEFAULT_SEMANAGE_CONF_LOCATION)
+	cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
 
 clean: 
-	rm -f $(OBJS) $(LIBA) conf-scan.c conf-parse.c conf-parse.h
+	rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) conf-parse.c conf-parse.h conf-scan.c
 
+.PHONY: clean

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-28 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-27 12:49 [PATCH] semanage-functionality 11/17 Karl MacMillan
2005-09-27 17:00 ` Ivan Gyurdiev
2005-09-27 19:18   ` Stephen Smalley
2005-09-28 15:18     ` Karl MacMillan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.