#------------------------------------------------------------------------------ # Copyright (c) 2001-2023 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2018-03-26 jed # Last Update: $Id$ # # !!! this is not a script but an step-by-step howto !!! #------------------------------------------------------------------------------ exit 1 # - needs the following environment to build: # - gcc v9.3.1 # - needs the following library packages to be build: # - libevent-dev # - libssl-dev # - lua53-dev # - ncurses-dev # - readline-dev # # - needs the following packages to be build: # - base 2.8.25 # - as first step the current software need to be downloaded # from Github and extracted so that at least the following # two directories exist: # ./tg-master (https://github.com/kenorb-contrib/tg) # ./tgl-master (https://github.com/kenorb-contrib/tgl) # # The tl-master source code is part of the tgl-master package # so that there is no requirement to install it separately. # # Next a symbolic link need to be set because the base software # expects the other components to reside in its sub directory # structure: # rm ./tg-master/tgl # ln -s ./tgl-master ./tg-master/tgl # # - Then the software can be build: 1. make clean rm -rf dep auto bin objs libs dep/auto objs/auto config.log config.status > /dev/null || echo "all clean" 2. export CFLAGS='-O2 -march=i486' export CXXFLAGS="-O2 -march=i486" ./configure --prefix=/usr --disable-libconfig --disable-liblua \ ` --disable-python --disable-json --disable-valgrind 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... -lrt 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... /bin/grep checking for egrep... /bin/grep -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/bin/pkg-config checking whether compiling and linking against OpenSSL works... yes checking if zlib is wanted... yes checking for inflateEnd in -lz... yes checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking for rl_save_prompt in -lreadline... yes checking for libconfig... enabled checking for config_init in -lconfig... no configure: error: No libconfig found. Try --disable-libconfig 3. make cat tgl/scheme.tl tgl/encrypted_scheme.tl tgl/binlog.tl tgl/append.tl tgl/mtproto.tl > auto/scheme.tl gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tlc.d -MQ objs/tlc.o -o objs/tlc.o tgl/tl-parser/tlc.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/crc32.d -MQ objs/crc32.o -o objs/crc32.o tgl/tl-parser/crc32.c gcc objs/tl-parser.o objs/tlc.o objs/crc32.o -L/usr/local/lib -L/usr/lib -L/usr/lib -rdynamic -ggdb -levent -lz -levent -lrt -lm -lreadline -lssl -lcrypto -ldl -lpthread -lutil -o bin/tl-parser bin/tl-parser -e auto/scheme.tlo auto/scheme.tl gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/generate.d -MQ objs/generate.o -o objs/generate.o tgl/generate.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tools.d -MQ objs/tools.o -o objs/tools.o tgl/tools.c gcc objs/generate.o objs/tools.o -L/usr/local/lib -L/usr/lib -L/usr/lib -rdynamic -ggdb -levent -lz -levent -lrt -lm -lreadline -lssl -lcrypto -ldl -lpthread -lutil -o bin/generate bin/generate -g skip-header auto/scheme.tlo > auto/auto-skip.h || rm auto/auto-skip.h bin/generate -g fetch-header auto/scheme.tlo > auto/auto-fetch.h || rm auto/auto-fetch.h bin/generate -g store-header auto/scheme.tlo > auto/auto-store.h || rm auto/auto-store.h bin/generate -g autocomplete-header auto/scheme.tlo > auto/auto-autocomplete.h || rm auto/auto-autocomplete.h bin/generate -g types-header auto/scheme.tlo > auto/auto-types.h || rm auto/auto-types.h bin/tl-parser -E auto/scheme.tl 2> auto/scheme2.tl || ( cat auto/scheme2.tl && rm auto/scheme2.tl && false ) awk -f ./tgl/gen_constants_h.awk < auto/scheme2.tl > auto/constants.h bin/generate -g fetch-ds-header auto/scheme.tlo > auto/auto-fetch-ds.h || rm auto/auto-fetch-ds.h bin/generate -g free-ds-header auto/scheme.tlo > auto/auto-free-ds.h || rm auto/auto-free-ds.h bin/generate -g store-ds-header auto/scheme.tlo > auto/auto-store-ds.h || rm auto/auto-store-ds.h bin/generate -g print-ds-header auto/scheme.tlo > auto/auto-print-ds.h || rm auto/auto-print-ds.h gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -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 gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/loop.d -MQ objs/loop.o -o objs/loop.o loop.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/interface.d -MQ objs/interface.o -o objs/interface.o interface.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/lua-tg.d -MQ objs/lua-tg.o -o objs/lua-tg.o lua-tg.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/json-tg.d -MQ objs/json-tg.o -o objs/json-tg.o json-tg.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/python-tg.d -MQ objs/python-tg.o -o objs/python-tg.o python-tg.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/python-types.d -MQ objs/python-types.o -o objs/python-types.o python-types.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/mtproto-common.d -MQ objs/mtproto-common.o -o objs/mtproto-common.o tgl/mtproto-common.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/mtproto-client.d -MQ objs/mtproto-client.o -o objs/mtproto-client.o tgl/mtproto-client.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/queries.d -MQ objs/queries.o -o objs/queries.o tgl/queries.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/structures.d -MQ objs/structures.o -o objs/structures.o tgl/structures.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/binlog.d -MQ objs/binlog.o -o objs/binlog.o tgl/binlog.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tgl.d -MQ objs/tgl.o -o objs/tgl.o tgl/tgl.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/updates.d -MQ objs/updates.o -o objs/updates.o tgl/updates.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tgl-net.d -MQ objs/tgl-net.o -o objs/tgl-net.o tgl/tgl-net.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tgl-timers.d -MQ objs/tgl-timers.o -o objs/tgl-timers.o tgl/tgl-timers.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tg-mime-types.d -MQ objs/tg-mime-types.o -o objs/tg-mime-types.o tgl/tg-mime-types.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/mtproto-utils.d -MQ objs/mtproto-utils.o -o objs/mtproto-utils.o tgl/mtproto-utils.c bin/generate -g skip auto/scheme.tlo > auto/auto-skip.c || rm auto/auto-skip.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-skip.d -MQ objs/auto-skip.o -o objs/auto/auto-skip.o auto/auto-skip.c bin/generate -g fetch auto/scheme.tlo > auto/auto-fetch.c || rm auto/auto-fetch.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-fetch.d -MQ objs/auto-fetch.o -o objs/auto/auto-fetch.o auto/auto-fetch.c bin/generate -g store auto/scheme.tlo > auto/auto-store.c || rm auto/auto-store.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-store.d -MQ objs/auto-store.o -o objs/auto/auto-store.o auto/auto-store.c bin/generate -g autocomplete auto/scheme.tlo > auto/auto-autocomplete.c || rm auto/auto-autocomplete.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-autocomplete.d -MQ objs/auto-autocomplete.o -o objs/auto/auto-autocomplete.o auto/auto-autocomplete.c bin/generate -g types auto/scheme.tlo > auto/auto-types.c || rm auto/auto-types.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-types.d -MQ objs/auto-types.o -o objs/auto/auto-types.o auto/auto-types.c bin/generate -g fetch-ds auto/scheme.tlo > auto/auto-fetch-ds.c || rm auto/auto-fetch-ds.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-fetch-ds.d -MQ objs/auto-fetch-ds.o -o objs/auto/auto-fetch-ds.o auto/auto-fetch-ds.c bin/generate -g free-ds auto/scheme.tlo > auto/auto-free-ds.c || rm auto/auto-free-ds.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-free-ds.d -MQ objs/auto-free-ds.o -o objs/auto/auto-free-ds.o auto/auto-free-ds.c bin/generate -g store-ds auto/scheme.tlo > auto/auto-store-ds.c || rm auto/auto-store-ds.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-store-ds.d -MQ objs/auto-store-ds.o -o objs/auto/auto-store-ds.o auto/auto-store-ds.c bin/generate -g print-ds auto/scheme.tlo > auto/auto-print-ds.c || rm auto/auto-print-ds.c gcc -I. -I. -I./tgl -O2 -march=i486 -I/usr/local/include -I/usr/include -I/usr/include -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-print-ds.d -MQ objs/auto-print-ds.o -o objs/auto/auto-print-ds.o auto/auto-print-ds.c rm -f libs/libtgl.a && ar ruv libs/libtgl.a objs/mtproto-common.o objs/mtproto-client.o objs/queries.o objs/structures.o objs/binlog.o objs/tgl.o objs/updates.o objs/tgl-net.o objs/tgl-timers.o objs/tg-mime-types.o objs/mtproto-utils.o objs/tools.o objs/auto/auto-skip.o objs/auto/auto-fetch.o objs/auto/auto-store.o objs/auto/auto-autocomplete.o objs/auto/auto-types.o objs/auto/auto-fetch-ds.o objs/auto/auto-free-ds.o objs/auto/auto-store-ds.o objs/auto/auto-print-ds.o ar: creating libs/libtgl.a a - objs/mtproto-common.o a - objs/mtproto-client.o a - objs/queries.o a - objs/structures.o a - objs/binlog.o a - objs/tgl.o a - objs/updates.o a - objs/tgl-net.o a - objs/tgl-timers.o a - objs/tg-mime-types.o a - objs/mtproto-utils.o a - objs/tools.o a - objs/auto/auto-skip.o a - objs/auto/auto-fetch.o a - objs/auto/auto-store.o a - objs/auto/auto-autocomplete.o a - objs/auto/auto-types.o a - objs/auto/auto-fetch-ds.o a - objs/auto/auto-free-ds.o a - objs/auto/auto-store-ds.o a - objs/auto/auto-print-ds.o gcc objs/main.o objs/loop.o objs/interface.o objs/lua-tg.o objs/json-tg.o objs/python-tg.o objs/python-types.o libs/libtgl.a -L/usr/local/lib -L/usr/lib -L/usr/lib -rdynamic -ggdb -levent -lz -levent -lrt -lm -lreadline -lssl -lcrypto -ldl -lpthread -lutil -o bin/telegram-cli 4. mkdir -p /data/public/tg-1.3.3/etc/telegram mkdir -p /data/public/tg-1.3.3/usr/bin/doc cp server.pub /data/public/tg-1.3.3/etc/telegram/ cp bin/* /data/public/tg-1.3.3/usr/bin/ chmod 0644 /data/public/tg-1.3.3/etc/telegram/server.pub chmod 0755 /data/public/tg-1.3.3/usr/bin/* 5. copy additional files to DESTDIR (error in build script!) for FNAME in CHANGELOG LICENSE README* jed_conf.log do cp ./ /data/public/tg-1.3.3/usr/bin/doc/; done