[matroska] r1087 - in trunk: libebml/make/linux libmatroska/make/linux

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2005-03-13 13:49:28 +0300 (Sun, 13 Mar 2005)
New Revision: 1087

Modified:
   trunk/libebml/make/linux/Makefile
   trunk/libmatroska/make/linux/Makefile
Log:
libebml/libmatroska: allow to build as shared libraries for Gentoo

Modified: trunk/libebml/make/linux/Makefile
===================================================================
--- trunk/libebml/make/linux/Makefile	2005-03-04 20:35:05 UTC (rev 1086)
+++ trunk/libebml/make/linux/Makefile	2005-03-13 10:49:28 UTC (rev 1087)
@@ -51,6 +51,8 @@
 
 # Names
 LIBRARY=libebml.a
+LIBRARY_SO=libebml.so
+LIBRARY_SO_VER=libebml.so.0
 
 # source-files
 sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
@@ -60,26 +62,36 @@
 
 # object files; replace .cxx extension with .o
 objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
+objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources))
 
 WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -Wshadow
 COMPILEFLAGS=$(WARNINGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(DEBUGFLAGS) $(INCLUDE)
 DEPENDFLAGS  = $(CXXFLAGS) $(INCLUDE)
 
-all: $(LIBRARY)
+all: $(LIBRARY) $(LIBRARY_SO)
 
-lib library: $(LIBRARY)
+lib library: $(LIBRARY) $(LIBRARY_SO)
 
 # Build rules
 %.o: %$(EXTENSION)
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
+%.lo: %$(EXTENSION)
+	$(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
+
 $(LIBRARY): $(objects)
 	$(AR) $@ $(objects)
 	$(RANLIB) $@
 
+$(LIBRARY_SO): $(objects_so)
+	$(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so)
+	ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
+
 clean:
 	rm -f $(objects)
 	rm -f $(LIBRARY)
+	rm -f $(LIBRARY_SO)
+	rm -f $(LIBRARY_SO_VER)
 	rm -f CORE
 
 distclean dist-clean: clean
@@ -95,9 +107,11 @@
 		$(CXX) $(DEPENDFLAGS) -MM -MT $$o $$i >> .depend ; \
 	done
 
-install: $(LIBRARY)
+install: $(LIBRARY) $(LIBRARY_SO)
 	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
 	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
+	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
+	ln -s $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
 	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
 	for i in $(INCLUDE_DIR)/*.h; do \
 		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \

Modified: trunk/libmatroska/make/linux/Makefile
===================================================================
--- trunk/libmatroska/make/linux/Makefile	2005-03-04 20:35:05 UTC (rev 1086)
+++ trunk/libmatroska/make/linux/Makefile	2005-03-13 10:49:28 UTC (rev 1087)
@@ -56,6 +56,8 @@
 
 # Names
 LIBRARY=libmatroska.a
+LIBRARY_SO=libmatroska.so
+LIBRARY_SO_VER=libmatroska.so.0
 
 # source-files
 sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
@@ -66,27 +68,38 @@
 # object files; replace .cxx extension with .o
 objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
 
+objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources))
+
 WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \
 		-Wshadow
 COMPILEFLAGS=$(DEBUGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(WARNINGFLAGS) $(INCLUDE)
 LINKFLAGS=-L. -L$(LIBEBML_LIB_DIR) $(LDFLAGS)
 DEPENDFLAGS  = $(CXXFLAGS) $(INCLUDE)
 
-all: $(LIBRARY)
+all: $(LIBRARY) $(LIBRARY_SO)
 
-lib library: $(LIBRARY)
+lib library: $(LIBRARY) $(LIBRARY_SO)
 
 # Build rules
 %.o: %$(EXTENSION)
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
+%.lo: %$(EXTENSION)
+	$(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
+
 $(LIBRARY): $(objects)
 	$(AR) $@ $(objects)
 	$(RANLIB) $@
 
+$(LIBRARY_SO): $(objects_so)
+	$(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml
+	ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
+
 clean:	cleantest
 	rm -f $(objects)
 	rm -f $(LIBRARY)
+	rm -f $(LIBRARY_SO)
+	rm -f $(LIBRARY_SO_VER)
 	rm -f CORE
 
 cleantest:
@@ -107,27 +120,29 @@
 
 test: test6 test9
 
-test6:	test6.o $(LIBRARY)
+test6:	test6.o $(LIBRARY) $(LIBRARY_SO)
 	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
 
 test6.o: $(MUX_SRC_DIR)test6.cpp
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
-test8:	test8.o $(LIBRARY)
+test8:	test8.o $(LIBRARY) $(LIBRARY_SO)
 	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
 
 test8.o: $(MUX_SRC_DIR)test8.cpp
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
-test9:	test9.o $(LIBRARY)
+test9:	test9.o $(LIBRARY) $(LIBRARY_SO)
 	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
 
 test9.o: $(TAG_SRC_DIR)test9.cpp
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
-install: $(LIBRARY)
+install: $(LIBRARY) $(LIBRARY_SO)
 	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
 	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
+	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
+	ln -s $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
 	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
 	for i in $(INCLUDE_DIR)/*.h; do \
 		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.