Skip to content

Commit

Permalink
Create libsoftether.so and dynamically link the userland.
Browse files Browse the repository at this point in the history
Sharing object code between vpnbridge, vpnclient, vpnserver, and vpncmd
reduces the binary size of SoftEther by 85% and its administrative memory
footprint by 50%.
  • Loading branch information
dajhorn committed Oct 3, 2014
1 parent c5e5d7e commit 75625af
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ AC_CONFIG_FILES([
src/Mayaqua/Makefile
src/Cedar/Makefile
src/hamcorebuilder/Makefile
src/libsoftether/Makefile
src/bin/hamcore/Makefile
src/vpnserver/Makefile
src/vpnclient/Makefile
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ SUBDIRS = Mayaqua Cedar
# This is a nodist helper.
SUBDIRS += hamcorebuilder

# These are final build products.
SUBDIRS += bin/hamcore vpnserver vpnclient vpnbridge vpncmd
# These are shared components.
SUBDIRS += libsoftether bin/hamcore

# These are the final build products.
SUBDIRS += vpnserver vpnclient vpnbridge vpncmd
34 changes: 34 additions & 0 deletions src/libsoftether/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
#
# This file is part of SoftEther.
#
# SoftEther is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2 of the License, or (at your option)
# any later version.
#
# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# SoftEther. If not, see <http://www.gnu.org/licenses/>.


include $(top_srcdir)/autotools/softether.am

lib_LTLIBRARIES = \
libsoftether.la

libsoftether_la_SOURCES =

libsoftether_la_LDFLAGS = \
-avoid-version

libsoftether_la_LIBTOOLFLAGS = \
--tag=disable-static

libsoftether_la_LIBADD = \
$(top_builddir)/src/Mayaqua/libmayaqua.la \
$(top_builddir)/src/Cedar/libcedar.la
3 changes: 1 addition & 2 deletions src/vpnbridge/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ vpnbridge_SOURCES = \
vpnbridge.c

vpnbridge_LDADD = \
$(top_builddir)/src/Mayaqua/libmayaqua.la \
$(top_builddir)/src/Cedar/libcedar.la
$(top_builddir)/src/libsoftether/libsoftether.la
3 changes: 1 addition & 2 deletions src/vpnclient/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ vpnclient_SOURCES = \
vpncsvc.c

vpnclient_LDADD = \
$(top_builddir)/src/Mayaqua/libmayaqua.la \
$(top_builddir)/src/Cedar/libcedar.la
$(top_builddir)/src/libsoftether/libsoftether.la
3 changes: 1 addition & 2 deletions src/vpncmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ vpncmd_SOURCES = \
vpncmd.c

vpncmd_LDADD = \
$(top_builddir)/src/Mayaqua/libmayaqua.la \
$(top_builddir)/src/Cedar/libcedar.la
$(top_builddir)/src/libsoftether/libsoftether.la
3 changes: 1 addition & 2 deletions src/vpnserver/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ vpnserver_SOURCES = \
vpnserver.c

vpnserver_LDADD = \
$(top_builddir)/src/Mayaqua/libmayaqua.la \
$(top_builddir)/src/Cedar/libcedar.la
$(top_builddir)/src/libsoftether/libsoftether.la

0 comments on commit 75625af

Please sign in to comment.