-
Notifications
You must be signed in to change notification settings - Fork 230
/
configure.ac
209 lines (186 loc) · 9.5 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_define([xcam_major_version], [1])
m4_define([xcam_minor_version], [5])
m4_define([xcam_micro_version], [0])
m4_define([xcam_version], [xcam_major_version.xcam_minor_version.xcam_micro_version])
AC_PREREQ([2.60])
AC_CONFIG_MACRO_DIR([m4])
AC_INIT([libxcam], [xcam_version], [[email protected]], [libxcam])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
# xcam version
XCAM_MAJOR_VERSION=xcam_major_version
XCAM_MINOR_VERSION=xcam_minor_version
XCAM_MICRO_VERSION=xcam_micro_version
XCAM_VERSION=xcam_version
XCAM_VERSION_HEX="0x$XCAM_MAJOR_VERSION$XCAM_MINOR_VERSION$XCAM_MICRO_VERSION"
AC_DEFINE_UNQUOTED(XCAM_VERSION, $XCAM_VERSION_HEX,
[define libxcam version])
AC_SUBST(XCAM_VERSION)
XCAM_LT_VERSION="xcam_major_version:xcam_minor_version:xcam_micro_version"
XCAM_LT_LDFLAGS="-version-number $XCAM_LT_VERSION"
AC_SUBST(XCAM_LT_VERSION)
AC_SUBST(XCAM_LT_LDFLAGS)
# xcam required OpenCV version [XCAM_REQUIRE_CV_MIN, XCAM_REQUIRE_CV_MAX)
XCAM_REQUIRE_CV_MIN=3.0.0
XCAM_REQUIRE_CV_MAX=5.0.0
# xcam required OpenSceneGraph version
XCAM_REQUIRE_OSG_MIN=3.3.2
# xcam required OpenVino version
XCAM_REQUIRE_DNN_MIN=2023.0.0
# xcam gstreamer version
GST_API_VERSION=1.0
GST_VERSION_MIN=1.2.3
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
LT_INIT
# set XCAM_CFLAGS and XCAM_CXXFLAGS
XCAM_CFLAGS=" -fPIC -Wall -fstack-protector"
XCAM_IF($enable_debug, yes, XCAM_CFLAGS="$XCAM_CFLAGS -g -DDEBUG")
XCAM_CXXFLAGS="$XCAM_CFLAGS -std=c++0x"
AC_SUBST(XCAM_CFLAGS)
AC_SUBST(XCAM_CXXFLAGS)
XCAM_ARG_ENABLE(debug, --enable-debug, enable_debug, no, enable debug)
XCAM_ARG_ENABLE(profiling, --enable-profiling, enable_profiling, no, enable profiling)
XCAM_ARG_ENABLE(drm, --enable-drm, enable_drm, no, enable drm buffer)
XCAM_ARG_ENABLE(aiq, --enable-aiq, enable_aiq, no, enable Aiq 3A algorithm)
XCAM_ARG_ENABLE(gst, --enable-gst, enable_gst, no, enable gstreamer plugin)
XCAM_ARG_ENABLE(libcl, --enable-libcl, enable_libcl, yes, enable libcl image processor)
XCAM_ARG_ENABLE(gles, --enable-gles, enable_gles, no, enable gles)
XCAM_ARG_ENABLE(vulkan, --enable-vulkan, enable_vulkan, no, enable vulkan)
XCAM_ARG_ENABLE(avx512, --enable-avx512, enable_avx512, no, enable avx512)
XCAM_ARG_ENABLE(opencv, --enable-opencv, enable_opencv, no, enable opencv library)
XCAM_ARG_ENABLE(capi, --enable-capi, enable_capi, no, enable libxcam-capi library)
XCAM_ARG_ENABLE(render, --enable-render, enable_render, no, enable texture render with OpenSceneGraph library)
XCAM_ARG_ENABLE(dnn, --enable-dnn, enable_dnn, no, enable dnn with OpenVino library)
XCAM_ARG_ENABLE(docs, --enable-docs, enable_docs, no, build Doxygen documentation)
XCAM_ARG_ENABLE(3alib, --enable-3alib, enable_3alib, no, enable 3A library)
XCAM_ARG_ENABLE(smartlib, --enable-smartlib, enable_smartlib, no, enable smart analysis library)
XCAM_ARG_ENABLE(json, --enable-json, enable_json, no, enable camera calibration json parser)
XCAM_CHECK_MODULE($enable_drm, libdrm, LIBDRM, HAVE_LIBDRM=1, HAVE_LIBDRM=0)
XCAM_CHECK_MODULE($enable_libcl, OpenCL, LIBCL, HAVE_LIBCL=1, HAVE_LIBCL=0)
XCAM_CHECK_MODULE($enable_gles, gl, LIBGL, HAVE_GLES=1, HAVE_GLES=0)
XCAM_CHECK_MODULE($enable_gles, gbm, LIBGBM, HAVE_GBM=1, HAVE_GBM=0)
XCAM_CHECK_MODULE($enable_vulkan, vulkan, LIBVULKAN, HAVE_VULKAN=1, HAVE_VULKAN=0)
XCAM_CHECK_GAWK($HAVE_LIBCL, $HAVE_GLES)
XCAM_CHECK_DOXYGEN($enable_docs, [], enable_docs="no")
XCAM_CHECK_AVX512($enable_avx512, ENABLE_AVX512=1, ENABLE_AVX512=0)
XCAM_CHECK_OSG($enable_render, $XCAM_REQUIRE_OSG_MIN, ENABLE_RENDER=1, ENABLE_RENDER=0)
XCAM_CHECK_DNN($enable_dnn, $XCAM_REQUIRE_DNN_MIN, ENABLE_DNN=1, ENABLE_DNN=0)
XCAM_CHECK_OPENCV($enable_opencv, $XCAM_REQUIRE_CV_MIN, $XCAM_REQUIRE_CV_MAX, HAVE_OPENCV=1, HAVE_OPENCV=0, OPENCV_VERSION3=1, OPENCV_VERSION3=0)
XCAM_CHECK_OCV_VIDEOSTAB($HAVE_OPENCV, ENABLE_DVS=1, ENABLE_DVS=0)
XCAM_CHECK_DVS_OCL($HAVE_OPENCV, ENABLE_DVS_CL_PATH=1, ENABLE_DVS_CL_PATH=0)
XCAM_CHECK_GST($enable_gst, $GST_API_VERSION, $GST_VERSION_MIN, ENABLE_GST=1, ENABLE_GST=0)
XCAM_CHECK_AIQ($enable_aiq, ENABLE_IA_AIQ=1, ENABLE_IA_AIQ=0, USE_LOCAL_AIQ=1, USE_LOCAL_AIQ=0)
XCAM_CHECK_LOCAL_ATOMISP($enable_aiq, USE_LOCAL_ATOMISP=1, USE_LOCAL_ATOMISP=0)
XCAM_CHECK_JSON($enable_json, HAVE_JSON=1, HAVE_JSON=0)
XCAM_IF($enable_capi, yes, ENABLE_CAPI=1, ENABLE_CAPI=0)
XCAM_IF($enable_profiling, yes, ENABLE_PROFILING=1, ENABLE_PROFILING=0)
XCAM_IF($enable_3alib, yes, ENABLE_3ALIB=1, ENABLE_3ALIB=0)
XCAM_IF($enable_smartlib, yes, ENABLE_SMART_LIB=1, ENABLE_SMART_LIB=0)
XCAM_PKG_EXPORT_LIBS=" -lxcam_core -lxcam_soft"
XCAM_CHECK_PKG_CONFIG($HAVE_LIBCL, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_ocl")
XCAM_CHECK_PKG_CONFIG($HAVE_GLES, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_gles")
XCAM_CHECK_PKG_CONFIG($HAVE_VULKAN, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_vulkan")
XCAM_CHECK_PKG_CONFIG($ENABLE_RENDER, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_render")
XCAM_CHECK_PKG_CONFIG($ENABLE_DNN, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_dnn")
XCAM_CHECK_PKG_CONFIG($ENABLE_CAPI, 1, XCAM_PKG_EXPORT_LIBS+=" -lxcam_capi")
# define macor in config.h
AC_DEFINE_UNQUOTED(XCAM_PKG_EXPORT_LIBS, "$XCAM_PKG_EXPORT_LIBS", [define libxcam pkg libs])
AC_SUBST(XCAM_PKG_EXPORT_LIBS)
XCAM_DEFINE_MACOR(ENABLE_PROFILING, $ENABLE_PROFILING, enable profiling)
XCAM_DEFINE_MACOR(HAVE_LIBDRM, $HAVE_LIBDRM, have libdrm)
XCAM_DEFINE_MACOR(HAVE_LIBCL, $HAVE_LIBCL, have libcl)
XCAM_DEFINE_MACOR(HAVE_GLES, $HAVE_GLES, have gles)
XCAM_DEFINE_MACOR(HAVE_GBM, $HAVE_GBM, have gbm)
XCAM_DEFINE_MACOR(HAVE_VULKAN, $HAVE_VULKAN, have vulkan)
XCAM_DEFINE_MACOR(ENABLE_AVX512, $ENABLE_AVX512, have avx instruction)
XCAM_DEFINE_MACOR(ENABLE_RENDER, $ENABLE_RENDER, enable texture render)
XCAM_DEFINE_MACOR(ENABLE_DNN, $ENABLE_DNN, have dnn)
XCAM_DEFINE_MACOR(HAVE_OPENCV, $HAVE_OPENCV, have opencv)
XCAM_DEFINE_MACOR(OPENCV_VERSION3, $OPENCV_VERSION3, opencv version3)
XCAM_DEFINE_MACOR(ENABLE_DVS, $ENABLE_DVS, have dvs)
XCAM_DEFINE_MACOR(ENABLE_DVS_CL_PATH, $ENABLE_DVS_CL_PATH, enable dvs cl path)
XCAM_DEFINE_MACOR(ENABLE_CAPI, $ENABLE_CAPI, enable capi)
XCAM_DEFINE_MACOR(HAVE_IA_AIQ, $ENABLE_IA_AIQ, have aiq binary)
XCAM_DEFINE_MACOR(HAVE_JSON, $HAVE_JSON, have json)
XCAM_CONDITIONAL(DEBUG, $enable_debug, yes)
XCAM_CONDITIONAL(ENABLE_DOCS, $enable_docs, yes)
XCAM_CONDITIONAL(ENABLE_3ALIB, $ENABLE_3ALIB, 1)
XCAM_CONDITIONAL(ENABLE_SMART_LIB, $ENABLE_SMART_LIB, 1)
XCAM_CONDITIONAL(ENABLE_GST, $ENABLE_GST, 1)
XCAM_CONDITIONAL(USE_LOCAL_ATOMISP, $USE_LOCAL_ATOMISP, 1)
XCAM_CONDITIONAL(ENABLE_IA_AIQ, $ENABLE_IA_AIQ, 1)
XCAM_CONDITIONAL(USE_LOCAL_AIQ, $USE_LOCAL_AIQ, 1)
AC_CONFIG_FILES([Makefile
shaders/Makefile
shaders/clx/Makefile
shaders/glslx/Makefile
xcore/Makefile
modules/Makefile
modules/ocv/Makefile
modules/soft/Makefile
modules/isp/Makefile
modules/ocl/Makefile
modules/gles/Makefile
modules/vulkan/Makefile
modules/render/Makefile
modules/dnn/Makefile
modules/dnn/inference/Makefile
wrapper/Makefile
wrapper/gstreamer/Makefile
wrapper/gstreamer/interface/Makefile
plugins/Makefile
plugins/3a/hybrid/Makefile
plugins/3a/aiq/Makefile
plugins/3a/Makefile
plugins/smart/Makefile
plugins/smart/dvs/Makefile
plugins/smart/dvs/libdvs/Makefile
plugins/smart/sample/Makefile
capi/Makefile
tests/Makefile
pkgconfig/Makefile
pkgconfig/libxcam.pc
])
AC_OUTPUT
XCAM_IF($HAVE_LIBDRM, 1, have_drm="yes", have_drm="no")
XCAM_IF($USE_LOCAL_AIQ, 1, use_local_aiq="yes", use_local_aiq="no")
XCAM_IF($USE_LOCAL_ATOMISP, 1, use_local_atomisp="yes", use_local_atomisp="no")
XCAM_IF($HAVE_LIBCL, 1, have_libcl="yes", have_libcl="no")
XCAM_IF($HAVE_GLES, 1, have_gles="yes", have_gles="no")
XCAM_IF($HAVE_VULKAN, 1, have_vulkan="yes", have_vulkan="no")
XCAM_IF($ENABLE_AVX512, 1, enable_avx512="yes", enable_avx512="no")
XCAM_IF($HAVE_OPENCV, 1, have_opencv="yes", have_opencv="no")
XCAM_IF($ENABLE_RENDER, 1, enable_render="yes", enable_render="no")
XCAM_IF($ENABLE_DNN, 1, enable_dnn="yes", enable_dnn="no")
XCAM_IF($ENABLE_DVS, 1, enable_dvs="yes", enable_dvs="no")
XCAM_IF($ENABLE_CAPI, 1, enable_capi="yes", enable_capi="no")
XCAM_IF($HAVE_JSON, 1, have_json="yes", have_json="no")
echo "
libxcam configuration summary
version : $XCAM_VERSION
enable debug : $enable_debug
enable profiling : $enable_profiling
enable drm lib : $have_drm
build GStreamer plugin : $enable_gst
build aiq analyzer : $enable_aiq
use local aiq : $use_local_aiq
use local atomisp : $use_local_atomisp
enable OpenCV : $have_opencv
enable OpenCL : $have_libcl
enable GLES : $have_gles
enable Vulkan : $have_vulkan
enable AVX512 instruction : $enable_avx512
enable OSG render : $enable_render
enable DNN : $enable_dnn
enable 3a lib : $enable_3alib
enable smart analysis lib : $enable_smartlib
enable dvs : $enable_dvs
enable libxcam-capi lib : $enable_capi
enable json parser : $have_json
"