On Wed, Nov 27, 2013 at 10:35:39AM +0100, Helmut Schaa wrote: > Currently openvswitch builds all libraries static only. However, > libopenvswitch is linked into nearly all openvswitch executables > making it hardly possible to run openvswitch on embedded devices > (for example running OpenWrt). > > Convert openvswitch to use libtool for building its internal libs. > This allows "--enable-shared" and "--enable-static" as configure > arguments. Default is "--disable-shared" thus keeping the current > behavior with the only change that static libs are installed by > "make install". > > Here's a quick size comparison (x86_64): > > Using static libs (*.a removed): > ovs_static> find -type f -executable | grep -v scripts | grep -v ".la" | > xargs du -ch > 7.5M ./sbin/ovs-vswitchd > 44K ./sbin/ovs-bugtool > 4.6M ./sbin/ovsdb-server > 1.0M ./bin/ovs-benchmark > 60K ./bin/ovs-dpctl-top > 1.7M ./bin/ovsdb-client > 5.1M ./bin/ovs-vsctl > 8.0K ./bin/ovs-test > 1.1M ./bin/ovs-appctl > 4.0K ./bin/ovs-pcap > 4.0M ./bin/ovs-ofctl > 1.8M ./bin/ovsdb-tool > 16K ./bin/ovs-pki > 3.8M ./bin/ovs-dpctl > 4.0K ./bin/ovs-parse-backtrace > 4.0K ./bin/ovs-l3ping > 2.0M ./bin/vtep-ctl > 4.0K ./bin/ovs-tcpundump > 33M total > > Using shared libs: > ovs_shared> find -type f -executable | grep -v scripts | grep -v ".la" | > xargs du -ch > 128K ./lib64/libsflow.so.0.0.0 > 644K ./lib64/libovsdb.so.0.0.0 > 6.2M ./lib64/libopenvswitch.so.0.0.0 > 1.8M ./lib64/libofproto.so.0.0.0 > 408K ./sbin/ovs-vswitchd > 44K ./sbin/ovs-bugtool > 132K ./sbin/ovsdb-server > 52K ./bin/ovs-benchmark > 60K ./bin/ovs-dpctl-top > 100K ./bin/ovsdb-client > 296K ./bin/ovs-vsctl > 8.0K ./bin/ovs-test > 28K ./bin/ovs-appctl > 4.0K ./bin/ovs-pcap > 252K ./bin/ovs-ofctl > 60K ./bin/ovsdb-tool > 16K ./bin/ovs-pki > 112K ./bin/ovs-dpctl > 4.0K ./bin/ovs-parse-backtrace > 4.0K ./bin/ovs-l3ping > 264K ./bin/vtep-ctl > 4.0K ./bin/ovs-tcpundump > 11M total > > Signed-off-by: Helmut Schaa <helmut.sc...@googlemail.com>
A broad discussion of this idea is already ongoing. Here are some specific remarks about this commit. Running autoconf I get several errors and warnings: configure.ac:41: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from... configure.ac:41: the top level configure.ac:41: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from... configure.ac:41: the top level configure.ac:41: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from... configure.ac:41: the top level configure.ac:41: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS ../../lib/autoconf/specific.m4:368: AC_USE_SYSTEM_EXTENSIONS is expanded from... configure.ac:41: the top level libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'. libtoolize: copying file `build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. libtoolize: copying file `m4/libtool.m4' libtoolize: copying file `m4/ltoptions.m4' libtoolize: copying file `m4/ltsugar.m4' libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT' I think that your binaries must include debug symbols. I don't know why you would include debug symbols in binaries meant for a space-constrained application. I was concerned that this would double compilation time, but I can see that with the defaults, anyhow, it only increased compilation time on my laptop from about 49 seconds to about 55 seconds, which is OK by me. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev