Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
7d7a40a8
Commit
7d7a40a8
authored
Sep 07, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed configure. Added fwd_media command
parent
19e06898
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1066 additions
and
414 deletions
+1066
-414
Makefile.in
Makefile.in
+4
-4
config.h.in
config.h.in
+1
-8
configure
configure
+708
-398
configure.ac
configure.ac
+11
-4
interface.c
interface.c
+9
-0
lua-tg.c
lua-tg.c
+6
-0
m4_ax_check_openssl.m4
m4_ax_check_openssl.m4
+124
-0
m4_ax_check_zlib.m4
m4_ax_check_zlib.m4
+142
-0
queries.c
queries.c
+60
-0
tgl.h
tgl.h
+1
-0
No files found.
Makefile.in
View file @
7d7a40a8
srcdir
=
@srcdir@
srcdir
=
@srcdir@
CFLAGS
=
@CFLAGS@
CFLAGS
=
@CFLAGS@
LDFLAGS
=
@LDFLAGS@
LDFLAGS
=
@LDFLAGS@
@OPENSSL_LDFLAGS@
CPPFLAGS
=
@CPPFLAGS@
CPPFLAGS
=
@CPPFLAGS@
@OPENSSL_INCLUDES@
DEFS
=
@DEFS@
DEFS
=
@DEFS@
COMPILE_FLAGS
=
${
CFLAGS
}
${
CPPFLAGS
}
${
DEFS
}
-Wall
-Wextra
-Werror
-Wno-deprecated-declarations
-fno-strict-aliasing
-fno-omit-frame-pointer
-ggdb
-Wno-unused-parameter
-fPIC
COMPILE_FLAGS
=
${
CFLAGS
}
${
CP
FLAGS
}
${
CP
PFLAGS
}
${
DEFS
}
-Wall
-Wextra
-Werror
-Wno-deprecated-declarations
-fno-strict-aliasing
-fno-omit-frame-pointer
-ggdb
-Wno-unused-parameter
-fPIC
EXTRA_LIBS
=
@LIBS@ @EXTRA_LIBS@
EXTRA_LIBS
=
@LIBS@ @EXTRA_LIBS@
@OPENSSL_LIBS@
LOCAL_LDFLAGS
=
-rdynamic
-ggdb
-levent
${
EXTRA_LIBS
}
LOCAL_LDFLAGS
=
-rdynamic
-ggdb
-levent
${
EXTRA_LIBS
}
LINK_FLAGS
=
${
LDFLAGS
}
${
LOCAL_LDFLAGS
}
LINK_FLAGS
=
${
LDFLAGS
}
${
LOCAL_LDFLAGS
}
...
...
config.h.in
View file @
7d7a40a8
...
@@ -21,16 +21,9 @@
...
@@ -21,16 +21,9 @@
/* Define to 1 if you have the <lauxlib.h> header file. */
/* Define to 1 if you have the <lauxlib.h> header file. */
#undef HAVE_LAUXLIB_H
#undef HAVE_LAUXLIB_H
/* Define to 1 if you have the `AES_set_encrypt_key' library
(-lAES_set_encrypt_key). */
#undef HAVE_LIBAES_SET_ENCRYPT_KEY
/* Define to 1 if you have the `config' library (-lconfig). */
/* Define to 1 if you have the `config' library (-lconfig). */
#undef HAVE_LIBCONFIG
#undef HAVE_LIBCONFIG
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_LIBCRYPTO
/* Define to 1 if you have the `edit' library (-ledit). */
/* Define to 1 if you have the `edit' library (-ledit). */
#undef HAVE_LIBEDIT
#undef HAVE_LIBEDIT
...
@@ -40,7 +33,7 @@
...
@@ -40,7 +33,7 @@
/* Define to 1 if you have the `m' library (-lm). */
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
#undef HAVE_LIBM
/* Define to 1 if you have
the `z' library (-lz).
*/
/* Define to 1 if you have
`z' library (-lz)
*/
#undef HAVE_LIBZ
#undef HAVE_LIBZ
/* Define to 1 if you have the <luaconf.h> header file. */
/* Define to 1 if you have the <luaconf.h> header file. */
...
...
configure
View file @
7d7a40a8
#! /bin/sh
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for telegram
0.1
.
# Generated by GNU Autoconf 2.69 for telegram
-cli 1.0
.
#
#
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
...
@@ -575,10 +575,10 @@ MFLAGS=
...
@@ -575,10 +575,10 @@ MFLAGS=
MAKEFLAGS
=
MAKEFLAGS
=
# Identity of this package.
# Identity of this package.
PACKAGE_NAME
=
'telegram'
PACKAGE_NAME
=
'telegram
-cli
'
PACKAGE_TARNAME
=
'telegram'
PACKAGE_TARNAME
=
'telegram
-cli
'
PACKAGE_VERSION
=
'
0.1
'
PACKAGE_VERSION
=
'
1.0
'
PACKAGE_STRING
=
'telegram
0.1
'
PACKAGE_STRING
=
'telegram
-cli 1.0
'
PACKAGE_BUGREPORT
=
''
PACKAGE_BUGREPORT
=
''
PACKAGE_URL
=
''
PACKAGE_URL
=
''
...
@@ -623,9 +623,6 @@ ac_subst_vars='LTLIBOBJS
...
@@ -623,9 +623,6 @@ ac_subst_vars='LTLIBOBJS
EXTRA_LIBS
EXTRA_LIBS
LIBOBJS
LIBOBJS
LUA_LIB
LUA_LIB
EGREP
GREP
CPP
LUA_INCLUDE
LUA_INCLUDE
pkgluaexecdir
pkgluaexecdir
luaexecdir
luaexecdir
...
@@ -637,6 +634,13 @@ LUA_PLATFORM
...
@@ -637,6 +634,13 @@ LUA_PLATFORM
LUA_SHORT_VERSION
LUA_SHORT_VERSION
LUA_VERSION
LUA_VERSION
LUA
LUA
EGREP
GREP
CPP
OPENSSL_LDFLAGS
OPENSSL_LIBS
OPENSSL_INCLUDES
PKG_CONFIG
OBJEXT
OBJEXT
EXEEXT
EXEEXT
ac_ct_CC
ac_ct_CC
...
@@ -685,6 +689,8 @@ SHELL'
...
@@ -685,6 +689,8 @@ SHELL'
ac_subst_files
=
''
ac_subst_files
=
''
ac_user_opts
=
'
ac_user_opts
=
'
enable_option_checking
enable_option_checking
with_openssl
with_zlib
enable_libconfig
enable_libconfig
enable_liblua
enable_liblua
with_progname
with_progname
...
@@ -697,9 +703,9 @@ CFLAGS
...
@@ -697,9 +703,9 @@ CFLAGS
LDFLAGS
LDFLAGS
LIBS
LIBS
CPPFLAGS
CPPFLAGS
CPP
LUA
LUA
LUA_INCLUDE
LUA_INCLUDE
CPP
LUA_LIB'
LUA_LIB'
...
@@ -1241,7 +1247,7 @@ if test "$ac_init_help" = "long"; then
...
@@ -1241,7 +1247,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
# This message is too long to be a string in the A/UX 3.1 sh.
cat
<<
_ACEOF
cat
<<
_ACEOF
\`
configure' configures telegram
0.1
to adapt to many kinds of systems.
\`
configure' configures telegram
-cli 1.0
to adapt to many kinds of systems.
Usage:
$0
[OPTION]... [VAR=VALUE]...
Usage:
$0
[OPTION]... [VAR=VALUE]...
...
@@ -1289,7 +1295,7 @@ Fine tuning of the installation directories:
...
@@ -1289,7 +1295,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/telegram]
--docdir=DIR documentation root [DATAROOTDIR/doc/telegram
-cli
]
--htmldir=DIR html documentation [DOCDIR]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
...
@@ -1302,7 +1308,7 @@ fi
...
@@ -1302,7 +1308,7 @@ fi
if
test
-n
"
$ac_init_help
"
;
then
if
test
-n
"
$ac_init_help
"
;
then
case
$ac_init_help
in
case
$ac_init_help
in
short
|
recursive
)
echo
"Configuration of telegram
0.1
:"
;;
short
|
recursive
)
echo
"Configuration of telegram
-cli 1.0
:"
;;
esac
esac
cat
<<
\
_ACEOF
cat
<<
\
_ACEOF
...
@@ -1316,6 +1322,10 @@ Optional Features:
...
@@ -1316,6 +1322,10 @@ Optional Features:
Optional Packages:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-openssl=DIR root of the OpenSSL directory
--with-zlib=DIR root directory path of zlib installation [defaults to
/usr/local or /usr if not found in /usr/local]
--without-zlib to disable zlib usage completely
--with-progname=<name>
--with-progname=<name>
Some influential environment variables:
Some influential environment variables:
...
@@ -1326,9 +1336,9 @@ Some influential environment variables:
...
@@ -1326,9 +1336,9 @@ Some influential environment variables:
LIBS libraries to pass to the linker, e.g. -l<library>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
LUA The Lua interpreter, e.g. /usr/bin/lua5.1
LUA The Lua interpreter, e.g. /usr/bin/lua5.1
LUA_INCLUDE The Lua includes, e.g. -I/usr/include/lua5.1
LUA_INCLUDE The Lua includes, e.g. -I/usr/include/lua5.1
CPP C preprocessor
LUA_LIB The Lua library, e.g. -llua5.1
LUA_LIB The Lua library, e.g. -llua5.1
Use these variables to override the choices made by `configure' or to help
Use these variables to override the choices made by `configure' or to help
...
@@ -1397,7 +1407,7 @@ fi
...
@@ -1397,7 +1407,7 @@ fi
test
-n
"
$ac_init_help
"
&&
exit
$ac_status
test
-n
"
$ac_init_help
"
&&
exit
$ac_status
if
$ac_init_version
;
then
if
$ac_init_version
;
then
cat
<<
\
_ACEOF
cat
<<
\
_ACEOF
telegram
configure 0.1
telegram
-cli configure 1.0
generated by GNU Autoconf 2.69
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2012 Free Software Foundation, Inc.
...
@@ -1816,7 +1826,7 @@ cat >config.log <<_ACEOF
...
@@ -1816,7 +1826,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
running configure, to aid debugging if configure makes a mistake.
It was created by telegram
$as_me
0.1
, which was
It was created by telegram
-cli
$as_me
1.0
, which was
generated by GNU Autoconf 2.69. Invocation command line was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0
$@
$ $0
$@
...
@@ -2376,6 +2386,150 @@ ac_config_headers="$ac_config_headers config.h"
...
@@ -2376,6 +2386,150 @@ ac_config_headers="$ac_config_headers config.h"
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
#
# DESCRIPTION
#
# Look for OpenSSL in a number of default spots, or in a user-selected
# spot (via --with-openssl). Sets
#
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
#
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
#
# This macro sets OPENSSL_INCLUDES such that source files should use the
# openssl/ directory in include directives:
#
# #include <openssl/hmac.h>
#
# LICENSE
#
# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
# This is what autoupdate's m4 run will expand. It fires
# the warning (with _au_warn_XXX), outputs it into the
# updated configure.ac (with AC_DIAGNOSE), and then outputs
# the replacement expansion.
# This is an auxiliary macro that is also run when
# autoupdate runs m4. It simply calls m4_warning, but
# we need a wrapper so that each warning is emitted only
# once. We break the quoting in m4_warning's argument in
# order to expand this macro's arguments, not AU_DEFUN's.
# Finally, this is the expansion that is picked up by
# autoconf. It tells the user to run autoupdate, and
# then outputs the replacement expansion. We do not care
# about autoupdate's warning because that contains
# information on what to do *after* running autoupdate.
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# This macro searches for an installed zlib library. If nothing was
# specified when calling configure, it searches first in /usr/local and
# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
# --without-zlib is specified, the library is not searched at all.
#
# If either the header file (zlib.h) or the library (libz) is not found,
# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
# not specified, the configuration exits on error, asking for a valid zlib
# installation directory or --without-zlib.
#
# If both header file and library are found, shell commands
# 'action-if-found' is run. If 'action-if-found' is not specified, the
# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
# for this symbol in a config.h file. Sample usage in a C/C++ source is as
# follows:
#
# #ifdef HAVE_LIBZ
# #include <zlib.h>
# #endif /* HAVE_LIBZ */
#
# LICENSE
#
# Copyright (c) 2008 Loic Dachary <loic@senga.org>
# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 14
# This is what autoupdate's m4 run will expand. It fires
# the warning (with _au_warn_XXX), outputs it into the
# updated configure.ac (with AC_DIAGNOSE), and then outputs
# the replacement expansion.
# This is an auxiliary macro that is also run when
# autoupdate runs m4. It simply calls m4_warning, but
# we need a wrapper so that each warning is emitted only
# once. We break the quoting in m4_warning's argument in
# order to expand this macro's arguments, not AU_DEFUN's.
# Finally, this is the expansion that is picked up by
# autoconf. It tells the user to run autoupdate, and
# then outputs the replacement expansion. We do not care
# about autoupdate's warning because that contains
# information on what to do *after* running autoupdate.
...
@@ -3334,96 +3488,6 @@ if test "$ac_res" != no; then :
...
@@ -3334,96 +3488,6 @@ if test "$ac_res" != no; then :
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for inflate in -lz"
>
&5
$as_echo_n
"checking for inflate in -lz... "
>
&6
;
}
if
${
ac_cv_lib_z_inflate
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lz
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inflate ();
int
main ()
{
return inflate ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_z_inflate
=
yes
else
ac_cv_lib_z_inflate
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_z_inflate
"
>
&5
$as_echo
"
$ac_cv_lib_z_inflate
"
>
&6
;
}
if
test
"x
$ac_cv_lib_z_inflate
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBZ 1
_ACEOF
LIBS
=
"-lz
$LIBS
"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for AES_set_encrypt_key in -lcrypto"
>
&5
$as_echo_n
"checking for AES_set_encrypt_key in -lcrypto... "
>
&6
;
}
if
${
ac_cv_lib_crypto_AES_set_encrypt_key
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lcrypto
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char AES_set_encrypt_key ();
int
main ()
{
return AES_set_encrypt_key ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_crypto_AES_set_encrypt_key
=
yes
else
ac_cv_lib_crypto_AES_set_encrypt_key
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_crypto_AES_set_encrypt_key
"
>
&5
$as_echo
"
$ac_cv_lib_crypto_AES_set_encrypt_key
"
>
&6
;
}
if
test
"x
$ac_cv_lib_crypto_AES_set_encrypt_key
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBCRYPTO 1
_ACEOF
LIBS
=
"-lcrypto
$LIBS
"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for event_base_new in -levent"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for event_base_new in -levent"
>
&5
$as_echo_n
"checking for event_base_new in -levent... "
>
&6
;
}
$as_echo_n
"checking for event_base_new in -levent... "
>
&6
;
}
if
${
ac_cv_lib_event_event_base_new
+
:
}
false
;
then
:
if
${
ac_cv_lib_event_event_base_new
+
:
}
false
;
then
:
...
@@ -3467,724 +3531,970 @@ _ACEOF
...
@@ -3467,724 +3531,970 @@ _ACEOF
LIBS
=
"-levent
$LIBS
"
LIBS
=
"-levent
$LIBS
"
else
as_fn_error
$?
"no libevent found"
"
$LINENO
"
5
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for ssl in -lAES_set_encrypt_key"
>
&5
EXTRA_LIBS
=
""
$as_echo_n
"checking for ssl in -lAES_set_encrypt_key... "
>
&6
;
}
if
${
ac_cv_lib_AES_set_encrypt_key_ssl
+
:
}
false
;
then
:
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
found
=
false
# Check whether --with-openssl was given.
if
test
"
${
with_openssl
+set
}
"
=
set
;
then
:
withval
=
$with_openssl
;
case
"
$withval
"
in
""
|
y
|
ye
|
yes
|
n
|
no
)
as_fn_error
$?
"Invalid --with-openssl value"
"
$LINENO
"
5
;;
*
)
ssldirs
=
"
$withval
"
;;
esac
else
# if pkg-config is installed and openssl has installed a .pc file,
# then use that information and don't search ssldirs
# Extract the first word of "pkg-config", so it can be a program name with args.
set
dummy pkg-config
;
ac_word
=
$2
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for
$ac_word
"
>
&5
$as_echo_n
"checking for
$ac_word
... "
>
&6
;
}
if
${
ac_cv_path_PKG_CONFIG
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
ac_check_lib_save_LIBS
=
$LIBS
case
$PKG_CONFIG
in
LIBS
=
"-lAES_set_encrypt_key
$LIBS
"
[
\\
/]
*
|
?:[
\\
/]
*
)
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
ac_cv_path_PKG_CONFIG
=
"
$PKG_CONFIG
"
# Let the user override the test with a path.
/* end confdefs.h. */
;;
*
)
as_save_IFS
=
$IFS
;
IFS
=
$PATH_SEPARATOR
for
as_dir
in
$PATH
do
IFS
=
$as_save_IFS
test
-z
"
$as_dir
"
&&
as_dir
=
.
for
ac_exec_ext
in
''
$ac_executable_extensions
;
do
if
as_fn_executable_p
"
$as_dir
/
$ac_word$ac_exec_ext
"
;
then
ac_cv_path_PKG_CONFIG
=
"
$as_dir
/
$ac_word$ac_exec_ext
"
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: found
$as_dir
/
$ac_word$ac_exec_ext
"
>
&5
break
2
fi
done
done
IFS
=
$as_save_IFS
/* Override any GCC internal prototype to avoid an error.
;;
Use char because int might match the return type of a GCC
esac
builtin and then its argument prototype would still apply. */
fi
#ifdef __cplusplus
PKG_CONFIG
=
$ac_cv_path_PKG_CONFIG
extern "C"
if
test
-n
"
$PKG_CONFIG
"
;
then
#endif
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$PKG_CONFIG
"
>
&5
char ssl ();
$as_echo
"
$PKG_CONFIG
"
>
&6
;
}
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
fi
if
test
x
"
$PKG_CONFIG
"
!=
x
""
;
then
OPENSSL_LDFLAGS
=
`
$PKG_CONFIG
openssl
--libs-only-L
2>/dev/null
`
if
test
$?
=
0
;
then
OPENSSL_LIBS
=
`
$PKG_CONFIG
openssl
--libs-only-l
2>/dev/null
`
OPENSSL_INCLUDES
=
`
$PKG_CONFIG
openssl
--cflags-only-I
2>/dev/null
`
found
=
true
fi
fi
# no such luck; use some default ssldirs
if
!
$found
;
then
ssldirs
=
"/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
fi
fi
# note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
# an 'openssl' subdirectory
if
!
$found
;
then
OPENSSL_INCLUDES
=
for
ssldir
in
$ssldirs
;
do
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for openssl/ssl.h in
$ssldir
"
>
&5
$as_echo_n
"checking for openssl/ssl.h in
$ssldir
... "
>
&6
;
}
if
test
-f
"
$ssldir
/include/openssl/ssl.h"
;
then
OPENSSL_INCLUDES
=
"-I
$ssldir
/include"
OPENSSL_LDFLAGS
=
"-L
$ssldir
/lib"
OPENSSL_LIBS
=
"-lssl -lcrypto"
found
=
true
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
break
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
fi
done
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
# it will just work!
fi
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether compiling and linking against OpenSSL works"
>
&5
$as_echo_n
"checking whether compiling and linking against OpenSSL works... "
>
&6
;
}
echo
"Trying link with OPENSSL_LDFLAGS=
$OPENSSL_LDFLAGS
;"
\
"OPENSSL_LIBS=
$OPENSSL_LIBS
; OPENSSL_INCLUDES=
$OPENSSL_INCLUDES
"
>
&5
save_LIBS
=
"
$LIBS
"
save_LDFLAGS
=
"
$LDFLAGS
"
save_CPPFLAGS
=
"
$CPPFLAGS
"
LDFLAGS
=
"
$LDFLAGS
$OPENSSL_LDFLAGS
"
LIBS
=
"
$OPENSSL_LIBS
$LIBS
"
CPPFLAGS
=
"
$OPENSSL_INCLUDES
$CPPFLAGS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <openssl/ssl.h>
int
int
main ()
main ()
{
{
return ssl ();
SSL_new(NULL)
;
;
return 0;
return 0;
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_AES_set_encrypt_key_ssl
=
yes
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
else
else
ac_cv_lib_AES_set_encrypt_key_ssl
=
no
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
as_fn_error
$?
"No openssl found"
"
$LINENO
"
5
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
CPPFLAGS
=
"
$save_CPPFLAGS
"
fi
LDFLAGS
=
"
$save_LDFLAGS
"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_AES_set_encrypt_key_ssl
"
>
&5
LIBS
=
"
$save_LIBS
"
$as_echo
"
$ac_cv_lib_AES_set_encrypt_key_ssl
"
>
&6
;
}
if
test
"x
$ac_cv_lib_AES_set_encrypt_key_ssl
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBAES_SET_ENCRYPT_KEY 1
_ACEOF
LIBS
=
"-lAES_set_encrypt_key
$LIBS
"
fi
EXTRA_LIBS
=
""
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for rl_save_prompt in -lreadline"
>
&5
$as_echo_n
"checking for rl_save_prompt in -lreadline... "
>
&6
;
}
ac_ext
=
c
if
${
ac_cv_lib_readline_rl_save_prompt
+
:
}
false
;
then
:
ac_cpp
=
'$CPP $CPPFLAGS'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking how to run the C preprocessor"
>
&5
$as_echo_n
"checking how to run the C preprocessor... "
>
&6
;
}
# On Suns, sometimes $CPP names a directory.
if
test
-n
"
$CPP
"
&&
test
-d
"
$CPP
"
;
then
CPP
=
fi
if
test
-z
"
$CPP
"
;
then
if
${
ac_cv_prog_CPP
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
ac_check_lib_save_LIBS
=
$LIBS
# Double quotes because CPP needs to be expanded
LIBS
=
"-lreadline
$LIBS
"
for
CPP
in
"
$CC
-E"
"
$CC
-E -traditional-cpp"
"/lib/cpp"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
do
ac_preproc_ok
=
false
for
ac_c_preproc_warn_flag
in
''
yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#ifdef __STDC__
/* Override any GCC internal prototype to avoid an error.
# include <limits.h>
Use char because int might match the return type of a GCC
#else
builtin and then its argument prototype would still apply. */
# include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
#endif
char rl_save_prompt ();
Syntax error
int
main ()
{
return rl_save_prompt ();
;
return 0;
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
cpp
"
$LINENO
"
;
then
:
ac_cv_lib_readline_rl_save_prompt
=
yes
else
else
ac_cv_lib_readline_rl_save_prompt
=
no
# Broken: fails on valid input.
fi
continue
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_readline_rl_save_prompt
"
>
&5
rm
-f
conftest.err conftest.i conftest.
$ac_ext
$as_echo
"
$ac_cv_lib_readline_rl_save_prompt
"
>
&6
;
}
if
test
"x
$ac_cv_lib_readline_rl_save_prompt
"
=
xyes
;
then
:
$as_echo
"#define READLINE_GNU 1"
>>
confdefs.h
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok
=
:
break
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-lreadline"
;
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm
-f
conftest.i conftest.err conftest.
$ac_ext
if
$ac_preproc_ok
;
then
:
break
fi
else
done
ac_cv_prog_CPP
=
$CPP
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for library containing tgetnum"
>
&5
fi
$as_echo_n
"checking for library containing tgetnum... "
>
&6
;
}
CPP
=
$ac_cv_prog_CPP
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
else
ac_func_search_save_LIBS
=
$LIBS
ac_cv_prog_CPP
=
$CPP
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$CPP
"
>
&5
$as_echo
"
$CPP
"
>
&6
;
}
ac_preproc_ok
=
false
for
ac_c_preproc_warn_flag
in
''
yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#ifdef __STDC__
/* Override any GCC internal prototype to avoid an error.
# include <limits.h>
Use char because int might match the return type of a GCC
#else
builtin and then its argument prototype would still apply. */
# include <assert.h>
#ifdef __cplusplus
extern "C"
#endif
#endif
char tgetnum ();
Syntax error
int
main ()
{
return tgetnum ();
;
return 0;
}
_ACEOF
_ACEOF
for
ac_lib
in
''
ncursesw ncurses curses
;
do
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
if
test
-z
"
$ac_lib
"
;
then
ac_res
=
"none required"
else
else
# Broken: fails on valid input.
ac_res
=
-l
$ac_lib
continue
LIBS
=
"-l
$ac_lib
$ac_func_search_save_LIBS
"
fi
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_search_tgetnum
=
$ac_res
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
rm
-f
conftest.err conftest.i conftest.
$ac_ext
conftest
$ac_exeext
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
# OK, works on sane cases. Now check whether nonexistent headers
break
# can be detected and how.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok
=
:
break
fi
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
done
done
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm
-f
conftest.i conftest.err conftest.
$ac_ext
if
$ac_preproc_ok
;
then
:
else
else
ac_cv_search_tgetnum
=
no
{
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: error: in
\`
$ac_pwd
':"
>
&5
fi
$as_echo
"
$as_me
: error: in
\`
$ac_pwd
':"
>
&2
;
}
rm
conftest.
$ac_ext
as_fn_error
$?
"C preprocessor
\"
$CPP
\"
fails sanity check
LIBS
=
$ac_func_search_save_LIBS
See
\`
config.log' for more details"
"
$LINENO
"
5
;
}
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_search_tgetnum
"
>
&5
$as_echo
"
$ac_cv_search_tgetnum
"
>
&6
;
}
ac_res
=
$ac_cv_search_tgetnum
if
test
"
$ac_res
"
!=
no
;
then
:
test
"
$ac_res
"
=
"none required"
||
LIBS
=
"
$ac_res
$LIBS
"
fi
ac_ext
=
c
ac_cpp
=
'$CPP $CPPFLAGS'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for rl_set_prompt in -ledit"
>
&5
$as_echo_n
"checking for rl_set_prompt in -ledit... "
>
&6
;
}
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for grep that handles long lines and -e"
>
&5
if
${
ac_cv_lib_edit_rl_set_prompt
+
:
}
false
;
then
:
$as_echo_n
"checking for grep that handles long lines and -e... "
>
&6
;
}
if
${
ac_cv_path_GREP
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
ac_check_lib_save_LIBS
=
$LIBS
if
test
-z
"
$GREP
"
;
then
LIBS
=
"-ledit
$LIBS
"
ac_path_GREP_found
=
false
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
# Loop through the user's path and test for each of PROGNAME-LIST
/* end confdefs.h. */
as_save_IFS
=
$IFS
;
IFS
=
$PATH_SEPARATOR
for
as_dir
in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin
do
IFS
=
$as_save_IFS
test
-z
"
$as_dir
"
&&
as_dir
=
.
for
ac_prog
in
grep
ggrep
;
do
for
ac_exec_ext
in
''
$ac_executable_extensions
;
do
ac_path_GREP
=
"
$as_dir
/
$ac_prog$ac_exec_ext
"
as_fn_executable_p
"
$ac_path_GREP
"
||
continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case
`
"
$ac_path_GREP
"
--version
2>&1
`
in
*
GNU
*
)
ac_cv_path_GREP
=
"
$ac_path_GREP
"
ac_path_GREP_found
=
:
;;
*
)
ac_count
=
0
$as_echo_n
0123456789
>
"conftest.in"
while
:
do
cat
"conftest.in"
"conftest.in"
>
"conftest.tmp"
mv
"conftest.tmp"
"conftest.in"
cp
"conftest.in"
"conftest.nl"
$as_echo
'GREP'
>>
"conftest.nl"
"
$ac_path_GREP
"
-e
'GREP$'
-e
'-(cannot match)-'
<
"conftest.nl"
>
"conftest.out"
2>/dev/null
||
break
diff
"conftest.out"
"conftest.nl"
>
/dev/null 2>&1
||
break
as_fn_arith
$ac_count
+ 1
&&
ac_count
=
$as_val
if
test
$ac_count
-gt
${
ac_path_GREP_max
-0
}
;
then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP
=
"
$ac_path_GREP
"
ac_path_GREP_max
=
$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test
$ac_count
-gt
10
&&
break
done
rm
-f
conftest.in conftest.tmp conftest.nl conftest.out
;;
esac
/* Override any GCC internal prototype to avoid an error.
$ac_path_GREP_found
&&
break
3
Use char because int might match the return type of a GCC
done
builtin and then its argument prototype would still apply. */
done
#ifdef __cplusplus
done
extern "C"
IFS
=
$as_save_IFS
#endif
if
test
-z
"
$ac_cv_path_GREP
"
;
then
char rl_set_prompt ();
as_fn_error
$?
"no acceptable grep could be found in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin"
"
$LINENO
"
5
int
fi
main ()
{
return rl_set_prompt ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_edit_rl_set_prompt
=
yes
else
else
ac_cv_
lib_edit_rl_set_prompt
=
no
ac_cv_
path_GREP
=
$GREP
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_edit_rl_set_prompt
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_path_GREP
"
>
&5
$as_echo
"
$ac_cv_lib_edit_rl_set_prompt
"
>
&6
;
}
$as_echo
"
$ac_cv_path_GREP
"
>
&6
;
}
if
test
"x
$ac_cv_lib_edit_rl_set_prompt
"
=
xyes
;
then
:
GREP
=
"
$ac_cv_path_GREP
"
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBEDIT 1
_ACEOF
LIBS
=
"-ledit
$LIBS
"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for egrep"
>
&5
$as_echo_n
"checking for egrep... "
>
&6
;
}
if
${
ac_cv_path_EGREP
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
if
echo
a |
$GREP
-E
'(a|b)'
>
/dev/null 2>&1
then
ac_cv_path_EGREP
=
"
$GREP
-E"
else
if
test
-z
"
$EGREP
"
;
then
ac_path_EGREP_found
=
false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS
=
$IFS
;
IFS
=
$PATH_SEPARATOR
for
as_dir
in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin
do
IFS
=
$as_save_IFS
test
-z
"
$as_dir
"
&&
as_dir
=
.
for
ac_prog
in
egrep
;
do
for
ac_exec_ext
in
''
$ac_executable_extensions
;
do
ac_path_EGREP
=
"
$as_dir
/
$ac_prog$ac_exec_ext
"
as_fn_executable_p
"
$ac_path_EGREP
"
||
continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case
`
"
$ac_path_EGREP
"
--version
2>&1
`
in
*
GNU
*
)
ac_cv_path_EGREP
=
"
$ac_path_EGREP
"
ac_path_EGREP_found
=
:
;;
*
)
ac_count
=
0
$as_echo_n
0123456789
>
"conftest.in"
while
:
do
cat
"conftest.in"
"conftest.in"
>
"conftest.tmp"
mv
"conftest.tmp"
"conftest.in"
cp
"conftest.in"
"conftest.nl"
$as_echo
'EGREP'
>>
"conftest.nl"
"
$ac_path_EGREP
"
'EGREP$'
<
"conftest.nl"
>
"conftest.out"
2>/dev/null
||
break
diff
"conftest.out"
"conftest.nl"
>
/dev/null 2>&1
||
break
as_fn_arith
$ac_count
+ 1
&&
ac_count
=
$as_val
if
test
$ac_count
-gt
${
ac_path_EGREP_max
-0
}
;
then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP
=
"
$ac_path_EGREP
"
ac_path_EGREP_max
=
$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test
$ac_count
-gt
10
&&
break
done
rm
-f
conftest.in conftest.tmp conftest.nl conftest.out
;;
esac
$ac_path_EGREP_found
&&
break
3
done
done
done
IFS
=
$as_save_IFS
if
test
-z
"
$ac_cv_path_EGREP
"
;
then
as_fn_error
$?
"no acceptable egrep could be found in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin"
"
$LINENO
"
5
fi
else
ac_cv_path_EGREP
=
$EGREP
fi
fi
fi
$as_echo
"#define READLINE_EDIT 1"
>>
confdefs.h
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-ledit"
;
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_path_EGREP
"
>
&5
$as_echo
"
$ac_cv_path_EGREP
"
>
&6
;
}
EGREP
=
"
$ac_cv_path_EGREP
"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for libconfig"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for ANSI C header files"
>
&5
$as_echo_n
"checking for libconfig... "
>
&6
;
}
$as_echo_n
"checking for ANSI C header files... "
>
&6
;
}
# Check whether --enable-libconfig was given.
if
${
ac_cv_header_stdc
+
:
}
false
;
then
:
if
test
"
${
enable_libconfig
+set
}
"
=
set
;
then
:
enableval
=
$enable_libconfig
;
if
test
"x
$enableval
"
=
"xno"
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: disabled"
>
&5
$as_echo
"disabled"
>
&6
;
}
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: enabled"
>
&5
$as_echo
"enabled"
>
&6
;
}
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for config_init in -lconfig"
>
&5
$as_echo_n
"checking for config_init in -lconfig... "
>
&6
;
}
if
${
ac_cv_lib_config_config_init
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
ac_check_lib_save_LIBS
=
$LIBS
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
LIBS
=
"-lconfig
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char config_init ();
int
int
main ()
main ()
{
{
return config_init ();
;
;
return 0;
return 0;
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
compile
"
$LINENO
"
;
then
:
ac_cv_
lib_config_config_init
=
yes
ac_cv_
header_stdc
=
yes
else
else
ac_cv_lib_config_config_init
=
no
ac_cv_header_stdc
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_config_config_init
"
>
&5
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
$as_echo
"
$ac_cv_lib_config_config_init
"
>
&6
;
}
if
test
"x
$ac_cv_lib_config_config_init
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBCONFIG 1
_ACEOF
LIBS
=
"-lconfig
$LIBS
"
if
test
$ac_cv_header_stdc
=
yes
;
then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <string.h>
_ACEOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
$EGREP
"memchr"
>
/dev/null 2>&1
;
then
:
else
else
a
s_fn_error
$?
"No libconfig found. Try --disable-libconfig"
"
$LINENO
"
5
a
c_cv_header_stdc
=
no
fi
fi
rm
-f
conftest
*
fi
fi
if
test
$ac_cv_header_stdc
=
yes
;
then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
$EGREP
"free"
>
/dev/null 2>&1
;
then
:
else
else
ac_cv_header_stdc
=
no
fi
rm
-f
conftest
*
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: enabled"
>
&5
fi
$as_echo
"enabled"
>
&6
;
}
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for config_init in -lconfig"
>
&5
if
test
$ac_cv_header_stdc
=
yes
;
then
$as_echo_n
"checking for config_init in -lconfig... "
>
&6
;
}
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if
${
ac_cv_lib_config_config_init
+
:
}
false
;
then
:
if
test
"
$cross_compiling
"
=
yes
;
then
:
$as_echo_n
"(cached) "
>
&6
:
else
else
ac_check_lib_save_LIBS
=
$LIBS
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
LIBS
=
"-lconfig
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#include <ctype.h>
/* Override any GCC internal prototype to avoid an error.
#include <stdlib.h>
Use char because int might match the return type of a GCC
#if ((' ' & 0x0FF) == 0x020)
builtin and then its argument prototype would still apply. */
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#ifdef __cplusplus
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
extern "C"
#else
# define ISLOWER(c)
\
(('a' <= (c) && (c) <= 'i')
\
|| ('j' <= (c) && (c) <= 'r')
\
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
#endif
char config_init ();
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
int
main ()
main ()
{
{
return config_init ();
int i;
;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
return 2;
return 0;
return 0;
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
run
"
$LINENO
"
;
then
:
ac_cv_lib_config_config_init
=
yes
else
else
ac_cv_
lib_config_config_init
=
no
ac_cv_
header_stdc
=
no
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
rm
-f
core
*
.core core.conftest.
*
gmon.out bb.out conftest
$ac_exeext
\
conftest
$ac_exeext
conftest.
$ac_ext
conftest.
$ac_objext
conftest.beam conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_config_config_init
"
>
&5
$as_echo
"
$ac_cv_lib_config_config_init
"
>
&6
;
}
if
test
"x
$ac_cv_lib_config_config_init
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBCONFIG 1
_ACEOF
LIBS
=
"-lconfig
$LIBS
"
else
as_fn_error
$?
"No libconfig found. Try --disable-libconfig"
"
$LINENO
"
5
fi
fi
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_header_stdc
"
>
&5
$as_echo
"
$ac_cv_header_stdc
"
>
&6
;
}
if
test
$ac_cv_header_stdc
=
yes
;
then
$as_echo
"#define STDC_HEADERS 1"
>>
confdefs.h
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for liblua"
>
&5
$as_echo_n
"checking for liblua... "
>
&6
;
}
ac_ext
=
c
ac_cpp
=
'$CPP $CPPFLAGS'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking how to run the C preprocessor"
>
&5
$as_echo_n
"checking how to run the C preprocessor... "
>
&6
;
}
# On Suns, sometimes $CPP names a directory.
if
test
-n
"
$CPP
"
&&
test
-d
"
$CPP
"
;
then
CPP
=
fi
fi
if
test
-z
"
$CPP
"
;
then
if
${
ac_cv_prog_CPP
+
:
}
false
;
then
:
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
$as_echo_n
"(cached) "
>
&6
for
ac_header
in
sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h
\
else
inttypes.h stdint.h unistd.h
# Double quotes because CPP needs to be expanded
do
:
for
CPP
in
"
$CC
-E"
"
$CC
-E -traditional-cpp"
"/lib/cpp"
as_ac_Header
=
`
$as_echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
do
ac_fn_c_check_header_compile
"
$LINENO
"
"
$ac_header
"
"
$as_ac_Header
"
"
$ac_includes_default
ac_preproc_ok
=
false
"
for
ac_c_preproc_warn_flag
in
''
yes
if
eval test
\"
x
\$
"
$as_ac_Header
"
\"
=
x
"yes"
;
then
:
do
cat
>>
confdefs.h
<<
_ACEOF
# Use a header file that comes with gcc, so configuring glibc
#define `
$as_echo
"HAVE_
$ac_header
" |
$as_tr_cpp
` 1
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
_ACEOF
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
else
# Broken: fails on valid input.
continue
fi
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
done
# can be detected and how.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#
#include <ac_nonexistent.h>
# Handle user hints
_ACEOF
#
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking if zlib is wanted"
>
&5
# Broken: success on invalid input.
$as_echo_n
"checking if zlib is wanted... "
>
&6
;
}
continue
zlib_places
=
"/usr/local /usr /opt/local /sw"
# Check whether --with-zlib was given.
if
test
"
${
with_zlib
+set
}
"
=
set
;
then
:
withval
=
$with_zlib
;
if
test
"
$withval
"
!=
no
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
if
test
-d
"
$withval
"
then
zlib_places
=
"
$withval
$zlib_places
"
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: WARNING: Sorry,
$withval
does not exist, checking usual places"
>
&5
$as_echo
"
$as_me
: WARNING: Sorry,
$withval
does not exist, checking usual places"
>
&2
;
}
fi
else
zlib_places
=
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
fi
else
else
# Passes both tests.
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
ac_preproc_ok
=
:
$as_echo
"yes"
>
&6
;
}
break
fi
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm
-f
conftest.i conftest.err conftest.
$ac_ext
if
$ac_preproc_ok
;
then
:
break
fi
#
# Locate zlib, if wanted
#
if
test
-n
"
${
zlib_places
}
"
then
# check the user supplied or any other more or less 'standard' place:
# Most UNIX systems : /usr/local and /usr
# MacPorts / Fink on OSX : /opt/local respectively /sw
for
ZLIB_HOME
in
${
zlib_places
}
;
do
if
test
-f
"
${
ZLIB_HOME
}
/include/zlib.h"
;
then
break
;
fi
ZLIB_HOME
=
""
done
done
ac_cv_prog_CPP
=
$CPP
fi
ZLIB_OLD_LDFLAGS
=
$LDFLAGS
CPP
=
$ac_cv_prog_CPP
ZLIB_OLD_CPPFLAGS
=
$CPPFLAGS
if
test
-n
"
${
ZLIB_HOME
}
"
;
then
LDFLAGS
=
"
$LDFLAGS
-L
${
ZLIB_HOME
}
/lib"
CPPFLAGS
=
"
$CPPFLAGS
-I
${
ZLIB_HOME
}
/include"
fi
ac_ext
=
c
ac_cpp
=
'$CPP $CPPFLAGS'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for inflateEnd in -lz"
>
&5
$as_echo_n
"checking for inflateEnd in -lz... "
>
&6
;
}
if
${
ac_cv_lib_z_inflateEnd
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
else
ac_cv_prog_CPP
=
$CPP
ac_check_lib_save_LIBS
=
$LIBS
fi
LIBS
=
"-lz
$LIBS
"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$CPP
"
>
&5
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
$as_echo
"
$CPP
"
>
&6
;
}
ac_preproc_ok
=
false
for
ac_c_preproc_warn_flag
in
''
yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
/* Override any GCC internal prototype to avoid an error.
#else
Use char because int might match the return type of a GCC
# include <assert.h>
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
#endif
Syntax error
char inflateEnd ();
int
main ()
{
return inflateEnd ();
;
return 0;
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
cpp
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
ac_cv_lib_z_inflateEnd
=
yes
else
else
# Broken: fails on valid input.
ac_cv_lib_z_inflateEnd
=
no
continue
fi
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
LIBS
=
$ac_check_lib_save_LIBS
# can be detected and how.
fi
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_z_inflateEnd
"
>
&5
/* end confdefs.h. */
$as_echo
"
$ac_cv_lib_z_inflateEnd
"
>
&6
;
}
#include <ac_nonexistent.h>
if
test
"x
$ac_cv_lib_z_inflateEnd
"
=
xyes
;
then
:
_ACEOF
zlib_cv_libz
=
yes
if
ac_fn_c_try_cpp
"
$LINENO
"
;
then
:
# Broken: success on invalid input.
continue
else
else
# Passes both tests.
zlib_cv_libz
=
no
ac_preproc_ok
=
:
break
fi
fi
rm
-f
conftest.err conftest.i conftest.
$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm
-f
conftest.i conftest.err conftest.
$ac_ext
if
$ac_preproc_ok
;
then
:
ac_fn_c_check_header_mongrel
"
$LINENO
"
"zlib.h"
"ac_cv_header_zlib_h"
"
$ac_includes_default
"
if
test
"x
$ac_cv_header_zlib_h
"
=
xyes
;
then
:
zlib_cv_zlib_h
=
yes
else
else
{
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: error: in
\`
$ac_pwd
':"
>
&5
zlib_cv_zlib_h
=
no
$as_echo
"
$as_me
: error: in
\`
$ac_pwd
':"
>
&2
;
}
as_fn_error
$?
"C preprocessor
\"
$CPP
\"
fails sanity check
See
\`
config.log' for more details"
"
$LINENO
"
5
;
}
fi
fi
ac_ext
=
c
ac_ext
=
c
ac_cpp
=
'$CPP $CPPFLAGS'
ac_cpp
=
'$CPP $CPPFLAGS'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_compile
=
'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_link
=
'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
ac_compiler_gnu
=
$ac_cv_c_compiler_gnu
if
test
"
$zlib_cv_libz
"
=
"yes"
&&
test
"
$zlib_cv_zlib_h
"
=
"yes"
then
#
# If both library and header were found, action-if-found
#
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for grep that handles long lines and -e"
>
&5
CPPFLAGS
=
"
$CPPFLAGS
-I
${
ZLIB_HOME
}
/include"
$as_echo_n
"checking for grep that handles long lines and -e... "
>
&6
;
}
LDFLAGS
=
"
$LDFLAGS
-L
${
ZLIB_HOME
}
/lib"
if
${
ac_cv_path_GREP
+
:
}
false
;
then
:
LIBS
=
"-lz
$LIBS
"
$as_echo
"#define HAVE_LIBZ 1"
>>
confdefs.h
else
#
# If either header or library was not found, action-if-not-found
#
as_fn_error
$?
"No zlib found"
"
$LINENO
"
5
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for rl_save_prompt in -lreadline"
>
&5
$as_echo_n
"checking for rl_save_prompt in -lreadline... "
>
&6
;
}
if
${
ac_cv_lib_readline_rl_save_prompt
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
if
test
-z
"
$GREP
"
;
then
ac_check_lib_save_LIBS
=
$LIBS
ac_path_GREP_found
=
false
LIBS
=
"-lreadline
$LIBS
"
# Loop through the user's path and test for each of PROGNAME-LIST
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
as_save_IFS
=
$IFS
;
IFS
=
$PATH_SEPARATOR
/* end confdefs.h. */
for
as_dir
in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin
do
IFS
=
$as_save_IFS
test
-z
"
$as_dir
"
&&
as_dir
=
.
for
ac_prog
in
grep
ggrep
;
do
for
ac_exec_ext
in
''
$ac_executable_extensions
;
do
ac_path_GREP
=
"
$as_dir
/
$ac_prog$ac_exec_ext
"
as_fn_executable_p
"
$ac_path_GREP
"
||
continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case
`
"
$ac_path_GREP
"
--version
2>&1
`
in
*
GNU
*
)
ac_cv_path_GREP
=
"
$ac_path_GREP
"
ac_path_GREP_found
=
:
;;
*
)
ac_count
=
0
$as_echo_n
0123456789
>
"conftest.in"
while
:
do
cat
"conftest.in"
"conftest.in"
>
"conftest.tmp"
mv
"conftest.tmp"
"conftest.in"
cp
"conftest.in"
"conftest.nl"
$as_echo
'GREP'
>>
"conftest.nl"
"
$ac_path_GREP
"
-e
'GREP$'
-e
'-(cannot match)-'
<
"conftest.nl"
>
"conftest.out"
2>/dev/null
||
break
diff
"conftest.out"
"conftest.nl"
>
/dev/null 2>&1
||
break
as_fn_arith
$ac_count
+ 1
&&
ac_count
=
$as_val
if
test
$ac_count
-gt
${
ac_path_GREP_max
-0
}
;
then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP
=
"
$ac_path_GREP
"
ac_path_GREP_max
=
$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test
$ac_count
-gt
10
&&
break
done
rm
-f
conftest.in conftest.tmp conftest.nl conftest.out
;;
esac
$ac_path_GREP_found
&&
break
3
/* Override any GCC internal prototype to avoid an error.
done
Use char because int might match the return type of a GCC
done
builtin and then its argument prototype would still apply. */
done
#ifdef __cplusplus
IFS
=
$as_save_IFS
extern "C"
if
test
-z
"
$ac_cv_path_GREP
"
;
then
#endif
as_fn_error
$?
"no acceptable grep could be found in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin"
"
$LINENO
"
5
char rl_save_prompt ();
fi
int
main ()
{
return rl_save_prompt ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_readline_rl_save_prompt
=
yes
else
else
ac_cv_
path_GREP
=
$GREP
ac_cv_
lib_readline_rl_save_prompt
=
no
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_
path_GREP
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_
lib_readline_rl_save_prompt
"
>
&5
$as_echo
"
$ac_cv_
path_GREP
"
>
&6
;
}
$as_echo
"
$ac_cv_
lib_readline_rl_save_prompt
"
>
&6
;
}
GREP
=
"
$ac_cv_path_GREP
"
if
test
"x
$ac_cv_lib_readline_rl_save_prompt
"
=
xyes
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for egrep"
>
&5
$as_echo
"#define READLINE_GNU 1"
>>
confdefs.h
$as_echo_n
"checking for egrep... "
>
&6
;
}
if
${
ac_cv_path_EGREP
+
:
}
false
;
then
:
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-lreadline"
;
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for library containing tgetnum"
>
&5
$as_echo_n
"checking for library containing tgetnum... "
>
&6
;
}
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
if
echo
a |
$GREP
-E
'(a|b)'
>
/dev/null 2>&1
ac_func_search_save_LIBS
=
$LIBS
then
ac_cv_path_EGREP
=
"
$GREP
-E"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
else
/* end confdefs.h. */
if
test
-z
"
$EGREP
"
;
then
ac_path_EGREP_found
=
false
/* Override any GCC internal prototype to avoid an error.
# Loop through the user's path and test for each of PROGNAME-LIST
Use char because int might match the return type of a GCC
as_save_IFS
=
$IFS
;
IFS
=
$PATH_SEPARATOR
builtin and then its argument prototype would still apply. */
for
as_dir
in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin
#ifdef __cplusplus
do
extern "C"
IFS
=
$as_save_IFS
#endif
test
-z
"
$as_dir
"
&&
as_dir
=
.
char tgetnum ();
for
ac_prog
in
egrep
;
do
int
for
ac_exec_ext
in
''
$ac_executable_extensions
;
do
main ()
ac_path_EGREP
=
"
$as_dir
/
$ac_prog$ac_exec_ext
"
{
as_fn_executable_p
"
$ac_path_EGREP
"
||
continue
return tgetnum ();
# Check for GNU ac_path_EGREP and select it if it is found.
;
# Check for GNU $ac_path_EGREP
return 0;
case
`
"
$ac_path_EGREP
"
--version
2>&1
`
in
}
*
GNU
*
)
_ACEOF
ac_cv_path_EGREP
=
"
$ac_path_EGREP
"
ac_path_EGREP_found
=
:
;;
for
ac_lib
in
''
ncursesw ncurses curses
;
do
*
)
if
test
-z
"
$ac_lib
"
;
then
ac_count
=
0
ac_res
=
"none required"
$as_echo_n
0123456789
>
"conftest.in"
else
while
:
ac_res
=
-l
$ac_lib
do
LIBS
=
"-l
$ac_lib
$ac_func_search_save_LIBS
"
cat
"conftest.in"
"conftest.in"
>
"conftest.tmp"
mv
"conftest.tmp"
"conftest.in"
cp
"conftest.in"
"conftest.nl"
$as_echo
'EGREP'
>>
"conftest.nl"
"
$ac_path_EGREP
"
'EGREP$'
<
"conftest.nl"
>
"conftest.out"
2>/dev/null
||
break
diff
"conftest.out"
"conftest.nl"
>
/dev/null 2>&1
||
break
as_fn_arith
$ac_count
+ 1
&&
ac_count
=
$as_val
if
test
$ac_count
-gt
${
ac_path_EGREP_max
-0
}
;
then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP
=
"
$ac_path_EGREP
"
ac_path_EGREP_max
=
$ac_count
fi
fi
# 10*(2^10) chars as input seems more than enough
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
test
$ac_count
-gt
10
&&
break
ac_cv_search_tgetnum
=
$ac_res
done
fi
rm
-f
conftest.in conftest.tmp conftest.nl conftest.out
;;
rm
-f
core conftest.err conftest.
$ac_objext
\
esac
conftest
$ac_exeext
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
break
fi
done
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
$ac_path_EGREP_found
&&
break
3
done
done
done
IFS
=
$as_save_IFS
if
test
-z
"
$ac_cv_path_EGREP
"
;
then
as_fn_error
$?
"no acceptable egrep could be found in
$PATH$PATH_SEPARATOR
/usr/xpg4/bin"
"
$LINENO
"
5
fi
else
else
ac_cv_
path_EGREP
=
$EGREP
ac_cv_
search_tgetnum
=
no
fi
fi
rm
conftest.
$ac_ext
fi
LIBS
=
$ac_func_search_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_path_EGREP
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_search_tgetnum
"
>
&5
$as_echo
"
$ac_cv_path_EGREP
"
>
&6
;
}
$as_echo
"
$ac_cv_search_tgetnum
"
>
&6
;
}
EGREP
=
"
$ac_cv_path_EGREP
"
ac_res
=
$ac_cv_search_tgetnum
if
test
"
$ac_res
"
!=
no
;
then
:
test
"
$ac_res
"
=
"none required"
||
LIBS
=
"
$ac_res
$LIBS
"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for ANSI C header files
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for rl_set_prompt in -ledit
"
>
&5
$as_echo_n
"checking for
ANSI C header files
... "
>
&6
;
}
$as_echo_n
"checking for
rl_set_prompt in -ledit
... "
>
&6
;
}
if
${
ac_cv_
header_stdc
+
:
}
false
;
then
:
if
${
ac_cv_
lib_edit_rl_set_prompt
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-ledit
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char rl_set_prompt ();
int
int
main ()
main ()
{
{
return rl_set_prompt ();
;
;
return 0;
return 0;
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
compile
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
ac_cv_
header_stdc
=
yes
ac_cv_
lib_edit_rl_set_prompt
=
yes
else
else
ac_cv_
header_stdc
=
no
ac_cv_
lib_edit_rl_set_prompt
=
no
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
if
test
$ac_cv_header_stdc
=
yes
;
then
LIBS
=
$ac_check_lib_save_LIBS
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
fi
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_edit_rl_set_prompt
"
>
&5
/* end confdefs.h. */
$as_echo
"
$ac_cv_lib_edit_rl_set_prompt
"
>
&6
;
}
#include <string.h>
if
test
"x
$ac_cv_lib_edit_rl_set_prompt
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBEDIT 1
_ACEOF
_ACEOF
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
$EGREP
"memchr"
>
/dev/null 2>&1
;
then
:
else
LIBS
=
"-ledit
$LIBS
"
ac_cv_header_stdc
=
no
fi
rm
-f
conftest
*
fi
fi
if
test
$ac_cv_header_stdc
=
yes
;
then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
$as_echo
"#define READLINE_EDIT 1"
>>
confdefs.h
if
(
eval
"
$ac_cpp
conftest.
$ac_ext
"
)
2>&5 |
$EGREP
"free"
>
/dev/null 2>&1
;
then
:
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-ledit"
;
else
ac_cv_header_stdc
=
no
fi
rm
-f
conftest
*
fi
fi
if
test
$ac_cv_header_stdc
=
yes
;
then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for libconfig"
>
&5
if
test
"
$cross_compiling
"
=
yes
;
then
:
$as_echo_n
"checking for libconfig... "
>
&6
;
}
:
# Check whether --enable-libconfig was given.
if
test
"
${
enable_libconfig
+set
}
"
=
set
;
then
:
enableval
=
$enable_libconfig
;
if
test
"x
$enableval
"
=
"xno"
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: disabled"
>
&5
$as_echo
"disabled"
>
&6
;
}
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: enabled"
>
&5
$as_echo
"enabled"
>
&6
;
}
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for config_init in -lconfig"
>
&5
$as_echo_n
"checking for config_init in -lconfig... "
>
&6
;
}
if
${
ac_cv_lib_config_config_init
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
else
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lconfig
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c)
\
(('a' <= (c) && (c) <= 'i')
\
|| ('j' <= (c) && (c) <= 'r')
\
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char config_init ();
int
int
main ()
main ()
{
{
int i;
return config_init ();
for (i = 0; i < 256; i++)
;
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
return 2;
return 0;
return 0;
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_
run
"
$LINENO
"
;
then
:
if
ac_fn_c_try_
link
"
$LINENO
"
;
then
:
ac_cv_lib_config_config_init
=
yes
else
else
ac_cv_
header_stdc
=
no
ac_cv_
lib_config_config_init
=
no
fi
fi
rm
-f
core
*
.core core.conftest.
*
gmon.out bb.out conftest
$ac_exeext
\
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest.
$ac_objext
conftest.beam conftest.
$ac_ext
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_config_config_init
"
>
&5
$as_echo
"
$ac_cv_lib_config_config_init
"
>
&6
;
}
if
test
"x
$ac_cv_lib_config_config_init
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBCONFIG 1
_ACEOF
LIBS
=
"-lconfig
$LIBS
"
else
as_fn_error
$?
"No libconfig found. Try --disable-libconfig"
"
$LINENO
"
5
fi
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_header_stdc
"
>
&5
$as_echo
"
$ac_cv_header_stdc
"
>
&6
;
}
if
test
$ac_cv_header_stdc
=
yes
;
then
$as_echo
"#define STDC_HEADERS 1"
>>
confdefs.h
fi
fi
else
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: enabled"
>
&5
for
ac_header
in
sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h
\
$as_echo
"enabled"
>
&6
;
}
inttypes.h stdint.h unistd.h
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for config_init in -lconfig"
>
&5
do
:
$as_echo_n
"checking for config_init in -lconfig... "
>
&6
;
}
as_ac_Header
=
`
$as_echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
if
${
ac_cv_lib_config_config_init
+
:
}
false
;
then
:
ac_fn_c_check_header_compile
"
$LINENO
"
"
$ac_header
"
"
$as_ac_Header
"
"
$ac_includes_default
$as_echo_n
"(cached) "
>
&6
"
else
if
eval test
\"
x
\$
"
$as_ac_Header
"
\"
=
x
"yes"
;
then
:
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lconfig
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char config_init ();
int
main ()
{
return config_init ();
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_lib_config_config_init
=
yes
else
ac_cv_lib_config_config_init
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_config_config_init
"
>
&5
$as_echo
"
$ac_cv_lib_config_config_init
"
>
&6
;
}
if
test
"x
$ac_cv_lib_config_config_init
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
cat
>>
confdefs.h
<<
_ACEOF
#define
`
$as_echo
"HAVE_
$ac_header
" |
$as_tr_cpp
`
1
#define
HAVE_LIBCONFIG
1
_ACEOF
_ACEOF
LIBS
=
"-lconfig
$LIBS
"
else
as_fn_error
$?
"No libconfig found. Try --disable-libconfig"
"
$LINENO
"
5
fi
fi
done
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for liblua"
>
&5
$as_echo_n
"checking for liblua... "
>
&6
;
}
# Check whether --enable-liblua was given.
# Check whether --enable-liblua was given.
if
test
"
${
enable_liblua
+set
}
"
=
set
;
then
:
if
test
"
${
enable_liblua
+set
}
"
=
set
;
then
:
enableval
=
$enable_liblua
;
enableval
=
$enable_liblua
;
...
@@ -6316,7 +6626,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
...
@@ -6316,7 +6626,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
# values after options handling.
ac_log="
ac_log="
This file was extended by telegram
$as_me
0.1
, which was
This file was extended by telegram
-cli
$as_me
1.0
, which was
generated by GNU Autoconf 2.69. Invocation command line was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES =
$CONFIG_FILES
CONFIG_FILES =
$CONFIG_FILES
...
@@ -6378,7 +6688,7 @@ _ACEOF
...
@@ -6378,7 +6688,7 @@ _ACEOF
cat
>>
$CONFIG_STATUS
<<
_ACEOF
|| ac_write_fail=1
cat
>>
$CONFIG_STATUS
<<
_ACEOF
|| ac_write_fail=1
ac_cs_config="`
$as_echo
"
$ac_configure_args
" | sed 's/^ //; s/[
\\
""
\`\$
]/
\\\\
&/g'`"
ac_cs_config="`
$as_echo
"
$ac_configure_args
" | sed 's/^ //; s/[
\\
""
\`\$
]/
\\\\
&/g'`"
ac_cs_version="
\\
ac_cs_version="
\\
telegram
config.status 0.1
telegram
-cli config.status 1.0
configured by
$0
, generated by GNU Autoconf 2.69,
configured by
$0
, generated by GNU Autoconf 2.69,
with options
\\
"
\$
ac_cs_config
\\
"
with options
\\
"
\$
ac_cs_config
\\
"
...
...
configure.ac
View file @
7d7a40a8
AC_PREREQ([2.68])
AC_PREREQ([2.68])
AC_INIT([telegram
], [0.1
])
AC_INIT([telegram
-cli], [1.0
])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([config.h])
m4_include([ax_lua.m4])
m4_include([ax_lua.m4])
m4_include([m4_ax_check_openssl.m4])
m4_include([m4_ax_check_zlib.m4])
# Checks for programs.
# Checks for programs.
AC_PROG_CC
AC_PROG_CC
...
@@ -16,11 +18,16 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib"
...
@@ -16,11 +18,16 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([m], [sqrt])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([backtrace], [execinfo])
AC_SEARCH_LIBS([backtrace], [execinfo])
AC_CHECK_LIB([z], [inflate])
AC_CHECK_LIB([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
AC_CHECK_LIB([crypto], [AES_set_encrypt_key])
AC_CHECK_LIB([event], [event_base_new])
EXTRA_LIBS=""
EXTRA_LIBS=""
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
AX_CHECK_OPENSSL(,[AC_MSG_ERROR([No openssl found])])
AX_CHECK_ZLIB(, [AC_MSG_ERROR([No zlib found])])
AC_CHECK_LIB([readline], [rl_save_prompt],
AC_CHECK_LIB([readline], [rl_save_prompt],
[
[
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
...
...
interface.c
View file @
7d7a40a8
...
@@ -354,6 +354,7 @@ struct command commands[] = {
...
@@ -354,6 +354,7 @@ struct command commands[] = {
{
"chat_info"
,
{
ca_chat
,
ca_none
}},
{
"chat_info"
,
{
ca_chat
,
ca_none
}},
{
"user_info"
,
{
ca_user
,
ca_none
}},
{
"user_info"
,
{
ca_user
,
ca_none
}},
{
"fwd"
,
{
ca_peer
,
ca_number
,
ca_none
}},
{
"fwd"
,
{
ca_peer
,
ca_number
,
ca_none
}},
{
"fwd_media"
,
{
ca_peer
,
ca_number
,
ca_none
}},
{
"msg"
,
{
ca_peer
,
ca_string_end
}},
{
"msg"
,
{
ca_peer
,
ca_string_end
}},
{
"rename_chat"
,
{
ca_peer
,
ca_string_end
}},
{
"rename_chat"
,
{
ca_peer
,
ca_string_end
}},
{
"load_photo"
,
{
ca_number
,
ca_none
}},
{
"load_photo"
,
{
ca_number
,
ca_none
}},
...
@@ -1180,6 +1181,14 @@ void interpreter (char *line UU) {
...
@@ -1180,6 +1181,14 @@ void interpreter (char *line UU) {
RET
;
RET
;
}
}
tgl_do_forward_message
(
id
,
num
,
0
,
0
);
tgl_do_forward_message
(
id
,
num
,
0
,
0
);
}
else
if
(
IS_WORD
(
"fwd_media"
))
{
GET_PEER
;
int
num
=
next_token_int
();
if
(
num
==
NOT_FOUND
||
num
<=
0
)
{
printf
(
"Bad msg id
\n
"
);
RET
;
}
tgl_do_forward_media
(
id
,
num
,
0
,
0
);
}
else
if
(
IS_WORD
(
"load_photo"
))
{
}
else
if
(
IS_WORD
(
"load_photo"
))
{
long
long
num
=
next_token_int
();
long
long
num
=
next_token_int
();
if
(
num
==
NOT_FOUND
)
{
if
(
num
==
NOT_FOUND
)
{
...
...
lua-tg.c
View file @
7d7a40a8
...
@@ -455,6 +455,7 @@ enum lua_query_type {
...
@@ -455,6 +455,7 @@ enum lua_query_type {
lq_send_video
,
lq_send_video
,
lq_send_text
,
lq_send_text
,
lq_fwd
,
lq_fwd
,
lq_fwd_media
,
lq_load_photo
,
lq_load_photo
,
lq_load_video_thumb
,
lq_load_video_thumb
,
lq_load_video
,
lq_load_video
,
...
@@ -922,6 +923,10 @@ void lua_do_all (void) {
...
@@ -922,6 +923,10 @@ void lua_do_all (void) {
tgl_do_forward_message
(((
tgl_peer_t
*
)
lua_ptr
[
p
+
1
])
->
id
,
((
struct
tgl_message
*
)
lua_ptr
[
p
+
2
])
->
id
,
lua_msg_cb
,
lua_ptr
[
p
]);
tgl_do_forward_message
(((
tgl_peer_t
*
)
lua_ptr
[
p
+
1
])
->
id
,
((
struct
tgl_message
*
)
lua_ptr
[
p
+
2
])
->
id
,
lua_msg_cb
,
lua_ptr
[
p
]);
p
+=
3
;
p
+=
3
;
break
;
break
;
case
lq_fwd_media
:
tgl_do_forward_media
(((
tgl_peer_t
*
)
lua_ptr
[
p
+
1
])
->
id
,
((
struct
tgl_message
*
)
lua_ptr
[
p
+
2
])
->
id
,
lua_msg_cb
,
lua_ptr
[
p
]);
p
+=
3
;
break
;
case
lq_chat_info
:
case
lq_chat_info
:
tgl_do_get_chat_info
(((
tgl_peer_t
*
)
lua_ptr
[
p
+
1
])
->
id
,
0
,
lua_chat_cb
,
lua_ptr
[
p
]);
tgl_do_get_chat_info
(((
tgl_peer_t
*
)
lua_ptr
[
p
+
1
])
->
id
,
0
,
lua_chat_cb
,
lua_ptr
[
p
]);
p
+=
2
;
p
+=
2
;
...
@@ -1077,6 +1082,7 @@ struct lua_function functions[] = {
...
@@ -1077,6 +1082,7 @@ struct lua_function functions[] = {
{
"load_document"
,
lq_load_document
,
{
lfp_msg
,
lfp_none
}},
{
"load_document"
,
lq_load_document
,
{
lfp_msg
,
lfp_none
}},
{
"load_document_thumb"
,
lq_load_document_thumb
,
{
lfp_msg
,
lfp_none
}},
{
"load_document_thumb"
,
lq_load_document_thumb
,
{
lfp_msg
,
lfp_none
}},
{
"fwd_msg"
,
lq_fwd
,
{
lfp_peer
,
lfp_msg
,
lfp_none
}},
{
"fwd_msg"
,
lq_fwd
,
{
lfp_peer
,
lfp_msg
,
lfp_none
}},
{
"fwd_media"
,
lq_fwd_media
,
{
lfp_peer
,
lfp_msg
,
lfp_none
}},
{
"chat_info"
,
lq_chat_info
,
{
lfp_chat
,
lfp_none
}},
{
"chat_info"
,
lq_chat_info
,
{
lfp_chat
,
lfp_none
}},
{
"user_info"
,
lq_user_info
,
{
lfp_user
,
lfp_none
}},
{
"user_info"
,
lq_user_info
,
{
lfp_user
,
lfp_none
}},
{
"get_history"
,
lq_history
,
{
lfp_peer
,
lfp_nonnegative_number
,
lfp_none
}},
{
"get_history"
,
lq_history
,
{
lfp_peer
,
lfp_nonnegative_number
,
lfp_none
}},
...
...
m4_ax_check_openssl.m4
0 → 100644
View file @
7d7a40a8
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
#
# DESCRIPTION
#
# Look for OpenSSL in a number of default spots, or in a user-selected
# spot (via --with-openssl). Sets
#
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_LIBS to the -l directives required
# OPENSSL_LDFLAGS to the -L or -R flags required
#
# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
#
# This macro sets OPENSSL_INCLUDES such that source files should use the
# openssl/ directory in include directives:
#
# #include <openssl/hmac.h>
#
# LICENSE
#
# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
AC_DEFUN([AX_CHECK_OPENSSL], [
found=false
AC_ARG_WITH([openssl],
[AS_HELP_STRING([--with-openssl=DIR],
[root of the OpenSSL directory])],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([Invalid --with-openssl value])
;;
*) ssldirs="$withval"
;;
esac
], [
# if pkg-config is installed and openssl has installed a .pc file,
# then use that information and don't search ssldirs
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
if test x"$PKG_CONFIG" != x""; then
OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
if test $? = 0; then
OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
found=true
fi
fi
# no such luck; use some default ssldirs
if ! $found; then
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
fi
]
)
# note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
# an 'openssl' subdirectory
if ! $found; then
OPENSSL_INCLUDES=
for ssldir in $ssldirs; do
AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
if test -f "$ssldir/include/openssl/ssl.h"; then
OPENSSL_INCLUDES="-I$ssldir/include"
OPENSSL_LDFLAGS="-L$ssldir/lib"
OPENSSL_LIBS="-lssl -lcrypto"
found=true
AC_MSG_RESULT([yes])
break
else
AC_MSG_RESULT([no])
fi
done
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
# it will just work!
fi
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
"OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
save_CPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
LIBS="$OPENSSL_LIBS $LIBS"
CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
[
AC_MSG_RESULT([yes])
$1
], [
AC_MSG_RESULT([no])
$2
])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
AC_SUBST([OPENSSL_INCLUDES])
AC_SUBST([OPENSSL_LIBS])
AC_SUBST([OPENSSL_LDFLAGS])
])
m4_ax_check_zlib.m4
0 → 100644
View file @
7d7a40a8
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# This macro searches for an installed zlib library. If nothing was
# specified when calling configure, it searches first in /usr/local and
# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
# --without-zlib is specified, the library is not searched at all.
#
# If either the header file (zlib.h) or the library (libz) is not found,
# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
# not specified, the configuration exits on error, asking for a valid zlib
# installation directory or --without-zlib.
#
# If both header file and library are found, shell commands
# 'action-if-found' is run. If 'action-if-found' is not specified, the
# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
# for this symbol in a config.h file. Sample usage in a C/C++ source is as
# follows:
#
# #ifdef HAVE_LIBZ
# #include <zlib.h>
# #endif /* HAVE_LIBZ */
#
# LICENSE
#
# Copyright (c) 2008 Loic Dachary <loic@senga.org>
# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 14
AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
AC_DEFUN([AX_CHECK_ZLIB],
#
# Handle user hints
#
[AC_MSG_CHECKING(if zlib is wanted)
zlib_places="/usr/local /usr /opt/local /sw"
AC_ARG_WITH([zlib],
[ --with-zlib=DIR root directory path of zlib installation @<:@defaults to
/usr/local or /usr if not found in /usr/local@:>@
--without-zlib to disable zlib usage completely],
[if test "$withval" != no ; then
AC_MSG_RESULT(yes)
if test -d "$withval"
then
zlib_places="$withval $zlib_places"
else
AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
fi
else
zlib_places=
AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(yes)])
#
# Locate zlib, if wanted
#
if test -n "${zlib_places}"
then
# check the user supplied or any other more or less 'standard' place:
# Most UNIX systems : /usr/local and /usr
# MacPorts / Fink on OSX : /opt/local respectively /sw
for ZLIB_HOME in ${zlib_places} ; do
if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
ZLIB_HOME=""
done
ZLIB_OLD_LDFLAGS=$LDFLAGS
ZLIB_OLD_CPPFLAGS=$CPPFLAGS
if test -n "${ZLIB_HOME}"; then
LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
fi
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
AC_LANG_RESTORE
if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
then
#
# If both library and header were found, action-if-found
#
m4_ifblank([$1],[
CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
LIBS="-lz $LIBS"
AC_DEFINE([HAVE_LIBZ], [1],
[Define to 1 if you have `z' library (-lz)])
],[
# Restore variables
LDFLAGS="$ZLIB_OLD_LDFLAGS"
CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
$1
])
else
#
# If either header or library was not found, action-if-not-found
#
m4_default([$2],[
AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
])
fi
fi
])
queries.c
View file @
7d7a40a8
...
@@ -1858,6 +1858,66 @@ void tgl_do_send_contact (tgl_peer_id_t id, const char *phone, int phone_len, co
...
@@ -1858,6 +1858,66 @@ void tgl_do_send_contact (tgl_peer_id_t id, const char *phone, int phone_len, co
tglq_send_query
(
tgl_state
.
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
fwd_msg_methods
,
0
,
callback
,
callback_extra
);
tglq_send_query
(
tgl_state
.
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
fwd_msg_methods
,
0
,
callback
,
callback_extra
);
}
}
void
tgl_do_forward_media
(
tgl_peer_id_t
id
,
int
n
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_message
*
M
),
void
*
callback_extra
)
{
if
(
tgl_get_peer_type
(
id
)
==
TGL_PEER_ENCR_CHAT
)
{
vlogprintf
(
E_WARNING
,
"Can not forward messages from secret chat
\n
"
);
callback
(
callback_extra
,
0
,
0
);
return
;
}
struct
tgl_message
*
M
=
tgl_message_get
(
n
);
if
(
!
M
)
{
vlogprintf
(
E_WARNING
,
"No such message
\n
"
);
callback
(
callback_extra
,
0
,
0
);
return
;
}
if
(
M
->
flags
&
FLAG_ENCRYPTED
)
{
vlogprintf
(
E_WARNING
,
"Can not forward media from encrypted message
\n
"
);
callback
(
callback_extra
,
0
,
0
);
return
;
}
if
(
M
->
media
.
type
!=
tgl_message_media_photo
&&
M
->
media
.
type
!=
tgl_message_media_video
&&
M
->
media
.
type
!=
tgl_message_media_audio
&&
M
->
media
.
type
!=
tgl_message_media_document
)
{
vlogprintf
(
E_WARNING
,
"Can only forward photo/audio/video/document
\n
"
);
callback
(
callback_extra
,
0
,
0
);
return
;
}
clear_packet
();
out_int
(
CODE_messages_send_media
);
out_peer_id
(
id
);
switch
(
M
->
media
.
type
)
{
case
tgl_message_media_photo
:
out_int
(
CODE_input_media_photo
);
out_int
(
CODE_input_photo
);
out_long
(
M
->
media
.
photo
.
id
);
out_long
(
M
->
media
.
photo
.
access_hash
);
break
;
case
tgl_message_media_video
:
out_int
(
CODE_input_media_video
);
out_int
(
CODE_input_video
);
out_long
(
M
->
media
.
video
.
id
);
out_long
(
M
->
media
.
video
.
access_hash
);
break
;
case
tgl_message_media_audio
:
out_int
(
CODE_input_media_audio
);
out_int
(
CODE_input_audio
);
out_long
(
M
->
media
.
audio
.
id
);
out_long
(
M
->
media
.
audio
.
access_hash
);
break
;
case
tgl_message_media_document
:
out_int
(
CODE_input_media_document
);
out_int
(
CODE_input_document
);
out_long
(
M
->
media
.
document
.
id
);
out_long
(
M
->
media
.
document
.
access_hash
);
break
;
default:
assert
(
0
);
}
long
long
r
;
tglt_secure_random
(
&
r
,
8
);
out_long
(
r
);
tglq_send_query
(
tgl_state
.
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
fwd_msg_methods
,
0
,
callback
,
callback_extra
);
}
/* }}} */
/* }}} */
/* {{{ Rename chat */
/* {{{ Rename chat */
...
...
tgl.h
View file @
7d7a40a8
...
@@ -280,6 +280,7 @@ void tgl_do_help_get_config_dc (struct tgl_dc *D, void (*callback)(void *, int),
...
@@ -280,6 +280,7 @@ void tgl_do_help_get_config_dc (struct tgl_dc *D, void (*callback)(void *, int),
void
tgl_do_export_card
(
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
int
size
,
int
*
card
),
void
*
callback_extra
);
void
tgl_do_export_card
(
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
int
size
,
int
*
card
),
void
*
callback_extra
);
void
tgl_do_import_card
(
int
size
,
int
*
card
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_user
*
U
),
void
*
callback_extra
);
void
tgl_do_import_card
(
int
size
,
int
*
card
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_user
*
U
),
void
*
callback_extra
);
void
tgl_do_send_contact
(
tgl_peer_id_t
id
,
const
char
*
phone
,
int
phone_len
,
const
char
*
first_name
,
int
first_name_len
,
const
char
*
last_name
,
int
last_name_len
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_message
*
M
),
void
*
callback_extra
);
void
tgl_do_send_contact
(
tgl_peer_id_t
id
,
const
char
*
phone
,
int
phone_len
,
const
char
*
first_name
,
int
first_name_len
,
const
char
*
last_name
,
int
last_name_len
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_message
*
M
),
void
*
callback_extra
);
void
tgl_do_forward_media
(
tgl_peer_id_t
id
,
int
n
,
void
(
*
callback
)(
void
*
callback_extra
,
int
success
,
struct
tgl_message
*
M
),
void
*
callback_extra
);
void
tgl_do_visualize_key
(
tgl_peer_id_t
id
,
unsigned
char
buf
[
16
]);
void
tgl_do_visualize_key
(
tgl_peer_id_t
id
,
unsigned
char
buf
[
16
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment