1dnl
2dnl configure.ac used to generate the configure script which
3dnl in turns is used to generate the Makefile scripts
4dnl Written by Jacek Naglak
5dnl
6dnl Copyright (c) 2004-2009 Made to Order Software Corp.
7dnl
8dnl Permission is hereby granted, free of charge, to any
9dnl person obtaining a copy of this software and
10dnl associated documentation files (the "Software"), to
11dnl deal in the Software without restriction, including
12dnl without limitation the rights to use, copy, modify,
13dnl merge, publish, distribute, sublicense, and/or sell
14dnl copies of the Software, and to permit persons to whom
15dnl the Software is furnished to do so, subject to the
16dnl following conditions:
17dnl
18dnl The above copyright notice and this permission notice
19dnl shall be included in all copies or substantial
20dnl portions of the Software.
21dnl
22dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
23dnl ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24dnl LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
25dnl FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
26dnl EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28dnl WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
29dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE
30dnl SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31dnl SOFTWARE.
32dnl
33
34AC_INIT([ScriptSWF],[1.8.4],[alexis@m2osw.com],[sswf])
35AC_SUBST(PACKAGE_VERSION)
36
37dnl a few things didn't work with my older version...
38dnl you can try with your current version by commenting
39dnl out the following line (it is safe)
40AC_PREREQ(2.57)
41
42dnl Copyright notice of the SSWF package
43AC_COPYRIGHT([Copyright (c) 2002-2009 Made to Order Software Corp.
44
45Permission is hereby granted, free of charge, to any
46person obtaining a copy of this software and
47associated documentation files (the "Software"), to
48deal in the Software without restriction, including
49without limitation the rights to use, copy, modify,
50merge, publish, distribute, sublicense, and/or sell
51copies of the Software, and to permit persons to whom
52the Software is furnished to do so, subject to the
53following conditions:
54
55The above copyright notice and this permission notice
56shall be included in all copies or substantial
57portions of the Software.
58
59THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
60ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
61LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
62FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
63EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
64LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
65WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
66ARISING FROM, OUT OF OR IN CONNECTION WITH THE
67SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68SOFTWARE.])
69
70dnl foreign option because sswf is not a gnu package
71AM_INIT_AUTOMAKE([foreign])
72
73dnl specify the supported languages
74ALL_LINGUAS="en"
75
76dnl check for programs
77AC_LIBTOOL_WIN32_DLL
78AC_PROG_LIBTOOL
79dnl AC_PROG_RANLIB -- libtool takes care of that
80AC_PROG_CC
81AC_PROG_CXX
82AC_PROG_MAKE_SET
83AC_PROG_YACC
84AC_PROG_INSTALL
85
86dnl check for headers
87AC_HAVE_HEADERS(string.h stdarg.h stdio.h stdlib.h limits.h errno.h zlib.h math.h ctype.h iconv.h)
88
89
90dnl Test for Win32 (necessary for the -no-undefined linker flag for DLLs)
91AC_MSG_CHECKING([if building for some Win32 platform])
92case "$host" in
93  *mingw*|*cygwin*)
94    platform_win32=yes
95    NO_UNDEFINED=-no-undefined
96    ;;
97  *)
98    platform_win32=no
99    NO_UNDEFINED=
100    ;;
101esac
102AC_MSG_RESULT($platform_win32)
103AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
104AC_SUBST(NO_UNDEFINED)
105
106
107dnl check for the ICONV library
108dnl Note that some systems have libiconv<function> instead of just iconv<function>
109dnl and also some have it directly in the C library!
110ICONV_LIBS=""
111AC_SUBST(ICONV_LIBS)
112AC_CHECK_LIB(iconv, libiconv_open, ICONV_LIBS="-liconv",
113	[AC_CHECK_LIB(iconv, iconv_open, ICONV_LIBS="-liconv",
114		[AC_CHECK_LIB(c, iconv_open, ICONV_LIBS="",
115			[AC_MSG_ERROR([cannot find libiconv])])])])
116
117
118dnl check for the JPEG library
119JPEG_LIBS=""
120AC_SUBST(JPEG_LIBS)
121AC_CHECK_HEADER([jpeglib.h],[],[AC_MSG_ERROR([cannot find libjpeg headers])])
122AC_CHECK_LIB(jpeg, jpeg_start_decompress,JPEG_LIBS="-ljpeg",
123           [AC_MSG_ERROR([cannot find libjpeg])])
124
125dnl check for the Z library
126ZLIB_LIBS=""
127AC_SUBST(ZLIB_LIBS)
128AC_CHECK_HEADER([zlib.h],[],[AC_MSG_ERROR([cannot find zlib headers])])
129AC_CHECK_LIB(z,compress,ZLIB_LIBS="-lz",
130           [AC_MSG_ERROR([cannot find libzlib])])
131
132dnl check for wcsncasecmp (not available on Mac OS/X 10.3 -- but I actually don't need it!)
133dnl AC_CHECK_FUNC(wcsncasecmp, AC_DEFINE(HAS_WCSNCASECMP, 1), AC_DEFINE(HAS_WCSNCASECMP, 0))
134
135dnl check for the FREETYPE (version 2) library
136FREETYPE_LIBS=""
137FREETYPE_CFLAGS=""
138AC_SUBST(FREETYPE_LIBS)
139AC_SUBST(FREETYPE_CFLAGS)
140AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
141if test "x$FREETYPE_CONFIG" != "xno" ; then
142  AC_MSG_CHECKING([for freetype libraries])
143  FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
144  FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
145  AC_MSG_RESULT($FREETYPE_LIBS)
146fi
147AM_CONDITIONAL(HAVE_FREETYPE, test "x$FREETYPE_CONFIG" != "xno")
148
149
150AC_ARG_ENABLE(internal-scripts,
151  AC_HELP_STRING([--enable-internal-scripts],[use the internal scripts from libsswf_asc instead of the include/sswf/scripts/... (Default disabled)]),
152[case "$enable_internal_scripts" in
153yes) internal_scripts=true ;;
154no) internal_scripts=false ;;
155*) AC_MSG_ERROR([bad value $internal_scripts for --enable-internal_scripts]) ;;
156esac],
157[internal_scripts=false])
158AM_CONDITIONAL(BUILD_WITH_INTERNAL_SCRIPTS, $internal_scripts)
159
160
161AC_ARG_ENABLE(notes-to-html,
162  AC_HELP_STRING([--enable-notes-to-html],[creates the notes-to-html tool (default is disabled)]),
163[case "$enable_notes_to_html" in
164yes) notes_to_html=true ;;
165no) notes_to_html=false ;;
166*) AC_MSG_ERROR([bad value $enable_notes_to_html for --enable-notes-to-html]) ;;
167esac],
168[notes_to_html=false])
169AM_CONDITIONAL(BUILD_NOTES_TO_HTML, $notes_to_html)
170
171
172AC_ARG_ENABLE(cpp-to-c,
173  AC_HELP_STRING([--enable-cpp-to-c],[creates the cpp-to-c tool (default is disabled)]),
174[case "$enable_cpp_to_c" in
175yes) cpp_to_c=true ;;
176no) cpp_to_c=false ;;
177*) AC_MSG_ERROR([bad value $enable_cpp_to_c for --enable-cpp-to-c]) ;;
178esac],
179[cpp_to_c=false])
180AM_CONDITIONAL(BUILD_CPP_TO_C, $cpp_to_c)
181
182
183
184AC_ARG_ENABLE(asc-to-c,
185  AC_HELP_STRING([--enable-asc-to-c],[creates the asc-to-c tool (default is disabled)]),
186[case "$enable_asc_to_c" in
187yes) asc_to_c=true ;;
188no) asc_to_c=false ;;
189*) AC_MSG_ERROR([bad value $enable_asc_to_c for --enable-asc-to-c]) ;;
190esac],
191[asc_to_c=false])
192AM_CONDITIONAL(BUILD_ASC_TO_C, $asc_to_c)
193
194
195
196
197AC_ARG_ENABLE(docs,
198  AC_HELP_STRING([--enable-docs],[install documentations (default is enabled if docs package installed along source code)]),
199[case "$enable_docs" in
200yes) install_sswf_docs=true ;;
201no) install_sswf_docs=false ;;
202*) AC_MSG_ERROR([bad value $enable_docs for --enable-docs]) ;;
203esac],
204[install_sswf_docs=true])
205AM_CONDITIONAL(INSTALL_SSWF_DOCS, test -d $srcdir/doc/html && $install_sswf_docs)
206
207
208AC_ARG_WITH(pkgconfigdir,
209	AC_HELP_STRING([--with-pkgconfigdir],
210	[Use specified pkgconfig directory (default is libdir/pkgconfig)]),
211	[pkgconfigdir=${withval}],
212	[pkgconfigdir='${libdir}/pkgconfig'])
213AC_SUBST([pkgconfigdir])
214AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
215
216
217
218AC_ARG_ENABLE(rpm_docs,
219  AC_HELP_STRING([--enable-rpm-docs],[avoid installing the HTML from the Makefile, it is done in the RPM specification file]),
220[case "$enable_rpm_docs" in
221yes) rpm_docs=false ;;
222no) rpm_docs=true ;;
223*) AC_MSG_ERROR([bad value $enable_rpm_docs for --enable-rpm-docs]) ;;
224esac],
225[rpm_docs=true])
226AM_CONDITIONAL(NOT_RPM_DOCS, $rpm_docs)
227
228
229AC_ARG_ENABLE(debug,
230  AC_HELP_STRING([--enable-debug],[enable debug (default is enabled)]),
231[if test "x$enable_debug" = "xyes"; then
232  AC_DEFINE(DEBUG)
233fi],
234[AC_DEFINE(DEBUG)])
235
236
237AC_ARG_ENABLE(yydebug,
238  AC_HELP_STRING([--enable-yydebug],[enable yydebug (default is enabled)]),
239[if test "x$enable_yydebug" = "xyes"; then
240  AC_DEFINE(YYDEBUG)
241fi],
242[AC_DEFINE(YYDEBUG)])
243
244
245
246dnl some dynamic list of files
247SAMPLES=`cd $ac_confdir; find samples ! -path '*/CVS/*' -type f -exec echo -n {} " " \\;`
248AC_SUBST(SAMPLES)
249
250MISC=`cd $ac_confdir; find misc ! -path '*/CVS/*' -type f -exec echo -n {} " " \\;`
251AC_SUBST(MISC)
252
253TXTDOC=`if test -d $ac_confdir/doc; then cd $ac_confdir/doc && find . ! -path '*/CVS/*' -name '*.txt' -exec echo -n {} " " \\;; fi`
254AC_SUBST(TXTDOC)
255
256HTMLDOC=`if test -d $ac_confdir/doc/html; then cd $ac_confdir/doc && find html ! -path '*/CVS/*' -type f -exec echo -n {} " " \\;; fi`
257AC_SUBST(HTMLDOC)
258
259MANDOC=`if test -d $ac_confdir/doc/man; then cd $ac_confdir/doc && find man ! -path '*/CVS/*' -type f -exec echo -n {} " " \\;; fi`
260AC_SUBST(MANDOC)
261
262ASCHEADERS=`if test -d $ac_confdir/include/sswf/scripts/global; then cd $ac_confdir/include/sswf && find scripts ! -path '*/CVS/*' -type f -name '*.asc' -exec echo -n {} " " \\;; fi`
263AC_SUBST(ASCHEADERS)
264
265dnl The libraries now have compatibility versions
266LIBSSWF_VERSION=3:0:0
267AC_SUBST(LIBSSWF_VERSION)
268LIBSSWFC_VERSION=2:0:0
269AC_SUBST(LIBSSWFC_VERSION)
270LIBSSWFAS_VERSION=2:0:0
271AC_SUBST(LIBSSWFAS_VERSION)
272LIBSSWFASAS_VERSION=2:0:0
273AC_SUBST(LIBSSWFASAS_VERSION)
274LIBSSWFASC_VERSION=1:0:0
275AC_SUBST(LIBSSWFASC_VERSION)
276
277
278dnl generate makefiles
279AC_CONFIG_FILES([
280	Makefile
281	doc/Makefile
282	src/Makefile
283	src/lib/Makefile
284	src/libas/Makefile
285	src/libasas/Makefile
286	src/libasc/Makefile
287	src/misc/Makefile
288	src/sswf/Makefile
289	src/tools/Makefile
290	include/Makefile
291	include/sswf/Makefile
292	libsswf.pc
293	libsswf_c.pc
294	libsswf_as.pc
295	libsswf_asas.pc
296	libsswf_asc.pc
297])
298AC_OUTPUT
299