- SEARCH_PATH="/usr/local /usr" # you might want to change this
- SEARCH_FOR="/include/ionc/ion.h" # you most likely want to change this
- if test -r $PHP_ION/$SEARCH_FOR; then # path given as parameter
- ION_DIR=$PHP_ION
- else # search default path list
- AC_MSG_CHECKING([for ion files in default path])
- for i in $SEARCH_PATH ; do
- if test -r $i/$SEARCH_FOR; then
- ION_DIR=$i
- AC_MSG_RESULT(found in $i)
- fi
- done
- fi
- dnl
- if test -z "$ION_DIR"; then
+AC_ARG_VAR([CMAKE], [cmake executable])
+AC_PATH_PROG([CMAKE], [cmake])
+PHP_SUBST([CMAKE])
+
+AC_ARG_VAR([AR], [system library archiver])
+AC_PATH_PROG([AR], [ar])
+PHP_SUBST([AR])
+
+AC_ARG_VAR([RANLIB], [system library archive indexer])
+AC_PATH_PROG([RANLIB], [ranlib])
+PHP_SUBST([RANLIB])
+
+use_bundled_ionc=false
+AC_DEFUN([ION_BUNDLE], [dnl
+
+ AC_MSG_CHECKING([for bundled ion-c])
+ if test -f PHP_EXT_SRCDIR([ion])/ion-c/CMakeLists.txt; then
+ AC_MSG_RESULT([ion-c])
+ elif test -d PHP_EXT_SRCDIR([ion])/.git; then
+ AC_MSG_RESULT([git submodule])
+ if ! GIT_DIR=PHP_EXT_SRCDIR([ion])/.git GIT_WORK_TREE=PHP_EXT_SRCDIR([ion])/ \
+ "$GIT" submodule update --init --depth 1 --recursive ion-c; then
+ AC_MSG_ERROR([giving up])
+ fi
+ else