[x265-commits] [x265] cmake: add `ar` and `libtool` examples to multlib.bat for...

Steve Borho steve at borho.org
Thu Jul 9 18:21:44 CEST 2015


details:   http://hg.videolan.org/x265/rev/3db2bb3c599d
branches:  
changeset: 10780:3db2bb3c599d
user:      Steve Borho <steve at borho.org>
date:      Thu Jul 09 10:30:35 2015 -0500
description:
cmake: add `ar` and `libtool` examples to multlib.bat for linux and BSD

This script is not going to be super portable, but should be a good hint to
packagers for how to combine the static libraries of the individual builds
together into a single static library which can then be installed by the default
install rule.

diffstat:

 build/linux/multilib.sh |  24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diffs (31 lines):

diff -r 83bc6fac1fb5 -r 3db2bb3c599d build/linux/multilib.sh
--- a/build/linux/multilib.sh	Wed Jul 08 13:35:39 2015 -0500
+++ b/build/linux/multilib.sh	Thu Jul 09 10:30:35 2015 -0500
@@ -15,3 +15,27 @@ ln -sf ../10bit/libx265.a libx265_main10
 ln -sf ../12bit/libx265.a libx265_main12.a
 cmake ../../../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON
 make ${MAKEFLAGS}
+
+# rename the 8bit library, then combine all three into libx265.a
+mv libx265.a libx265_main.a
+
+uname=`uname`
+if [[ "$uname" == "Linux" ]];
+then
+
+# On Linux, we use GNU ar to combine the static libraries together
+ar -M <<EOF
+CREATE libx265.a
+ADDLIB libx265_main.a
+ADDLIB libx265_main10.a
+ADDLIB libx265_main12.a
+SAVE
+END
+EOF
+
+else
+
+# Mac/BSD libtool
+libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2>/dev/null
+
+fi


More information about the x265-commits mailing list