Permalink
Browse files

Add --enable-static option for configure

Allows static linking with libzmq when necessary
  • Loading branch information...
1 parent da3ef33 commit ab65e4897fcb9b03cbea7df3dbc7ca872018175b @yrashk yrashk committed Feb 13, 2011
Showing with 25 additions and 4 deletions.
  1. +25 −4 configure.ac
View
@@ -133,6 +133,16 @@ AC_ARG_ENABLE([examples],
AM_CONDITIONAL(ENABLE_EXAMPLES, test "x${enable_examples}" = "xyes")
dnl ------------------------------------------------------------------
+dnl Static
+dnl ------------------------------------------------------------------
+
+AC_ARG_ENABLE([static],
+ AC_HELP_STRING([--enable-static],
+ [link with zeromq static library [[default=no]]]),,
+ enable_static="no")
+AM_CONDITIONAL(ENABLE_STATIC, test "x${enable_static}" = "xyes")
+
+dnl ------------------------------------------------------------------
dnl ZeroMQ
dnl ------------------------------------------------------------------
@@ -148,12 +158,19 @@ Use the '--with-zeromq=PATH' option to specify location of ZeroMQ])])
CXXFLAGS="${CXXFLAGS# } -I${with_zeromq}/include"
-case "${host_os}" in
- *darwin*)
- LDFLAGS="${LDFLAGS# } -L${with_zeromq}/lib -lzmq"
+case "${enable_static}" in
+ *yes*)
+ LDFLAGS="${LDFLAGS# } ${with_zeromq}/lib/libzmq.a"
;;
*)
- LDFLAGS="${LDFLAGS# } -L${with_zeromq}/lib -lzmq -Wl,-R${with_zeromq}/lib"
+ case "${host_os}" in
+ *darwin*)
+ LDFLAGS="${LDFLAGS# } -L${with_zeromq}/lib -lzmq"
+ ;;
+ *)
+ LDFLAGS="${LDFLAGS# } -L${with_zeromq}/lib -lzmq -Wl,-R${with_zeromq}/lib"
+ ;;
+ esac
;;
esac
@@ -212,4 +229,8 @@ echo
AC_MSG_NOTICE([ Debug/warnings: ${enable_debug}/${enable_warnings}])
AC_MSG_NOTICE([ Documentation: ${enable_docs}])
AC_MSG_NOTICE([ Examples: ${enable_examples}])
+
+echo
+AC_MSG_NOTICE([ Static: ${enable_static}])
+
echo

0 comments on commit ab65e48

Please sign in to comment.