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
9f8828fc
Commit
9f8828fc
authored
Sep 07, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to add support of libevent 1.4.*
parent
d7f9fcc6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
255 additions
and
293 deletions
+255
-293
config.h.in
config.h.in
+6
-9
configure
configure
+185
-272
configure.ac
configure.ac
+8
-12
event-old.h
event-old.h
+20
-0
interface.c
interface.c
+6
-0
loop.c
loop.c
+5
-0
lua-tg.c
lua-tg.c
+5
-0
mtproto-client.c
mtproto-client.c
+5
-0
net.c
net.c
+5
-0
queries.c
queries.c
+5
-0
tgl.c
tgl.c
+5
-0
No files found.
config.h.in
View file @
9f8828fc
/* config.h.in. Generated from configure.ac by autoheader. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Use libevent v1 */
#undef EVENT_V1
/* Use libevent v2 */
#undef EVENT_V2
/* Define to 1 if you have the `alarm' function. */
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
#undef HAVE_ALARM
...
@@ -24,9 +30,6 @@
...
@@ -24,9 +30,6 @@
/* 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 `edit' library (-ledit). */
#undef HAVE_LIBEDIT
/* Define to 1 if you have the `event' library (-levent). */
/* Define to 1 if you have the `event' library (-levent). */
#undef HAVE_LIBEVENT
#undef HAVE_LIBEVENT
...
@@ -143,12 +146,6 @@
...
@@ -143,12 +146,6 @@
/* Use custom prog name */
/* Use custom prog name */
#undef PROG_NAME
#undef PROG_NAME
/* Use libedit */
#undef READLINE_EDIT
/* Use gnu libreadline */
#undef READLINE_GNU
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
#undef STDC_HEADERS
...
...
configure
View file @
9f8828fc
...
@@ -634,13 +634,13 @@ LUA_PLATFORM
...
@@ -634,13 +634,13 @@ LUA_PLATFORM
LUA_SHORT_VERSION
LUA_SHORT_VERSION
LUA_VERSION
LUA_VERSION
LUA
LUA
EGREP
GREP
CPP
OPENSSL_LDFLAGS
OPENSSL_LDFLAGS
OPENSSL_LIBS
OPENSSL_LIBS
OPENSSL_INCLUDES
OPENSSL_INCLUDES
PKG_CONFIG
PKG_CONFIG
EGREP
GREP
CPP
OBJEXT
OBJEXT
EXEEXT
EXEEXT
ac_ct_CC
ac_ct_CC
...
@@ -3535,162 +3535,8 @@ else
...
@@ -3535,162 +3535,8 @@ else
as_fn_error
$?
"no libevent found"
"
$LINENO
"
5
as_fn_error
$?
"no libevent found"
"
$LINENO
"
5
fi
fi
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
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
else
case
$PKG_CONFIG
in
[
\\
/]
*
|
?:[
\\
/]
*
)
ac_cv_path_PKG_CONFIG
=
"
$PKG_CONFIG
"
# Let the user override the test with a path.
;;
*
)
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
;;
esac
fi
PKG_CONFIG
=
$ac_cv_path_PKG_CONFIG
if
test
-n
"
$PKG_CONFIG
"
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$PKG_CONFIG
"
>
&5
$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
main ()
{
SSL_new(NULL)
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
as_fn_error
$?
"No openssl found"
"
$LINENO
"
5
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CPPFLAGS
=
"
$save_CPPFLAGS
"
LDFLAGS
=
"
$save_LDFLAGS
"
LIBS
=
"
$save_LIBS
"
EVENT_VER
=
""
ac_ext
=
c
ac_ext
=
c
ac_cpp
=
'$CPP $CPPFLAGS'
ac_cpp
=
'$CPP $CPPFLAGS'
...
@@ -4089,6 +3935,185 @@ fi
...
@@ -4089,6 +3935,185 @@ fi
done
done
ac_fn_c_check_header_mongrel
"
$LINENO
"
"event2/event.h"
"ac_cv_header_event2_event_h"
"
$ac_includes_default
"
if
test
"x
$ac_cv_header_event2_event_h
"
=
xyes
;
then
:
$as_echo
"#define EVENT_V2 1"
>>
confdefs.h
else
ac_fn_c_check_header_mongrel
"
$LINENO
"
"event.h"
"ac_cv_header_event_h"
"
$ac_includes_default
"
if
test
"x
$ac_cv_header_event_h
"
=
xyes
;
then
:
$as_echo
"#define EVENT_V1 1"
>>
confdefs.h
else
as_fn_error
$?
"no libevent found"
"
$LINENO
"
5
fi
fi
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
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
else
case
$PKG_CONFIG
in
[
\\
/]
*
|
?:[
\\
/]
*
)
ac_cv_path_PKG_CONFIG
=
"
$PKG_CONFIG
"
# Let the user override the test with a path.
;;
*
)
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
;;
esac
fi
PKG_CONFIG
=
$ac_cv_path_PKG_CONFIG
if
test
-n
"
$PKG_CONFIG
"
;
then
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$PKG_CONFIG
"
>
&5
$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
main ()
{
SSL_new(NULL)
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: yes"
>
&5
$as_echo
"yes"
>
&6
;
}
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: no"
>
&5
$as_echo
"no"
>
&6
;
}
as_fn_error
$?
"No openssl found"
"
$LINENO
"
5
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CPPFLAGS
=
"
$save_CPPFLAGS
"
LDFLAGS
=
"
$save_LDFLAGS
"
LIBS
=
"
$save_LIBS
"
#
#
# Handle user hints
# Handle user hints
#
#
...
@@ -4260,121 +4285,9 @@ fi
...
@@ -4260,121 +4285,9 @@ fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_readline_rl_save_prompt
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_readline_rl_save_prompt
"
>
&5
$as_echo
"
$ac_cv_lib_readline_rl_save_prompt
"
>
&6
;
}
$as_echo
"
$ac_cv_lib_readline_rl_save_prompt
"
>
&6
;
}
if
test
"x
$ac_cv_lib_readline_rl_save_prompt
"
=
xyes
;
then
:
if
test
"x
$ac_cv_lib_readline_rl_save_prompt
"
=
xyes
;
then
:
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-lreadline"
;
$as_echo
"#define READLINE_GNU 1"
>>
confdefs.h
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
else
ac_func_search_save_LIBS
=
$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 tgetnum ();
int
main ()
{
return tgetnum ();
;
return 0;
}
_ACEOF
for
ac_lib
in
''
ncursesw ncurses curses
;
do
if
test
-z
"
$ac_lib
"
;
then
ac_res
=
"none required"
else
ac_res
=
-l
$ac_lib
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
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
break
fi
done
if
${
ac_cv_search_tgetnum
+
:
}
false
;
then
:
else
ac_cv_search_tgetnum
=
no
fi
rm
conftest.
$ac_ext
LIBS
=
$ac_func_search_save_LIBS
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
{
$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
;
}
if
${
ac_cv_lib_edit_rl_set_prompt
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-ledit
$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 rl_set_prompt ();
int
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
as_fn_error
$?
"no libreadline found"
"
$LINENO
"
5
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_edit_rl_set_prompt
"
>
&5
$as_echo
"
$ac_cv_lib_edit_rl_set_prompt
"
>
&6
;
}
if
test
"x
$ac_cv_lib_edit_rl_set_prompt
"
=
xyes
;
then
:
cat
>>
confdefs.h
<<
_ACEOF
#define HAVE_LIBEDIT 1
_ACEOF
LIBS
=
"-ledit
$LIBS
"
fi
$as_echo
"#define READLINE_EDIT 1"
>>
confdefs.h
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-ledit"
;
fi
fi
...
...
configure.ac
View file @
9f8828fc
...
@@ -19,6 +19,13 @@ AC_CHECK_LIB([m], [sqrt])
...
@@ -19,6 +19,13 @@ 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([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
AC_CHECK_LIB([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
EVENT_VER=""
AC_CHECK_HEADER(event2/event.h, [AC_DEFINE([EVENT_V2], [1], [Use libevent v2])], [
AC_CHECK_HEADER(event.h, [AC_DEFINE([EVENT_V1], [1], [Use libevent v1])], [AC_MSG_ERROR([no libevent found])])
])
EXTRA_LIBS=""
EXTRA_LIBS=""
# OPENSSL_INCLUDES to the include directives required
# OPENSSL_INCLUDES to the include directives required
...
@@ -28,18 +35,7 @@ EXTRA_LIBS=""
...
@@ -28,18 +35,7 @@ EXTRA_LIBS=""
AX_CHECK_OPENSSL(,[AC_MSG_ERROR([No openssl found])])
AX_CHECK_OPENSSL(,[AC_MSG_ERROR([No openssl found])])
AX_CHECK_ZLIB(, [AC_MSG_ERROR([No zlib found])])
AX_CHECK_ZLIB(, [AC_MSG_ERROR([No zlib found])])
AC_CHECK_LIB([readline], [rl_save_prompt],
AC_CHECK_LIB([readline], [rl_save_prompt], [ EXTRA_LIBS="${EXTRA_LIBS} -lreadline" ; ], [AC_MSG_ERROR([no libreadline found])])
[
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
[ EXTRA_LIBS="${EXTRA_LIBS} -lreadline" ; ]
],
[
AC_SEARCH_LIBS([tgetnum], [ncursesw ncurses curses])
AC_CHECK_LIB([edit], [rl_set_prompt])
AC_DEFINE([READLINE_EDIT], [1], [Use libedit])
[ EXTRA_LIBS="${EXTRA_LIBS} -ledit" ; ]
]
)
AC_MSG_CHECKING([for libconfig])
AC_MSG_CHECKING([for libconfig])
AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig],
AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig],
...
...
event-old.h
0 → 100644
View file @
9f8828fc
#ifndef __EVENT_OLD_H__
#define __EVENT_OLD_H__
typedef
evutil_socket_t
int
static
inline
struct
event
*
event_new
(
struct
event_base
*
base
,
int
fd
,
int
what
,
void
(
*
callback
)(
int
,
short
,
void
*
),
void
*
arg
)
{
struct
event
*
ev
=
malloc
(
sizeof
(
*
ec
));
event_set
(
ev
,
base
,
fd
,
what
,
callback
,
arg
);
}
static
inline
struct
event
*
evtimer_new
(
struct
event_base
*
base
,
void
(
*
callback
)(
int
,
short
,
void
*
),
void
*
arg
)
{
struct
event
*
ev
=
malloc
(
sizeof
(
*
ec
));
evtimer_set
(
ev
,
base
,
callback
,
arg
);
}
static
void
event_free
(
struct
event
*
ev
)
{
event_del
(
ev
);
free
(
ev
);
}
#endif
interface.c
View file @
9f8828fc
...
@@ -42,7 +42,13 @@
...
@@ -42,7 +42,13 @@
#include "interface.h"
#include "interface.h"
#include "telegram.h"
#include "telegram.h"
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
//#include "auto/constants.h"
//#include "auto/constants.h"
//#include "tools.h"
//#include "tools.h"
//#include "structures.h"
//#include "structures.h"
...
...
loop.c
View file @
9f8828fc
...
@@ -43,7 +43,12 @@
...
@@ -43,7 +43,12 @@
#include <sys/stat.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <fcntl.h>
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include "interface.h"
#include "interface.h"
#include "telegram.h"
#include "telegram.h"
...
...
lua-tg.c
View file @
9f8828fc
...
@@ -32,7 +32,12 @@
...
@@ -32,7 +32,12 @@
#include <lua.h>
#include <lua.h>
#include <lualib.h>
#include <lualib.h>
#include <lauxlib.h>
#include <lauxlib.h>
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
lua_State
*
luaState
;
lua_State
*
luaState
;
//#include "interface.h"
//#include "interface.h"
...
...
mtproto-client.c
View file @
9f8828fc
...
@@ -58,7 +58,12 @@
...
@@ -58,7 +58,12 @@
#include "tools.h"
#include "tools.h"
#include "tree.h"
#include "tree.h"
#include "updates.h"
#include "updates.h"
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#if defined(__FreeBSD__)
#if defined(__FreeBSD__)
#define __builtin_bswap32(x) bswap32(x)
#define __builtin_bswap32(x) bswap32(x)
...
...
net.c
View file @
9f8828fc
...
@@ -38,7 +38,12 @@
...
@@ -38,7 +38,12 @@
#include <poll.h>
#include <poll.h>
#include <openssl/rand.h>
#include <openssl/rand.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include <sys/time.h>
#include <sys/time.h>
#include <time.h>
#include <time.h>
...
...
queries.c
View file @
9f8828fc
...
@@ -54,7 +54,12 @@
...
@@ -54,7 +54,12 @@
#include "updates.h"
#include "updates.h"
#include "auto.h"
#include "auto.h"
#include "tgl.h"
#include "tgl.h"
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#define sha1 SHA1
#define sha1 SHA1
...
...
tgl.c
View file @
9f8828fc
...
@@ -28,7 +28,12 @@
...
@@ -28,7 +28,12 @@
#include "structures.h"
#include "structures.h"
#include "net.h"
#include "net.h"
#ifdef EVENT_V2
#include <event2/event.h>
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include <assert.h>
#include <assert.h>
...
...
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