File: configure.ac

package info (click to toggle)
libdmtx 0.7.2-2%2Bbuild1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,676 kB
  • sloc: sh: 10,371; ansic: 10,144; cs: 596; makefile: 204; java: 161; objc: 157; python: 125; perl: 28; php: 18; ruby: 16
file content (294 lines) | stat: -rw-r--r-- 7,923 bytes parent folder | download | duplicates (2)
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
AC_INIT([libdmtx], [0.7.2], [mike@dragonflylogic.com])
AM_INIT_AUTOMAKE([-Wall -Werror gnu])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
   Makefile
   util/Makefile
   test/Makefile
   test/multi_test/Makefile
   test/rotate_test/Makefile
   test/simple_test/Makefile
   test/unit_test/Makefile
   wrapper/Makefile
])

AC_PROG_CC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O

AC_SEARCH_LIBS([sin], [m] ,[], AC_MSG_ERROR([libdmtx requires libm]))
AC_SEARCH_LIBS([cos], [m] ,[], AC_MSG_ERROR([libdmtx requires libm]))
AC_SEARCH_LIBS([atan2], [m] ,[], AC_MSG_ERROR([libdmtx requires libm]))

AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_FUNCS([gettimeofday])

case $host_os in
   cygwin*)
      ARCH=cygwin ;;
   darwin*)
      ARCH=macosx ;;
   freebsd*)
      ARCH=freebsd ;;
   linux-gnu*)
      ARCH=linux-gnu ;;
   mingw32*)
      ARCH=mingw32 ;;
esac
AM_CONDITIONAL([TARGET_MACOSX], [test x$ARCH = xmacosx])

AC_ARG_ENABLE(
   [dmtxquery],
   AS_HELP_STRING([--disable-dmtxquery], [do not build the dmtxquery command line utility]),
   [dmtxquery="$enableval"],
   [dmtxquery="yes"]
)
AM_CONDITIONAL([ENABLE_DMTXQUERY], [test x$dmtxquery = xyes])

AC_ARG_ENABLE(
   [dmtxread],
   AS_HELP_STRING([--disable-dmtxread], [do not build the dmtxread command line utility]),
   [dmtxread="$enableval"],
   [dmtxread="yes"]
)
AM_CONDITIONAL([ENABLE_DMTXREAD], [test x$dmtxread = xyes])

AC_ARG_ENABLE(
   [dmtxwrite],
   AS_HELP_STRING([--disable-dmtxwrite], [do not build the dmtxwrite command line utility]),
   [dmtxwrite="$enableval"],
   [dmtxwrite="yes"]
)
AM_CONDITIONAL([ENABLE_DMTXWRITE], [test x$dmtxwrite = xyes])

if test x$dmtxread = xyes \
      -o x$dmtxwrite = xyes \
      -o x$dmtxquery = xyes; then
   AC_CHECK_HEADERS([sysexits.h])
   AC_CHECK_HEADERS([getopt.h])
   AC_CHECK_FUNCS([getopt_long])
fi

if test x$dmtxread = xyes \
      -o x$dmtxwrite = xyes; then
   ifdef([PKG_CHECK_MODULES],
         [PKG_CHECK_MODULES(
            MAGICK,
            Wand >= 6.2.4,
            true,
            AC_MSG_ERROR([[dmtxread/dmtxwrite requires Wand >= 6.2.4]]))],
         [AC_MSG_ERROR([Building dmtxread/dmtxwrite requires a working autoconf/pkg-config])]
   )
   AC_SUBST(MAGICK_CFLAGS)
   AC_SUBST(MAGICK_LIBS)
fi

if test x$dmtxquery = xyes; then
   AC_CONFIG_FILES([util/dmtxquery/Makefile])
fi

if test x$dmtxread = xyes; then
   AC_CONFIG_FILES([util/dmtxread/Makefile])
fi

if test x$dmtxwrite = xyes; then
   AC_CONFIG_FILES([util/dmtxwrite/Makefile])
fi

# Create options to override certain functions

# --enable-customEncodeDataMatrix
AC_ARG_ENABLE(
   [customEncodeDataMatrix],
   [],
   [customEncodeDataMatrix="$enableval"],
   [customEncodeDataMatrix="no"]
)
AM_CONDITIONAL([CUSTOM_ENCODEDATAMATRIX], [test x$customEncodeDataMatrix = xyes])
if test x$customEncodeDataMatrix = xyes; then
   AC_DEFINE([CUSTOM_ENCODEDATAMATRIX], [1], [Override dmtxEncodeDataMatrix function])
fi

# --enable-customEncodeDataMosaic
AC_ARG_ENABLE(
   [customEncodeDataMosaic],
   [],
   [customEncodeDataMosaic="$enableval"],
   [customEncodeDataMosaic="no"]
)
AM_CONDITIONAL([CUSTOM_ENCODEDATAMOSAIC], [test x$customEncodeDataMosaic = xyes])
if test x$customEncodeDataMosaic = xyes; then
   AC_DEFINE([CUSTOM_ENCODEDATAMOSAIC], [1], [Override customEncodeDataMosaic function])
fi

# --enable-customDecodeMatrixRegion
AC_ARG_ENABLE(
   [customDecodeMatrixRegion],
   [],
   [customDecodeMatrixRegion="$enableval"],
   [customDecodeMatrixRegion="no"]
)
AM_CONDITIONAL([CUSTOM_DECODEMATRIXREGION], [test x$customDecodeMatrixRegion = xyes])
if test x$customDecodeMatrixRegion = xyes; then
   AC_DEFINE([CUSTOM_DECODEMATRIXREGION], [1], [Override customDecodeMatrixRegion function])
fi

# --enable-customDecodeMosaicRegion
AC_ARG_ENABLE(
   [customDecodeMosaicRegion],
   [],
   [customDecodeMosaicRegion="$enableval"],
   [customDecodeMosaicRegion="no"]
)
AM_CONDITIONAL([CUSTOM_DECODEMOSAICREGION], [test x$customDecodeMosaicRegion = xyes])
if test x$customDecodeMosaicRegion = xyes; then
   AC_DEFINE([CUSTOM_DECODEMOSAICREGION], [1], [Override customDecodeMosaicRegion function])
fi

# --enable-customRegionFindNext
AC_ARG_ENABLE(
   [customRegionFindNext],
   [],
   [customRegionFindNext="$enableval"],
   [customRegionFindNext="no"]
)
AM_CONDITIONAL([CUSTOM_REGIONFINDNEXT], [test x$customRegionFindNext = xyes])
if test x$customRegionFindNext = xyes; then
   AC_DEFINE([CUSTOM_REGIONFINDNEXT], [1], [Override customRegionFindNext function])
fi

# --enable-customRegionScanPixel
AC_ARG_ENABLE(
   [customRegionScanPixel],
   [],
   [customRegionScanPixel="$enableval"],
   [customRegionScanPixel="no"]
)
AM_CONDITIONAL([CUSTOM_REGIONSCANPIXEL], [test x$customRegionScanPixel = xyes])
if test x$customRegionScanPixel = xyes; then
   AC_DEFINE([CUSTOM_REGIONSCANPIXEL], [1], [Override customRegionScanPixel function])
fi

AC_ARG_ENABLE(
   [cocoa],
   AS_HELP_STRING([--enable-cocoa], [enable Cocoa bindings]),
   [enable_cocoa="$enableval"],
   [enable_cocoa="no"]
)
AM_CONDITIONAL(ENABLE_COCOA, [test x$enable_cocoa = xyes])

if test x$enable_cocoa = xyes; then
   AC_WARN([Building the Cocoa wrapper though the libdmtx build system is not yet supported])
fi

AC_ARG_ENABLE(
   [java],
   AS_HELP_STRING([--enable-java], [enable Java bindings]),
   [enable_java="$enableval"],
   [enable_java="no"]
)
AM_CONDITIONAL(ENABLE_JAVA, [test x$enable_java = xyes])

if test x$enable_java = xyes; then
   AC_WARN([Building the Java wrapper though the libdmtx build system is not yet supported])
fi

AC_ARG_ENABLE(
   [net],
   AS_HELP_STRING([--enable-net], [enable .NET bindings]),
   [enable_net="$enableval"],
   [enable_net="no"]
)
AM_CONDITIONAL(ENABLE_NET, [test x$enable_net = xyes])

if test x$enable_net = xyes; then
   AC_WARN([Building the .NET wrapper though the libdmtx build system is not yet supported])
fi

AC_ARG_ENABLE(
   [php],
   AS_HELP_STRING([--enable-php], [enable PHP bindings]),
   [enable_php="$enableval"],
   [enable_php="no"]
)
AM_CONDITIONAL([ENABLE_PHP], [test x$enable_php = xyes])

if test x$enable_php = xyes; then
   AC_PATH_PROG([PHPIZE], [phpize])
   if test ! -e "$PHPIZE"; then
      AC_ERROR([phpize is required to generate the PHP bindings.])
   fi

   AC_WARN([Building the PHP wrapper will break make uninstall])

   dmtx_dir=`pwd`
   cd wrapper/php && \
   $PHPIZE && \
   ./configure --prefix=${prefix} && \
   cd $dmtx_dir
fi

AC_ARG_ENABLE(
   [python],
   AS_HELP_STRING([--enable-python], [enable Python bindings]),
   [enable_python="$enableval"],
   [enable_python="no"]
)
AM_CONDITIONAL(ENABLE_PYTHON, [test x$enable_python = xyes])

if test x$enable_python = xyes; then
   AM_PATH_PYTHON
   AC_WARN([Building the Python wrapper will break make uninstall])
fi

AC_ARG_ENABLE(
   [ruby],
   AS_HELP_STRING([--enable-ruby], [enable Ruby bindings]),
   [enable_ruby="$enableval"],
   [enable_ruby="no"]
)
AM_CONDITIONAL(ENABLE_RUBY, [test x$enable_ruby = xyes])

if test x$enable_ruby = xyes; then
   AC_PATH_PROG([RUBY], [ruby])
   if test ! -e "$RUBY"; then
      AC_ERROR([ruby is required to generate the Ruby bindings.])
   fi

   AC_WARN([Building the Ruby wrapper will break make uninstall])

   dmtx_dir=`pwd`
   cd wrapper/ruby && \
   $RUBY extconf.rb --with-dmtx-dir=${prefix}
   cd $dmtx_dir
fi

AC_ARG_ENABLE(
   [vala],
   AS_HELP_STRING([--enable-vala], [enable Vala bindings]),
   [enable_vala="$enableval"],
   [enable_vala="no"]
)
AM_CONDITIONAL(ENABLE_VALA, [test x$enable_vala = xyes])

if test x$enable_vala = xyes; then
   PKG_PROG_PKG_CONFIG

   PKG_CHECK_EXISTS(
      [vala-1.0],
      [VALA_VAPIDIR=`$PKG_CONFIG --variable=vapidir vala-1.0`],
      [
         AC_WARN([Can't find vala development files, guessing where to install vala bindings...])
         VALA_VAPIDIR='${prefix}/share/vala/vapi'
      ]
   )

   AC_SUBST(VALA_VAPIDIR)
   AC_CONFIG_FILES([wrapper/vala/Makefile])
fi

AC_CONFIG_FILES([libdmtx.pc])

AC_OUTPUT