initial ci
[awesomized/ext-ion] / config.m4
1
2 PHP_ARG_WITH([ion],
3 [for ion support],
4 [AS_HELP_STRING([--with-ion],
5 [path to libion])],
6 [no])
7
8 if test "$PHP_ION" != "no"; then
9
10 SEARCH_PATH="/usr/local /usr" # you might want to change this
11 SEARCH_FOR="/include/ionc/ion.h" # you most likely want to change this
12 if test -r $PHP_ION/$SEARCH_FOR; then # path given as parameter
13 ION_DIR=$PHP_ION
14 else # search default path list
15 AC_MSG_CHECKING([for ion files in default path])
16 for i in $SEARCH_PATH ; do
17 if test -r $i/$SEARCH_FOR; then
18 ION_DIR=$i
19 AC_MSG_RESULT(found in $i)
20 fi
21 done
22 fi
23 dnl
24 if test -z "$ION_DIR"; then
25 AC_MSG_RESULT([not found])
26 AC_MSG_ERROR([Please reinstall the ion distribution])
27 fi
28
29 PHP_ADD_INCLUDE($ION_DIR/include)
30
31 LIBNAME=ionc
32 LIBSYMBOL=ion_error_to_str
33 PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL,
34 [
35 PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $ION_DIR/$PHP_LIBDIR, ION_SHARED_LIBADD)
36 ],[
37 AC_MSG_ERROR([could not link with ionc library.])
38 ],[
39 -L$ION_DIR/$PHP_LIBDIR -lm
40 ])
41 LIBNAME=decNumber
42 LIBSYMBOL=decQuadFromInt32
43 PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL,
44 [
45 PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $ION_DIR/$PHP_LIBDIR, ION_SHARED_LIBADD)
46 ],[
47 AC_MSG_ERROR([could not link with ionc library.])
48 ],[
49 -L$ION_DIR/$PHP_LIBDIR -lm
50 ])
51
52 PHP_SUBST(ION_SHARED_LIBADD)
53 AC_DEFINE(HAVE_ION, 1, [ Have ion support ])
54
55 PHP_NEW_EXTENSION(ion, ion.c, $ext_shared)
56 fi