0002-Create-libsoftether.so-and-dynamically-link.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. From 75625af541fd128f51079d0ffe5ef24645b8f421 Mon Sep 17 00:00:00 2001
  2. From: Darik Horn <dajhorn@vanadac.com>
  3. Date: Sun, 13 Apr 2014 12:51:15 -0400
  4. Subject: [PATCH] Create libsoftether.so and dynamically link the userland.
  5. Sharing object code between vpnbridge, vpnclient, vpnserver, and vpncmd
  6. reduces the binary size of SoftEther by 85% and its administrative memory
  7. footprint by 50%.
  8. [Upstream commit https://github.com/dajhorn/SoftEtherVPN/commit/75625af541fd128f51079d0ffe5ef24645b8f421]
  9. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  10. ---
  11. configure.ac | 1 +
  12. src/Makefile.am | 7 +++++--
  13. src/libsoftether/Makefile.am | 34 ++++++++++++++++++++++++++++++++++
  14. src/vpnbridge/Makefile.am | 3 +--
  15. src/vpnclient/Makefile.am | 3 +--
  16. src/vpncmd/Makefile.am | 3 +--
  17. src/vpnserver/Makefile.am | 3 +--
  18. 7 files changed, 44 insertions(+), 10 deletions(-)
  19. create mode 100644 src/libsoftether/Makefile.am
  20. diff --git a/configure.ac b/configure.ac
  21. index 4a3fc2ba..94639c44 100644
  22. --- a/configure.ac
  23. +++ b/configure.ac
  24. @@ -30,6 +30,7 @@ AC_CONFIG_FILES([
  25. src/Mayaqua/Makefile
  26. src/Cedar/Makefile
  27. src/hamcorebuilder/Makefile
  28. + src/libsoftether/Makefile
  29. src/bin/hamcore/Makefile
  30. src/vpnserver/Makefile
  31. src/vpnclient/Makefile
  32. diff --git a/src/Makefile.am b/src/Makefile.am
  33. index dc745426..1d041d47 100644
  34. --- a/src/Makefile.am
  35. +++ b/src/Makefile.am
  36. @@ -22,5 +22,8 @@ SUBDIRS = Mayaqua Cedar
  37. # This is a nodist helper.
  38. SUBDIRS += hamcorebuilder
  39. -# These are final build products.
  40. -SUBDIRS += bin/hamcore vpnserver vpnclient vpnbridge vpncmd
  41. +# These are shared components.
  42. +SUBDIRS += libsoftether bin/hamcore
  43. +
  44. +# These are the final build products.
  45. +SUBDIRS += vpnserver vpnclient vpnbridge vpncmd
  46. diff --git a/src/libsoftether/Makefile.am b/src/libsoftether/Makefile.am
  47. new file mode 100644
  48. index 00000000..601920d9
  49. --- /dev/null
  50. +++ b/src/libsoftether/Makefile.am
  51. @@ -0,0 +1,34 @@
  52. +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
  53. +#
  54. +# This file is part of SoftEther.
  55. +#
  56. +# SoftEther is free software: you can redistribute it and/or modify it under
  57. +# the terms of the GNU General Public License as published by the Free
  58. +# Software Foundation, either version 2 of the License, or (at your option)
  59. +# any later version.
  60. +#
  61. +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
  62. +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  63. +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  64. +# details.
  65. +#
  66. +# You should have received a copy of the GNU General Public License along with
  67. +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
  68. +
  69. +
  70. +include $(top_srcdir)/autotools/softether.am
  71. +
  72. +lib_LTLIBRARIES = \
  73. + libsoftether.la
  74. +
  75. +libsoftether_la_SOURCES =
  76. +
  77. +libsoftether_la_LDFLAGS = \
  78. + -avoid-version
  79. +
  80. +libsoftether_la_LIBTOOLFLAGS = \
  81. + --tag=disable-static
  82. +
  83. +libsoftether_la_LIBADD = \
  84. + $(top_builddir)/src/Mayaqua/libmayaqua.la \
  85. + $(top_builddir)/src/Cedar/libcedar.la
  86. diff --git a/src/vpnbridge/Makefile.am b/src/vpnbridge/Makefile.am
  87. index 35fe043d..fb91dd2d 100644
  88. --- a/src/vpnbridge/Makefile.am
  89. +++ b/src/vpnbridge/Makefile.am
  90. @@ -25,5 +25,4 @@ vpnbridge_SOURCES = \
  91. vpnbridge.c
  92. vpnbridge_LDADD = \
  93. - $(top_builddir)/src/Mayaqua/libmayaqua.la \
  94. - $(top_builddir)/src/Cedar/libcedar.la
  95. + $(top_builddir)/src/libsoftether/libsoftether.la
  96. diff --git a/src/vpnclient/Makefile.am b/src/vpnclient/Makefile.am
  97. index 1aa55330..c225c416 100644
  98. --- a/src/vpnclient/Makefile.am
  99. +++ b/src/vpnclient/Makefile.am
  100. @@ -25,5 +25,4 @@ vpnclient_SOURCES = \
  101. vpncsvc.c
  102. vpnclient_LDADD = \
  103. - $(top_builddir)/src/Mayaqua/libmayaqua.la \
  104. - $(top_builddir)/src/Cedar/libcedar.la
  105. + $(top_builddir)/src/libsoftether/libsoftether.la
  106. diff --git a/src/vpncmd/Makefile.am b/src/vpncmd/Makefile.am
  107. index d8042aa2..271affb0 100644
  108. --- a/src/vpncmd/Makefile.am
  109. +++ b/src/vpncmd/Makefile.am
  110. @@ -25,5 +25,4 @@ vpncmd_SOURCES = \
  111. vpncmd.c
  112. vpncmd_LDADD = \
  113. - $(top_builddir)/src/Mayaqua/libmayaqua.la \
  114. - $(top_builddir)/src/Cedar/libcedar.la
  115. + $(top_builddir)/src/libsoftether/libsoftether.la
  116. diff --git a/src/vpnserver/Makefile.am b/src/vpnserver/Makefile.am
  117. index c1c33570..1f7b7f98 100644
  118. --- a/src/vpnserver/Makefile.am
  119. +++ b/src/vpnserver/Makefile.am
  120. @@ -25,5 +25,4 @@ vpnserver_SOURCES = \
  121. vpnserver.c
  122. vpnserver_LDADD = \
  123. - $(top_builddir)/src/Mayaqua/libmayaqua.la \
  124. - $(top_builddir)/src/Cedar/libcedar.la
  125. + $(top_builddir)/src/libsoftether/libsoftether.la