source: eviacam/trunk/fuentes/configure.in @ 29

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

added eviacam content

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