2 dnl config.m4 for extension bbcode
4 PHP_ARG_ENABLE(bbcode, whether to enable bbcode support,
5 [ --enable-bbcode Enable bbcode support])
7 if test "$PHP_BBCODE" != "no"; then
8 dnl Write more examples of tests here...
10 dnl # get library FOO build options from pkg-config output
11 dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
12 dnl AC_MSG_CHECKING(for libfoo)
13 dnl if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists foo; then
14 dnl if $PKG_CONFIG foo --atleast-version 1.2.3; then
15 dnl LIBFOO_CFLAGS=`$PKG_CONFIG foo --cflags`
16 dnl LIBFOO_LIBDIR=`$PKG_CONFIG foo --libs`
17 dnl LIBFOO_VERSON=`$PKG_CONFIG foo --modversion`
18 dnl AC_MSG_RESULT(from pkgconfig: version $LIBFOO_VERSON)
20 dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
23 dnl AC_MSG_ERROR(pkg-config not found)
25 dnl PHP_EVAL_LIBLINE($LIBFOO_LIBDIR, BBCODE_SHARED_LIBADD)
26 dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS)
28 dnl # --with-bbcode -> check with-path
29 dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
30 dnl SEARCH_FOR="/include/bbcode.h" # you most likely want to change this
31 dnl if test -r $PHP_BBCODE/$SEARCH_FOR; then # path given as parameter
32 dnl BBCODE_DIR=$PHP_BBCODE
33 dnl else # search default path list
34 dnl AC_MSG_CHECKING([for bbcode files in default path])
35 dnl for i in $SEARCH_PATH ; do
36 dnl if test -r $i/$SEARCH_FOR; then
38 dnl AC_MSG_RESULT(found in $i)
43 dnl if test -z "$BBCODE_DIR"; then
44 dnl AC_MSG_RESULT([not found])
45 dnl AC_MSG_ERROR([Please reinstall the bbcode distribution])
48 dnl # --with-bbcode -> add include path
49 dnl PHP_ADD_INCLUDE($BBCODE_DIR/include)
51 dnl # --with-bbcode -> check for lib and symbol presence
52 dnl LIBNAME=bbcode # you may want to change this
53 dnl LIBSYMBOL=bbcode # you most likely want to change this
55 dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
57 dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $BBCODE_DIR/$PHP_LIBDIR, BBCODE_SHARED_LIBADD)
58 dnl AC_DEFINE(HAVE_BBCODELIB,1,[ ])
60 dnl AC_MSG_ERROR([wrong bbcode lib version or lib not found])
62 dnl -L$BBCODE_DIR/$PHP_LIBDIR -lm
65 dnl PHP_SUBST(BBCODE_SHARED_LIBADD)
68 dnl PHP_ADD_LIBRARY(stdc++,,BBCODE_SHARED_LIBADD)
69 dnl AC_DEFINE(HAVE_PARLE,1,[ ])
70 dnl PHP_SUBST(BBCODE_SHARED_LIBADD)
71 PHP_NEW_EXTENSION(bbcode, bbcode.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)