diff options
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | util.h | 2 |
3 files changed, 15 insertions, 8 deletions
@@ -1,10 +1,12 @@ | |||
1 | SOURCES = $(wildcard *.c) | 1 | SOURCES = $(wildcard *.c) |
2 | DEPS=libtoxcore | 2 | DEPS=libsodium toxcore |
3 | CC=gcc | 3 | CC=gcc |
4 | CFLAGS=-g #-std=c99 | 4 | CFLAGS=-g #-std=c99 |
5 | CFLAGS += $(shell pkg-config --cflags $(DEPS)) | 5 | CFLAGS += $(shell pkg-config --cflags $(DEPS)) |
6 | LDFLAGS=-g -pthread -lm -static -lrt | 6 | LDFLAGS=-g -pthread -lm -static -lrt |
7 | LDFLAGS += $(shell pkg-config --libs $(DEPS)) | 7 | LDFLAGS += $(shell pkg-config --static --libs $(DEPS)) |
8 | DSO_LDFLAGS=-g -pthread -lm -lrt | ||
9 | DSO_LDFLAGS += $(shell pkg-config --libs $(DEPS)) | ||
8 | OBJECTS=$(SOURCES:.c=.o) | 10 | OBJECTS=$(SOURCES:.c=.o) |
9 | INCLUDES = $(wildcard *.h) | 11 | INCLUDES = $(wildcard *.h) |
10 | 12 | ||
@@ -19,7 +21,10 @@ gitversion.c: gitversion.h | |||
19 | $(CC) $(CFLAGS) $< -c -o $@ | 21 | $(CC) $(CFLAGS) $< -c -o $@ |
20 | 22 | ||
21 | tuntox: $(OBJECTS) $(INCLUDES) | 23 | tuntox: $(OBJECTS) $(INCLUDES) |
22 | $(CC) -o $@ $(OBJECTS) -ltoxcore -lpthread $(LDFLAGS) /usr/local/lib/libsodium.a /usr/local/lib/libtoxcore.a | 24 | $(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS) /usr/local/lib/libtoxmessenger.a /usr/local/lib/libtoxcore.a |
25 | |||
26 | tuntox_nostatic: $(OBJECTS) $(INCLUDES) | ||
27 | $(CC) -o $@ $(OBJECTS) -lpthread $(DSO_LDFLAGS) | ||
23 | 28 | ||
24 | cscope.out: | 29 | cscope.out: |
25 | cscope -bv ./*.[ch] | 30 | cscope -bv ./*.[ch] |
@@ -331,7 +331,7 @@ int send_frame(protocol_frame *frame, uint8_t *data) | |||
331 | 331 | ||
332 | for(j = 0; j < i; j++) | 332 | for(j = 0; j < i; j++) |
333 | { | 333 | { |
334 | tox_iterate(tox); | 334 | tox_iterate(tox, NULL); |
335 | usleep(j * 10000); | 335 | usleep(j * 10000); |
336 | } | 336 | } |
337 | } | 337 | } |
@@ -904,7 +904,7 @@ int do_server_loop() | |||
904 | tunnel *tmp = NULL; | 904 | tunnel *tmp = NULL; |
905 | TOX_CONNECTION connected = 0; | 905 | TOX_CONNECTION connected = 0; |
906 | 906 | ||
907 | tox_callback_friend_lossless_packet(tox, parse_lossless_packet, NULL); | 907 | tox_callback_friend_lossless_packet(tox, parse_lossless_packet); |
908 | 908 | ||
909 | tv.tv_sec = 0; | 909 | tv.tv_sec = 0; |
910 | tv.tv_usec = 20000; | 910 | tv.tv_usec = 20000; |
@@ -918,7 +918,7 @@ int do_server_loop() | |||
918 | int select_rv = 0; | 918 | int select_rv = 0; |
919 | 919 | ||
920 | /* Let tox do its stuff */ | 920 | /* Let tox do its stuff */ |
921 | tox_iterate(tox); | 921 | tox_iterate(tox, NULL); |
922 | 922 | ||
923 | /* Get the desired sleep time, used in select() later */ | 923 | /* Get the desired sleep time, used in select() later */ |
924 | tox_do_interval_ms = tox_iteration_interval(tox); | 924 | tox_do_interval_ms = tox_iteration_interval(tox); |
@@ -1378,7 +1378,7 @@ int main(int argc, char *argv[]) | |||
1378 | } | 1378 | } |
1379 | 1379 | ||
1380 | set_tox_username(tox); | 1380 | set_tox_username(tox); |
1381 | tox_callback_self_connection_status(tox, handle_connection_status_change, NULL); | 1381 | tox_callback_self_connection_status(tox, handle_connection_status_change); |
1382 | 1382 | ||
1383 | do_bootstrap(tox); | 1383 | do_bootstrap(tox); |
1384 | 1384 | ||
@@ -1411,7 +1411,7 @@ int main(int argc, char *argv[]) | |||
1411 | tox_printable_id[TOX_ADDRESS_SIZE * 2] = '\0'; | 1411 | tox_printable_id[TOX_ADDRESS_SIZE * 2] = '\0'; |
1412 | log_printf(L_INFO, "Using Tox ID: %s\n", tox_printable_id); | 1412 | log_printf(L_INFO, "Using Tox ID: %s\n", tox_printable_id); |
1413 | 1413 | ||
1414 | tox_callback_friend_request(tox, accept_friend_request, NULL); | 1414 | tox_callback_friend_request(tox, accept_friend_request); |
1415 | do_server_loop(); | 1415 | do_server_loop(); |
1416 | clear_rules(); | 1416 | clear_rules(); |
1417 | } | 1417 | } |
@@ -13,5 +13,7 @@ void id_to_string(char_t *dest, const char_t *src); | |||
13 | int string_to_id(char_t *w, char_t *a); | 13 | int string_to_id(char_t *w, char_t *a); |
14 | void* file_raw(char *path, uint32_t *size); | 14 | void* file_raw(char *path, uint32_t *size); |
15 | const char *readable_connection_status(TOX_CONNECTION status); | 15 | const char *readable_connection_status(TOX_CONNECTION status); |
16 | int parse_local_port_forward(char *string, int *local_port, char **hostname, int *remote_port); | ||
17 | int parse_pipe_port_forward(char *string, char **hostname, int *remote_port); | ||
16 | 18 | ||
17 | #endif | 19 | #endif |