Debian Codegraph @

contrib/php/config.m4

raw
1 dnl $Id: config.m4,v 1.1 2007-10-03 20:20:14 chu11 Exp $
2 dnl config.m4 for extension genders
3
4 dnl Comments in this file start with the string 'dnl'.
5 dnl Remove where necessary. This file will not work
6 dnl without editing.
7
8 PHP_ARG_WITH(genders, for genders support,
9 [ --with-genders[=DIR] Include genders support])
10
11 if test "$PHP_GENDERS" != "no"; then
12
13 if test "$PHP_GENDERS" != "yes"; then
14 AC_MSG_CHECKING(if genders specified path is valid)
15 if test -r $PHP_GENDERS/include/genders.h; then
16 GENDERS_DIR=$PHP_GENDERS
17 AC_MSG_RESULT([yes])
18 else
19 AC_MSG_RESULT([no])
20 AC_MSG_ERROR([The specified genders path is Invalid or the installation is incomplete
21 Please specify another path or reinstall the genders distribution])
22 fi
23 else
24 SEARCH_PATH="/usr/local/genders /usr/local /usr /opt"
25 SEARCH_FOR="/include/genders.h"
26 if test -r $PHP_GENDERS/$SEARCH_FOR; then # path given as parameter
27 GENDERS_DIR=$PHP_GENDERS
28 else # search default path list
29 AC_MSG_CHECKING([for genders files in default path])
30 for i in $SEARCH_PATH ; do
31 if test -r $i/$SEARCH_FOR; then
32 GENDERS_DIR=$i
33 AC_MSG_RESULT(found in $i)
34 fi
35 done
36 fi
37 fi
38
39 if test -z "$GENDERS_DIR"; then
40 AC_MSG_RESULT([not found])
41 AC_MSG_ERROR([Please reinstall the genders distribution])
42 fi
43
44 PHP_ADD_INCLUDE($GENDERS_DIR/include)
45
46 LIBNAME=genders
47 LIBSYMBOL=genders_handle_create
48
49 PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
50 [
51 PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $GENDERS_DIR/lib, GENDERS_SHARED_LIBADD)
52 AC_DEFINE(HAVE_GENDERSLIB,1,[ ])
53 ],[
54 AC_MSG_ERROR([wrong genders lib version or lib not found])
55 ],[
56 -L$GENDERS_DIR/lib -lm -ldl
57 ])
58
59 PHP_SUBST(GENDERS_SHARED_LIBADD)
60
61 PHP_NEW_EXTENSION(genders, genders.c, $ext_shared)
62 fi