c5bae798248f959682215c157950ce4ea2fc4063
[packages/libmatroska.git] / libmatroska-makefile.patch
1 --- libmatroska-1.0.0/make/linux/Makefile~      2010-08-05 23:37:39.000000000 +0300
2 +++ libmatroska-1.0.0/make/linux/Makefile       2010-08-05 23:38:53.361903703 +0300
3 @@ -28,6 +28,7 @@
4  INSTALL_OPTS = -m 644
5  INSTALL_OPTS_LIB = -m 644
6  INSTALL_DIR_OPTS = -m 755
7 +LIBTOOL = libtool
8  
9  ifneq (,$(shell $(CXX) -v 2>&1 | tail -n 1 | grep -i mingw))
10  $(error Please use the Makefile in ../mingw32)
11 @@ -36,8 +37,8 @@
12  CWD=$(shell pwd)
13  
14  # Options
15 -LIBEBML_INCLUDE_DIR=$(CWD)/../../../libebml
16 -LIBEBML_LIB_DIR=$(CWD)/../../../libebml/make/linux
17 +LIBEBML_INCLUDE_DIR=
18 +LIBEBML_LIB_DIR=
19  EXTENSION=.cpp
20  
21  ifeq (yes,$(DEBUG))
22 @@ -50,12 +50,10 @@
23  # Librarires
24  INCLUDE=-I$(CWD)/../.. -I$(LIBEBML_INCLUDE_DIR)
25  LIBS=
26 -MUX_LIBS=-lmatroska -lebml $(LIBICONV)
27 +MUX_LIBS=libmatroska.la -lebml $(LIBICONV)
28  
29  # Names
30 -LIBRARY=libmatroska.a
31 -LIBRARY_SO=libmatroska.so
32 -LIBRARY_SO_VER=libmatroska.so.2
33 +LIBRARY=libmatroska.la
34  
35  # source-files
36  sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
37 @@ -65,10 +64,8 @@
38  # header files; replace .cxx extension with .h
39  headers:=$(patsubst %$(EXTENSION),%.h,$(sources))
40  
41 -# object files; replace .cxx extension with .o
42 -objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
43 -
44 -objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources))
45 +# object files; replace .cxx extension with .lo
46 +objects:=$(patsubst %$(EXTENSION),%.lo,$(sources))
47  
48  WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \
49                 -Wshadow
50 @@ -75,32 +73,19 @@
51  ifeq (Darwin,$(shell uname -s))
52  all: staticlib
53  else
54 -all: staticlib sharedlib
55 +all: $(LIBRARY)
56  endif
57  
58 -staticlib: $(LIBRARY)
59 -
60 -sharedlib: $(LIBRARY_SO)
61 -
62  lib:
63         @echo "Use the 'staticlib', 'sharedlib' or 'all' targets."
64         @false
65  
66  # Build rules
67 -%.o: %$(EXTENSION)
68 -       $(CXX) -c $(COMPILEFLAGS) -o $@ $<
69 -
70  %.lo: %$(EXTENSION)
71 -       $(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
72 +       $(LIBTOOL) --mode=compile --tag=CC $(CXX) -c $(COMPILEFLAGS) -o $@ $<
73  
74  $(LIBRARY): $(objects)
75 -       $(AR) rcvu $@ $(objects)
76 -       $(RANLIB) $@
77 -
78 -$(LIBRARY_SO): $(objects_so)
79 -       $(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml
80 -       rm -f $(LIBRARY_SO)
81 -       ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
82 +       $(LIBTOOL) --mode=link --tag=CC $(LD) $(LDFLAGS) -version-info 2:0:0 -o $@ $^ $(LIBS) -lebml -rpath $(libdir)
83  
84  clean: cleantest
85         rm -f $(objects) $(objects_so)
86 @@ -132,19 +116,19 @@
87  test: test6 test9
88  
89  test6: test6.o $(LIBRARY) $(LIBRARY_SO)
90 -       $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
91 +       $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
92  
93  test6.o: $(MUX_SRC_DIR)test6.cpp
94         $(CXX) -c $(COMPILEFLAGS) -o $@ $<
95  
96  test8: test8.o $(LIBRARY) $(LIBRARY_SO)
97 -       $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
98 +       $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
99  
100  test8.o: $(MUX_SRC_DIR)test8.cpp
101         $(CXX) -c $(COMPILEFLAGS) -o $@ $<
102  
103  test9: test9.o $(LIBRARY) $(LIBRARY_SO)
104 -       $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
105 +       $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
106  
107  test9.o: $(TAG_SRC_DIR)test9.cpp
108         $(CXX) -c $(COMPILEFLAGS) -o $@ $<
109 @@ -152,27 +136,22 @@
110  ifeq (Darwin,$(shell uname -s))
111  install: install_staticlib install_headers
112  else
113 -install: install_staticlib install_sharedlib install_headers
114 +install: install_lib install_headers
115  endif
116  
117  install_headers:
118 -       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
119 +       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(includedir)
120         for i in $(INCLUDE_DIR)/*.h; do \
121 -               $(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \
122 +               $(INSTALL) $(INSTALL_OPTS) $$i $(DESTDIR)$(includedir) ; \
123         done
124 -       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)/c
125 +       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(includedir)/c
126         for i in $(INCLUDE_DIR)/c/*.h; do \
127 -               $(INSTALL) $(INSTALL_OPTS) $$i $(includedir)/c ; \
128 +               $(INSTALL) $(INSTALL_OPTS) $$i $(DESTDIR)$(includedir)/c ; \
129         done
130  
131 -install_staticlib: $(LIBRARY)
132 -       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
133 -       $(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
134 -
135 -install_sharedlib: $(LIBRARY_SO)
136 -       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
137 -       $(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
138 -       ln -fs $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
139 +install_lib: $(LIBRARY)
140 +       $(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(libdir)
141 +       $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)
142  
143  ifneq ($(wildcard .depend),)
144  include .depend
This page took 0.106926 seconds and 2 git commands to generate.