mirror of
https://github.com/tmate-io/tmate.git
synced 2025-04-14 06:28:21 +02:00
Allow static linking
This commit is contained in:
parent
a397be388c
commit
3a73f17354
4
.gitignore
vendored
4
.gitignore
vendored
@ -21,3 +21,7 @@ cscope.*
|
||||
ctags
|
||||
*.log
|
||||
tmate.1.*
|
||||
downloads/
|
||||
ext/
|
||||
libssh-*/
|
||||
msgpack-*/
|
||||
|
49
Makefile.static-build
Normal file
49
Makefile.static-build
Normal file
@ -0,0 +1,49 @@
|
||||
LIBSSH=libssh-0.7.2
|
||||
LIBSSH_URL=https://red.libssh.org/attachments/download/177/$(LIBSSH).tar.xz
|
||||
LIBSSH_LIB=ext/lib/libssh.a
|
||||
|
||||
MSGPACK=msgpack-1.3.0
|
||||
MSGPACK_URL=https://github.com/msgpack/msgpack-c/releases/download/cpp-1.3.0/$(MSGPACK).tar.gz
|
||||
MSGPACK_LIB=ext/lib/libmsgpack.a
|
||||
|
||||
TMATE_CONFIGURE=PKG_CONFIG_PATH=./ext/lib/pkgconfig
|
||||
|
||||
all: tmate
|
||||
|
||||
dependencies:
|
||||
apt-get install build-essentials cmake libssl-dev autoconf automake pkg-config libtool libevent-dev libncurses-dev zlib1g-dev
|
||||
|
||||
downloads/$(notdir $(LIBSSH_URL)):
|
||||
mkdir -p downloads
|
||||
wget -O $@ $(LIBSSH_URL)
|
||||
|
||||
$(LIBSSH)/.ready: downloads/$(notdir $(LIBSSH_URL))
|
||||
tar xf $<
|
||||
touch $@
|
||||
|
||||
downloads/$(notdir $(MSGPACK_URL)):
|
||||
mkdir -p downloads
|
||||
wget -O $@ $(MSGPACK_URL)
|
||||
|
||||
$(MSGPACK)/.ready: downloads/$(notdir $(MSGPACK_URL))
|
||||
tar xf $<
|
||||
touch $@
|
||||
|
||||
$(LIBSSH_LIB): $(LIBSSH)/.ready
|
||||
mkdir -p $(LIBSSH)/build
|
||||
cd $(LIBSSH)/build; ([ -f Makefile ] || cmake -DCMAKE_INSTALL_PREFIX:PATH=$(shell pwd)/ext .. -DWITH_SFTP=OFF -DWITH_SERVER=OFF -DWITH_PCAP=OFF -DWITH_STATIC_LIB=ON -DWITH_GSSAPI=OFF)
|
||||
+make -C $(LIBSSH)/build install
|
||||
|
||||
$(MSGPACK_LIB): $(MSGPACK)/.ready
|
||||
mkdir -p $(MSGPACK)/build
|
||||
cd $(MSGPACK)/build; ([ -f Makefile ] || cmake -DCMAKE_INSTALL_PREFIX:PATH=$(shell pwd)/ext ..)
|
||||
+make -C $(MSGPACK)/build install
|
||||
|
||||
tmate: $(MSGPACK_LIB) $(LIBSSH_LIB)
|
||||
./autogen.sh
|
||||
$(TMATE_CONFIGURE) ./configure --enable-static
|
||||
+make
|
||||
|
||||
clean:
|
||||
rm -rf ext $(LIBSSH) $(MSGPACK)
|
||||
+make clean
|
14
configure.ac
14
configure.ac
@ -49,6 +49,20 @@ AC_ARG_ENABLE(
|
||||
if test "x$found_static" = xyes; then
|
||||
LDFLAGS="$LDFLAGS -static"
|
||||
PKG_CONFIG="pkg-config --static"
|
||||
|
||||
CFLAGS="$CFLAGS -flto"
|
||||
LDFLAGS="$LDFLAGS -flto"
|
||||
|
||||
PKG_CHECK_MODULES([ZLIB], [zlib], [
|
||||
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
||||
LIBS="$ZLIB_LIBS $LIBS"
|
||||
])
|
||||
|
||||
PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto], [
|
||||
CPPFLAGS="$LIBCRYPTO_CFLAGS $CPPFLAGS"
|
||||
LIBS="$LIBCRYPTO_LIBS $LIBS"
|
||||
])
|
||||
AC_CHECK_LIB(dl, dlopen)
|
||||
fi
|
||||
|
||||
# Is this gcc?
|
||||
|
Loading…
Reference in New Issue
Block a user