Last active
December 27, 2015 18:18
-
-
Save tony2001/7368353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/acinclude.m4 b/acinclude.m4 | |
index 7bb0354..82a5dcf 100644 | |
--- a/acinclude.m4 | |
+++ b/acinclude.m4 | |
@@ -984,3 +984,48 @@ AC_DEFUN([AX_GTEST], | |
AC_SUBST([GTEST_LIBS]) | |
AC_SUBST([GTEST_SUBDIR]) | |
]) | |
+ | |
+AC_DEFUN([AX_LIBSPINDLE], | |
+[ | |
+ | |
+ AC_ARG_WITH(libspindle, | |
+ [AS_HELP_STRING([--with-libspindle],[specify libspindle install prefix]) | |
+ ], | |
+ [ ], | |
+ [with_libspindle=yes] | |
+ ) | |
+ | |
+ AC_MSG_CHECKING([for libspindle]) | |
+ if test "x$with_libspindle" = "xyes"; then | |
+ for i in /usr /usr/local /local /opt; do | |
+ if test -f "$i/include/spindle.h"; then | |
+ LIBSPINDLE_DIR="$i" | |
+ break; | |
+ fi | |
+ done | |
+ else | |
+ if test -f "$with_libspindle/include/spindle.h"; then | |
+ LIBSPINDLE_DIR="$with_libspindle" | |
+ else | |
+ AC_MSG_ERROR([Can''t find libspindle headers under $with_libspindle directory]) | |
+ fi | |
+ fi | |
+ | |
+ if test "x$LIBSPINDLE_DIR" = "x"; then | |
+ AC_MSG_RESULT([not found]) | |
+ AC_MSG_ERROR([Unable to locate libspindle headers, please use --with-libspindle=<DIR>]) | |
+ else | |
+ AC_MSG_RESULT([$LIBSPINDLE_DIR]) | |
+ | |
+ LIBSPINDLE_LIBS="-L$LIBSPINDLE_DIR/lib -lspindle -pthread" | |
+ LIBSPINDLE_INCLUDES="-I$LIBSPINDLE_DIR/include" | |
+ | |
+ AC_CHECK_LIB([spindle], [spindle_create], [], [ | |
+ AC_MSG_ERROR([spindle_create() is missing. Check config.log for more details])], | |
+ [-L$LIBSPINDLE_DIR/lib -pthread] | |
+ ) | |
+ | |
+ AC_SUBST([LIBSPINDLE_LIBS]) | |
+ AC_SUBST([LIBSPINDLE_INCLUDES]) | |
+ fi | |
+]) |
anton-povarov
commented
Nov 8, 2013
- имхо надо назвать AX_SPINDLE, либо переименовать опцию в --with-libspindle
- посмотри третий параметр к AC_CHECK_LIB - туда можно ебошить список флагов линкеру, с которыми пробовать линковку, т.е. не нужно будет ебаться с orig_ переменными скорее всего.
- чек spindle.h - имхо надо делать через ac_check_headers
- поменял
- поменял
- у нас check_headers используется в 1м месте, а ручной чек - в 10.
- дык, это не повод! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment