summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 19 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index 895ee03..c08840e 100644
--- a/configure.in
+++ b/configure.in
@@ -8,18 +8,26 @@ AC_HEADER_STDC
AC_PROG_INSTALL
dnl Check for compiler options
-AC_MSG_CHECKING(whether compiler supports PIE)
-oldCFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -fPIE"
-oldLDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -pie"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[]])], compilepie="yes")
-if test "x$compilepie" != "xyes"; then
- CFLAGS="$oldCFLAGS"
- LDFLAGS="$oldLDFLAGS"
- AC_MSG_RESULT(no)
+AC_ARG_ENABLE(static-link, [ --enable-static-link=[yes/no] Link all binaries statically [default=no].],
+ ,
+ enable_static_link="no")
+if test "x$enable_static_link" != "xyes"; then
+ AC_MSG_CHECKING(whether compiler supports PIE)
+ oldCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fPIE"
+ oldLDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -pie"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]])], compilepie="yes")
+ if test "x$compilepie" != "xyes"; then
+ CFLAGS="$oldCFLAGS"
+ LDFLAGS="$oldLDFLAGS"
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ fi
else
- AC_MSG_RESULT(yes)
+ CFLAGS="$CFLAGS -static"
+ LDFLAGS="$LDFLAGS -static"
fi
dnl Checks for libraries.