File: config.m4

package info (click to toggle)
php4 6%3A4.4.4-8%2Betch1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 34,976 kB
  • ctags: 39,148
  • sloc: ansic: 340,486; php: 34,786; cpp: 10,150; sh: 9,010; lex: 2,180; yacc: 1,712; xml: 1,335; makefile: 559; awk: 466; java: 455; perl: 154
file content (77 lines) | stat: -rw-r--r-- 1,895 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
dnl
dnl $Id: config.m4,v 1.19.2.1.4.1 2005/12/21 21:50:08 sniper Exp $
dnl

PHP_ARG_WITH(ming, for MING support,
[  --with-ming[=DIR]       Include MING support])

if test "$PHP_MING" != "no"; then
  AC_CHECK_LIB(m, sin)

  for i in $PHP_MING /usr/local /usr; do
    if test -f $i/lib/libming.$SHLIB_SUFFIX_NAME -o -f $i/lib/libming.a; then
      MING_DIR=$i
    fi
  done

  if test -z "$MING_DIR"; then
    AC_MSG_ERROR(Please reinstall ming distribution. libming.(a|so) not found.)
  fi

  for i in $MING_DIR/include $MING_DIR/include/ming $MING_DIR/ming/include; do
    if test -f $i/ming.h; then
      MING_INC_DIR=$i
    fi
  done

  if test -z "$MING_INC_DIR"; then
    AC_MSG_ERROR(Please reinstall ming distribution. ming.h not found.)
  fi

  PHP_CHECK_LIBRARY(ming, Ming_useSWFVersion, [
    AC_DEFINE(HAVE_MING,1,[ ])
  ],[
    AC_MSG_ERROR([Ming library 0.2a or greater required.])
  ],[
    -L$MING_DIR/lib
  ])
  
  PHP_ADD_INCLUDE($MING_INC_DIR)
  PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/lib, MING_SHARED_LIBADD)

  AC_MSG_CHECKING([for destroySWFBlock])
  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$MING_INC_DIR
  AC_TRY_RUN([
#include "ming.h"
int destroySWFBlock(int a, int b) {
	return a+b;
}
int main() {
	return destroySWFBlock(-1,1); /* returns 0 only if function is not yet defined */
}
  ],[
    AC_MSG_RESULT([missing])
  ],[
    AC_DEFINE(HAVE_DESTROY_SWF_BLOCK,1,[ ])
    AC_MSG_RESULT([ok])
  ],[
    AC_MSG_RESULT([unknown])
  ]) 

  dnl Check Ming version (FIXME: if/when ming has some better way to detect the version..)
  AC_EGREP_CPP(yes, [
#include <ming.h>
#ifdef SWF_SOUND_COMPRESSION
yes
#endif
  ], [
    AC_DEFINE(HAVE_NEW_MING,  1, [ ]) 
    dnl FIXME: This is now unconditional..better check coming later.
    AC_DEFINE(HAVE_MING_ZLIB, 1, [ ])
  ])
  CPPFLAGS=$old_CPPFLAGS

  PHP_NEW_EXTENSION(ming, ming.c, $ext_shared)
  PHP_SUBST(MING_SHARED_LIBADD)
fi