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
6f16f82a
Commit
6f16f82a
authored
Feb 03, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge github.com:vysheng/tg
parents
3b7dc309
75ac9886
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
244 additions
and
187 deletions
+244
-187
Makefile.in
Makefile.in
+2
-2
config.h
config.h
+6
-0
config.h.in
config.h.in
+6
-0
configure
configure
+211
-152
configure.ac
configure.ac
+4
-25
main.c
main.c
+15
-8
No files found.
Makefile.in
View file @
6f16f82a
...
...
@@ -6,8 +6,8 @@ CPPFLAGS=@CPPFLAGS@
DEFS
=
@DEFS@
COMPILE_FLAGS
=
${
CFLAGS
}
${
CPPFLAGS
}
${
DEFS
}
-Wall
-Wextra
-Werror
-Wno-deprecated
-fno-strict-aliasing
-fno-omit-frame-pointer
-ggdb
EXTRA_LIBS
=
@EXTRA_LIBS@
LOCAL_LDFLAGS
=
-
lm
-lcrypto
-lz
-lssl
-
rdynamic
-ggdb
${
EXTRA_LIBS
}
EXTRA_LIBS
=
-lssl
@LIBS@
@EXTRA_LIBS@
LOCAL_LDFLAGS
=
-rdynamic
-ggdb
${
EXTRA_LIBS
}
LINK_FLAGS
=
${
LDFLAGS
}
${
LOCAL_LDFLAGS
}
HEADERS
=
${
srcdir
}
/constants.h
${
srcdir
}
/include.h
${
srcdir
}
/interface.h
${
srcdir
}
/LICENSE.h
${
srcdir
}
/loop.h
${
srcdir
}
/mtproto-client.h
${
srcdir
}
/mtproto-common.h
${
srcdir
}
/net.h
${
srcdir
}
/no-preview.h
${
srcdir
}
/queries.h
${
srcdir
}
/structures.h
${
srcdir
}
/telegram.h
${
srcdir
}
/tree.h
${
srcdir
}
/config.h
${
srcdir
}
/binlog.h
${
srcdir
}
/tools.h
${
srcdir
}
/lua-tg.h
...
...
config.h
View file @
6f16f82a
...
...
@@ -13,6 +13,9 @@
/* Define to 1 if you have the `endpwent' function. */
#define HAVE_ENDPWENT 1
/* Define to 1 if you have the <execinfo.h> header file. */
#define HAVE_EXECINFO_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
...
...
@@ -31,6 +34,9 @@
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
/* Define to 1 if you have the <luaconf.h> header file. */
#define HAVE_LUACONF_H 1
...
...
config.h.in
View file @
6f16f82a
...
...
@@ -12,6 +12,9 @@
/* Define to 1 if you have the `endpwent' function. */
#undef HAVE_ENDPWENT
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
...
...
@@ -30,6 +33,9 @@
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <luaconf.h> header file. */
#undef HAVE_LUACONF_H
...
...
configure
View file @
6f16f82a
This diff is collapsed.
Click to expand it.
configure.ac
View file @
6f16f82a
...
...
@@ -10,25 +10,12 @@ AC_PROG_CC
# Checks for libraries.
AC_CHECK_LIB([m], [sqrt])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([backtrace], [execinfo])
AC_CHECK_LIB([z], [inflate])
AC_CHECK_LIB([crypto], [AES_set_encrypt_key])
EXTRA_LIBS=""
BT=
AC_CHECK_FUNC([backtrace],
[
BT=1
],
[
]
)
if test "x$BT" = "x" ; then
AC_CHECK_LIB([execinfo], [backtrace],
[ EXTRA_LIBS="${EXTRA_LIBS} -lexecinfo" ; ],
[ CFLAGS="${CFLAGS} -DNO_BACKTRACE" ; ])
fi
AC_CHECK_LIB([readline], [rl_save_prompt],
[
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
...
...
@@ -41,14 +28,6 @@ AC_CHECK_LIB([readline], [rl_save_prompt],
]
)
AC_CHECK_LIB([rt], [clock_gettime],
[
[ EXTRA_LIBS="${EXTRA_LIBS} -lrt" ; ]
],
[
]
)
AC_MSG_CHECKING([for libconfig])
AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig],
[
...
...
@@ -100,7 +79,7 @@ AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua],
])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h])
AC_CHECK_HEADERS([
execinfo.h
fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
...
...
main.c
View file @
6f16f82a
...
...
@@ -38,7 +38,8 @@
#include <sys/stat.h>
#include <time.h>
#include <fcntl.h>
#ifndef NO_BACKTRACE
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#include <signal.h>
...
...
@@ -420,7 +421,7 @@ void args_parse (int argc, char **argv) {
}
}
#if
ndef NO_BACKTRACE
#if
def HAVE_EXECINFO_H
void
print_backtrace
(
void
)
{
void
*
buffer
[
255
];
const
int
calls
=
backtrace
(
buffer
,
sizeof
(
buffer
)
/
sizeof
(
void
*
));
...
...
@@ -428,21 +429,27 @@ void print_backtrace (void) {
}
#else
void
print_backtrace
(
void
)
{
printf
(
"No libexec. Backtrace disabled
\n
"
);
write
(
1
,
"No libexec. Backtrace disabled
\n
"
,
32
);
}
#endif
void
sig_
handler
(
int
signum
)
{
void
sig_
segv_handler
(
int
signum
__attribute__
((
unused
))
)
{
set_terminal_attributes
();
printf
(
"Signal %d received
\n
"
,
signum
);
(
void
)
write
(
1
,
"SIGSEGV received
\n
"
,
18
);
print_backtrace
();
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
void
sig_abrt_handler
(
int
signum
__attribute__
((
unused
)))
{
set_terminal_attributes
();
(
void
)
write
(
1
,
"SIGABRT received
\n
"
,
18
);
print_backtrace
();
exit
(
EXIT_FAILURE
);
}
int
main
(
int
argc
,
char
**
argv
)
{
signal
(
SIGSEGV
,
sig_handler
);
signal
(
SIGABRT
,
sig_handler
);
signal
(
SIGSEGV
,
sig_
segv_
handler
);
signal
(
SIGABRT
,
sig_
abrt_
handler
);
log_level
=
10
;
...
...
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