Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
Wind Yuan | 6753374 | 2015-01-16 17:19:05 +0800 | [diff] [blame] | 4 | m4_define([xcam_major_version], [0]) |
Wind Yuan | 47b5e4d | 2015-07-02 13:13:15 +0800 | [diff] [blame] | 5 | m4_define([xcam_minor_version], [2]) |
Wind Yuan | 0d7d28c | 2015-07-30 17:53:06 +0800 | [diff] [blame] | 6 | m4_define([xcam_micro_version], [1]) |
Wind Yuan | 6753374 | 2015-01-16 17:19:05 +0800 | [diff] [blame] | 7 | m4_define([xcam_version], [xcam_major_version.xcam_minor_version.xcam_micro_version]) |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 8 | |
| 9 | AC_PREREQ([2.60]) |
| 10 | AC_CONFIG_MACRO_DIR([m4]) |
| 11 | AC_INIT([libxcam], [xcam_version], [feng.yuan@intel.com], [libxcam]) |
| 12 | AC_CONFIG_HEADERS([config.h]) |
| 13 | AM_INIT_AUTOMAKE |
| 14 | |
Wind Yuan | 6753374 | 2015-01-16 17:19:05 +0800 | [diff] [blame] | 15 | #xcam version |
| 16 | XCAM_MAJOR_VERSION=xcam_major_version |
| 17 | XCAM_MINOR_VERSION=xcam_minor_version |
| 18 | XCAM_MICRO_VERSION=xcam_micro_version |
| 19 | XCAM_VERSION=xcam_version |
| 20 | XCAM_VERSION_HEX="0x$XCAM_MAJOR_VERSION$XCAM_MINOR_VERSION$XCAM_MICRO_VERSION" |
| 21 | AC_DEFINE_UNQUOTED(XCAM_VERSION, $XCAM_VERSION_HEX, |
| 22 | [define libxcam version]) |
| 23 | AC_SUBST(XCAM_VERSION) |
| 24 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 25 | # Checks for programs. |
| 26 | AC_PROG_CC |
| 27 | AC_PROG_CXX |
| 28 | AC_PROG_INSTALL |
| 29 | LT_INIT |
| 30 | |
| 31 | AC_ARG_ENABLE(debug, |
| 32 | AS_HELP_STRING([--enable-debug], |
| 33 | [enable debug, @<:@default=no@:>@]), |
| 34 | [], [enable_debug="no"]) |
| 35 | AM_CONDITIONAL([DEBUG], [test "$enable_debug" = "yes"]) |
| 36 | |
Wind Yuan | 9162580 | 2015-06-24 15:36:01 +0800 | [diff] [blame] | 37 | AC_ARG_ENABLE(profiling, |
| 38 | AS_HELP_STRING([--enable-profiling], |
| 39 | [enable profiling, @<:@default=no@:>@]), |
| 40 | [], [enable_profiling="no"]) |
| 41 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 42 | AC_ARG_ENABLE(drm, |
| 43 | AS_HELP_STRING([--enable-drm], |
| 44 | [enable drm buffer, @<:@default=yes@:>@]), |
| 45 | [], [enable_drm="yes"]) |
| 46 | |
| 47 | AC_ARG_ENABLE([aiq], |
| 48 | AS_HELP_STRING([--enable-aiq], |
| 49 | [enable Aiq 3A algorithm build, @<:@default=no@:>@]), |
| 50 | [], [enable_aiq="no"]) |
| 51 | |
John Ye | 3fc8fc4 | 2015-03-19 14:41:01 +0800 | [diff] [blame] | 52 | AC_ARG_ENABLE([gst], |
| 53 | AS_HELP_STRING([--enable-gst], |
| 54 | [enable gstreamer plugin build, @<:@default=no@:>@]), |
| 55 | [], [enable_gst="no"]) |
| 56 | |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 57 | AC_ARG_ENABLE(libcl, |
| 58 | AS_HELP_STRING([--enable-libcl], |
Yinhang Liu | c2f1908 | 2015-08-28 12:27:48 +0800 | [diff] [blame] | 59 | [enable libcl image processor, @<:@default=no@:>@]), |
| 60 | [], [enable_libcl="no"]) |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 61 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 62 | # documentation |
| 63 | AC_ARG_ENABLE(docs, |
| 64 | [AC_HELP_STRING([--enable-docs], |
| 65 | [build Doxygen documentation @<:@default=no@:>@])], |
| 66 | [], [enable_docs="no"]) |
| 67 | |
Wind Yuan | 8ba2f16 | 2015-05-04 14:51:07 +0800 | [diff] [blame] | 68 | AC_ARG_ENABLE([3alib], |
| 69 | AS_HELP_STRING([--enable-3alib], |
| 70 | [enable 3A lib build, @<:@default=no@:>@]), |
| 71 | [], [enable_3alib="no"]) |
| 72 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 73 | # Check for Doxygen |
| 74 | if test "$enable_docs" = "yes"; then |
| 75 | AC_CHECK_TOOL([DOXYGEN], [doxygen], [no]) |
| 76 | if test "$DOXYGEN" = "no"; then |
| 77 | enable_docs="no" |
| 78 | fi |
| 79 | fi |
| 80 | AM_CONDITIONAL(ENABLE_DOCS, test "$enable_docs" = "yes") |
| 81 | |
Wind Yuan | 9162580 | 2015-06-24 15:36:01 +0800 | [diff] [blame] | 82 | # check profiling |
| 83 | ENABLE_PROFILING=0 |
| 84 | if test "$enable_profiling" = "yes"; then |
| 85 | ENABLE_PROFILING=1 |
| 86 | fi |
| 87 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 88 | # check drm |
| 89 | HAVE_LIBDRM=0 |
| 90 | if test "$enable_drm" = "yes"; then |
| 91 | PKG_CHECK_MODULES(LIBDRM, [libdrm], [HAVE_LIBDRM=1], [HAVE_LIBDRM=0]) |
| 92 | fi |
| 93 | |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 94 | # check libcl |
| 95 | HAVE_LIBCL=0 |
| 96 | if test "$enable_libcl" = "yes"; then |
| 97 | PKG_CHECK_MODULES(LIBCL, [libcl], [HAVE_LIBCL=1], [HAVE_LIBCL=0]) |
| 98 | fi |
| 99 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 100 | # check AIQ |
Jia Meng | e2ed239 | 2015-07-16 23:20:12 +0800 | [diff] [blame] | 101 | ENABLE_IA_AIQ=0 |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 102 | USE_LOCAL_AIQ=0 |
| 103 | if test "$enable_aiq" = "yes"; then |
Jia Meng | e2ed239 | 2015-07-16 23:20:12 +0800 | [diff] [blame] | 104 | 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 Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 111 | fi |
| 112 | |
Wind Yuan | 8ba2f16 | 2015-05-04 14:51:07 +0800 | [diff] [blame] | 113 | # check 3a lib build |
| 114 | ENABLE_3ALIB=0 |
| 115 | if test "$enable_3alib" = "yes"; then |
| 116 | ENABLE_3ALIB=1 |
| 117 | fi |
| 118 | AM_CONDITIONAL([ENABLE_3ALIB], [test "$ENABLE_3ALIB" -eq 1]) |
| 119 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 120 | # check atomisp headers |
| 121 | USE_LOCAL_ATOMISP=0 |
| 122 | #AC_CHECK_HEADERS([linux/atomisp.h], [USE_LOCAL_ATOMISP=0], [USE_LOCAL_ATOMISP=1]) |
| 123 | AC_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 Ye | 3fc8fc4 | 2015-03-19 14:41:01 +0800 | [diff] [blame] | 147 | # build gstreamer plugin |
| 148 | GST_API_VERSION=1.0 |
| 149 | GST_VERSION_REQUIRED=1.2.3 |
| 150 | ENABLE_GST=0 |
| 151 | if 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]) |
| 156 | fi |
| 157 | AM_CONDITIONAL([ENABLE_GST], [test "$ENABLE_GST" -eq 1]) |
| 158 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 159 | dnl set XCAM_CFLAGS and XCAM_CXXFLAGS |
| 160 | XCAM_CFLAGS=" -fPIC -DSTDC99 -W -Wall -D_REENTRANT" |
| 161 | if test "$enable_debug" = "yes"; then |
| 162 | XCAM_CFLAGS="$XCAM_CFLAGS -g -DDEBUG" |
| 163 | fi |
| 164 | XCAM_CXXFLAGS="$XCAM_CFLAGS -std=c++0x" |
| 165 | AC_SUBST(XCAM_CFLAGS) |
| 166 | AC_SUBST(XCAM_CXXFLAGS) |
| 167 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 168 | # define macor in config.h |
Wind Yuan | 9162580 | 2015-06-24 15:36:01 +0800 | [diff] [blame] | 169 | AC_DEFINE_UNQUOTED([ENABLE_PROFILING], $ENABLE_PROFILING, |
| 170 | [enable profiling]) |
| 171 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 172 | AC_DEFINE_UNQUOTED([HAVE_LIBDRM], $HAVE_LIBDRM, |
| 173 | [have libdrm]) |
| 174 | AM_CONDITIONAL([HAVE_LIBDRM], [test "$HAVE_LIBDRM" -eq 1]) |
| 175 | |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 176 | AC_DEFINE_UNQUOTED([HAVE_LIBCL], $HAVE_LIBCL, |
| 177 | [have libcl]) |
| 178 | AM_CONDITIONAL([HAVE_LIBCL], [test "$HAVE_LIBCL" -eq 1]) |
| 179 | |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 180 | #atomisp |
| 181 | AM_CONDITIONAL([USE_LOCAL_ATOMISP], [test "$USE_LOCAL_ATOMISP" -eq 1]) |
| 182 | |
| 183 | # aiq (ia_imaging) |
Jia Meng | e2ed239 | 2015-07-16 23:20:12 +0800 | [diff] [blame] | 184 | AC_DEFINE_UNQUOTED([HAVE_IA_AIQ], $ENABLE_IA_AIQ, |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 185 | [have aiq binary]) |
Jia Meng | e2ed239 | 2015-07-16 23:20:12 +0800 | [diff] [blame] | 186 | AM_CONDITIONAL([ENABLE_IA_AIQ], [test "$ENABLE_IA_AIQ" -eq 1]) |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 187 | AM_CONDITIONAL([USE_LOCAL_AIQ], [test "$USE_LOCAL_AIQ" -eq 1]) |
| 188 | |
| 189 | AC_CONFIG_FILES([Makefile |
Yinhang Liu | 42f0630 | 2015-05-22 17:01:58 +0800 | [diff] [blame] | 190 | clx_kernel/Makefile |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 191 | xcore/Makefile |
John Ye | e94eb96 | 2015-03-17 15:34:03 +0800 | [diff] [blame] | 192 | wrapper/Makefile |
| 193 | wrapper/gstreamer/Makefile |
John Ye | 79d1f1e | 2015-04-01 17:02:11 +0800 | [diff] [blame] | 194 | wrapper/gstreamer/interface/Makefile |
Wind Yuan | 8ba2f16 | 2015-05-04 14:51:07 +0800 | [diff] [blame] | 195 | 3alib/Makefile |
Jia Meng | c54c332 | 2015-08-26 09:45:18 +0800 | [diff] [blame] | 196 | 3alib/aiq/Makefile |
| 197 | 3alib/hybrid/Makefile |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 198 | tests/Makefile |
| 199 | pkgconfig/Makefile |
| 200 | pkgconfig/xcam_core.pc |
| 201 | ]) |
| 202 | |
| 203 | AC_OUTPUT |
| 204 | |
| 205 | if test "$USE_LOCAL_AIQ" -eq 1; then use_local_aiq="yes"; else use_local_aiq="no"; fi |
| 206 | if test "$USE_LOCAL_ATOMISP" -eq 1; then use_local_atomisp="yes"; else use_local_atomisp="no"; fi |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 207 | if test "$HAVE_LIBCL" -eq 1; then have_libcl="yes"; else have_libcl="no"; fi |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 208 | |
| 209 | echo " |
| 210 | libxcam configuration summary |
| 211 | version : $XCAM_VERSION |
| 212 | enable debug : $enable_debug |
Wind Yuan | 9162580 | 2015-06-24 15:36:01 +0800 | [diff] [blame] | 213 | enable profiling : $enable_profiling |
John Ye | 3fc8fc4 | 2015-03-19 14:41:01 +0800 | [diff] [blame] | 214 | build GStreamer plugin : $enable_gst |
Jia Meng | e2ed239 | 2015-07-16 23:20:12 +0800 | [diff] [blame] | 215 | build aiq analyzer : $enable_aiq |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 216 | use local aiq : $use_local_aiq |
| 217 | use local atomisp : $use_local_atomisp |
Wind Yuan | 4009d6c | 2015-02-10 18:09:48 +0800 | [diff] [blame] | 218 | have opencl lib : $have_libcl |
Wind Yuan | 8ba2f16 | 2015-05-04 14:51:07 +0800 | [diff] [blame] | 219 | enable 3a lib : $enable_3alib |
Wind Yuan | 75564b1 | 2015-01-15 06:51:15 -0500 | [diff] [blame] | 220 | " |