source: eviacam/trunk/fuentes/configure.ac @ 567

Last change on this file since 567 was 567, checked in by mabarracus, 4 years ago

updated sources to version 2.0.3

File size: 6.1 KB
Line 
1AC_INIT([eviacam], 2.0.3)
2AC_CONFIG_SRCDIR([src/eviacamapp.cpp])
3AC_PREREQ(2.61)
4AM_CONFIG_HEADER(config.h)
5AM_INIT_AUTOMAKE
6COPYRIGHT="© 2008-15"
7PUBLISHER="César Mauri Loba"
8
9AC_SUBST(COPYRIGHT, [`echo $COPYRIGHT`])
10AC_DEFINE_UNQUOTED([COPYRIGHT], ["$COPYRIGHT"], [Copyright notice])
11AC_SUBST(PUBLISHER, [`echo $PUBLISHER`])
12AC_DEFINE_UNQUOTED([PUBLISHER], ["$PUBLISHER"], [Publisher info])
13
14# Use libtool for building static libraries only
15AC_ENABLE_SHARED
16AC_DISABLE_STATIC
17
18AC_PROG_LIBTOOL
19AM_PROG_LIBTOOL
20
21# Checks for programs.
22AC_PROG_CC
23AC_PROG_CXX
24AC_PROG_CPP
25AC_PROG_AWK
26AC_PROG_INSTALL
27AC_PROG_LN_S
28AC_PROG_MAKE_SET
29AC_PROG_MKDIR_P
30
31ALL_LINGUAS="ca es gl it tr ast de oc fr ar he ru pt_BR ja el lt zh_TW zh_CN"
32
33AM_GNU_GETTEXT([external])
34
35# ----------------- Debug mode switch --------------------
36AC_ARG_ENABLE(debug,
37[  --enable-debug          turn on debug build],
38[case "${enableval}" in
39yes) debug=true ;;
40full) debug=true ;;
41no)  debug=false ;;
42*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
43esac],[debug=false])
44AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
45AC_MSG_NOTICE([build in debug mode... $debug])
46# ----------------- Debug mode switch --------------------
47
48# ------------- Check for updates switch  ----------------
49# This adds the option of compiling without automatic check for
50# updates which is undesired for some builds (e.g. debian)
51AC_ARG_ENABLE(updates_check,
52  [  --disable-updates-check disable check for updates feature],
53  [case "${enableval}" in
54     yes | no ) WITH_UPDATES_CHECK="${enableval}" ;;
55     *) AC_MSG_ERROR(bad value ${enableval} for --disable-updates-check) ;;
56   esac],
57  [WITH_UPDATES_CHECK="yes"]
58)
59AM_CONDITIONAL([WITH_UPDATES_CHECK], [test "x$WITH_UPDATES_CHECK" = "xyes"])
60
61# Define UPDATES_CHECK in config.h if we're going to compile it
62if test "x$WITH_UPDATES_CHECK" = "xyes"; then
63    AC_DEFINE([ENABLE_UPDATES_CHECK], [], [Enable check for updates feature])
64    AC_MSG_NOTICE([check for updates feature... yes])
65else
66    AC_MSG_NOTICE([check for updates feature... no])
67fi
68# ------------- Check for updates switch  ----------------
69
70# Checks for libraries.
71# FIXME: Replace `main' with a function of each library
72
73AC_CHECK_LIB([X11], [main])
74AC_CHECK_LIB([Xext], [main], , AC_MSG_ERROR([libXext is required.]) )
75AC_CHECK_LIB([Xtst], [main], , AC_MSG_ERROR([libXtst is required.]) )
76AC_CHECK_FUNCS([pow])
77AC_CHECK_FUNCS([sqrt])
78
79# -----------------       gtk+-2.0  --------------------
80# TODO: check if gtk-2.0-devel is really needed
81# Put this early on, since gtk may rely on it.
82AC_PATH_XTRA
83
84GTKCONFIG='pkg-config gtk+-2.0'
85AC_DEFUN([GTKTEST],
86[
87        AC_REQUIRE([AC_PROG_AWK])
88        AC_MSG_CHECKING([gdk version])
89        if gdkversion=`pkg-config gtk+-2.0 --modversion`; then
90                AC_MSG_RESULT([$gdkversion])
91        else
92                AC_MSG_RESULT([not found])
93                AC_MSG_ERROR([gtk+-2.0 is required.])
94        fi])
95
96# Call test func
97GTKTEST
98
99GTK_CPPFLAGS="`$GTKCONFIG --cflags`"
100GTK_LIBS="`$GTKCONFIG --libs`"
101# -----------------   gtk+-2.0      --------------------
102
103# -----------------       wxWidgets --------------------
104WXCONFIG=wx-config
105AC_ARG_WITH(wx-config,
106[[  --with-wx-config=FILE     Use the given path to wx-config when determining
107                            wxWidgets configuration; defaults to "wx-config"]],
108[
109    if test "$withval" != "yes" -a "$withval" != ""; then
110        WXCONFIG=$withval
111    fi
112])
113
114wxversion=0
115
116AC_DEFUN([WXTEST],
117[
118        AC_REQUIRE([AC_PROG_AWK])
119        AC_MSG_CHECKING([wxWidgets version])
120        if wxversion=`$WXCONFIG --version`; then
121                AC_MSG_RESULT([$wxversion])
122        else
123                AC_MSG_RESULT([not found])
124                AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
125        fi])
126
127# Call WXTEST func
128WXTEST
129
130# Verify minimum requires
131vers=`echo $wxversion | $AWK 'BEGIN { FS = "."; } { printf "% d", ($1 * 1000 + $2) * 1000 + $3;}'`
132if test -n "$vers" && test "$vers" -ge 2006003; then
133        if ! "$debug"; then
134                WX_CPPFLAGS="`$WXCONFIG --cppflags`"
135                WX_CXXFLAGS="`$WXCONFIG --cxxflags | sed -e 's/-fno-exceptions//'`"
136                WX_LIBS="`$WXCONFIG --libs`"
137        else
138                WX_CPPFLAGS="`$WXCONFIG --cppflags`"
139                WX_CXXFLAGS="`$WXCONFIG --cxxflags | sed -e 's/-fno-exceptions//'`"
140                WX_LIBS="`$WXCONFIG --libs`"
141        fi
142else
143        AC_MSG_ERROR([wxWidgets 2.6.3 or newer is required])
144fi
145# -----------------       wxWidgets --------------------
146
147# -----------------       opencv  --------------------
148OPENCVCONFIG='pkg-config opencv'
149AC_DEFUN([OPENCVTEST],
150[
151        AC_REQUIRE([AC_PROG_AWK])
152        AC_MSG_CHECKING([opencv version])
153        if opencvversion=`pkg-config opencv --modversion`; then
154                AC_MSG_RESULT([$opencvversion])
155        else
156                AC_MSG_RESULT([not found])
157                AC_MSG_ERROR([opencv is required.])
158        fi])
159
160# Call OPENCVTEST func
161OPENCVTEST
162
163OPENCVVERSION=`echo $opencvversion | $AWK 'BEGIN { FS = "."; } { printf "% d", ($1 * 1000 + $2) * 1000 + $3;}'`
164AC_SUBST(OPENCVVERSION)
165OPENCV_CPPFLAGS="`$OPENCVCONFIG --cflags`"
166OPENCV_LIBS=" -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_objdetect -lopencv_video"
167# -----------------       opencv  --------------------
168
169# Checks for header files.
170AC_PATH_X
171AC_CHECK_HEADERS([float.h])
172AC_CHECK_HEADERS([sys/timeb.h])
173
174AC_CHECK_HEADER([libv4l1-videodev.h],
175        [AC_SUBST(VIDEODEV_INCLUDE_FILE, libv4l1-videodev.h)],
176        [AC_CHECK_HEADER([linux/videodev.h],
177                [AC_SUBST(VIDEODEV_INCLUDE_FILE, linux/videodev.h)],
178                [AC_MSG_ERROR([Couldn't find linux/videodev.h nor libv4l1-videodev.h])])
179        ]
180        )
181
182# Checks for typedefs, structures, and compiler characteristics.
183AC_HEADER_STDBOOL
184AC_C_CONST
185AC_C_INLINE
186
187COMPFLAGS="-fexceptions $WX_CPPFLAGS $OPENCV_CPPFLAGS $GTK_CPPFLAGS"
188if ! "$debug"; then
189        COMPFLAGS="$COMPFLAGS -DNDEBUG -O2"
190else
191        COMPFLAGS="$COMPFLAGS -Wall -Wconversion -DDEBUG -g -O0"
192fi
193
194CXXFLAGS="$CXXFLAGS $COMPFLAGS"
195LDFLAGS="$LDFLAGS -Wl,--as-needed"
196
197AC_SUBST(WX_LIBS)
198AC_SUBST(OPENCV_LIBS)
199AC_SUBST(GTK_LIBS)
200
201# libtool variables
202Xsed="sed -e s/^X//"
203LTLIBOBJS=`echo X"$LIBOBJS"|\
204           [$Xsed -e "s,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,"]`
205AC_SUBST(LTLIBOBJS)
206
207AC_OUTPUT(
208        [Makefile]
209        [po/Makefile.in]
210        [man/Makefile]
211        [doc/Makefile]
212        [wxutil/Makefile]
213        [creavision/Makefile]
214        [creavision/libwebcam/Makefile]
215        [simplelog/Makefile]
216        [wxcamwindow/Makefile]
217        [src/Makefile]
218        [src/eviacamloader.c]
219        [win32/installer.iss]
220        [creavision/libwebcam/incvideodev.h]
221)
Note: See TracBrowser for help on using the repository browser.