Changeset 30
- Timestamp:
- 05/14/08 15:30:31 (7 months ago)
- Files:
-
- trunk/debian (added)
- trunk/debian/changelog (added)
- trunk/debian/compat (added)
- trunk/debian/control (added)
- trunk/debian/copyright (added)
- trunk/debian/libsipc1-dev.install (added)
- trunk/debian/libsipc1-java.install (added)
- trunk/debian/libsipc1-jni.install (added)
- trunk/debian/libsipc1-jni.postinst (added)
- trunk/debian/libsipc1-jni.postrm (added)
- trunk/debian/libsipc1.install (added)
- trunk/debian/libsipc1.postinst (added)
- trunk/debian/libsipc1.postrm (added)
- trunk/debian/rules (added)
- trunk/libsipc/Makefile (modified) (3 diffs)
- trunk/libsipc/bindings/java/Makefile (modified) (5 diffs)
- trunk/libsipc/examples/Makefile (modified) (2 diffs)
- trunk/libsipc/examples/policy/Makefile (modified) (2 diffs)
- trunk/libsipc/include/Makefile (modified) (1 diff)
- trunk/libsipc/man/Makefile (modified) (1 diff)
- trunk/libsipc/src/Makefile (modified) (2 diffs)
- trunk/libsipc/src/mqueue_internal.c (modified) (2 diffs)
- trunk/libsipc/src/shm_internal.c (modified) (1 diff)
- trunk/libsipc/src/sipc_shm.c (modified) (2 diffs)
- trunk/libsipc/tests/Makefile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libsipc/Makefile
r28 r30 1 1 # Installation directories 2 PREFIX ?= $(DESTDIR)/usr/local2 PREFIX ?= /usr/local 3 3 INCLUDEDIR ?= $(PREFIX)/include 4 4 LIBDIR ?= $(PREFIX)/lib … … 13 13 endif 14 14 15 overrideCFLAGS += -Wall -Wundef -Wmissing-noreturn -D_GNU_SOURCE -fpic15 AM_CFLAGS += -Wall -Wundef -Wmissing-noreturn -D_GNU_SOURCE -fpic 16 16 # -Werror -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wswitch -Wshadow -Wcast-align 17 17 INCLUDEDIRS := -I$(shell pwd)/include … … 19 19 20 20 export PREFIX INCLUDEDIR LIBDIR DATAROOTDIR MANDIR \ 21 CFLAGS LDFLAGS21 AM_CFLAGS LDFLAGS 22 22 23 23 # This library can optionally build bindings for other langugages. trunk/libsipc/bindings/java/Makefile
r28 r30 1 1 BINDINGSDIR = $(DATAROOTDIR)/sipc/bindings/java 2 2 JARDIR = $(DATAROOTDIR)/java 3 4 SRC = com/tresys/sipc/BadKeyException.java \5 com/tresys/sipc/ConnectionException.java \6 com/tresys/sipc/libsipc.java \7 com/tresys/sipc/Sipc.java \8 com/tresys/sipc/SipcMqueue.java \9 com/tresys/sipc/SipcShm.java10 CLASSES = $(patsubst %.java,%.class,$(SRC))11 3 12 4 JAVA_HOME ?= /usr/java/default … … 20 12 LIBDIRS = -L$(TOP_BUILDDIR)/src 21 13 14 SRC = com/tresys/sipc/BadKeyException.java \ 15 com/tresys/sipc/ConnectionException.java \ 16 com/tresys/sipc/libsipc.java \ 17 com/tresys/sipc/Sipc.java \ 18 com/tresys/sipc/SipcMqueue.java \ 19 com/tresys/sipc/SipcShm.java 20 CLASSES = $(patsubst %.java,%.class,$(SRC)) 21 22 SOVERSION = 1 23 RELEASE = 0 24 JARTARGET = libsipc-$(SOVERSION).$(RELEASE).jar 25 22 26 # Change the following to be appropriate for your system: 23 27 # 24 # JNI_CFLAGS: Location of JNI include files.28 # JNI_CFLAGS: Location of JNI include files. 25 29 # Only set this value if JNI's include files 26 30 # are installed outside of the compiler's search path. … … 29 33 JNI_CFLAGS=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -fno-strict-aliasing 30 34 31 LIBVERSION = 0.132 35 TARGET = libsipcwrapper.so 33 LIBSO = $(TARGET).$(LIBVERSION) 36 SONAME = $(TARGET).$(SOVERSION) 37 LIBSO = $(TARGET).$(SOVERSION).$(RELEASE) 34 38 OBJS = sipc_wrap.o 35 39 36 all: libsipc.jar$(LIBSO)40 all: $(JARTARGET) $(LIBSO) 37 41 38 install: 39 test -d $(BINDINGSDIR) || install -m 755 -d $(BINDINGSDIR) 40 test -d $(BINDINGSDIR)/examples || install -m 755 -d $(BINDINGSDIR)/examples 41 install -m 644 README $(BINDINGSDIR) 42 install -m 644 examples/* $(BINDINGSDIR)/examples 43 install -m 644 libsipc.jar $(BINDINGSDIR) 44 test -d $(JARDIR) || install -m 755 -d $(JARDIR) 45 cd $(JARDIR) && ln -sf $(BINDINGSDIR)/libsipc.jar libsipc.jar 46 test -d $(LIBDIR) || install -m 755 -d $(LIBDIR) 47 install -m 755 $(LIBSO) $(LIBDIR) 48 cd $(LIBDIR) && ln -sf $(LIBSO) $(TARGET) 42 install: $(JARTARGET) $(LIBSO) 43 test -d $(DESTDIR)/$(BINDINGSDIR) || install -m 755 -d $(DESTDIR)/$(BINDINGSDIR) 44 test -d $(DESTDIR)/$(BINDINGSDIR)/examples || install -m 755 -d $(DESTDIR)/$(BINDINGSDIR)/examples 45 install -m 644 README $(DESTDIR)/$(BINDINGSDIR) 46 install -m 644 examples/* $(DESTDIR)/$(BINDINGSDIR)/examples 47 install -m 644 $(JARTARGET) $(DESTDIR)/$(BINDINGSDIR) 48 test -d $(DESTDIR)/$(JARDIR) || install -m 755 -d $(DESTDIR)/$(JARDIR) 49 cd $(DESTDIR)/$(JARDIR) && ln -sf $(BINDINGSDIR)/$(JARTARGET) libsipc.jar 50 cd $(DESTDIR)/$(JARDIR) && ln -sf $(BINDINGSDIR)/$(JARTARGET) $(JARTARGET) 51 test -d $(DESTDIR)/$(LIBDIR) || install -m 755 -d $(DESTDIR)/$(LIBDIR) 52 install -m 644 $(LIBSO) $(DESTDIR)/$(LIBDIR) 53 cd $(DESTDIR)/$(LIBDIR) && ln -sf $(LIBSO) $(TARGET) 54 cd $(DESTDIR)/$(LIBDIR) && ln -sf $(LIBSO) $(TARGET).$(SOVERSION) 49 55 50 libsipc.jar: $(CLASSES)51 $(JAR) cf libsipc.jar$(CLASSES)56 $(JARTARGET): $(CLASSES) 57 $(JAR) cf $@ $(CLASSES) 52 58 53 59 %.class: %.java … … 55 61 56 62 $(LIBSO): $(OBJS) 57 $(CC) $(LDFLAGS) $(LIBDIRS) - lsipc -shared -o $@ $<63 $(CC) $(LDFLAGS) $(LIBDIRS) -Wl,-soname,$(SONAME) -lsipc -shared -o $@ $< 58 64 ln -sf $@ $(TARGET) 59 65 60 66 %.o: %.c 61 $(CC) $( CFLAGS) $(INCLUDEDIRS) $(JNI_CFLAGS) -fPIC -c -o $@ $<67 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INCLUDEDIRS) $(JNI_CFLAGS) -fPIC -c -o $@ $< 62 68 63 69 javadoc: … … 65 71 66 72 clean: 67 -rm -f $(CLASSES) libsipc.jar$(TARGET) $(LIBSO) $(OBJS)73 -rm -f $(CLASSES) $(JARTARGET) $(TARGET) $(LIBSO) $(OBJS) 68 74 69 75 .PHONY: all install clean javadoc trunk/libsipc/examples/Makefile
r28 r30 70 70 71 71 %.o: %.c 72 $(CC) $( CFLAGS) $(INCLUDEDIRS) -c -o $@ $<72 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INCLUDEDIRS) -c -o $@ $< 73 73 74 74 install-example: $(BINS) … … 78 78 install -m 755 $(BINS) $(EXAMPLESDIR) 79 79 install -m 644 data.txt $(EXAMPLESDIR) 80 install -m 644 Makefile $(EXAMPLESDIR) 81 install -m 644 README $(EXAMPLESDIR) 80 install -m 644 Makefile $(EXAMPLESDIR) 81 install -m 644 README $(EXAMPLESDIR) 82 82 @for subdir in $(SUBDIRS); do \ 83 83 (cd $$subdir && $(MAKE) $@) || exit 1;\ trunk/libsipc/examples/policy/Makefile
r20 r30 12 12 13 13 install-example: 14 test -d $( EXAMPLESDIR)/policy || install -m 755 -d$(EXAMPLESDIR)/policy15 install -m 644 *.te $( EXAMPLESDIR)/policy16 install -m 644 *.fc $( EXAMPLESDIR)/policy17 install -m 644 *.if $( EXAMPLESDIR)/policy18 install -m 644 *.spt $( EXAMPLESDIR)/policy19 install -m 644 Makefile $( EXAMPLESDIR)/policy20 install -m 644 README $( EXAMPLESDIR)/policy14 test -d $(DESTDIR)/$(EXAMPLESDIR)/policy || install -m 755 -d $(DESTDIR)/$(EXAMPLESDIR)/policy 15 install -m 644 *.te $(DESTDIR)/$(EXAMPLESDIR)/policy 16 install -m 644 *.fc $(DESTDIR)/$(EXAMPLESDIR)/policy 17 install -m 644 *.if $(DESTDIR)/$(EXAMPLESDIR)/policy 18 install -m 644 *.spt $(DESTDIR)/$(EXAMPLESDIR)/policy 19 install -m 644 Makefile $(DESTDIR)/$(EXAMPLESDIR)/policy 20 install -m 644 README $(DESTDIR)/$(EXAMPLESDIR)/policy 21 21 22 setup: 22 setup: 23 23 ifneq ($(UID),0) 24 @echo "make $@" must be run as root since this target manipulates policy && false 24 @echo "make $@" must be run as root since this target manipulates policy && false 25 25 endif 26 26 @cp /usr/share/selinux/devel/include/system/unconfined.if unconfined.if.bak && \ 27 cp unconfined.spt /usr/share/selinux/devel/include/system/unconfined.if 27 cp unconfined.spt /usr/share/selinux/devel/include/system/unconfined.if 28 28 29 29 install-policy: setup 30 30 ifneq ($(UID),0) 31 @echo "make $@" must be run as root since this target manipulates policy && false 31 @echo "make $@" must be run as root since this target manipulates policy && false 32 32 endif 33 33 @echo "Building policy modules..." 34 34 @$(MAKE) -f /usr/share/selinux/devel/include/Makefile 1>/dev/null 35 35 @echo "Inserting policy modules..." 36 @/usr/sbin/semodule `ls *.pp|sed 's/^\(.*\)$$/ -i \1/g'` 36 @/usr/sbin/semodule `ls *.pp|sed 's/^\(.*\)$$/ -i \1/g'` 37 37 @echo "Labeling files..." 38 38 @for file in $(FC_ENTRIES); do \ … … 51 51 @echo "make $@" must be run as root since this target manipulates policy && false 52 52 endif 53 @echo "Removing modules..." 53 @echo "Removing modules..." 54 54 @/usr/sbin/semodule `ls *.te|sed 's/^\(.*\)\.te$$/ -r \1/g'` || true 55 55 @echo "Resetting file labels..." 56 56 @for file in $(FC_ENTRIES); do \ 57 57 /usr/sbin/setfiles -v /etc/selinux/targeted/contexts/files/file_contexts $$file 2>&1 1>/dev/null; \ 58 done 58 done 59 59 echo "Finishing clean up..." 60 60 @[ -f unconfined.if.bak ] && \ trunk/libsipc/include/Makefile
r28 r30 2 2 3 3 install: 4 test -d $( INCLUDEDIR)/sipc || install -m 755 -d$(INCLUDEDIR)/sipc5 install -m 644 $(wildcard sipc/*.h) $( INCLUDEDIR)/sipc4 test -d $(DESTDIR)/$(INCLUDEDIR)/sipc || install -m 755 -d $(DESTDIR)/$(INCLUDEDIR)/sipc 5 install -m 644 $(wildcard sipc/*.h) $(DESTDIR)/$(INCLUDEDIR)/sipc 6 6 7 7 clean: trunk/libsipc/man/Makefile
r28 r30 2 2 3 3 install: 4 test -d $( MANDIR)/man3 || mkdir -m 755 -p$(MANDIR)/man35 install -m 644 $(wildcard man3/*.3) $( MANDIR)/man34 test -d $(DESTDIR)/$(MANDIR)/man3 || mkdir -m 755 -p $(DESTDIR)/$(MANDIR)/man3 5 install -m 644 $(wildcard man3/*.3) $(DESTDIR)/$(MANDIR)/man3 6 6 7 7 clean: trunk/libsipc/src/Makefile
r28 r30 1 LIBVERSION=1.0 1 SOVERSION=1 2 RELEASE=0 2 3 3 4 TARGET=libsipc.so 4 LIBSO=$(TARGET).$(LIBVERSION) 5 SONAME=$(TARGET).$(SOVERSION) 6 LIBSO=$(TARGET).$(SOVERSION).$(RELEASE) 5 7 6 8 TOP_SRCDIR ?= .. … … 12 14 13 15 $(LIBSO): $(OBJS) 14 $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,$( LIBSO),--version-script=libsipc.map,-z,defs $(LIBDIRS)16 $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,$(SONAME),--version-script=libsipc.map,-z,defs $(LIBDIRS) 15 17 ln -sf $@ $(TARGET) 16 18 17 19 %.o: %.c 18 $(CC) $( CFLAGS) $(INCLUDEDIRS) -c -o $@ $<20 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INCLUDEDIRS) -c -o $@ $< 19 21 20 22 install: $(LIBSO) 21 test -d $(LIBDIR) || install -m 755 -d $(LIBDIR) 22 install -m 755 $(LIBSO) $(LIBDIR) 23 cd $(LIBDIR) && ln -sf $(LIBSO) $(TARGET) 23 test -d $(DESTDIR)/$(LIBDIR) || install -m 755 -d $(DESTDIR)/$(LIBDIR) 24 install -m 644 $(LIBSO) $(DESTDIR)/$(LIBDIR) 25 cd $(DESTDIR)/$(LIBDIR) && ln -sf $(LIBSO) $(TARGET) 26 cd $(DESTDIR)/$(LIBDIR) && ln -sf $(LIBSO) $(TARGET).$(SOVERSION) 24 27 25 28 clean: trunk/libsipc/src/mqueue_internal.c
r24 r30 20 20 21 21 #include <stdio.h> 22 #include <sipc/sipc.h>23 22 #include <sys/types.h> 24 23 #include <sys/ipc.h> … … 27 26 #include <errno.h> 28 27 #include <fcntl.h> 28 #include "sipc/sipc.h" 29 29 #include "mqueue_internal.h" 30 30 trunk/libsipc/src/shm_internal.c
r1 r30 25 25 #include <string.h> 26 26 #include <errno.h> 27 #include <sipc/sipc.h>27 #include "sipc/sipc.h" 28 28 #include "sipc_internal.h" 29 29 #include "sipc_mqueue.h" trunk/libsipc/src/sipc_shm.c
r21 r30 24 24 #include <string.h> 25 25 #include <errno.h> 26 #include <sipc/sipc.h>27 26 #include <sys/ipc.h> 28 27 #include <sys/shm.h> … … 31 30 #include <sys/stat.h> 32 31 #include <fcntl.h> 32 #include "sipc/sipc.h" 33 33 #include "sipc_internal.h" 34 34 #include "sipc_shm.h" trunk/libsipc/tests/Makefile
r28 r30 1 1 TESTS = test_ipc ipc_creator ipc_destroyer 2 override LDFLAGS += -lsipc -lcunit -Wl,-rpath,$(LIBDIRS)2 AM_LDFLAGS = -lsipc -lcunit -Wl,-rpath,$(LIBDIRS) 3 3 4 4 all: … … 9 9 10 10 test_ipc: test_ipc.c shm.h shm.c mqueue.h mqueue.c 11 $(CC) $( CFLAGS) $(INCLUDEDIRS) $^$(LDFLAGS) -o $@11 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INCLUDEDIRS) $^ $(AM_LDFLAGS) $(LDFLAGS) -o $@ 12 12 13 13 ipc_creator: ipc_creator.c 14 $(CC) $( CFLAGS) $(INLCUDEDIRS) $(LDFLAGS) $^ -o $@14 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INLCUDEDIRS) $(AM_LDFLAGS) $(LDFLAGS) $^ -o $@ 15 15 16 16 ipc_destroyer: ipc_destroyer.c 17 $(CC) $( CFLAGS) $(INCLUDEDIRS) $(LDFLAGS) $^ -o $@17 $(CC) $(AM_CFLAGS) $(CFLAGS) $(INCLUDEDIRS) $(AM_LDFLAGS) $(LDFLAGS) $^ -o $@ 18 18 19 19 clean:
