Skip to content

Commit

Permalink
コンパイル用ファイルの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujiro3 committed Nov 27, 2014
1 parent 408e5e6 commit fcd7f3a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions CREDITS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
groonga
Empty file added EXPERIMENTAL
Empty file.
49 changes: 49 additions & 0 deletions config.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
dnl $Id$
dnl config.m4 for extension groonga

PHP_ARG_ENABLE(groonga, whether to enable groonga support,
dnl Make sure that the comment is aligned:
[ --enable-groonga Enable groonga support])

if test "$PHP_GROONGA" != "no"; then
# --with-groonga -> check with-path
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/groonga/groonga.h" # you most likely want to change this
if test -r $PHP_GROONGA/$SEARCH_FOR; then # path given as parameter
GROONGA_DIR=$PHP_GROONGA
else # search default path list
AC_MSG_CHECKING([for groonga files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
GROONGA_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi

if test -z "$GROONGA_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the groonga distribution])
fi

# --with-groonga -> add include path
PHP_ADD_INCLUDE($GROONGA_DIR/include/groonga)

# --with-groonga -> check for lib and symbol presence
LIBNAME=groonga # you may want to change this
LIBSYMBOL=grn_init # you most likely want to change this

PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GROONGA_DIR/lib, GROONGA_SHARED_LIBADD)
AC_DEFINE(HAVE_GROONGALIB,1,[ ])
],[
AC_MSG_ERROR([wrong groonga lib version or lib not found])
],[
-L$GROONGA_DIR/lib -lm
])

PHP_SUBST(GROONGA_SHARED_LIBADD)

PHP_NEW_EXTENSION(groonga, php_groonga.c src/object.c src/command.c, $ext_shared)
fi
13 changes: 13 additions & 0 deletions config.w32
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// $Id$
// vim:ft=javascript

// If your extension references something external, use ARG_WITH
// ARG_WITH("groonga", "for groonga support", "no");

// Otherwise, use ARG_ENABLE
// ARG_ENABLE("groonga", "enable groonga support", "no");

if (PHP_GROONGA != "no") {
EXTENSION("groonga", "groonga.c");
}

0 comments on commit fcd7f3a

Please sign in to comment.