First import
[bbcode] / config.m4
1 dnl $Id$
2 dnl config.m4 for extension bbcode
3
4 PHP_ARG_ENABLE(bbcode, whether to enable bbcode support,
5 [ --enable-bbcode Enable bbcode support])
6
7 if test "$PHP_BBCODE" != "no"; then
8 dnl Write more examples of tests here...
9
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)
19 dnl else
20 dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
21 dnl fi
22 dnl else
23 dnl AC_MSG_ERROR(pkg-config not found)
24 dnl fi
25 dnl PHP_EVAL_LIBLINE($LIBFOO_LIBDIR, BBCODE_SHARED_LIBADD)
26 dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS)
27
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
37 dnl BBCODE_DIR=$i
38 dnl AC_MSG_RESULT(found in $i)
39 dnl fi
40 dnl done
41 dnl fi
42 dnl
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])
46 dnl fi
47
48 dnl # --with-bbcode -> add include path
49 dnl PHP_ADD_INCLUDE($BBCODE_DIR/include)
50
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
54
55 dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
56 dnl [
57 dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $BBCODE_DIR/$PHP_LIBDIR, BBCODE_SHARED_LIBADD)
58 dnl AC_DEFINE(HAVE_BBCODELIB,1,[ ])
59 dnl ],[
60 dnl AC_MSG_ERROR([wrong bbcode lib version or lib not found])
61 dnl ],[
62 dnl -L$BBCODE_DIR/$PHP_LIBDIR -lm
63 dnl ])
64 dnl
65 dnl PHP_SUBST(BBCODE_SHARED_LIBADD)
66
67 dnl PHP_REQUIRE_CXX()
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)
72 fi