File: config.m4

package info (click to toggle)
php4-ps 1.3.4-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 576 kB
  • ctags: 371
  • sloc: ansic: 1,533; php: 1,272; xml: 147; makefile: 75; sh: 40
file content (50 lines) | stat: -rwxr-xr-x 1,445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
dnl $Id: config.m4,v 1.5 2004/05/14 10:30:17 steinm Exp $
dnl config.m4 for extension ps

PHP_ARG_WITH(ps, for ps support,
Option to configure ps extension:
[  --with-ps[=DIR]    Include PostScript support])

if test "$PHP_PS" != "no"; then
  dnl Write more examples of tests here...

  dnl # --with-ps -> check with-path
  SEARCH_PATH="/usr/local /usr"     # you might want to change this
  SEARCH_FOR="include/libps/pslib.h"  # you most likely want to change this
  if test -r $PHP_PS/$SEARCH_FOR; then # path given as parameter
    PS_DIR=$PHP_PS
  else # search default path list
    AC_MSG_CHECKING([for ps files in default path])
    for i in $SEARCH_PATH ; do
      if test -r $i/$SEARCH_FOR; then
        PS_DIR=$i
        AC_MSG_RESULT(found in $i)
      fi
    done
  fi

  if test -z "$PS_DIR"; then
    AC_MSG_RESULT([not found])
    AC_MSG_ERROR([Please reinstall the pslib distribution])
  fi

  PHP_ADD_INCLUDE($PS_DIR/include)

  LIBNAME=ps # you may want to change this
  LIBSYMBOL=PS_begin_pattern # you most likely want to change this 

  PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
  [
    PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PS_DIR/lib, PS_SHARED_LIBADD)
    AC_DEFINE(HAVE_PS,1,[ ])
  ],[
    AC_MSG_ERROR([wrong pslib lib version or lib not found])
  ],[
    -L$PS_DIR/lib -lm -ldl
  ])

  PHP_SUBST(PS_SHARED_LIBADD)

  AC_DEFINE(HAVE_PS,1,[Whether to include the ps extension])
  PHP_NEW_EXTENSION(ps, ps.c, $ext_shared)
fi