-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfigure.ac
140 lines (121 loc) · 3.55 KB
/
configure.ac
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
AC_PREREQ([2.69])
AC_INIT([facelbp], [0.1.0])
AC_CONFIG_SRCDIR([src/common.h])
AM_INIT_AUTOMAKE([1.11 foreign silent-rules])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
dnl make aclocal work in maintainer mode
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
AC_OPENMP
AC_SUBST(OPENMP_CFLAGS)
dnl OpenMP checker only defines for C when compiling both C and C++
OPENMP_CXXFLAGS=$OPENMP_CFLAGS
AC_SUBST(OPENMP_CXXFLAGS)
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# check for opencl
AC_ARG_ENABLE(opencl,
[ --enable-opencl enable OpenCL optimizations (default no)],,[enable_opencl=no])
AS_IF([test "${enable_opencl}" != "no"], [
case "${host_os}" in
darwin*)
OPENCL_LIBS="-framework OpenCL"
;;
*)
OPENCL_LIBS="-lOpenCL"
;;
esac
AC_SUBST(OPENCL_LIBS)
])
AM_CONDITIONAL([USE_OPENCL], [test "$enable_opencl" = "yes"])
# check for gtk clutter demo
AC_ARG_ENABLE(gtkdemo,
[ --disable-gtkdemo disable gtk demo (default auto)],,[
case "${host_os}" in
*linux* | darwin* )
enable_gtkdemo="yes"
;;
*)
enable_gtkdemo="no"
;;
esac
])
AS_IF([test "${enable_gtkdemo}" != "no"], [
PKG_CHECK_MODULES(GTK_GST_VIDEO, gtk+-3.0 clutter-gst-2.0 clutter-gtk-1.0 gstreamer-plugins-base-1.0 gstreamer-base-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-app-1.0,, [
AC_MSG_WARN([${GTK_GST_VIDEO_PKG_ERRORS}.])
enable_gtkdemo=no
])
])
AM_CONDITIONAL([ENABLE_GTKDEMO], [test "$enable_gtkdemo" = "yes"])
enable_opencvdemo=yes
# check using opencv capture demo
PKG_CHECK_MODULES(OPENCV, [opencv >= 2.0],, [
AC_MSG_WARN([${OPENCV_PKG_ERRORS}.])
enable_opencvdemo=no
])
AM_CONDITIONAL([ENABLE_OPENCVDEMO], [test "$enable_opencvdemo" = "yes"])
# check for sse2 intrinsics
AC_ARG_ENABLE(sse2,
[ --disable-sse2 disable SSE2 optimizations (default auto)],,[
case "${host_cpu}" in
i*86|x86_64|amd64)
enable_sse2="yes"
;;
*)
enable_sse2="no"
;;
esac
])
have_sse2="no"
AS_IF([test "${enable_sse2}" != "no"], [
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} -msse2"
AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
]])
], [
ac_cv_sse2_inline=yes
], [
ac_cv_sse2_inline=no
])
])
CFLAGS="${CFLAGS_save}"
AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
have_sse2="yes"
])
])
AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
# check for xml library support for convert opencv xml data file to our format
# if missing not affect normal using of the library
have_xml="no"
PKG_CHECK_MODULES(XML, libxml-2.0, have_xml="yes", [AC_MSG_WARN([${XML_PKG_ERRORS}.])])
AM_CONDITIONAL([HAVE_XML], [test "$have_xml" = "yes"])
# Checks for library functions.
AC_FUNC_MALLOC
AC_CONFIG_FILES([Makefile
src/Makefile
data/Makefile
examples/Makefile])
AC_OUTPUT
echo "
Configuration
OpenCV : ${enable_opencvdemo}
GTK Demo : ${enable_gtkdemo}
Using OpenCL : ${enable_opencl}
face_detect configured. Type 'make' to build.
"