source: src/router/php7/ext/fileinfo/config.m4 @ 31879

Last change on this file since 31879 was 31879, checked in by brainslayer, 6 weeks ago

update php

File size: 1.6 KB
Line 
1dnl $Id$
2dnl config.m4 for extension fileinfo
3
4PHP_ARG_ENABLE(fileinfo, for fileinfo support,
5[  --disable-fileinfo      Disable fileinfo support], yes)
6
7if test "$PHP_FILEINFO" != "no"; then
8
9  libmagic_sources=" \
10    libmagic/apprentice.c libmagic/apptype.c libmagic/ascmagic.c \
11    libmagic/cdf.c libmagic/cdf_time.c libmagic/compress.c \
12    libmagic/encoding.c libmagic/fsmagic.c libmagic/funcs.c \
13    libmagic/is_tar.c libmagic/magic.c libmagic/print.c \
14    libmagic/readcdf.c libmagic/softmagic.c"
15
16  AC_MSG_CHECKING([for strcasestr])
17  AC_TRY_RUN([
18#include <string.h>
19#include <strings.h>
20#include <stdlib.h>
21
22int main(void)
23{
24        char *s0, *s1, *ret;
25
26        s0 = (char *) malloc(42);
27        s1 = (char *) malloc(8);
28
29        memset(s0, 'X', 42);
30        s0[24] = 'Y';
31        s0[26] = 'Z';
32        s0[41] = '\0';
33        memset(s1, 'x', 8);
34        s1[0] = 'y';
35        s1[2] = 'Z';
36        s1[7] = '\0';
37
38        ret = strcasestr(s0, s1);
39
40        return !(NULL != ret);
41}
42  ],[
43    dnl using the platform implementation
44    AC_MSG_RESULT(yes)
45  ],[
46    AC_MSG_RESULT(no)
47    AC_MSG_NOTICE(using libmagic strcasestr implementation)
48    libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
49  ],[
50    dnl cross-compiling; assume not present
51    AC_MSG_NOTICE(using libmagic strcasestr implementation)
52    libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
53  ])
54
55  PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
56  PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
57
58  AC_CHECK_FUNCS([utimes strndup])
59
60  PHP_ADD_MAKEFILE_FRAGMENT
61fi
Note: See TracBrowser for help on using the repository browser.