1 From c5e5d7e93c6f3302adf5821c29c4efdb7630e418 Mon Sep 17 00:00:00 2001
2 From: Darik Horn <dajhorn@vanadac.com>
3 Date: Sat, 12 Apr 2014 17:46:04 -0400
4 Subject: [PATCH] Create autotools plumbing for SoftEther.
6 Add autoconf and automake capabilities to SoftEther so that it can be built
9 # autoreconf --force --install
11 # make install DESTDIR=/tmp/softether
13 All standard configure parameters are supported, plus:
15 # ./configure --enable-debug
17 Autotools support makes porting, cross compiling, and optimization much easier.
19 These GNU autoconf-archive components are used for dependency checking:
27 NB: http://www.gnu.org/software/autoconf-archive/
29 [Upstream commit: https://github.com/dajhorn/SoftEtherVPN/commit/c5e5d7e93c6f3302adf5821c29c4efdb7630e418]
30 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
33 autotools/ax_check_openssl.m4 | 124 ++++++++++
34 autotools/ax_check_zlib.m4 | 142 +++++++++++
35 autotools/ax_lib_readline.m4 | 107 +++++++++
36 autotools/ax_pthread.m4 | 332 ++++++++++++++++++++++++++
37 autotools/ax_with_curses.m4 | 518 +++++++++++++++++++++++++++++++++++++++++
38 autotools/softether.am | 39 ++++
39 configure.ac | 96 ++++++++
40 configure => manual_configure | 0
41 src/Cedar/Makefile.am | 82 +++++++
42 src/Makefile.am | 26 +++
43 src/Mayaqua/Makefile.am | 43 ++++
44 src/bin/hamcore/Makefile.am | 29 +++
45 src/hamcorebuilder/Makefile.am | 29 +++
46 src/vpnbridge/Makefile.am | 29 +++
47 src/vpnclient/Makefile.am | 29 +++
48 src/vpncmd/Makefile.am | 29 +++
49 src/vpnserver/Makefile.am | 29 +++
50 18 files changed, 1704 insertions(+)
51 create mode 100644 Makefile.am
52 create mode 100644 autotools/ax_check_openssl.m4
53 create mode 100644 autotools/ax_check_zlib.m4
54 create mode 100644 autotools/ax_lib_readline.m4
55 create mode 100644 autotools/ax_pthread.m4
56 create mode 100644 autotools/ax_with_curses.m4
57 create mode 100644 autotools/softether.am
58 create mode 100644 configure.ac
59 rename configure => manual_configure (100%)
60 create mode 100644 src/Cedar/Makefile.am
61 create mode 100644 src/Makefile.am
62 create mode 100644 src/Mayaqua/Makefile.am
63 create mode 100644 src/bin/hamcore/Makefile.am
64 create mode 100644 src/hamcorebuilder/Makefile.am
65 create mode 100644 src/vpnbridge/Makefile.am
66 create mode 100644 src/vpnclient/Makefile.am
67 create mode 100644 src/vpncmd/Makefile.am
68 create mode 100644 src/vpnserver/Makefile.am
70 diff --git a/Makefile.am b/Makefile.am
72 index 00000000..aa73b2ba
76 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
78 +# This file is part of SoftEther.
80 +# SoftEther is free software: you can redistribute it and/or modify it under
81 +# the terms of the GNU General Public License as published by the Free
82 +# Software Foundation, either version 2 of the License, or (at your option)
85 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
86 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
87 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
90 +# You should have received a copy of the GNU General Public License along with
91 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
94 +ACLOCAL_AMFLAGS = -I autotools
95 +include $(top_srcdir)/autotools/softether.am
97 diff --git a/autotools/ax_check_openssl.m4 b/autotools/ax_check_openssl.m4
99 index 00000000..a87c5a6b
101 +++ b/autotools/ax_check_openssl.m4
103 +# ===========================================================================
104 +# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
105 +# ===========================================================================
109 +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
113 +# Look for OpenSSL in a number of default spots, or in a user-selected
114 +# spot (via --with-openssl). Sets
116 +# OPENSSL_INCLUDES to the include directives required
117 +# OPENSSL_LIBS to the -l directives required
118 +# OPENSSL_LDFLAGS to the -L or -R flags required
120 +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
122 +# This macro sets OPENSSL_INCLUDES such that source files should use the
123 +# openssl/ directory in include directives:
125 +# #include <openssl/hmac.h>
129 +# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
130 +# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
132 +# Copying and distribution of this file, with or without modification, are
133 +# permitted in any medium without royalty provided the copyright notice
134 +# and this notice are preserved. This file is offered as-is, without any
139 +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
140 +AC_DEFUN([AX_CHECK_OPENSSL], [
142 + AC_ARG_WITH([openssl],
143 + [AS_HELP_STRING([--with-openssl=DIR],
144 + [root of the OpenSSL directory])],
147 + "" | y | ye | yes | n | no)
148 + AC_MSG_ERROR([Invalid --with-openssl value])
150 + *) ssldirs="$withval"
154 + # if pkg-config is installed and openssl has installed a .pc file,
155 + # then use that information and don't search ssldirs
156 + AC_PATH_PROG([PKG_CONFIG], [pkg-config])
157 + if test x"$PKG_CONFIG" != x""; then
158 + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
159 + if test $? = 0; then
160 + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
161 + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
166 + # no such luck; use some default ssldirs
168 + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
174 + # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
175 + # an 'openssl' subdirectory
179 + for ssldir in $ssldirs; do
180 + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
181 + if test -f "$ssldir/include/openssl/ssl.h"; then
182 + OPENSSL_INCLUDES="-I$ssldir/include"
183 + OPENSSL_LDFLAGS="-L$ssldir/lib"
184 + OPENSSL_LIBS="-lssl -lcrypto"
186 + AC_MSG_RESULT([yes])
189 + AC_MSG_RESULT([no])
193 + # if the file wasn't found, well, go ahead and try the link anyway -- maybe
194 + # it will just work!
197 + # try the preprocessor and linker with our new flags,
198 + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
200 + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
201 + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
202 + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
205 + save_LDFLAGS="$LDFLAGS"
206 + save_CPPFLAGS="$CPPFLAGS"
207 + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
208 + LIBS="$OPENSSL_LIBS $LIBS"
209 + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
211 + [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
213 + AC_MSG_RESULT([yes])
216 + AC_MSG_RESULT([no])
219 + CPPFLAGS="$save_CPPFLAGS"
220 + LDFLAGS="$save_LDFLAGS"
223 + AC_SUBST([OPENSSL_INCLUDES])
224 + AC_SUBST([OPENSSL_LIBS])
225 + AC_SUBST([OPENSSL_LDFLAGS])
227 diff --git a/autotools/ax_check_zlib.m4 b/autotools/ax_check_zlib.m4
229 index 00000000..ae5705f6
231 +++ b/autotools/ax_check_zlib.m4
233 +# ===========================================================================
234 +# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
235 +# ===========================================================================
239 +# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
243 +# This macro searches for an installed zlib library. If nothing was
244 +# specified when calling configure, it searches first in /usr/local and
245 +# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
246 +# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
247 +# --without-zlib is specified, the library is not searched at all.
249 +# If either the header file (zlib.h) or the library (libz) is not found,
250 +# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
251 +# not specified, the configuration exits on error, asking for a valid zlib
252 +# installation directory or --without-zlib.
254 +# If both header file and library are found, shell commands
255 +# 'action-if-found' is run. If 'action-if-found' is not specified, the
256 +# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
257 +# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
258 +# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
259 +# for this symbol in a config.h file. Sample usage in a C/C++ source is as
264 +# #endif /* HAVE_LIBZ */
268 +# Copyright (c) 2008 Loic Dachary <loic@senga.org>
269 +# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
271 +# This program is free software; you can redistribute it and/or modify it
272 +# under the terms of the GNU General Public License as published by the
273 +# Free Software Foundation; either version 2 of the License, or (at your
274 +# option) any later version.
276 +# This program is distributed in the hope that it will be useful, but
277 +# WITHOUT ANY WARRANTY; without even the implied warranty of
278 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
279 +# Public License for more details.
281 +# You should have received a copy of the GNU General Public License along
282 +# with this program. If not, see <http://www.gnu.org/licenses/>.
284 +# As a special exception, the respective Autoconf Macro's copyright owner
285 +# gives unlimited permission to copy, distribute and modify the configure
286 +# scripts that are the output of Autoconf when processing the Macro. You
287 +# need not follow the terms of the GNU General Public License when using
288 +# or distributing such scripts, even though portions of the text of the
289 +# Macro appear in them. The GNU General Public License (GPL) does govern
290 +# all other use of the material that constitutes the Autoconf Macro.
292 +# This special exception to the GPL applies to versions of the Autoconf
293 +# Macro released by the Autoconf Archive. When you make and distribute a
294 +# modified version of the Autoconf Macro, you may extend this special
295 +# exception to the GPL to apply to your modified version as well.
299 +AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
300 +AC_DEFUN([AX_CHECK_ZLIB],
304 +[AC_MSG_CHECKING(if zlib is wanted)
305 +zlib_places="/usr/local /usr /opt/local /sw"
307 +[ --with-zlib=DIR root directory path of zlib installation @<:@defaults to
308 + /usr/local or /usr if not found in /usr/local@:>@
309 + --without-zlib to disable zlib usage completely],
310 +[if test "$withval" != no ; then
312 + if test -d "$withval"
314 + zlib_places="$withval $zlib_places"
316 + AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
322 +[AC_MSG_RESULT(yes)])
325 +# Locate zlib, if wanted
327 +if test -n "${zlib_places}"
329 + # check the user supplied or any other more or less 'standard' place:
330 + # Most UNIX systems : /usr/local and /usr
331 + # MacPorts / Fink on OSX : /opt/local respectively /sw
332 + for ZLIB_HOME in ${zlib_places} ; do
333 + if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
337 + ZLIB_OLD_LDFLAGS=$LDFLAGS
338 + ZLIB_OLD_CPPFLAGS=$CPPFLAGS
339 + if test -n "${ZLIB_HOME}"; then
340 + LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
341 + CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
345 + AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
346 + AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
348 + if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
351 + # If both library and header were found, action-if-found
354 + CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
355 + LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
357 + AC_DEFINE([HAVE_LIBZ], [1],
358 + [Define to 1 if you have `z' library (-lz)])
360 + # Restore variables
361 + LDFLAGS="$ZLIB_OLD_LDFLAGS"
362 + CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
367 + # If either header or library was not found, action-if-not-found
370 + AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
375 diff --git a/autotools/ax_lib_readline.m4 b/autotools/ax_lib_readline.m4
377 index 00000000..056f25c2
379 +++ b/autotools/ax_lib_readline.m4
381 +# ===========================================================================
382 +# http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
383 +# ===========================================================================
391 +# Searches for a readline compatible library. If found, defines
392 +# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
393 +# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
394 +# necessary include files and sets `HAVE_READLINE_H' or
395 +# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
396 +# 'HAVE_HISTORY_H' if the corresponding include files exists.
398 +# The libraries that may be readline compatible are `libedit',
399 +# `libeditline' and `libreadline'. Sometimes we need to link a termcap
400 +# library for readline to work, this macro tests these cases too by trying
401 +# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
403 +# Here is an example of how to use the information provided by this macro
404 +# to perform the necessary includes or declarations in a C file:
406 +# #ifdef HAVE_LIBREADLINE
407 +# # if defined(HAVE_READLINE_READLINE_H)
408 +# # include <readline/readline.h>
409 +# # elif defined(HAVE_READLINE_H)
410 +# # include <readline.h>
411 +# # else /* !defined(HAVE_READLINE_H) */
412 +# extern char *readline ();
413 +# # endif /* !defined(HAVE_READLINE_H) */
414 +# char *cmdline = NULL;
415 +# #else /* !defined(HAVE_READLINE_READLINE_H) */
417 +# #endif /* HAVE_LIBREADLINE */
419 +# #ifdef HAVE_READLINE_HISTORY
420 +# # if defined(HAVE_READLINE_HISTORY_H)
421 +# # include <readline/history.h>
422 +# # elif defined(HAVE_HISTORY_H)
423 +# # include <history.h>
424 +# # else /* !defined(HAVE_HISTORY_H) */
425 +# extern void add_history ();
426 +# extern int write_history ();
427 +# extern int read_history ();
428 +# # endif /* defined(HAVE_READLINE_HISTORY_H) */
430 +# #endif /* HAVE_READLINE_HISTORY */
434 +# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
436 +# Copying and distribution of this file, with or without modification, are
437 +# permitted in any medium without royalty provided the copyright notice
438 +# and this notice are preserved. This file is offered as-is, without any
443 +AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
444 +AC_DEFUN([AX_LIB_READLINE], [
445 + AC_CACHE_CHECK([for a readline compatible library],
446 + ax_cv_lib_readline, [
448 + for readline_lib in readline edit editline; do
449 + for termcap_lib in "" termcap curses ncurses; do
450 + if test -z "$termcap_lib"; then
451 + TRY_LIB="-l$readline_lib"
453 + TRY_LIB="-l$readline_lib -l$termcap_lib"
455 + LIBS="$ORIG_LIBS $TRY_LIB"
456 + AC_TRY_LINK_FUNC(readline, ax_cv_lib_readline="$TRY_LIB")
457 + if test -n "$ax_cv_lib_readline"; then
461 + if test -n "$ax_cv_lib_readline"; then
465 + if test -z "$ax_cv_lib_readline"; then
466 + ax_cv_lib_readline="no"
471 + if test "$ax_cv_lib_readline" != "no"; then
472 + LIBS="$LIBS $ax_cv_lib_readline"
473 + AC_DEFINE(HAVE_LIBREADLINE, 1,
474 + [Define if you have a readline compatible library])
475 + AC_CHECK_HEADERS(readline.h readline/readline.h)
476 + AC_CACHE_CHECK([whether readline supports history],
477 + ax_cv_lib_readline_history, [
478 + ax_cv_lib_readline_history="no"
479 + AC_TRY_LINK_FUNC(add_history, ax_cv_lib_readline_history="yes")
481 + if test "$ax_cv_lib_readline_history" = "yes"; then
482 + AC_DEFINE(HAVE_READLINE_HISTORY, 1,
483 + [Define if your readline library has \`add_history'])
484 + AC_CHECK_HEADERS(history.h readline/history.h)
488 diff --git a/autotools/ax_pthread.m4 b/autotools/ax_pthread.m4
490 index 00000000..d383ad5c
492 +++ b/autotools/ax_pthread.m4
494 +# ===========================================================================
495 +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
496 +# ===========================================================================
500 +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
504 +# This macro figures out how to build C programs using POSIX threads. It
505 +# sets the PTHREAD_LIBS output variable to the threads library and linker
506 +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
507 +# flags that are needed. (The user can also force certain compiler
508 +# flags/libs to be tested by setting these environment variables.)
510 +# Also sets PTHREAD_CC to any special C compiler that is needed for
511 +# multi-threaded programs (defaults to the value of CC otherwise). (This
512 +# is necessary on AIX to use the special cc_r compiler alias.)
514 +# NOTE: You are assumed to not only compile your program with these flags,
515 +# but also link it with them as well. e.g. you should link with
516 +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
518 +# If you are only building threads programs, you may wish to use these
519 +# variables in your default LIBS, CFLAGS, and CC:
521 +# LIBS="$PTHREAD_LIBS $LIBS"
522 +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
525 +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
526 +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
527 +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
529 +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
530 +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
533 +# ACTION-IF-FOUND is a list of shell commands to run if a threads library
534 +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
535 +# is not found. If ACTION-IF-FOUND is not specified, the default action
536 +# will define HAVE_PTHREAD.
538 +# Please let the authors know if this macro fails on any platform, or if
539 +# you have any other suggestions or comments. This macro was based on work
540 +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
541 +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
542 +# Alejandro Forero Cuervo to the autoconf macro repository. We are also
543 +# grateful for the helpful feedback of numerous users.
545 +# Updated for Autoconf 2.68 by Daniel Richard G.
549 +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
550 +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
552 +# This program is free software: you can redistribute it and/or modify it
553 +# under the terms of the GNU General Public License as published by the
554 +# Free Software Foundation, either version 3 of the License, or (at your
555 +# option) any later version.
557 +# This program is distributed in the hope that it will be useful, but
558 +# WITHOUT ANY WARRANTY; without even the implied warranty of
559 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
560 +# Public License for more details.
562 +# You should have received a copy of the GNU General Public License along
563 +# with this program. If not, see <http://www.gnu.org/licenses/>.
565 +# As a special exception, the respective Autoconf Macro's copyright owner
566 +# gives unlimited permission to copy, distribute and modify the configure
567 +# scripts that are the output of Autoconf when processing the Macro. You
568 +# need not follow the terms of the GNU General Public License when using
569 +# or distributing such scripts, even though portions of the text of the
570 +# Macro appear in them. The GNU General Public License (GPL) does govern
571 +# all other use of the material that constitutes the Autoconf Macro.
573 +# This special exception to the GPL applies to versions of the Autoconf
574 +# Macro released by the Autoconf Archive. When you make and distribute a
575 +# modified version of the Autoconf Macro, you may extend this special
576 +# exception to the GPL to apply to your modified version as well.
580 +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
581 +AC_DEFUN([AX_PTHREAD], [
582 +AC_REQUIRE([AC_CANONICAL_HOST])
586 +# We used to check for pthread.h first, but this fails if pthread.h
587 +# requires special compiler flags (e.g. on True64 or Sequent).
588 +# It gets checked for in the link test anyway.
590 +# First of all, check if the user has set any of the PTHREAD_LIBS,
591 +# etcetera environment variables, and if threads linking works using
593 +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
594 + save_CFLAGS="$CFLAGS"
595 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
597 + LIBS="$PTHREAD_LIBS $LIBS"
598 + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
599 + AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
600 + AC_MSG_RESULT([$ax_pthread_ok])
601 + if test x"$ax_pthread_ok" = xno; then
606 + CFLAGS="$save_CFLAGS"
609 +# We must check for the threads library under a number of different
610 +# names; the ordering is very important because some systems
611 +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
612 +# libraries is broken (non-POSIX).
614 +# Create a list of thread flags to try. Items starting with a "-" are
615 +# C compiler flags, and other items are library names, except for "none"
616 +# which indicates that we try without any flags at all, and "pthread-config"
617 +# which is a program returning the flags for the Pth emulation library.
619 +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
621 +# The ordering *is* (sometimes) important. Some notes on the
622 +# individual items follow:
624 +# pthreads: AIX (must check this before -lpthread)
625 +# none: in case threads are in libc; should be tried before -Kthread and
626 +# other compiler flags to prevent continual compiler warnings
627 +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
628 +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
629 +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
630 +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
631 +# -pthreads: Solaris/gcc
632 +# -mthreads: Mingw32/gcc, Lynx/gcc
633 +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
634 +# doesn't hurt to check since this sometimes defines pthreads too;
635 +# also defines -D_REENTRANT)
636 +# ... -mt is also the pthreads flag for HP/aCC
637 +# pthread: Linux, etcetera
638 +# --thread-safe: KAI C++
639 +# pthread-config: use pthread-config program (for GNU Pth library)
644 + # On Solaris (at least, for some versions), libc contains stubbed
645 + # (non-functional) versions of the pthreads routines, so link-based
646 + # tests will erroneously succeed. (We need to link with -pthreads/-mt/
647 + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
648 + # a function called by this macro, so we could check for that, but
649 + # who knows whether they'll stub that too in a future libc.) So,
650 + # we'll just look for -pthreads and -lpthread first:
652 + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
656 + ax_pthread_flags="-pthread $ax_pthread_flags"
660 +# Clang doesn't consider unrecognized options an error unless we specify
661 +# -Werror. We throw in some extra Clang-specific options to ensure that
662 +# this doesn't happen for GCC, which also accepts -Werror.
664 +AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
665 +save_CFLAGS="$CFLAGS"
666 +ax_pthread_extra_flags="-Werror"
667 +CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
668 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
669 + [AC_MSG_RESULT([yes])],
670 + [ax_pthread_extra_flags=
671 + AC_MSG_RESULT([no])])
672 +CFLAGS="$save_CFLAGS"
674 +if test x"$ax_pthread_ok" = xno; then
675 +for flag in $ax_pthread_flags; do
679 + AC_MSG_CHECKING([whether pthreads work without any flags])
683 + AC_MSG_CHECKING([whether pthreads work with $flag])
684 + PTHREAD_CFLAGS="$flag"
688 + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
689 + if test x"$ax_pthread_config" = xno; then continue; fi
690 + PTHREAD_CFLAGS="`pthread-config --cflags`"
691 + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
695 + AC_MSG_CHECKING([for the pthreads library -l$flag])
696 + PTHREAD_LIBS="-l$flag"
701 + save_CFLAGS="$CFLAGS"
702 + LIBS="$PTHREAD_LIBS $LIBS"
703 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
705 + # Check for various functions. We must include pthread.h,
706 + # since some functions may be macros. (On the Sequent, we
707 + # need a special flag -Kthread to make this header compile.)
708 + # We check for pthread_join because it is in -lpthread on IRIX
709 + # while pthread_create is in libc. We check for pthread_attr_init
710 + # due to DEC craziness with -lpthreads. We check for
711 + # pthread_cleanup_push because it is one of the few pthread
712 + # functions on Solaris that doesn't have a non-functional libc stub.
713 + # We try pthread_create on general principles.
714 + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
715 + static void routine(void *a) { a = 0; }
716 + static void *start_routine(void *a) { return a; }],
717 + [pthread_t th; pthread_attr_t attr;
718 + pthread_create(&th, 0, start_routine, 0);
719 + pthread_join(th, 0);
720 + pthread_attr_init(&attr);
721 + pthread_cleanup_push(routine, 0);
722 + pthread_cleanup_pop(0) /* ; */])],
723 + [ax_pthread_ok=yes],
727 + CFLAGS="$save_CFLAGS"
729 + AC_MSG_RESULT([$ax_pthread_ok])
730 + if test "x$ax_pthread_ok" = xyes; then
739 +# Various other checks:
740 +if test "x$ax_pthread_ok" = xyes; then
742 + LIBS="$PTHREAD_LIBS $LIBS"
743 + save_CFLAGS="$CFLAGS"
744 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
746 + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
747 + AC_MSG_CHECKING([for joinable pthread attribute])
749 + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
750 + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
751 + [int attr = $attr; return attr /* ; */])],
752 + [attr_name=$attr; break],
755 + AC_MSG_RESULT([$attr_name])
756 + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
757 + AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
758 + [Define to necessary symbol if this constant
759 + uses a non-standard name on your system.])
762 + AC_MSG_CHECKING([if more special flags are required for pthreads])
765 + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
766 + osf* | hpux*) flag="-D_REENTRANT";;
768 + if test "$GCC" = "yes"; then
769 + flag="-D_REENTRANT"
771 + # TODO: What about Clang on Solaris?
772 + flag="-mt -D_REENTRANT"
776 + AC_MSG_RESULT([$flag])
777 + if test "x$flag" != xno; then
778 + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
781 + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
782 + [ax_cv_PTHREAD_PRIO_INHERIT], [
783 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
784 + [[int i = PTHREAD_PRIO_INHERIT;]])],
785 + [ax_cv_PTHREAD_PRIO_INHERIT=yes],
786 + [ax_cv_PTHREAD_PRIO_INHERIT=no])
788 + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
789 + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
792 + CFLAGS="$save_CFLAGS"
794 + # More AIX lossage: compile with *_r variant
795 + if test "x$GCC" != xyes; then
799 + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
800 + [#handle absolute path differently from PATH based program lookup
803 + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
804 + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
810 +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
812 +AC_SUBST([PTHREAD_LIBS])
813 +AC_SUBST([PTHREAD_CFLAGS])
814 +AC_SUBST([PTHREAD_CC])
816 +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
817 +if test x"$ax_pthread_ok" = xyes; then
818 + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
826 diff --git a/autotools/ax_with_curses.m4 b/autotools/ax_with_curses.m4
828 index 00000000..e4cbd31b
830 +++ b/autotools/ax_with_curses.m4
832 +# ===========================================================================
833 +# http://www.gnu.org/software/autoconf-archive/ax_with_curses.html
834 +# ===========================================================================
842 +# This macro checks whether a SysV or X/Open-compatible Curses library is
843 +# present, along with the associated header file. The NcursesW
844 +# (wide-character) library is searched for first, followed by Ncurses,
845 +# then the system-default plain Curses. The first library found is the
848 +# The following options are understood: --with-ncursesw, --with-ncurses,
849 +# --without-ncursesw, --without-ncurses. The "--with" options force the
850 +# macro to use that particular library, terminating with an error if not
851 +# found. The "--without" options simply skip the check for that library.
852 +# The effect on the search pattern is:
854 +# (no options) - NcursesW, Ncurses, Curses
855 +# --with-ncurses --with-ncursesw - NcursesW only [*]
856 +# --without-ncurses --with-ncursesw - NcursesW only [*]
857 +# --with-ncursesw - NcursesW only [*]
858 +# --with-ncurses --without-ncursesw - Ncurses only [*]
859 +# --with-ncurses - NcursesW, Ncurses [**]
860 +# --without-ncurses --without-ncursesw - Curses only
861 +# --without-ncursesw - Ncurses, Curses
862 +# --without-ncurses - NcursesW, Curses
864 +# [*] If the library is not found, abort the configure script.
866 +# [**] If the second library (Ncurses) is not found, abort configure.
868 +# The following preprocessor symbols may be defined by this macro if the
869 +# appropriate conditions are met:
871 +# HAVE_CURSES - if any SysV or X/Open Curses library found
872 +# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions
873 +# HAVE_CURSES_COLOR - if library supports color (enhanced functions)
874 +# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features
875 +# HAVE_NCURSESW - if NcursesW (wide char) library is to be used
876 +# HAVE_NCURSES - if the Ncurses library is to be used
878 +# HAVE_CURSES_H - if <curses.h> is present and should be used
879 +# HAVE_NCURSESW_H - if <ncursesw.h> should be used
880 +# HAVE_NCURSES_H - if <ncurses.h> should be used
881 +# HAVE_NCURSESW_CURSES_H - if <ncursesw/curses.h> should be used
882 +# HAVE_NCURSES_CURSES_H - if <ncurses/curses.h> should be used
884 +# (These preprocessor symbols are discussed later in this document.)
886 +# The following output variable is defined by this macro; it is precious
887 +# and may be overridden on the ./configure command line:
889 +# CURSES_LIB - library to add to xxx_LDADD
891 +# The library listed in CURSES_LIB is NOT added to LIBS by default. You
892 +# need to add CURSES_LIB to the appropriate xxx_LDADD line in your
893 +# Makefile.am. For example:
895 +# prog_LDADD = @CURSES_LIB@
897 +# If CURSES_LIB is set on the configure command line (such as by running
898 +# "./configure CURSES_LIB=-lmycurses"), then the only header searched for
899 +# is <curses.h>. The user may use the CPPFLAGS precious variable to
900 +# override the standard #include search path. If the user needs to
901 +# specify an alternative path for a library (such as for a non-standard
902 +# NcurseW), the user should use the LDFLAGS variable.
904 +# The following shell variables may be defined by this macro:
906 +# ax_cv_curses - set to "yes" if any Curses library found
907 +# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present
908 +# ax_cv_curses_color - set to "yes" if color functions present
909 +# ax_cv_curses_obsolete - set to "yes" if obsolete features present
911 +# ax_cv_ncursesw - set to "yes" if NcursesW library found
912 +# ax_cv_ncurses - set to "yes" if Ncurses library found
913 +# ax_cv_plaincurses - set to "yes" if plain Curses library found
914 +# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no"
916 +# These variables can be used in your configure.ac to determine the level
917 +# of support you need from the Curses library. For example, if you must
918 +# have either Ncurses or NcursesW, you could include:
921 +# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
922 +# AC_MSG_ERROR([requires either NcursesW or Ncurses library])
925 +# If any Curses library will do (but one must be present and must support
926 +# color), you could use:
929 +# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
930 +# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
933 +# Certain preprocessor symbols and shell variables defined by this macro
934 +# can be used to determine various features of the Curses library. In
935 +# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses
936 +# library found conforms to the traditional SysV and/or X/Open Base Curses
937 +# definition. Any working Curses library conforms to this level.
939 +# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the
940 +# library supports the X/Open Enhanced Curses definition. In particular,
941 +# the wide-character types attr_t, cchar_t and wint_t, the functions
942 +# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES
943 +# are checked. The Ncurses library does NOT conform to this definition,
944 +# although NcursesW does.
946 +# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library
947 +# supports color functions and macros such as COLOR_PAIR, A_COLOR,
948 +# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the
949 +# X/Open Base Curses definition, but are part of the Enhanced set of
950 +# functions. The Ncurses library DOES support these functions, as does
953 +# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the
954 +# library supports certain features present in SysV and BSD Curses but not
955 +# defined in the X/Open definition. In particular, the functions
956 +# getattrs(), getcurx() and getmaxx() are checked.
958 +# To use the HAVE_xxx_H preprocessor symbols, insert the following into
959 +# your system.h (or equivalent) header file:
961 +# #if defined HAVE_NCURSESW_CURSES_H
962 +# # include <ncursesw/curses.h>
963 +# #elif defined HAVE_NCURSESW_H
964 +# # include <ncursesw.h>
965 +# #elif defined HAVE_NCURSES_CURSES_H
966 +# # include <ncurses/curses.h>
967 +# #elif defined HAVE_NCURSES_H
968 +# # include <ncurses.h>
969 +# #elif defined HAVE_CURSES_H
970 +# # include <curses.h>
972 +# # error "SysV or X/Open-compatible Curses header file required"
975 +# For previous users of this macro: you should not need to change anything
976 +# in your configure.ac or Makefile.am, as the previous (serial 10)
977 +# semantics are still valid. However, you should update your system.h (or
978 +# equivalent) header file to the fragment shown above. You are encouraged
979 +# also to make use of the extended functionality provided by this version
980 +# of AX_WITH_CURSES, as well as in the additional macros
981 +# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM.
985 +# Copyright (c) 2009 Mark Pulford <mark@kyne.com.au>
986 +# Copyright (c) 2009 Damian Pietras <daper@daper.net>
987 +# Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org>
988 +# Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au>
990 +# This program is free software: you can redistribute it and/or modify it
991 +# under the terms of the GNU General Public License as published by the
992 +# Free Software Foundation, either version 3 of the License, or (at your
993 +# option) any later version.
995 +# This program is distributed in the hope that it will be useful, but
996 +# WITHOUT ANY WARRANTY; without even the implied warranty of
997 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
998 +# Public License for more details.
1000 +# You should have received a copy of the GNU General Public License along
1001 +# with this program. If not, see <http://www.gnu.org/licenses/>.
1003 +# As a special exception, the respective Autoconf Macro's copyright owner
1004 +# gives unlimited permission to copy, distribute and modify the configure
1005 +# scripts that are the output of Autoconf when processing the Macro. You
1006 +# need not follow the terms of the GNU General Public License when using
1007 +# or distributing such scripts, even though portions of the text of the
1008 +# Macro appear in them. The GNU General Public License (GPL) does govern
1009 +# all other use of the material that constitutes the Autoconf Macro.
1011 +# This special exception to the GPL applies to versions of the Autoconf
1012 +# Macro released by the Autoconf Archive. When you make and distribute a
1013 +# modified version of the Autoconf Macro, you may extend this special
1014 +# exception to the GPL to apply to your modified version as well.
1018 +AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
1019 +AC_DEFUN([AX_WITH_CURSES], [
1020 + AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses])
1021 + AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
1022 + [force the use of Ncurses or NcursesW])],
1023 + [], [with_ncurses=check])
1024 + AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw],
1025 + [do not use NcursesW (wide character support)])],
1026 + [], [with_ncursesw=check])
1028 + ax_saved_LIBS=$LIBS
1029 + AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
1030 + [ax_with_plaincurses=no], [ax_with_plaincurses=check])
1032 + ax_cv_curses_which=no
1034 + # Test for NcursesW
1036 + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [
1037 + LIBS="$ax_saved_LIBS -lncursesw"
1039 + AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [
1040 + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
1041 + [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no])
1043 + AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
1044 + AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
1047 + AS_IF([test "x$ax_cv_ncursesw" = xyes], [
1049 + ax_cv_curses_which=ncursesw
1050 + CURSES_LIB="-lncursesw"
1051 + AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
1052 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
1054 + AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [
1055 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1056 + @%:@define _XOPEN_SOURCE_EXTENDED 1
1057 + @%:@include <ncursesw/curses.h>
1059 + chtype a = A_BOLD;
1061 + chtype c = COLOR_PAIR(1) & A_COLOR;
1062 + attr_t d = WA_NORMAL;
1065 + int g = getattrs(stdscr);
1066 + int h = getcurx(stdscr) + getmaxx(stdscr);
1068 + init_pair(1, COLOR_WHITE, COLOR_RED);
1069 + wattr_set(stdscr, d, 0, NULL);
1070 + wget_wch(stdscr, &f);
1072 + [ax_cv_header_ncursesw_curses_h=yes],
1073 + [ax_cv_header_ncursesw_curses_h=no])
1075 + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [
1076 + ax_cv_curses_enhanced=yes
1077 + ax_cv_curses_color=yes
1078 + ax_cv_curses_obsolete=yes
1079 + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
1080 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1081 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1082 + AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if <ncursesw/curses.h> is present])
1085 + AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [
1086 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1087 + @%:@define _XOPEN_SOURCE_EXTENDED 1
1088 + @%:@include <ncursesw.h>
1090 + chtype a = A_BOLD;
1092 + chtype c = COLOR_PAIR(1) & A_COLOR;
1093 + attr_t d = WA_NORMAL;
1096 + int g = getattrs(stdscr);
1097 + int h = getcurx(stdscr) + getmaxx(stdscr);
1099 + init_pair(1, COLOR_WHITE, COLOR_RED);
1100 + wattr_set(stdscr, d, 0, NULL);
1101 + wget_wch(stdscr, &f);
1103 + [ax_cv_header_ncursesw_h=yes],
1104 + [ax_cv_header_ncursesw_h=no])
1106 + AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [
1107 + ax_cv_curses_enhanced=yes
1108 + ax_cv_curses_color=yes
1109 + ax_cv_curses_obsolete=yes
1110 + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
1111 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1112 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1113 + AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if <ncursesw.h> is present])
1116 + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [
1117 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1118 + @%:@define _XOPEN_SOURCE_EXTENDED 1
1119 + @%:@include <ncurses.h>
1121 + chtype a = A_BOLD;
1123 + chtype c = COLOR_PAIR(1) & A_COLOR;
1124 + attr_t d = WA_NORMAL;
1127 + int g = getattrs(stdscr);
1128 + int h = getcurx(stdscr) + getmaxx(stdscr);
1130 + init_pair(1, COLOR_WHITE, COLOR_RED);
1131 + wattr_set(stdscr, d, 0, NULL);
1132 + wget_wch(stdscr, &f);
1134 + [ax_cv_header_ncurses_h_with_ncursesw=yes],
1135 + [ax_cv_header_ncurses_h_with_ncursesw=no])
1137 + AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [
1138 + ax_cv_curses_enhanced=yes
1139 + ax_cv_curses_color=yes
1140 + ax_cv_curses_obsolete=yes
1141 + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
1142 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1143 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1144 + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
1147 + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [
1148 + AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h])
1153 + # Test for Ncurses
1155 + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
1156 + LIBS="$ax_saved_LIBS -lncurses"
1158 + AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [
1159 + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
1160 + [ax_cv_ncurses=yes], [ax_cv_ncurses=no])
1162 + AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
1163 + AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
1166 + AS_IF([test "x$ax_cv_ncurses" = xyes], [
1168 + ax_cv_curses_which=ncurses
1169 + CURSES_LIB="-lncurses"
1170 + AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
1171 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
1173 + AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [
1174 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1175 + @%:@include <ncurses/curses.h>
1177 + chtype a = A_BOLD;
1179 + chtype c = COLOR_PAIR(1) & A_COLOR;
1180 + int g = getattrs(stdscr);
1181 + int h = getcurx(stdscr) + getmaxx(stdscr);
1183 + init_pair(1, COLOR_WHITE, COLOR_RED);
1185 + [ax_cv_header_ncurses_curses_h=yes],
1186 + [ax_cv_header_ncurses_curses_h=no])
1188 + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [
1189 + ax_cv_curses_color=yes
1190 + ax_cv_curses_obsolete=yes
1191 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1192 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1193 + AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if <ncurses/curses.h> is present])
1196 + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [
1197 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1198 + @%:@include <ncurses.h>
1200 + chtype a = A_BOLD;
1202 + chtype c = COLOR_PAIR(1) & A_COLOR;
1203 + int g = getattrs(stdscr);
1204 + int h = getcurx(stdscr) + getmaxx(stdscr);
1206 + init_pair(1, COLOR_WHITE, COLOR_RED);
1208 + [ax_cv_header_ncurses_h=yes],
1209 + [ax_cv_header_ncurses_h=no])
1211 + AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [
1212 + ax_cv_curses_color=yes
1213 + ax_cv_curses_obsolete=yes
1214 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1215 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1216 + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
1219 + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [
1220 + AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h])
1225 + # Test for plain Curses (or if CURSES_LIB was set by user)
1227 + AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
1228 + AS_IF([test "x$CURSES_LIB" != x], [
1229 + LIBS="$ax_saved_LIBS $CURSES_LIB"
1231 + LIBS="$ax_saved_LIBS -lcurses"
1234 + AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [
1235 + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
1236 + [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no])
1239 + AS_IF([test "x$ax_cv_plaincurses" = xyes], [
1241 + ax_cv_curses_which=plaincurses
1242 + AS_IF([test "x$CURSES_LIB" = x], [
1243 + CURSES_LIB="-lcurses"
1245 + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
1247 + # Check for base conformance (and header file)
1249 + AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [
1250 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1251 + @%:@include <curses.h>
1253 + chtype a = A_BOLD;
1257 + [ax_cv_header_curses_h=yes],
1258 + [ax_cv_header_curses_h=no])
1260 + AS_IF([test "x$ax_cv_header_curses_h" = xyes], [
1261 + AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])
1263 + # Check for X/Open Enhanced conformance
1265 + AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [
1266 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1267 + @%:@define _XOPEN_SOURCE_EXTENDED 1
1268 + @%:@include <curses.h>
1269 + @%:@ifndef _XOPEN_CURSES
1270 + @%:@error "this Curses library is not enhanced"
1271 + "this Curses library is not enhanced"
1274 + chtype a = A_BOLD;
1276 + chtype c = COLOR_PAIR(1) & A_COLOR;
1277 + attr_t d = WA_NORMAL;
1281 + init_pair(1, COLOR_WHITE, COLOR_RED);
1282 + wattr_set(stdscr, d, 0, NULL);
1283 + wget_wch(stdscr, &f);
1285 + [ax_cv_plaincurses_enhanced=yes],
1286 + [ax_cv_plaincurses_enhanced=no])
1288 + AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [
1289 + ax_cv_curses_enhanced=yes
1290 + ax_cv_curses_color=yes
1291 + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
1292 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1295 + # Check for color functions
1297 + AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [
1298 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1299 + @%:@define _XOPEN_SOURCE_EXTENDED 1
1300 + @%:@include <curses.h>
1302 + chtype a = A_BOLD;
1304 + chtype c = COLOR_PAIR(1) & A_COLOR;
1306 + init_pair(1, COLOR_WHITE, COLOR_RED);
1308 + [ax_cv_plaincurses_color=yes],
1309 + [ax_cv_plaincurses_color=no])
1311 + AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [
1312 + ax_cv_curses_color=yes
1313 + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
1316 + # Check for obsolete functions
1318 + AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [
1319 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1320 + @%:@include <curses.h>
1322 + chtype a = A_BOLD;
1324 + int g = getattrs(stdscr);
1325 + int h = getcurx(stdscr) + getmaxx(stdscr);
1328 + [ax_cv_plaincurses_obsolete=yes],
1329 + [ax_cv_plaincurses_obsolete=no])
1331 + AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [
1332 + ax_cv_curses_obsolete=yes
1333 + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
1337 + AS_IF([test "x$ax_cv_header_curses_h" = xno], [
1338 + AC_MSG_WARN([could not find a working curses.h])
1343 + AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no])
1344 + AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no])
1345 + AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no])
1346 + AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
1348 + LIBS=$ax_saved_LIBS
1350 diff --git a/autotools/softether.am b/autotools/softether.am
1351 new file mode 100644
1352 index 00000000..e5e91eeb
1354 +++ b/autotools/softether.am
1356 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1358 +# This file is part of SoftEther.
1360 +# SoftEther is free software: you can redistribute it and/or modify it under
1361 +# the terms of the GNU General Public License as published by the Free
1362 +# Software Foundation, either version 2 of the License, or (at your option)
1363 +# any later version.
1365 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1366 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1367 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1370 +# You should have received a copy of the GNU General Public License along with
1371 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1374 +if CONFIGURE_ENABLE_DEBUG
1375 +DEBUG_CFLAGS = -g -D_DEBUG -DDEBUG
1377 +DEBUG_CFLAGS = -DNDEBUG -DVPN_SPEED
1382 + -I$(top_srcdir)/src \
1383 + -I$(top_srcdir)/src/Mayaqua \
1384 + -I$(top_srcdir)/src/Cedar \
1393 + -D_FILE_OFFSET_BITS=64 \
1395 diff --git a/configure.ac b/configure.ac
1396 new file mode 100644
1397 index 00000000..4a3fc2ba
1401 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1403 +# This file is part of SoftEther.
1405 +# SoftEther is free software: you can redistribute it and/or modify it under
1406 +# the terms of the GNU General Public License as published by the Free
1407 +# Software Foundation, either version 2 of the License, or (at your option)
1408 +# any later version.
1410 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1411 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1412 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1415 +# You should have received a copy of the GNU General Public License along with
1416 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1419 +AC_INIT([SoftEther], [1], [http://www.vpnusers.com/], [softether], [http://www.softether.org/])
1420 +AC_CONFIG_AUX_DIR([autotools])
1421 +AC_CONFIG_MACRO_DIR([autotools])
1422 +AM_INIT_AUTOMAKE([foreign -Wall -Werror])
1426 +AC_CONFIG_HEADERS([softether_config.h])
1430 + src/Mayaqua/Makefile
1431 + src/Cedar/Makefile
1432 + src/hamcorebuilder/Makefile
1433 + src/bin/hamcore/Makefile
1434 + src/vpnserver/Makefile
1435 + src/vpnclient/Makefile
1436 + src/vpnbridge/Makefile
1437 + src/vpncmd/Makefile
1443 + AS_HELP_STRING([--enable-debug], [build SoftEther with debugging features]),
1446 +AM_CONDITIONAL([CONFIGURE_ENABLE_DEBUG], [test _"$debug" = _yes])
1450 + AC_SUBST(PTHREAD_CC)
1451 + AC_SUBST(PTHREAD_CFLAGS)
1452 + AC_SUBST(PTHREAD_LIBS)
1454 + AC_MSG_ERROR([pthread capabilities not found])
1458 +CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1459 +LIBS="$PTHREAD_LIBS $LIBS"
1463 + AC_SUBST(OPENSSL_LIBS)
1464 + AC_SUBST(OPENSSL_LDFLAGS)
1466 + AC_MSG_ERROR([openssl not found])
1469 +LIBS="$LIBS $OPENSSL_LIBS"
1470 +LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
1473 +# This macro automatically updates build variables.
1474 +AX_CHECK_ZLIB(, AC_MSG_ERROR([zlib not found]))
1478 +if test "_$ax_cv_curses" != _yes
1480 + AC_MSG_ERROR([libcurses, libncurses, or libncursesw not found])
1482 + AC_SUBST(CURSES_LIB)
1483 + LIBS="$LIBS $CURSES_LIB"
1488 +if test "_$ax_cv_lib_readline" = _no
1490 + AC_MSG_ERROR([libreadline not found])
1492 + : This macro automatically updates build variables.
1497 --- a/configure 2017-07-16 04:53:31.000000000 +0200
1498 +++ b/configure 1970-01-01 01:00:00.000000000 +0100
1502 -echo '---------------------------------------------------------------------'
1503 -echo 'SoftEther VPN for Unix'
1505 -echo 'Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.'
1506 -echo 'Copyright (c) Daiyuu Nobori. All Rights Reserved.'
1508 -echo 'This program is free software; you can redistribute it and/or'
1509 -echo 'modify it under the terms of the GNU General Public License'
1510 -echo 'version 2 as published by the Free Software Foundation.'
1512 -echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
1513 -echo '---------------------------------------------------------------------'
1516 -echo 'Welcome to the corner-cutting configure script !'
1520 -case "`uname -s`" in
1537 - echo 'Select your operating system below:'
1539 - echo ' 2: FreeBSD'
1540 - echo ' 3: Solaris'
1541 - echo ' 4: Mac OS X'
1542 - echo ' 5: OpenBSD'
1544 - echo -n 'Which is your operating system (1 - 5) ? : '
1547 - if test "$TMP" = "1"
1551 - if test "$TMP" = "2"
1555 - if test "$TMP" = "3"
1559 - if test "$TMP" = "4"
1563 - if test "$TMP" = "5"
1568 - if test "$OS" = ""
1570 - echo "Wrong number."
1577 -case "`uname -m`" in
1578 -x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
1581 -i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
1585 - echo 'Select your CPU bits below:'
1589 - echo -n 'Which is the type of your CPU (1 - 2) ? : '
1592 - if test "$TMP" = "1"
1596 - if test "$TMP" = "2"
1601 - if test "$CPU" = ""
1603 - echo "Wrong number."
1609 -cp src/makefiles/${OS}_${CPU}.mak Makefile
1611 -echo "The Makefile is generated. Run 'make' to build SoftEther VPN."
1612 --- a/manual_configure 1970-01-01 01:00:00.000000000 +0100
1613 +++ b/manual_configure 2017-07-16 04:53:31.000000000 +0200
1617 +echo '---------------------------------------------------------------------'
1618 +echo 'SoftEther VPN for Unix'
1620 +echo 'Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.'
1621 +echo 'Copyright (c) Daiyuu Nobori. All Rights Reserved.'
1623 +echo 'This program is free software; you can redistribute it and/or'
1624 +echo 'modify it under the terms of the GNU General Public License'
1625 +echo 'version 2 as published by the Free Software Foundation.'
1627 +echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
1628 +echo '---------------------------------------------------------------------'
1631 +echo 'Welcome to the corner-cutting configure script !'
1635 +case "`uname -s`" in
1652 + echo 'Select your operating system below:'
1654 + echo ' 2: FreeBSD'
1655 + echo ' 3: Solaris'
1656 + echo ' 4: Mac OS X'
1657 + echo ' 5: OpenBSD'
1659 + echo -n 'Which is your operating system (1 - 5) ? : '
1662 + if test "$TMP" = "1"
1666 + if test "$TMP" = "2"
1670 + if test "$TMP" = "3"
1674 + if test "$TMP" = "4"
1678 + if test "$TMP" = "5"
1683 + if test "$OS" = ""
1685 + echo "Wrong number."
1692 +case "`uname -m`" in
1693 +x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
1696 +i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
1700 + echo 'Select your CPU bits below:'
1704 + echo -n 'Which is the type of your CPU (1 - 2) ? : '
1707 + if test "$TMP" = "1"
1711 + if test "$TMP" = "2"
1716 + if test "$CPU" = ""
1718 + echo "Wrong number."
1724 +cp src/makefiles/${OS}_${CPU}.mak Makefile
1726 +echo "The Makefile is generated. Run 'make' to build SoftEther VPN."
1727 diff --git a/src/Cedar/Makefile.am b/src/Cedar/Makefile.am
1728 new file mode 100644
1729 index 00000000..5346537d
1731 +++ b/src/Cedar/Makefile.am
1733 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1735 +# This file is part of SoftEther.
1737 +# SoftEther is free software: you can redistribute it and/or modify it under
1738 +# the terms of the GNU General Public License as published by the Free
1739 +# Software Foundation, either version 2 of the License, or (at your option)
1740 +# any later version.
1742 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1743 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1744 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1747 +# You should have received a copy of the GNU General Public License along with
1748 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1751 +include $(top_srcdir)/autotools/softether.am
1753 +noinst_LTLIBRARIES = libcedar.la
1755 +libcedar_la_SOURCES = \
1775 + Interop_OpenVPN.c \
1780 + IPsec_IkePacket.c \
1815 diff --git a/src/Makefile.am b/src/Makefile.am
1816 new file mode 100644
1817 index 00000000..dc745426
1819 +++ b/src/Makefile.am
1821 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1823 +# This file is part of SoftEther.
1825 +# SoftEther is free software: you can redistribute it and/or modify it under
1826 +# the terms of the GNU General Public License as published by the Free
1827 +# Software Foundation, either version 2 of the License, or (at your option)
1828 +# any later version.
1830 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1831 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1832 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1835 +# You should have received a copy of the GNU General Public License along with
1836 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1839 +# These components are built as libtool convenience libraries.
1840 +SUBDIRS = Mayaqua Cedar
1842 +# This is a nodist helper.
1843 +SUBDIRS += hamcorebuilder
1845 +# These are final build products.
1846 +SUBDIRS += bin/hamcore vpnserver vpnclient vpnbridge vpncmd
1847 diff --git a/src/Mayaqua/Makefile.am b/src/Mayaqua/Makefile.am
1848 new file mode 100644
1849 index 00000000..6b8dc1a6
1851 +++ b/src/Mayaqua/Makefile.am
1853 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1855 +# This file is part of SoftEther.
1857 +# SoftEther is free software: you can redistribute it and/or modify it under
1858 +# the terms of the GNU General Public License as published by the Free
1859 +# Software Foundation, either version 2 of the License, or (at your option)
1860 +# any later version.
1862 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1863 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1864 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1867 +# You should have received a copy of the GNU General Public License along with
1868 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1871 +include $(top_srcdir)/autotools/softether.am
1873 +noinst_LTLIBRARIES = libmayaqua.la
1875 +libmayaqua_la_SOURCES = \
1896 diff --git a/src/bin/hamcore/Makefile.am b/src/bin/hamcore/Makefile.am
1897 new file mode 100644
1898 index 00000000..37b0291e
1900 +++ b/src/bin/hamcore/Makefile.am
1902 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1904 +# This file is part of SoftEther.
1906 +# SoftEther is free software: you can redistribute it and/or modify it under
1907 +# the terms of the GNU General Public License as published by the Free
1908 +# Software Foundation, either version 2 of the License, or (at your option)
1909 +# any later version.
1911 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1912 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1913 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1916 +# You should have received a copy of the GNU General Public License along with
1917 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1920 +include $(top_srcdir)/autotools/softether.am
1922 +# This is required to use a custom build rule with -Wall and -Werror enabled.
1923 +AUTOMAKE_OPTIONS = -Wno-override
1925 +HAMCOREBUILDER = $(top_builddir)/src/hamcorebuilder/hamcorebuilder
1927 +sbin_PROGRAMS = hamcore.se2
1929 +hamcore.se2$(EXEEXT): $(HAMCOREBUILDER)
1930 + $(HAMCOREBUILDER) $(top_srcdir)/src/bin/hamcore $@
1931 diff --git a/src/hamcorebuilder/Makefile.am b/src/hamcorebuilder/Makefile.am
1932 new file mode 100644
1933 index 00000000..a22429f0
1935 +++ b/src/hamcorebuilder/Makefile.am
1937 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1939 +# This file is part of SoftEther.
1941 +# SoftEther is free software: you can redistribute it and/or modify it under
1942 +# the terms of the GNU General Public License as published by the Free
1943 +# Software Foundation, either version 2 of the License, or (at your option)
1944 +# any later version.
1946 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1947 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1948 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1951 +# You should have received a copy of the GNU General Public License along with
1952 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1955 +include $(top_srcdir)/autotools/softether.am
1957 +noinst_PROGRAMS = \
1960 +hamcorebuilder_SOURCES = \
1963 +hamcorebuilder_LDADD = \
1964 + $(top_builddir)/src/Mayaqua/libmayaqua.la \
1965 + $(top_builddir)/src/Cedar/libcedar.la
1966 diff --git a/src/vpnbridge/Makefile.am b/src/vpnbridge/Makefile.am
1967 new file mode 100644
1968 index 00000000..35fe043d
1970 +++ b/src/vpnbridge/Makefile.am
1972 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1974 +# This file is part of SoftEther.
1976 +# SoftEther is free software: you can redistribute it and/or modify it under
1977 +# the terms of the GNU General Public License as published by the Free
1978 +# Software Foundation, either version 2 of the License, or (at your option)
1979 +# any later version.
1981 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
1982 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1983 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1986 +# You should have received a copy of the GNU General Public License along with
1987 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
1990 +include $(top_srcdir)/autotools/softether.am
1995 +vpnbridge_SOURCES = \
1998 +vpnbridge_LDADD = \
1999 + $(top_builddir)/src/Mayaqua/libmayaqua.la \
2000 + $(top_builddir)/src/Cedar/libcedar.la
2001 diff --git a/src/vpnclient/Makefile.am b/src/vpnclient/Makefile.am
2002 new file mode 100644
2003 index 00000000..1aa55330
2005 +++ b/src/vpnclient/Makefile.am
2007 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2009 +# This file is part of SoftEther.
2011 +# SoftEther is free software: you can redistribute it and/or modify it under
2012 +# the terms of the GNU General Public License as published by the Free
2013 +# Software Foundation, either version 2 of the License, or (at your option)
2014 +# any later version.
2016 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
2017 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2018 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
2021 +# You should have received a copy of the GNU General Public License along with
2022 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
2025 +include $(top_srcdir)/autotools/softether.am
2030 +vpnclient_SOURCES = \
2033 +vpnclient_LDADD = \
2034 + $(top_builddir)/src/Mayaqua/libmayaqua.la \
2035 + $(top_builddir)/src/Cedar/libcedar.la
2036 diff --git a/src/vpncmd/Makefile.am b/src/vpncmd/Makefile.am
2037 new file mode 100644
2038 index 00000000..d8042aa2
2040 +++ b/src/vpncmd/Makefile.am
2042 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2044 +# This file is part of SoftEther.
2046 +# SoftEther is free software: you can redistribute it and/or modify it under
2047 +# the terms of the GNU General Public License as published by the Free
2048 +# Software Foundation, either version 2 of the License, or (at your option)
2049 +# any later version.
2051 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
2052 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2053 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
2056 +# You should have received a copy of the GNU General Public License along with
2057 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
2060 +include $(top_srcdir)/autotools/softether.am
2069 + $(top_builddir)/src/Mayaqua/libmayaqua.la \
2070 + $(top_builddir)/src/Cedar/libcedar.la
2071 diff --git a/src/vpnserver/Makefile.am b/src/vpnserver/Makefile.am
2072 new file mode 100644
2073 index 00000000..c1c33570
2075 +++ b/src/vpnserver/Makefile.am
2077 +# Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2079 +# This file is part of SoftEther.
2081 +# SoftEther is free software: you can redistribute it and/or modify it under
2082 +# the terms of the GNU General Public License as published by the Free
2083 +# Software Foundation, either version 2 of the License, or (at your option)
2084 +# any later version.
2086 +# SoftEther is distributed in the hope that it will be useful, but WITHOUT ANY
2087 +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2088 +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
2091 +# You should have received a copy of the GNU General Public License along with
2092 +# SoftEther. If not, see <http://www.gnu.org/licenses/>.
2095 +include $(top_srcdir)/autotools/softether.am
2100 +vpnserver_SOURCES = \
2103 +vpnserver_LDADD = \
2104 + $(top_builddir)/src/Mayaqua/libmayaqua.la \
2105 + $(top_builddir)/src/Cedar/libcedar.la