Skip to content

Commit bd08772

Browse files
author
Sebastiano Merlino
committed
Add option for static linking
1 parent aa65438 commit bd08772

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ compiler:
55
env:
66
- DEBUG="debug"
77
- DEBUG="nodebug"
8+
- LINKING="static"
89
before_install:
910
- sudo apt-get install info install-info
1011
- sudo pip install cpp-coveralls
@@ -20,7 +21,7 @@ script:
2021
- ./bootstrap
2122
- mkdir build
2223
- cd build
23-
- if [ $DEBUG = "debug" ]; then ../configure --enable-debug --disable-shared --disable-fastopen; else ../configure --disable-fastopen; fi
24+
- if [ $LINKING = "static" ]; then ../configure --enable-static --disable-fastopen; elif [ $DEBUG = "debug" ]; then ../configure --enable-debug --disable-shared --disable-fastopen; else ../configure --disable-fastopen; fi
2425
- make
2526
- make check
2627
after_success:
@@ -29,3 +30,5 @@ matrix:
2930
exclude:
3031
- compiler: clang
3132
env: DEBUG="debug"
33+
- compiler: clang
34+
env: LINKING='static'

configure.ac

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ if test x"$fastopen" = x"yes"; then
133133
fi
134134
fi
135135

136+
AC_MSG_CHECKING([whether to link statically])
137+
AC_ARG_ENABLE([static],
138+
[AS_HELP_STRING([--enable-static],
139+
[enable use static linking (def=yes)])],
140+
[static="$enableval"],
141+
[static=yes])
142+
AC_MSG_RESULT([$static])
143+
144+
if test x"$static" = x"$yes"; then
145+
LDFLAGS="-static $LDFLAGS";
146+
fi
147+
136148
m4_pattern_allow([AC_TYPE_SIZE_T])
137149
m4_pattern_allow([AC_TYPE_UINT16_T])
138150
m4_pattern_allow([AC_TYPE_UINT32_T])
@@ -223,4 +235,5 @@ AC_MSG_NOTICE([Configuration Summary:
223235
Debug : ${debugit}
224236
TLS Enabled : ${have_gnutls}
225237
TCP_FASTOPEN : ${is_fastopen_supported}
238+
Static : ${static}
226239
])

0 commit comments

Comments
 (0)