blob: 25b820d429369dde3b1eab812e85e4d5e7ca7a5f [file] [log] [blame]
Wind Yuan75564b12015-01-15 06:51:15 -05001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
Wind Yuan67533742015-01-16 17:19:05 +08004m4_define([xcam_major_version], [0])
Wind Yuan47b5e4d2015-07-02 13:13:15 +08005m4_define([xcam_minor_version], [2])
Wind Yuan0d7d28c2015-07-30 17:53:06 +08006m4_define([xcam_micro_version], [1])
Wind Yuan67533742015-01-16 17:19:05 +08007m4_define([xcam_version], [xcam_major_version.xcam_minor_version.xcam_micro_version])
Wind Yuan75564b12015-01-15 06:51:15 -05008
9AC_PREREQ([2.60])
10AC_CONFIG_MACRO_DIR([m4])
11AC_INIT([libxcam], [xcam_version], [feng.yuan@intel.com], [libxcam])
12AC_CONFIG_HEADERS([config.h])
13AM_INIT_AUTOMAKE
14
Wind Yuan67533742015-01-16 17:19:05 +080015#xcam version
16XCAM_MAJOR_VERSION=xcam_major_version
17XCAM_MINOR_VERSION=xcam_minor_version
18XCAM_MICRO_VERSION=xcam_micro_version
19XCAM_VERSION=xcam_version
20XCAM_VERSION_HEX="0x$XCAM_MAJOR_VERSION$XCAM_MINOR_VERSION$XCAM_MICRO_VERSION"
21AC_DEFINE_UNQUOTED(XCAM_VERSION, $XCAM_VERSION_HEX,
22 [define libxcam version])
23AC_SUBST(XCAM_VERSION)
24
Wind Yuan75564b12015-01-15 06:51:15 -050025# Checks for programs.
26AC_PROG_CC
27AC_PROG_CXX
28AC_PROG_INSTALL
29LT_INIT
30
31AC_ARG_ENABLE(debug,
32 AS_HELP_STRING([--enable-debug],
33 [enable debug, @<:@default=no@:>@]),
34 [], [enable_debug="no"])
35AM_CONDITIONAL([DEBUG], [test "$enable_debug" = "yes"])
36
Wind Yuan91625802015-06-24 15:36:01 +080037AC_ARG_ENABLE(profiling,
38 AS_HELP_STRING([--enable-profiling],
39 [enable profiling, @<:@default=no@:>@]),
40 [], [enable_profiling="no"])
41
Wind Yuan75564b12015-01-15 06:51:15 -050042AC_ARG_ENABLE(drm,
43 AS_HELP_STRING([--enable-drm],
44 [enable drm buffer, @<:@default=yes@:>@]),
45 [], [enable_drm="yes"])
46
47AC_ARG_ENABLE([aiq],
48 AS_HELP_STRING([--enable-aiq],
49 [enable Aiq 3A algorithm build, @<:@default=no@:>@]),
50 [], [enable_aiq="no"])
51
John Ye3fc8fc42015-03-19 14:41:01 +080052AC_ARG_ENABLE([gst],
53 AS_HELP_STRING([--enable-gst],
54 [enable gstreamer plugin build, @<:@default=no@:>@]),
55 [], [enable_gst="no"])
56
Wind Yuan4009d6c2015-02-10 18:09:48 +080057AC_ARG_ENABLE(libcl,
58 AS_HELP_STRING([--enable-libcl],
Yinhang Liuc2f19082015-08-28 12:27:48 +080059 [enable libcl image processor, @<:@default=no@:>@]),
60 [], [enable_libcl="no"])
Wind Yuan4009d6c2015-02-10 18:09:48 +080061
Wind Yuan75564b12015-01-15 06:51:15 -050062# documentation
63AC_ARG_ENABLE(docs,
64 [AC_HELP_STRING([--enable-docs],
65 [build Doxygen documentation @<:@default=no@:>@])],
66 [], [enable_docs="no"])
67
Wind Yuan8ba2f162015-05-04 14:51:07 +080068AC_ARG_ENABLE([3alib],
69 AS_HELP_STRING([--enable-3alib],
70 [enable 3A lib build, @<:@default=no@:>@]),
71 [], [enable_3alib="no"])
72
Wind Yuan75564b12015-01-15 06:51:15 -050073# Check for Doxygen
74if test "$enable_docs" = "yes"; then
75 AC_CHECK_TOOL([DOXYGEN], [doxygen], [no])
76 if test "$DOXYGEN" = "no"; then
77 enable_docs="no"
78 fi
79fi
80AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes")
81
Wind Yuan91625802015-06-24 15:36:01 +080082# check profiling
83ENABLE_PROFILING=0
84if test "$enable_profiling" = "yes"; then
85 ENABLE_PROFILING=1
86fi
87
Wind Yuan75564b12015-01-15 06:51:15 -050088# check drm
89HAVE_LIBDRM=0
90if test "$enable_drm" = "yes"; then
91 PKG_CHECK_MODULES(LIBDRM, [libdrm], [HAVE_LIBDRM=1], [HAVE_LIBDRM=0])
92fi
93
Wind Yuan4009d6c2015-02-10 18:09:48 +080094# check libcl
95HAVE_LIBCL=0
96if test "$enable_libcl" = "yes"; then
97 PKG_CHECK_MODULES(LIBCL, [libcl], [HAVE_LIBCL=1], [HAVE_LIBCL=0])
98fi
99
Wind Yuan75564b12015-01-15 06:51:15 -0500100# check AIQ
Jia Menge2ed2392015-07-16 23:20:12 +0800101ENABLE_IA_AIQ=0
Wind Yuan75564b12015-01-15 06:51:15 -0500102USE_LOCAL_AIQ=0
103if test "$enable_aiq" = "yes"; then
Jia Menge2ed2392015-07-16 23:20:12 +0800104 ENABLE_IA_AIQ=1
105 PKG_CHECK_MODULES(IA_AIQ, ia_imaging,
106 PKG_CHECK_EXISTS(ia_imaging >= 2.7,
107 AC_DEFINE(HAVE_AIQ_2_7, 1, [defined if ia_imaging >= v2.0_007 is found])
108 ),
109 [USE_LOCAL_AIQ=1]
110 )
Wind Yuan75564b12015-01-15 06:51:15 -0500111fi
112
Wind Yuan8ba2f162015-05-04 14:51:07 +0800113# check 3a lib build
114ENABLE_3ALIB=0
115if test "$enable_3alib" = "yes"; then
116 ENABLE_3ALIB=1
117fi
118AM_CONDITIONAL([ENABLE_3ALIB], [test "$ENABLE_3ALIB" -eq 1])
119
Wind Yuan75564b12015-01-15 06:51:15 -0500120# check atomisp headers
121USE_LOCAL_ATOMISP=0
122#AC_CHECK_HEADERS([linux/atomisp.h], [USE_LOCAL_ATOMISP=0], [USE_LOCAL_ATOMISP=1])
123AC_CACHE_CHECK([for linux/atomisp.h],
124 ac_cv_have_atomisp_headers, [
125 saved_CPPFLAGS="$CPPFLAGS"
126 CPPFLAGS="$CPPFLAGS"
127 saved_LIBS="$LIBS"
128 LIBS="$LIBS"
129 AC_COMPILE_IFELSE(
130 [AC_LANG_PROGRAM(
131 [[#ifndef __user
132 #define __user
133 #endif
134 #include <stdint.h>
135 #include <stdio.h>
136 #include <linux/atomisp.h>]],
137 [[struct atomisp_parm param;]]
138 )],
139 [ac_cv_have_atomisp_headers="yes"],
140 [ac_cv_have_atomisp_headers="no" USE_LOCAL_ATOMISP=1]
141 )
142 CPPFLAGS="$saved_CPPFLAGS"
143 LIBS="$saved_LIBS"
144])
145
146
John Ye3fc8fc42015-03-19 14:41:01 +0800147# build gstreamer plugin
148GST_API_VERSION=1.0
149GST_VERSION_REQUIRED=1.2.3
150ENABLE_GST=0
151if test "$enable_gst" = "yes"; then
152 ENABLE_GST=1
153 PKG_CHECK_MODULES([GST], [gstreamer-$GST_API_VERSION >= $GST_VERSION_REQUIRED])
154 PKG_CHECK_MODULES([GST_ALLOCATOR], [gstreamer-allocators-$GST_API_VERSION >= $GST_VERSION_REQUIRED])
155 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-$GST_API_VERSION >= $GST_VERSION_REQUIRED])
156fi
157AM_CONDITIONAL([ENABLE_GST], [test "$ENABLE_GST" -eq 1])
158
Wind Yuan75564b12015-01-15 06:51:15 -0500159dnl set XCAM_CFLAGS and XCAM_CXXFLAGS
160XCAM_CFLAGS=" -fPIC -DSTDC99 -W -Wall -D_REENTRANT"
161if test "$enable_debug" = "yes"; then
162 XCAM_CFLAGS="$XCAM_CFLAGS -g -DDEBUG"
163fi
164XCAM_CXXFLAGS="$XCAM_CFLAGS -std=c++0x"
165AC_SUBST(XCAM_CFLAGS)
166AC_SUBST(XCAM_CXXFLAGS)
167
Wind Yuan75564b12015-01-15 06:51:15 -0500168# define macor in config.h
Wind Yuan91625802015-06-24 15:36:01 +0800169AC_DEFINE_UNQUOTED([ENABLE_PROFILING], $ENABLE_PROFILING,
170 [enable profiling])
171
Wind Yuan75564b12015-01-15 06:51:15 -0500172AC_DEFINE_UNQUOTED([HAVE_LIBDRM], $HAVE_LIBDRM,
173 [have libdrm])
174AM_CONDITIONAL([HAVE_LIBDRM], [test "$HAVE_LIBDRM" -eq 1])
175
Wind Yuan4009d6c2015-02-10 18:09:48 +0800176AC_DEFINE_UNQUOTED([HAVE_LIBCL], $HAVE_LIBCL,
177 [have libcl])
178AM_CONDITIONAL([HAVE_LIBCL], [test "$HAVE_LIBCL" -eq 1])
179
Wind Yuan75564b12015-01-15 06:51:15 -0500180#atomisp
181AM_CONDITIONAL([USE_LOCAL_ATOMISP], [test "$USE_LOCAL_ATOMISP" -eq 1])
182
183# aiq (ia_imaging)
Jia Menge2ed2392015-07-16 23:20:12 +0800184AC_DEFINE_UNQUOTED([HAVE_IA_AIQ], $ENABLE_IA_AIQ,
Wind Yuan75564b12015-01-15 06:51:15 -0500185 [have aiq binary])
Jia Menge2ed2392015-07-16 23:20:12 +0800186AM_CONDITIONAL([ENABLE_IA_AIQ], [test "$ENABLE_IA_AIQ" -eq 1])
Wind Yuan75564b12015-01-15 06:51:15 -0500187AM_CONDITIONAL([USE_LOCAL_AIQ], [test "$USE_LOCAL_AIQ" -eq 1])
188
189AC_CONFIG_FILES([Makefile
Yinhang Liu42f06302015-05-22 17:01:58 +0800190 clx_kernel/Makefile
Wind Yuan75564b12015-01-15 06:51:15 -0500191 xcore/Makefile
John Yee94eb962015-03-17 15:34:03 +0800192 wrapper/Makefile
193 wrapper/gstreamer/Makefile
John Ye79d1f1e2015-04-01 17:02:11 +0800194 wrapper/gstreamer/interface/Makefile
Wind Yuan8ba2f162015-05-04 14:51:07 +0800195 3alib/Makefile
Jia Mengc54c3322015-08-26 09:45:18 +0800196 3alib/aiq/Makefile
197 3alib/hybrid/Makefile
Wind Yuan75564b12015-01-15 06:51:15 -0500198 tests/Makefile
199 pkgconfig/Makefile
200 pkgconfig/xcam_core.pc
201 ])
202
203AC_OUTPUT
204
205if test "$USE_LOCAL_AIQ" -eq 1; then use_local_aiq="yes"; else use_local_aiq="no"; fi
206if test "$USE_LOCAL_ATOMISP" -eq 1; then use_local_atomisp="yes"; else use_local_atomisp="no"; fi
Wind Yuan4009d6c2015-02-10 18:09:48 +0800207if test "$HAVE_LIBCL" -eq 1; then have_libcl="yes"; else have_libcl="no"; fi
Wind Yuan75564b12015-01-15 06:51:15 -0500208
209echo "
210 libxcam configuration summary
211 version : $XCAM_VERSION
212 enable debug : $enable_debug
Wind Yuan91625802015-06-24 15:36:01 +0800213 enable profiling : $enable_profiling
John Ye3fc8fc42015-03-19 14:41:01 +0800214 build GStreamer plugin : $enable_gst
Jia Menge2ed2392015-07-16 23:20:12 +0800215 build aiq analyzer : $enable_aiq
Wind Yuan75564b12015-01-15 06:51:15 -0500216 use local aiq : $use_local_aiq
217 use local atomisp : $use_local_atomisp
Wind Yuan4009d6c2015-02-10 18:09:48 +0800218 have opencl lib : $have_libcl
Wind Yuan8ba2f162015-05-04 14:51:07 +0800219 enable 3a lib : $enable_3alib
Wind Yuan75564b12015-01-15 06:51:15 -0500220"