forked from Leon2012/php-qrencode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
90 lines (72 loc) · 2.34 KB
/
config.m4
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
78
79
80
81
82
83
84
85
86
87
88
89
90
PHP_ARG_WITH(qrencode, for qrencode support,
[ --with-qrencode Include qrencode support])
PHP_ARG_ENABLE(qrencode, whether to enable qrencode support,
[ --enable-qrencode Enable qrencode support])
if test "$PHP_QRENCODE" != "no"; then
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="/include/qrencode.h"
if test -r $PHP_QRENCODE/$SEARCH_FOR; then # path given as parameter
QRENCODE_DIR=$PHP_QRENCODE
else
AC_MSG_CHECKING([for qrencode files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
QRENCODE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$QRENCODE_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the qrencode distribution])
fi
PHP_ADD_INCLUDE($QRENCODE_DIR/include)
LIBNAME=qrencode
LIBSYMBOL=QRcode_APIVersionString
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $QRENCODE_DIR/$PHP_LIBDIR, QRENCODE_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(gd, $QRENCODE_DIR/$PHP_LIBDIR, QRENCODE_SHARED_LIBADD)
AC_DEFINE(HAVE_QRENCODELIB,1,[ ])
],[
AC_MSG_ERROR([wrong qrencode lib version or lib not found])
],[
-L$QRENCODE_DIR/$PHP_LIBDIR -lm
])
PHP_SUBST(QRENCODE_SHARED_LIBADD)
PHP_NEW_EXTENSION(qrencode, qrencode.c, $ext_shared)
fi
dnl PHP_ARG_WITH(gd, for libgd support,
dnl [ --with-gd[=DIR] Include gd support])
dnl if test "$PHP_GD" != "no"; then
dnl if test -r $PHP_GD/lib/libgd.a; then
dnl GD_DIR=$PHP_GD
dnl else
dnl AC_MSG_CHECKING(for libgd in default path)
dnl for i in /usr/local/opt/gd /usr/local /usr ; do
dnl if test -r $i/lib/libgd.a; then
dnl GD_DIR=$i
dnl AC_MSG_RESULT(found in $i)
dnl fi
dnl done
dnl fi
dnl
dnl if test -z "$GD_DIR"; then
dnl AC_MSG_RESULT(not found)
dnl AC_MSG_ERROR(please install gd )
dnl fi
dnl PHP_ADD_INCLUDE($GD_DIR/include)
dnl PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_DIR/lib, QRENCODE_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_GD,1,[ ])
dnl
dnl PHP_SUBST(QRENCODE_SHARED_LIBADD)
dnl
dnl PHP_EXTENSION(qrencode, $ext_shared)
dnl fi
if test -z "$PHP_DEBUG"; then
AC_ARG_ENABLE(debug,
[ --enable-debug compile with debugging symbols],[
PHP_DEBUG=$enableval
],[ PHP_DEBUG=no
])
fi