Chris@0
|
1 dnl $Id$
|
Chris@0
|
2 dnl config.m4 for extension symfony_debug
|
Chris@0
|
3
|
Chris@0
|
4 dnl Comments in this file start with the string 'dnl'.
|
Chris@0
|
5 dnl Remove where necessary. This file will not work
|
Chris@0
|
6 dnl without editing.
|
Chris@0
|
7
|
Chris@0
|
8 dnl If your extension references something external, use with:
|
Chris@0
|
9
|
Chris@0
|
10 dnl PHP_ARG_WITH(symfony_debug, for symfony_debug support,
|
Chris@0
|
11 dnl Make sure that the comment is aligned:
|
Chris@0
|
12 dnl [ --with-symfony_debug Include symfony_debug support])
|
Chris@0
|
13
|
Chris@0
|
14 dnl Otherwise use enable:
|
Chris@0
|
15
|
Chris@0
|
16 PHP_ARG_ENABLE(symfony_debug, whether to enable symfony_debug support,
|
Chris@0
|
17 dnl Make sure that the comment is aligned:
|
Chris@0
|
18 [ --enable-symfony_debug Enable symfony_debug support])
|
Chris@0
|
19
|
Chris@0
|
20 if test "$PHP_SYMFONY_DEBUG" != "no"; then
|
Chris@0
|
21 dnl Write more examples of tests here...
|
Chris@0
|
22
|
Chris@0
|
23 dnl # --with-symfony_debug -> check with-path
|
Chris@0
|
24 dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
|
Chris@0
|
25 dnl SEARCH_FOR="/include/symfony_debug.h" # you most likely want to change this
|
Chris@0
|
26 dnl if test -r $PHP_SYMFONY_DEBUG/$SEARCH_FOR; then # path given as parameter
|
Chris@0
|
27 dnl SYMFONY_DEBUG_DIR=$PHP_SYMFONY_DEBUG
|
Chris@0
|
28 dnl else # search default path list
|
Chris@0
|
29 dnl AC_MSG_CHECKING([for symfony_debug files in default path])
|
Chris@0
|
30 dnl for i in $SEARCH_PATH ; do
|
Chris@0
|
31 dnl if test -r $i/$SEARCH_FOR; then
|
Chris@0
|
32 dnl SYMFONY_DEBUG_DIR=$i
|
Chris@0
|
33 dnl AC_MSG_RESULT(found in $i)
|
Chris@0
|
34 dnl fi
|
Chris@0
|
35 dnl done
|
Chris@0
|
36 dnl fi
|
Chris@0
|
37 dnl
|
Chris@0
|
38 dnl if test -z "$SYMFONY_DEBUG_DIR"; then
|
Chris@0
|
39 dnl AC_MSG_RESULT([not found])
|
Chris@0
|
40 dnl AC_MSG_ERROR([Please reinstall the symfony_debug distribution])
|
Chris@0
|
41 dnl fi
|
Chris@0
|
42
|
Chris@0
|
43 dnl # --with-symfony_debug -> add include path
|
Chris@0
|
44 dnl PHP_ADD_INCLUDE($SYMFONY_DEBUG_DIR/include)
|
Chris@0
|
45
|
Chris@0
|
46 dnl # --with-symfony_debug -> check for lib and symbol presence
|
Chris@0
|
47 dnl LIBNAME=symfony_debug # you may want to change this
|
Chris@0
|
48 dnl LIBSYMBOL=symfony_debug # you most likely want to change this
|
Chris@0
|
49
|
Chris@0
|
50 dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
|
Chris@0
|
51 dnl [
|
Chris@0
|
52 dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SYMFONY_DEBUG_DIR/lib, SYMFONY_DEBUG_SHARED_LIBADD)
|
Chris@0
|
53 dnl AC_DEFINE(HAVE_SYMFONY_DEBUGLIB,1,[ ])
|
Chris@0
|
54 dnl ],[
|
Chris@0
|
55 dnl AC_MSG_ERROR([wrong symfony_debug lib version or lib not found])
|
Chris@0
|
56 dnl ],[
|
Chris@0
|
57 dnl -L$SYMFONY_DEBUG_DIR/lib -lm
|
Chris@0
|
58 dnl ])
|
Chris@0
|
59 dnl
|
Chris@0
|
60 dnl PHP_SUBST(SYMFONY_DEBUG_SHARED_LIBADD)
|
Chris@0
|
61
|
Chris@0
|
62 PHP_NEW_EXTENSION(symfony_debug, symfony_debug.c, $ext_shared)
|
Chris@0
|
63 fi
|