]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/softether/0001-Create-autotools-plumbing-for-SoftEther.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / softether / 0001-Create-autotools-plumbing-for-SoftEther.patch
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.
5
6 Add autoconf and automake capabilities to SoftEther so that it can be built
7 like this:
8
9         # autoreconf --force --install
10         # ./configure
11         # make install DESTDIR=/tmp/softether
12
13 All standard configure parameters are supported, plus:
14
15         # ./configure --enable-debug
16
17 Autotools support makes porting, cross compiling, and optimization much easier.
18
19 These GNU autoconf-archive components are used for dependency checking:
20
21   * ax_check_openssl.m4
22   * ax_check_zlib.m4
23   * ax_lib_readline.m4
24   * ax_pthread.m4
25   * ax_with_curses.m4
26
27 NB: http://www.gnu.org/software/autoconf-archive/
28
29 [Upstream commit: https://github.com/dajhorn/SoftEtherVPN/commit/c5e5d7e93c6f3302adf5821c29c4efdb7630e418]
30 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
31 ---
32  Makefile.am                    |  21 ++
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
69
70 diff --git a/Makefile.am b/Makefile.am
71 new file mode 100644
72 index 00000000..aa73b2ba
73 --- /dev/null
74 +++ b/Makefile.am
75 @@ -0,0 +1,21 @@
76 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
77 +#
78 +#  This file is part of SoftEther.
79 +#
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)
83 +#  any later version.
84 +#
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
88 +#  details.
89 +#
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/>.
92 +
93 +
94 +ACLOCAL_AMFLAGS = -I autotools
95 +include $(top_srcdir)/autotools/softether.am
96 +SUBDIRS = src
97 diff --git a/autotools/ax_check_openssl.m4 b/autotools/ax_check_openssl.m4
98 new file mode 100644
99 index 00000000..a87c5a6b
100 --- /dev/null
101 +++ b/autotools/ax_check_openssl.m4
102 @@ -0,0 +1,124 @@
103 +# ===========================================================================
104 +#     http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
105 +# ===========================================================================
106 +#
107 +# SYNOPSIS
108 +#
109 +#   AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
110 +#
111 +# DESCRIPTION
112 +#
113 +#   Look for OpenSSL in a number of default spots, or in a user-selected
114 +#   spot (via --with-openssl).  Sets
115 +#
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
119 +#
120 +#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
121 +#
122 +#   This macro sets OPENSSL_INCLUDES such that source files should use the
123 +#   openssl/ directory in include directives:
124 +#
125 +#     #include <openssl/hmac.h>
126 +#
127 +# LICENSE
128 +#
129 +#   Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
130 +#   Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
131 +#
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
135 +#   warranty.
136 +
137 +#serial 8
138 +
139 +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
140 +AC_DEFUN([AX_CHECK_OPENSSL], [
141 +    found=false
142 +    AC_ARG_WITH([openssl],
143 +        [AS_HELP_STRING([--with-openssl=DIR],
144 +            [root of the OpenSSL directory])],
145 +        [
146 +            case "$withval" in
147 +            "" | y | ye | yes | n | no)
148 +            AC_MSG_ERROR([Invalid --with-openssl value])
149 +              ;;
150 +            *) ssldirs="$withval"
151 +              ;;
152 +            esac
153 +        ], [
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`
162 +                    found=true
163 +                fi
164 +            fi
165 +
166 +            # no such luck; use some default ssldirs
167 +            if ! $found; then
168 +                ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
169 +            fi
170 +        ]
171 +        )
172 +
173 +
174 +    # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
175 +    # an 'openssl' subdirectory
176 +
177 +    if ! $found; then
178 +        OPENSSL_INCLUDES=
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"
185 +                found=true
186 +                AC_MSG_RESULT([yes])
187 +                break
188 +            else
189 +                AC_MSG_RESULT([no])
190 +            fi
191 +        done
192 +
193 +        # if the file wasn't found, well, go ahead and try the link anyway -- maybe
194 +        # it will just work!
195 +    fi
196 +
197 +    # try the preprocessor and linker with our new flags,
198 +    # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
199 +
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
203 +
204 +    save_LIBS="$LIBS"
205 +    save_LDFLAGS="$LDFLAGS"
206 +    save_CPPFLAGS="$CPPFLAGS"
207 +    LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
208 +    LIBS="$OPENSSL_LIBS $LIBS"
209 +    CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
210 +    AC_LINK_IFELSE(
211 +        [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
212 +        [
213 +            AC_MSG_RESULT([yes])
214 +            $1
215 +        ], [
216 +            AC_MSG_RESULT([no])
217 +            $2
218 +        ])
219 +    CPPFLAGS="$save_CPPFLAGS"
220 +    LDFLAGS="$save_LDFLAGS"
221 +    LIBS="$save_LIBS"
222 +
223 +    AC_SUBST([OPENSSL_INCLUDES])
224 +    AC_SUBST([OPENSSL_LIBS])
225 +    AC_SUBST([OPENSSL_LDFLAGS])
226 +])
227 diff --git a/autotools/ax_check_zlib.m4 b/autotools/ax_check_zlib.m4
228 new file mode 100644
229 index 00000000..ae5705f6
230 --- /dev/null
231 +++ b/autotools/ax_check_zlib.m4
232 @@ -0,0 +1,142 @@
233 +# ===========================================================================
234 +#       http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
235 +# ===========================================================================
236 +#
237 +# SYNOPSIS
238 +#
239 +#   AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
240 +#
241 +# DESCRIPTION
242 +#
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.
248 +#
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.
253 +#
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
260 +#   follows:
261 +#
262 +#     #ifdef HAVE_LIBZ
263 +#     #include <zlib.h>
264 +#     #endif /* HAVE_LIBZ */
265 +#
266 +# LICENSE
267 +#
268 +#   Copyright (c) 2008 Loic Dachary <loic@senga.org>
269 +#   Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
270 +#
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.
275 +#
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.
280 +#
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/>.
283 +#
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.
291 +#
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.
296 +
297 +#serial 14
298 +
299 +AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
300 +AC_DEFUN([AX_CHECK_ZLIB],
301 +#
302 +# Handle user hints
303 +#
304 +[AC_MSG_CHECKING(if zlib is wanted)
305 +zlib_places="/usr/local /usr /opt/local /sw"
306 +AC_ARG_WITH([zlib],
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
311 +  AC_MSG_RESULT(yes)
312 +  if test -d "$withval"
313 +  then
314 +    zlib_places="$withval $zlib_places"
315 +  else
316 +    AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
317 +  fi
318 +else
319 +  zlib_places=
320 +  AC_MSG_RESULT(no)
321 +fi],
322 +[AC_MSG_RESULT(yes)])
323 +
324 +#
325 +# Locate zlib, if wanted
326 +#
327 +if test -n "${zlib_places}"
328 +then
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
334 +         ZLIB_HOME=""
335 +       done
336 +
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"
342 +  fi
343 +  AC_LANG_SAVE
344 +  AC_LANG_C
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])
347 +  AC_LANG_RESTORE
348 +  if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
349 +  then
350 +    #
351 +    # If both library and header were found, action-if-found
352 +    #
353 +    m4_ifblank([$1],[
354 +                CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
355 +                LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
356 +                LIBS="-lz $LIBS"
357 +                AC_DEFINE([HAVE_LIBZ], [1],
358 +                          [Define to 1 if you have `z' library (-lz)])
359 +               ],[
360 +                # Restore variables
361 +                LDFLAGS="$ZLIB_OLD_LDFLAGS"
362 +                CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
363 +                $1
364 +               ])
365 +  else
366 +    #
367 +    # If either header or library was not found, action-if-not-found
368 +    #
369 +    m4_default([$2],[
370 +                AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
371 +                ])
372 +  fi
373 +fi
374 +])
375 diff --git a/autotools/ax_lib_readline.m4 b/autotools/ax_lib_readline.m4
376 new file mode 100644
377 index 00000000..056f25c2
378 --- /dev/null
379 +++ b/autotools/ax_lib_readline.m4
380 @@ -0,0 +1,107 @@
381 +# ===========================================================================
382 +#      http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
383 +# ===========================================================================
384 +#
385 +# SYNOPSIS
386 +#
387 +#   AX_LIB_READLINE
388 +#
389 +# DESCRIPTION
390 +#
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.
397 +#
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.
402 +#
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:
405 +#
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) */
416 +#       /* no readline */
417 +#     #endif /* HAVE_LIBREADLINE */
418 +#
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) */
429 +#       /* no history */
430 +#     #endif /* HAVE_READLINE_HISTORY */
431 +#
432 +# LICENSE
433 +#
434 +#   Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
435 +#
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
439 +#   warranty.
440 +
441 +#serial 6
442 +
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, [
447 +    ORIG_LIBS="$LIBS"
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"
452 +        else
453 +          TRY_LIB="-l$readline_lib -l$termcap_lib"
454 +        fi
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
458 +          break
459 +        fi
460 +      done
461 +      if test -n "$ax_cv_lib_readline"; then
462 +        break
463 +      fi
464 +    done
465 +    if test -z "$ax_cv_lib_readline"; then
466 +      ax_cv_lib_readline="no"
467 +    fi
468 +    LIBS="$ORIG_LIBS"
469 +  ])
470 +
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")
480 +    ])
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)
485 +    fi
486 +  fi
487 +])dnl
488 diff --git a/autotools/ax_pthread.m4 b/autotools/ax_pthread.m4
489 new file mode 100644
490 index 00000000..d383ad5c
491 --- /dev/null
492 +++ b/autotools/ax_pthread.m4
493 @@ -0,0 +1,332 @@
494 +# ===========================================================================
495 +#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
496 +# ===========================================================================
497 +#
498 +# SYNOPSIS
499 +#
500 +#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
501 +#
502 +# DESCRIPTION
503 +#
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.)
509 +#
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.)
513 +#
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
517 +#
518 +#   If you are only building threads programs, you may wish to use these
519 +#   variables in your default LIBS, CFLAGS, and CC:
520 +#
521 +#     LIBS="$PTHREAD_LIBS $LIBS"
522 +#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
523 +#     CC="$PTHREAD_CC"
524 +#
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).
528 +#
529 +#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
530 +#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
531 +#   PTHREAD_CFLAGS.
532 +#
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.
537 +#
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.
544 +#
545 +#   Updated for Autoconf 2.68 by Daniel Richard G.
546 +#
547 +# LICENSE
548 +#
549 +#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
550 +#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
551 +#
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.
556 +#
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.
561 +#
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/>.
564 +#
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.
572 +#
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.
577 +
578 +#serial 21
579 +
580 +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
581 +AC_DEFUN([AX_PTHREAD], [
582 +AC_REQUIRE([AC_CANONICAL_HOST])
583 +AC_LANG_PUSH([C])
584 +ax_pthread_ok=no
585 +
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.
589 +
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
592 +# them:
593 +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
594 +        save_CFLAGS="$CFLAGS"
595 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
596 +        save_LIBS="$LIBS"
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
602 +                PTHREAD_LIBS=""
603 +                PTHREAD_CFLAGS=""
604 +        fi
605 +        LIBS="$save_LIBS"
606 +        CFLAGS="$save_CFLAGS"
607 +fi
608 +
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).
613 +
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.
618 +
619 +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
620 +
621 +# The ordering *is* (sometimes) important.  Some notes on the
622 +# individual items follow:
623 +
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)
640 +
641 +case ${host_os} in
642 +        solaris*)
643 +
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:
651 +
652 +        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
653 +        ;;
654 +
655 +        darwin*)
656 +        ax_pthread_flags="-pthread $ax_pthread_flags"
657 +        ;;
658 +esac
659 +
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.
663 +
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"
673 +
674 +if test x"$ax_pthread_ok" = xno; then
675 +for flag in $ax_pthread_flags; do
676 +
677 +        case $flag in
678 +                none)
679 +                AC_MSG_CHECKING([whether pthreads work without any flags])
680 +                ;;
681 +
682 +                -*)
683 +                AC_MSG_CHECKING([whether pthreads work with $flag])
684 +                PTHREAD_CFLAGS="$flag"
685 +                ;;
686 +
687 +                pthread-config)
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`"
692 +                ;;
693 +
694 +                *)
695 +                AC_MSG_CHECKING([for the pthreads library -l$flag])
696 +                PTHREAD_LIBS="-l$flag"
697 +                ;;
698 +        esac
699 +
700 +        save_LIBS="$LIBS"
701 +        save_CFLAGS="$CFLAGS"
702 +        LIBS="$PTHREAD_LIBS $LIBS"
703 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
704 +
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],
724 +                [])
725 +
726 +        LIBS="$save_LIBS"
727 +        CFLAGS="$save_CFLAGS"
728 +
729 +        AC_MSG_RESULT([$ax_pthread_ok])
730 +        if test "x$ax_pthread_ok" = xyes; then
731 +                break;
732 +        fi
733 +
734 +        PTHREAD_LIBS=""
735 +        PTHREAD_CFLAGS=""
736 +done
737 +fi
738 +
739 +# Various other checks:
740 +if test "x$ax_pthread_ok" = xyes; then
741 +        save_LIBS="$LIBS"
742 +        LIBS="$PTHREAD_LIBS $LIBS"
743 +        save_CFLAGS="$CFLAGS"
744 +        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
745 +
746 +        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
747 +        AC_MSG_CHECKING([for joinable pthread attribute])
748 +        attr_name=unknown
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],
753 +                [])
754 +        done
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.])
760 +        fi
761 +
762 +        AC_MSG_CHECKING([if more special flags are required for pthreads])
763 +        flag=no
764 +        case ${host_os} in
765 +            aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
766 +            osf* | hpux*) flag="-D_REENTRANT";;
767 +            solaris*)
768 +            if test "$GCC" = "yes"; then
769 +                flag="-D_REENTRANT"
770 +            else
771 +                # TODO: What about Clang on Solaris?
772 +                flag="-mt -D_REENTRANT"
773 +            fi
774 +            ;;
775 +        esac
776 +        AC_MSG_RESULT([$flag])
777 +        if test "x$flag" != xno; then
778 +            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
779 +        fi
780 +
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])
787 +            ])
788 +        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
789 +            [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
790 +
791 +        LIBS="$save_LIBS"
792 +        CFLAGS="$save_CFLAGS"
793 +
794 +        # More AIX lossage: compile with *_r variant
795 +        if test "x$GCC" != xyes; then
796 +            case $host_os in
797 +                aix*)
798 +                AS_CASE(["x/$CC"],
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
801 +                   AS_CASE(["x$CC"],
802 +                     [x/*],
803 +                     [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
804 +                     [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
805 +                ;;
806 +            esac
807 +        fi
808 +fi
809 +
810 +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
811 +
812 +AC_SUBST([PTHREAD_LIBS])
813 +AC_SUBST([PTHREAD_CFLAGS])
814 +AC_SUBST([PTHREAD_CC])
815 +
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])
819 +        :
820 +else
821 +        ax_pthread_ok=no
822 +        $2
823 +fi
824 +AC_LANG_POP
825 +])dnl AX_PTHREAD
826 diff --git a/autotools/ax_with_curses.m4 b/autotools/ax_with_curses.m4
827 new file mode 100644
828 index 00000000..e4cbd31b
829 --- /dev/null
830 +++ b/autotools/ax_with_curses.m4
831 @@ -0,0 +1,518 @@
832 +# ===========================================================================
833 +#      http://www.gnu.org/software/autoconf-archive/ax_with_curses.html
834 +# ===========================================================================
835 +#
836 +# SYNOPSIS
837 +#
838 +#   AX_WITH_CURSES
839 +#
840 +# DESCRIPTION
841 +#
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
846 +#   one returned.
847 +#
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:
853 +#
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
863 +#
864 +#   [*]  If the library is not found, abort the configure script.
865 +#
866 +#   [**] If the second library (Ncurses) is not found, abort configure.
867 +#
868 +#   The following preprocessor symbols may be defined by this macro if the
869 +#   appropriate conditions are met:
870 +#
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
877 +#
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
883 +#
884 +#   (These preprocessor symbols are discussed later in this document.)
885 +#
886 +#   The following output variable is defined by this macro; it is precious
887 +#   and may be overridden on the ./configure command line:
888 +#
889 +#     CURSES_LIB  - library to add to xxx_LDADD
890 +#
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:
894 +#
895 +#     prog_LDADD = @CURSES_LIB@
896 +#
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.
903 +#
904 +#   The following shell variables may be defined by this macro:
905 +#
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
910 +#
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"
915 +#
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:
919 +#
920 +#     AX_WITH_CURSES
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])
923 +#     fi
924 +#
925 +#   If any Curses library will do (but one must be present and must support
926 +#   color), you could use:
927 +#
928 +#     AX_WITH_CURSES
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])
931 +#     fi
932 +#
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.
938 +#
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.
945 +#
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
951 +#   NcursesW.
952 +#
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.
957 +#
958 +#   To use the HAVE_xxx_H preprocessor symbols, insert the following into
959 +#   your system.h (or equivalent) header file:
960 +#
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>
971 +#     #else
972 +#     #  error "SysV or X/Open-compatible Curses header file required"
973 +#     #endif
974 +#
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.
982 +#
983 +# LICENSE
984 +#
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>
989 +#
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.
994 +#
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.
999 +#
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/>.
1002 +#
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.
1010 +#
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.
1015 +
1016 +#serial 15
1017 +
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])
1027 +
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])
1031 +
1032 +    ax_cv_curses_which=no
1033 +
1034 +    # Test for NcursesW
1035 +
1036 +    AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [
1037 +        LIBS="$ax_saved_LIBS -lncursesw"
1038 +
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])
1042 +        ])
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])
1045 +        ])
1046 +
1047 +        AS_IF([test "x$ax_cv_ncursesw" = xyes], [
1048 +            ax_cv_curses=yes
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])
1053 +
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>
1058 +                    ]], [[
1059 +                        chtype a = A_BOLD;
1060 +                        int b = KEY_LEFT;
1061 +                        chtype c = COLOR_PAIR(1) & A_COLOR;
1062 +                        attr_t d = WA_NORMAL;
1063 +                        cchar_t e;
1064 +                        wint_t f;
1065 +                        int g = getattrs(stdscr);
1066 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1067 +                        initscr();
1068 +                        init_pair(1, COLOR_WHITE, COLOR_RED);
1069 +                        wattr_set(stdscr, d, 0, NULL);
1070 +                        wget_wch(stdscr, &f);
1071 +                    ]])],
1072 +                    [ax_cv_header_ncursesw_curses_h=yes],
1073 +                    [ax_cv_header_ncursesw_curses_h=no])
1074 +            ])
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])
1083 +            ])
1084 +
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>
1089 +                    ]], [[
1090 +                        chtype a = A_BOLD;
1091 +                        int b = KEY_LEFT;
1092 +                        chtype c = COLOR_PAIR(1) & A_COLOR;
1093 +                        attr_t d = WA_NORMAL;
1094 +                        cchar_t e;
1095 +                        wint_t f;
1096 +                        int g = getattrs(stdscr);
1097 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1098 +                        initscr();
1099 +                        init_pair(1, COLOR_WHITE, COLOR_RED);
1100 +                        wattr_set(stdscr, d, 0, NULL);
1101 +                        wget_wch(stdscr, &f);
1102 +                    ]])],
1103 +                    [ax_cv_header_ncursesw_h=yes],
1104 +                    [ax_cv_header_ncursesw_h=no])
1105 +            ])
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])
1114 +            ])
1115 +
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>
1120 +                    ]], [[
1121 +                        chtype a = A_BOLD;
1122 +                        int b = KEY_LEFT;
1123 +                        chtype c = COLOR_PAIR(1) & A_COLOR;
1124 +                        attr_t d = WA_NORMAL;
1125 +                        cchar_t e;
1126 +                        wint_t f;
1127 +                        int g = getattrs(stdscr);
1128 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1129 +                        initscr();
1130 +                        init_pair(1, COLOR_WHITE, COLOR_RED);
1131 +                        wattr_set(stdscr, d, 0, NULL);
1132 +                        wget_wch(stdscr, &f);
1133 +                    ]])],
1134 +                    [ax_cv_header_ncurses_h_with_ncursesw=yes],
1135 +                    [ax_cv_header_ncurses_h_with_ncursesw=no])
1136 +            ])
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])
1145 +            ])
1146 +
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])
1149 +            ])
1150 +        ])
1151 +    ])
1152 +
1153 +    # Test for Ncurses
1154 +
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"
1157 +
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])
1161 +        ])
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])
1164 +        ])
1165 +
1166 +        AS_IF([test "x$ax_cv_ncurses" = xyes], [
1167 +            ax_cv_curses=yes
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])
1172 +
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>
1176 +                    ]], [[
1177 +                        chtype a = A_BOLD;
1178 +                        int b = KEY_LEFT;
1179 +                        chtype c = COLOR_PAIR(1) & A_COLOR;
1180 +                        int g = getattrs(stdscr);
1181 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1182 +                        initscr();
1183 +                        init_pair(1, COLOR_WHITE, COLOR_RED);
1184 +                    ]])],
1185 +                    [ax_cv_header_ncurses_curses_h=yes],
1186 +                    [ax_cv_header_ncurses_curses_h=no])
1187 +            ])
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])
1194 +            ])
1195 +
1196 +            AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [
1197 +                AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1198 +                        @%:@include <ncurses.h>
1199 +                    ]], [[
1200 +                        chtype a = A_BOLD;
1201 +                        int b = KEY_LEFT;
1202 +                        chtype c = COLOR_PAIR(1) & A_COLOR;
1203 +                        int g = getattrs(stdscr);
1204 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1205 +                        initscr();
1206 +                        init_pair(1, COLOR_WHITE, COLOR_RED);
1207 +                    ]])],
1208 +                    [ax_cv_header_ncurses_h=yes],
1209 +                    [ax_cv_header_ncurses_h=no])
1210 +            ])
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])
1217 +            ])
1218 +
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])
1221 +            ])
1222 +        ])
1223 +    ])
1224 +
1225 +    # Test for plain Curses (or if CURSES_LIB was set by user)
1226 +
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"
1230 +        ], [
1231 +            LIBS="$ax_saved_LIBS -lcurses"
1232 +        ])
1233 +
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])
1237 +        ])
1238 +
1239 +        AS_IF([test "x$ax_cv_plaincurses" = xyes], [
1240 +            ax_cv_curses=yes
1241 +            ax_cv_curses_which=plaincurses
1242 +            AS_IF([test "x$CURSES_LIB" = x], [
1243 +                CURSES_LIB="-lcurses"
1244 +            ])
1245 +            AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
1246 +
1247 +            # Check for base conformance (and header file)
1248 +
1249 +            AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [
1250 +                AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1251 +                        @%:@include <curses.h>
1252 +                    ]], [[
1253 +                        chtype a = A_BOLD;
1254 +                        int b = KEY_LEFT;
1255 +                        initscr();
1256 +                    ]])],
1257 +                    [ax_cv_header_curses_h=yes],
1258 +                    [ax_cv_header_curses_h=no])
1259 +            ])
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])
1262 +
1263 +                # Check for X/Open Enhanced conformance
1264 +
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"
1272 +                            @%:@endif
1273 +                        ]], [[
1274 +                            chtype a = A_BOLD;
1275 +                            int b = KEY_LEFT;
1276 +                            chtype c = COLOR_PAIR(1) & A_COLOR;
1277 +                            attr_t d = WA_NORMAL;
1278 +                            cchar_t e;
1279 +                            wint_t f;
1280 +                            initscr();
1281 +                            init_pair(1, COLOR_WHITE, COLOR_RED);
1282 +                            wattr_set(stdscr, d, 0, NULL);
1283 +                            wget_wch(stdscr, &f);
1284 +                        ]])],
1285 +                        [ax_cv_plaincurses_enhanced=yes],
1286 +                        [ax_cv_plaincurses_enhanced=no])
1287 +                ])
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)])
1293 +                ])
1294 +
1295 +                # Check for color functions
1296 +
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>
1301 +                        ]], [[
1302 +                            chtype a = A_BOLD;
1303 +                            int b = KEY_LEFT;
1304 +                            chtype c = COLOR_PAIR(1) & A_COLOR;
1305 +                            initscr();
1306 +                            init_pair(1, COLOR_WHITE, COLOR_RED);
1307 +                        ]])],
1308 +                        [ax_cv_plaincurses_color=yes],
1309 +                        [ax_cv_plaincurses_color=no])
1310 +                ])
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)])
1314 +                ])
1315 +
1316 +                # Check for obsolete functions
1317 +
1318 +                AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [
1319 +                AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1320 +                        @%:@include <curses.h>
1321 +                    ]], [[
1322 +                        chtype a = A_BOLD;
1323 +                        int b = KEY_LEFT;
1324 +                        int g = getattrs(stdscr);
1325 +                        int h = getcurx(stdscr) + getmaxx(stdscr);
1326 +                        initscr();
1327 +                    ]])],
1328 +                    [ax_cv_plaincurses_obsolete=yes],
1329 +                    [ax_cv_plaincurses_obsolete=no])
1330 +                ])
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])
1334 +                ])
1335 +            ])
1336 +
1337 +            AS_IF([test "x$ax_cv_header_curses_h" = xno], [
1338 +                AC_MSG_WARN([could not find a working curses.h])
1339 +            ])
1340 +        ])
1341 +    ])
1342 +
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])
1347 +
1348 +    LIBS=$ax_saved_LIBS
1349 +])dnl
1350 diff --git a/autotools/softether.am b/autotools/softether.am
1351 new file mode 100644
1352 index 00000000..e5e91eeb
1353 --- /dev/null
1354 +++ b/autotools/softether.am
1355 @@ -0,0 +1,39 @@
1356 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1357 +#
1358 +#  This file is part of SoftEther.
1359 +#
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.
1364 +#
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
1368 +#  details.
1369 +#
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/>.
1372 +
1373 +
1374 +if CONFIGURE_ENABLE_DEBUG
1375 +DEBUG_CFLAGS = -g -D_DEBUG -DDEBUG
1376 +else
1377 +DEBUG_CFLAGS = -DNDEBUG -DVPN_SPEED
1378 +endif
1379 +
1380 +AM_CFLAGS = \
1381 +       $(DEBUG_CFLAGS) \
1382 +       -I$(top_srcdir)/src \
1383 +       -I$(top_srcdir)/src/Mayaqua \
1384 +       -I$(top_srcdir)/src/Cedar \
1385 +       -DUNIX \
1386 +       -DUNIX_LINUX \
1387 +       -D_REENTRANT \
1388 +       -DREENTRANT \
1389 +       -D_THREAD_SAFE \
1390 +       -D_THREADSAFE \
1391 +       -DTHREAD_SAFE \
1392 +       -DTHREADSAFE \
1393 +       -D_FILE_OFFSET_BITS=64 \
1394 +       -fsigned-char
1395 diff --git a/configure.ac b/configure.ac
1396 new file mode 100644
1397 index 00000000..4a3fc2ba
1398 --- /dev/null
1399 +++ b/configure.ac
1400 @@ -0,0 +1,96 @@
1401 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1402 +#
1403 +#  This file is part of SoftEther.
1404 +#
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.
1409 +#
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
1413 +#  details.
1414 +#
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/>.
1417 +
1418 +
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])
1423 +AM_PROG_AR
1424 +AC_PROG_CC
1425 +AC_PROG_LIBTOOL
1426 +AC_CONFIG_HEADERS([softether_config.h])
1427 +AC_CONFIG_FILES([
1428 +       Makefile
1429 +       src/Makefile
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
1438 +])
1439 +
1440 +
1441 +AC_ARG_ENABLE(
1442 +       [debug],
1443 +       AS_HELP_STRING([--enable-debug], [build SoftEther with debugging features]),
1444 +       [debug=yes]
1445 +)
1446 +AM_CONDITIONAL([CONFIGURE_ENABLE_DEBUG], [test _"$debug" = _yes])
1447 +
1448 +
1449 +AX_PTHREAD([
1450 +       AC_SUBST(PTHREAD_CC)
1451 +       AC_SUBST(PTHREAD_CFLAGS)
1452 +       AC_SUBST(PTHREAD_LIBS)
1453 +],[
1454 +       AC_MSG_ERROR([pthread capabilities not found])
1455 +])
1456 +
1457 +CC="$PTHREAD_CC"
1458 +CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1459 +LIBS="$PTHREAD_LIBS $LIBS"
1460 +
1461 +
1462 +AX_CHECK_OPENSSL([
1463 +       AC_SUBST(OPENSSL_LIBS)
1464 +       AC_SUBST(OPENSSL_LDFLAGS)
1465 +],[
1466 +       AC_MSG_ERROR([openssl not found])
1467 +])
1468 +
1469 +LIBS="$LIBS $OPENSSL_LIBS"
1470 +LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
1471 +
1472 +
1473 +# This macro automatically updates build variables.
1474 +AX_CHECK_ZLIB(, AC_MSG_ERROR([zlib not found]))
1475 +
1476 +
1477 +AX_WITH_CURSES
1478 +if test "_$ax_cv_curses" != _yes
1479 +then
1480 +       AC_MSG_ERROR([libcurses, libncurses, or libncursesw not found])
1481 +else
1482 +       AC_SUBST(CURSES_LIB)
1483 +       LIBS="$LIBS $CURSES_LIB"
1484 +fi
1485 +
1486 +
1487 +AX_LIB_READLINE
1488 +if test "_$ax_cv_lib_readline" = _no
1489 +then
1490 +       AC_MSG_ERROR([libreadline not found])
1491 +else
1492 +       : This macro automatically updates build variables.
1493 +fi
1494 +
1495 +
1496 +AC_OUTPUT
1497 --- a/configure 2017-07-16 04:53:31.000000000 +0200
1498 +++ b/configure 1970-01-01 01:00:00.000000000 +0100
1499 @@ -1,112 +0,0 @@
1500 -#!/bin/sh
1501 -
1502 -echo '---------------------------------------------------------------------'
1503 -echo 'SoftEther VPN for Unix'
1504 -echo
1505 -echo 'Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.'
1506 -echo 'Copyright (c) Daiyuu Nobori. All Rights Reserved.'
1507 -echo
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.'
1511 -echo
1512 -echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
1513 -echo '---------------------------------------------------------------------'
1514 -echo
1515 -
1516 -echo 'Welcome to the corner-cutting configure script !'
1517 -echo
1518 -
1519 -OS=""
1520 -case "`uname -s`" in
1521 -Linux)
1522 -       OS="linux"
1523 -       ;;
1524 -FreeBSD)
1525 -       OS="freebsd"
1526 -       ;;
1527 -SunOS)
1528 -       OS="solaris"
1529 -       ;;
1530 -Darwin)
1531 -       OS="macos"
1532 -       ;;
1533 -OpenBSD)
1534 -       OS="openbsd"
1535 -       ;;
1536 -*)
1537 -       echo 'Select your operating system below:'
1538 -       echo ' 1: Linux'
1539 -       echo ' 2: FreeBSD'
1540 -       echo ' 3: Solaris'
1541 -       echo ' 4: Mac OS X'
1542 -       echo ' 5: OpenBSD'
1543 -       echo
1544 -       echo -n 'Which is your operating system (1 - 5) ? : '
1545 -       read TMP
1546 -       echo
1547 -       if test "$TMP" = "1"
1548 -       then
1549 -               OS="linux"
1550 -       fi
1551 -       if test "$TMP" = "2"
1552 -       then
1553 -               OS="freebsd"
1554 -       fi
1555 -       if test "$TMP" = "3"
1556 -       then
1557 -               OS="solaris"
1558 -       fi
1559 -       if test "$TMP" = "4"
1560 -       then
1561 -               OS="macos"
1562 -       fi
1563 -       if test "$TMP" = "5"
1564 -       then
1565 -               OS="openbsd"
1566 -       fi
1567 -
1568 -       if test "$OS" = ""
1569 -       then
1570 -               echo "Wrong number."
1571 -               exit 1
1572 -       fi
1573 -       ;;
1574 -esac
1575 -
1576 -CPU=""
1577 -case "`uname -m`" in
1578 -x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
1579 -       CPU=64bit
1580 -       ;;
1581 -i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
1582 -       CPU=32bit
1583 -       ;;
1584 -*)
1585 -       echo 'Select your CPU bits below:'
1586 -       echo ' 1: 32-bit'
1587 -       echo ' 2: 64-bit'
1588 -       echo
1589 -       echo -n 'Which is the type of your CPU (1 - 2) ? : '
1590 -       read TMP
1591 -       echo
1592 -       if test "$TMP" = "1"
1593 -       then
1594 -               CPU="32bit"
1595 -       fi
1596 -       if test "$TMP" = "2"
1597 -       then
1598 -               CPU="64bit"
1599 -       fi
1600 -
1601 -       if test "$CPU" = ""
1602 -       then
1603 -               echo "Wrong number."
1604 -               exit 1
1605 -       fi
1606 -       ;;
1607 -esac
1608 -
1609 -cp src/makefiles/${OS}_${CPU}.mak Makefile
1610 -
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
1614 @@ -0,0 +1,112 @@
1615 +#!/bin/sh
1616 +
1617 +echo '---------------------------------------------------------------------'
1618 +echo 'SoftEther VPN for Unix'
1619 +echo
1620 +echo 'Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.'
1621 +echo 'Copyright (c) Daiyuu Nobori. All Rights Reserved.'
1622 +echo
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.'
1626 +echo
1627 +echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
1628 +echo '---------------------------------------------------------------------'
1629 +echo
1630 +
1631 +echo 'Welcome to the corner-cutting configure script !'
1632 +echo
1633 +
1634 +OS=""
1635 +case "`uname -s`" in
1636 +Linux)
1637 +       OS="linux"
1638 +       ;;
1639 +FreeBSD)
1640 +       OS="freebsd"
1641 +       ;;
1642 +SunOS)
1643 +       OS="solaris"
1644 +       ;;
1645 +Darwin)
1646 +       OS="macos"
1647 +       ;;
1648 +OpenBSD)
1649 +       OS="openbsd"
1650 +       ;;
1651 +*)
1652 +       echo 'Select your operating system below:'
1653 +       echo ' 1: Linux'
1654 +       echo ' 2: FreeBSD'
1655 +       echo ' 3: Solaris'
1656 +       echo ' 4: Mac OS X'
1657 +       echo ' 5: OpenBSD'
1658 +       echo
1659 +       echo -n 'Which is your operating system (1 - 5) ? : '
1660 +       read TMP
1661 +       echo
1662 +       if test "$TMP" = "1"
1663 +       then
1664 +               OS="linux"
1665 +       fi
1666 +       if test "$TMP" = "2"
1667 +       then
1668 +               OS="freebsd"
1669 +       fi
1670 +       if test "$TMP" = "3"
1671 +       then
1672 +               OS="solaris"
1673 +       fi
1674 +       if test "$TMP" = "4"
1675 +       then
1676 +               OS="macos"
1677 +       fi
1678 +       if test "$TMP" = "5"
1679 +       then
1680 +               OS="openbsd"
1681 +       fi
1682 +
1683 +       if test "$OS" = ""
1684 +       then
1685 +               echo "Wrong number."
1686 +               exit 1
1687 +       fi
1688 +       ;;
1689 +esac
1690 +
1691 +CPU=""
1692 +case "`uname -m`" in
1693 +x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
1694 +       CPU=64bit
1695 +       ;;
1696 +i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
1697 +       CPU=32bit
1698 +       ;;
1699 +*)
1700 +       echo 'Select your CPU bits below:'
1701 +       echo ' 1: 32-bit'
1702 +       echo ' 2: 64-bit'
1703 +       echo
1704 +       echo -n 'Which is the type of your CPU (1 - 2) ? : '
1705 +       read TMP
1706 +       echo
1707 +       if test "$TMP" = "1"
1708 +       then
1709 +               CPU="32bit"
1710 +       fi
1711 +       if test "$TMP" = "2"
1712 +       then
1713 +               CPU="64bit"
1714 +       fi
1715 +
1716 +       if test "$CPU" = ""
1717 +       then
1718 +               echo "Wrong number."
1719 +               exit 1
1720 +       fi
1721 +       ;;
1722 +esac
1723 +
1724 +cp src/makefiles/${OS}_${CPU}.mak Makefile
1725 +
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
1730 --- /dev/null
1731 +++ b/src/Cedar/Makefile.am
1732 @@ -0,0 +1,82 @@
1733 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1734 +#
1735 +#  This file is part of SoftEther.
1736 +#
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.
1741 +#
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
1745 +#  details.
1746 +#
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/>.
1749 +
1750 +
1751 +include $(top_srcdir)/autotools/softether.am
1752 +
1753 +noinst_LTLIBRARIES = libcedar.la
1754 +
1755 +libcedar_la_SOURCES = \
1756 +       Account.c \
1757 +       Admin.c \
1758 +       AzureClient.c \
1759 +       AzureServer.c \
1760 +       Bridge.c \
1761 +       BridgeUnix.c \
1762 +       BridgeWin32.c \
1763 +       Cedar.c \
1764 +       CedarPch.c \
1765 +       Client.c \
1766 +       CM.c \
1767 +       Command.c \
1768 +       Connection.c \
1769 +       Console.c \
1770 +       Database.c \
1771 +       DDNS.c \
1772 +       EM.c \
1773 +       EtherLog.c \
1774 +       Hub.c \
1775 +       Interop_OpenVPN.c \
1776 +       Interop_SSTP.c \
1777 +       IPsec.c \
1778 +       IPsec_EtherIP.c \
1779 +       IPsec_IKE.c \
1780 +       IPsec_IkePacket.c \
1781 +       IPsec_IPC.c \
1782 +       IPsec_L2TP.c \
1783 +       IPsec_PPP.c \
1784 +       IPsec_Win7.c \
1785 +       Layer3.c \
1786 +       Link.c \
1787 +       Listener.c \
1788 +       Logging.c \
1789 +       Nat.c \
1790 +       NativeStack.c \
1791 +       NM.c \
1792 +       NullLan.c \
1793 +       Protocol.c \
1794 +       Radius.c \
1795 +       Remote.c \
1796 +       Sam.c \
1797 +       SecureInfo.c \
1798 +       SecureNAT.c \
1799 +       SeLowUser.c \
1800 +       Server.c \
1801 +       Session.c \
1802 +       SM.c \
1803 +       SW.c \
1804 +       UdpAccel.c \
1805 +       UT.c \
1806 +       VG.c \
1807 +       Virtual.c \
1808 +       VLan.c \
1809 +       VLanUnix.c \
1810 +       VLanWin32.c \
1811 +       WaterMark.c \
1812 +       WebUI.c \
1813 +       WinUi.c \
1814 +       Wpc.c
1815 diff --git a/src/Makefile.am b/src/Makefile.am
1816 new file mode 100644
1817 index 00000000..dc745426
1818 --- /dev/null
1819 +++ b/src/Makefile.am
1820 @@ -0,0 +1,26 @@
1821 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1822 +#
1823 +#  This file is part of SoftEther.
1824 +#
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.
1829 +#
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
1833 +#  details.
1834 +#
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/>.
1837 +
1838 +
1839 +# These components are built as libtool convenience libraries.
1840 +SUBDIRS = Mayaqua Cedar
1841 +
1842 +# This is a nodist helper.
1843 +SUBDIRS += hamcorebuilder
1844 +
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
1850 --- /dev/null
1851 +++ b/src/Mayaqua/Makefile.am
1852 @@ -0,0 +1,43 @@
1853 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1854 +#
1855 +#  This file is part of SoftEther.
1856 +#
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.
1861 +#
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
1865 +#  details.
1866 +#
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/>.
1869 +
1870 +
1871 +include $(top_srcdir)/autotools/softether.am
1872 +
1873 +noinst_LTLIBRARIES = libmayaqua.la
1874 +
1875 +libmayaqua_la_SOURCES = \
1876 +       Cfg.c \
1877 +       Encrypt.c \
1878 +       FileIO.c \
1879 +       Internat.c \
1880 +       Kernel.c \
1881 +       Mayaqua.c \
1882 +       Memory.c \
1883 +       Microsoft.c \
1884 +       Network.c \
1885 +       Object.c \
1886 +       OS.c \
1887 +       Pack.c \
1888 +       Secure.c \
1889 +       Str.c \
1890 +       Table.c \
1891 +       TcpIp.c \
1892 +       Tick64.c \
1893 +       Tracking.c \
1894 +       Unix.c \
1895 +       Win32.c
1896 diff --git a/src/bin/hamcore/Makefile.am b/src/bin/hamcore/Makefile.am
1897 new file mode 100644
1898 index 00000000..37b0291e
1899 --- /dev/null
1900 +++ b/src/bin/hamcore/Makefile.am
1901 @@ -0,0 +1,29 @@
1902 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1903 +#
1904 +#  This file is part of SoftEther.
1905 +#
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.
1910 +#
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
1914 +#  details.
1915 +#
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/>.
1918 +
1919 +
1920 +include $(top_srcdir)/autotools/softether.am
1921 +
1922 +# This is required to use a custom build rule with -Wall and -Werror enabled.
1923 +AUTOMAKE_OPTIONS = -Wno-override
1924 +EXEEXT =
1925 +HAMCOREBUILDER = $(top_builddir)/src/hamcorebuilder/hamcorebuilder
1926 +
1927 +sbin_PROGRAMS = hamcore.se2
1928 +
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
1934 --- /dev/null
1935 +++ b/src/hamcorebuilder/Makefile.am
1936 @@ -0,0 +1,29 @@
1937 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1938 +#
1939 +#  This file is part of SoftEther.
1940 +#
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.
1945 +#
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
1949 +#  details.
1950 +#
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/>.
1953 +
1954 +
1955 +include $(top_srcdir)/autotools/softether.am
1956 +
1957 +noinst_PROGRAMS = \
1958 +       hamcorebuilder
1959 +
1960 +hamcorebuilder_SOURCES = \
1961 +       hamcorebuilder.c
1962 +
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
1969 --- /dev/null
1970 +++ b/src/vpnbridge/Makefile.am
1971 @@ -0,0 +1,29 @@
1972 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
1973 +#
1974 +#  This file is part of SoftEther.
1975 +#
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.
1980 +#
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
1984 +#  details.
1985 +#
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/>.
1988 +
1989 +
1990 +include $(top_srcdir)/autotools/softether.am
1991 +
1992 +sbin_PROGRAMS = \
1993 +       vpnbridge
1994 +
1995 +vpnbridge_SOURCES = \
1996 +       vpnbridge.c
1997 +
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
2004 --- /dev/null
2005 +++ b/src/vpnclient/Makefile.am
2006 @@ -0,0 +1,29 @@
2007 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2008 +#
2009 +#  This file is part of SoftEther.
2010 +#
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.
2015 +#
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
2019 +#  details.
2020 +#
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/>.
2023 +
2024 +
2025 +include $(top_srcdir)/autotools/softether.am
2026 +
2027 +sbin_PROGRAMS = \
2028 +       vpnclient
2029 +
2030 +vpnclient_SOURCES = \
2031 +       vpncsvc.c
2032 +
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
2039 --- /dev/null
2040 +++ b/src/vpncmd/Makefile.am
2041 @@ -0,0 +1,29 @@
2042 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2043 +#
2044 +#  This file is part of SoftEther.
2045 +#
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.
2050 +#
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
2054 +#  details.
2055 +#
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/>.
2058 +
2059 +
2060 +include $(top_srcdir)/autotools/softether.am
2061 +
2062 +sbin_PROGRAMS = \
2063 +       vpncmd
2064 +
2065 +vpncmd_SOURCES = \
2066 +       vpncmd.c
2067 +
2068 +vpncmd_LDADD = \
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
2074 --- /dev/null
2075 +++ b/src/vpnserver/Makefile.am
2076 @@ -0,0 +1,29 @@
2077 +#  Copyright 2014 Darik Horn <dajhorn@vanadac.com>
2078 +#
2079 +#  This file is part of SoftEther.
2080 +#
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.
2085 +#
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
2089 +#  details.
2090 +#
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/>.
2093 +
2094 +
2095 +include $(top_srcdir)/autotools/softether.am
2096 +
2097 +sbin_PROGRAMS = \
2098 +       vpnserver
2099 +
2100 +vpnserver_SOURCES = \
2101 +       vpnserver.c
2102 +
2103 +vpnserver_LDADD = \
2104 +       $(top_builddir)/src/Mayaqua/libmayaqua.la \
2105 +       $(top_builddir)/src/Cedar/libcedar.la