[go: up one dir, main page]

File: configure.in

package info (click to toggle)
libdecodeqr 0.9.3-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 704 kB
  • ctags: 528
  • sloc: cpp: 3,416; sh: 279; makefile: 202
file content (128 lines) | stat: -rw-r--r-- 3,679 bytes parent folder | download | duplicates (3)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(libdecodeqr, package, zophos@koka-in.org)
AC_CONFIG_SRCDIR([$srcdir/libdecodeqr/imagereader.cpp])
dnl AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_LANG_CPLUSPLUS

#
# Check if don't want -g option
#
AC_ARG_ENABLE(optimize,
       [  --enable-optimize       turn off debug information (CC -g option). ],
       [enable_optimize=$enableval], [enable_optimize=no])
if test x"$enable_optimize" = xyes; then
   CXXFLAGS="$CXXFLAGS -O2"
fi

AC_PROG_CXX
AC_PROG_INSTALL
AC_CHECK_TOOL(AR,ar)
AC_CHECK_TOOL(LD,ld)
AC_CHECK_TOOL(LN,ln)

# Checks for libraries.
AC_ARG_WITH(cv,
	 [  --with-cv=NAME          specify libcv (eg, cv0.9.7)],
	 [ LIBCVNAME=$withval ], [ LIBCVNAME=cv ])
AC_CHECK_LIB($LIBCVNAME,cvCreateImage,LIBCV=-l$LIBCVNAME,)
if test -z "$LIBCV"; then
   echo
   echo "If your system already has OpenCV, append place of the libcv.la"
   echo "to your LDFLAGS environment variables. eg,"
   echo
   echo 'LDFLAGS="$LDFLAGS -L/usr/local/opencv/lib";export LDFLAGS'
   echo
   AC_MSG_ERROR(libcv.la not found.)
fi
AC_SUBST(LIBCV)


AC_ARG_ENABLE(sample,
       [  --enable-sample         build sample programs.],
       [enable_sample=$enableval],)
if test x"$enable_sample" != xno; then
   SAMPLE=sample
   AC_ARG_WITH(highgui,
	[  --with-highgui=NAME     specify libhighgui (eg, highgui0.9.7)],
	[ LIBHIGHGUINAME=$withval ], [ LIBHIGHGUINAME=highgui ])
else
   SAMPLE=""
   LIBHIGHGUINAME=no
fi
if test x"$LIBHIGHGUINAME" = xno ; then
   SAMPLE=""
   LIBHIGHGUINAME=highgui
else
   AC_CHECK_LIB($LIBHIGHGUINAME,cvShowImage,LIBHIGHGUI=-l$LIBHIGHGUINAME,)
   if test -z "$LIBHIGHGUI"; then
      echo
      echo "If your system already has OpenCV, append place of the libhighgui.la"
      echo "to your LDFLAGS environment variables. eg,"
      echo
      echo 'LDFLAGS="$LDFLAGS -L/usr/local/opencv/lib";export LDFLAGS'
      echo
      AC_MSG_ERROR(libhighgui.la not found.)
   fi
fi
AC_SUBST(SAMPLE)
AC_SUBST(LIBHIGHGUI)


# Checks for header files.
AC_CHECK_HEADERS([memory.h netinet/in.h])

AC_CHECK_HEADER(cv.h,HAVE_CV_H=yes,)
if test -z "$HAVE_CV_H"; then
   echo
   echo "If your system already has OpenCV, append place of the cv.h"
   echo "to your CPPFLAGS environment variables. eg,"
   echo
   echo 'CPPFLAGS="$CPPFLAGS -I/usr/local/opencv/cv/include";export CPPFLAGS'
   echo
   AC_MSG_ERROR(cv.h not found.)
fi


# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for library functions.
AC_HEADER_STDC
AC_CHECK_FUNCS([memset snprintf])

AC_ARG_ENABLE(debug,
       [  --enable-debugmessage   turn on debug message.],
       [enable_debugmessage=$enableval], [enable_debugmessage=no])
if test x"$enable_debugmessage" = xyes; then
   CPPFLAGS="$CPPFLAGS -D_DEBUG"
fi


# Get version info
libdecodeqr=$srcdir/libdecodeqr
decodeqr_major_version=`grep '#define LIBDECODEQR_VERSION_MAJOR' $libdecodeqr/version.h`
decodeqr_minor_version=`grep '#define LIBDECODEQR_VERSION_MINOR' $libdecodeqr/version.h`
decodeqr_teeny_version=`grep '#define LIBDECODEQR_VERSION_TEENY' $libdecodeqr/version.h`

MAJOR=`expr "$decodeqr_major_version" : '#define LIBDECODEQR_VERSION_MAJOR \([0-9]*\)'`
MINOR=`expr "$decodeqr_minor_version" : '#define LIBDECODEQR_VERSION_MINOR \([0-9]*\)'`
TEENY=`expr "$decodeqr_teeny_version" : '#define LIBDECODEQR_VERSION_TEENY \([0-9]*\)'`

AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(TEENY)

AC_OUTPUT([Makefile
libdecodeqr/Makefile
test/Makefile
sample/Makefile
sample/simple/Makefile
sample/webcam/Makefile])