vysheng / tg

telegram-cli
GNU General Public License v2.0
6.49k stars 1.54k forks source link

Build fails in OS X 10.11.3 #961

Open behrangsa opened 8 years ago

behrangsa commented 8 years ago

I have installed OpenSSL via Homebrew. However build fails with the following output:

$ ./configure && make
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for sqrt in -lm... yes
checking for library containing clock_gettime... no
checking for library containing backtrace... none required
checking for event_base_new in -levent... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking event2/event.h usability... yes
checking event2/event.h presence... yes
checking for event2/event.h... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking whether compiling and linking against OpenSSL works... no
configure: error: No openssl found
behrangsa commented 8 years ago

Fixed by manually passing OpenSSL's location:

./configure --with-openssl=/usr/local/Cellar/openssl/1.0.2e_1
PabloDinella commented 8 years ago

Thanks!

eipplusone commented 8 years ago

Thanks! Maybe this should be mentioned in the readme...

ajsb85 commented 8 years ago

I try:

 brew install libconfig readline lua python libevent jansson
 export CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include"
 export LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.3.8/lib"
 ./configure --with-openssl=/usr/local/Cellar/openssl/1.0.2g
 make

and I have this error:

bin/generate -g types-header auto/scheme.tlo > auto/auto-types.h || rm auto/auto-types.h
gcc -I. -I. -I./tgl -I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include  -I/usr/local/opt/openssl/include -I/usr/local/include -I/usr/include -I/usr/include  -I/usr/local/Cellar/openssl/1.0.2g/include -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c:900:5: error: '__builtin___snprintf_chk' will always overflow destination buffer
      [-Werror,-Wbuiltin-memcpy-chk-size]
    snprintf (serv_addr.sun_path, 108, "%s", unix_socket);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:57:3: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [objs/main.o] Error 1