forked from Leon2012/php-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
54 lines (43 loc) · 1.69 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PHP_ARG_WITH(rocksdb, for rocksdb support,
[ --with-rocksdb Include rocksdb support])
dnl PHP_ARG_ENABLE(rocksdb, whether to enable rocksdb support,
dnl Make sure that the comment is aligned:
dnl [ --enable-rocksdb Enable rocksdb support])
if test "$PHP_ROCKSDB" != "no"; then
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/rocksdb/c.h" # you most likely want to change this
SEARCH_LIB="/lib/librocksdb.a"
if test -r $PHP_ROCKSDB/$SEARCH_FOR; then # path given as parameter
ROCKSDB_DIR=$PHP_ROCKSDB
else # search default path list
AC_MSG_CHECKING([for rocksdb files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR && test -r $i/$SEARCH_LIB; then
ROCKSDB_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$ROCKSDB_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the rocksdb distribution])
fi
dnl # --with-rocksdb -> add include path
PHP_ADD_INCLUDE($ROCKSDB_DIR/include)
dnl # --with-rocksdb -> check for lib and symbol presence
LIBNAME=rocksdb # you may want to change this
LIBSYMBOL=rocksdb_open # you most likely want to change this
PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY(stdc++, 1, ROCKSDB_SHARED_LIBADD)
dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
dnl [
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $ROCKSDB_DIR, ROCKSDB_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_ROCKSDBLIB,1,[ ])
dnl ],[
dnl AC_MSG_ERROR([wrong rocksdb lib version or lib not found])
dnl ],[
dnl -L$ROCKSDB_DIR/$PHP_LIBDIR -lm
dnl ])
PHP_SUBST(ROCKSDB_SHARED_LIBADD)
PHP_NEW_EXTENSION(rocksdb, rocksdb.c, $ext_shared)
fi