Add Mandelbrot and Julia fractal layers. Thanks to Bertrand Grégoire (berteh)
[synfig.git] / synfig-studio / configure.ac
1 # $Id$
2
3 # -- I N I T --------------------------------------------------
4
5 AC_INIT([Synfig Studio],[0.62.00],[http://synfig.org/Bugs],[synfigstudio])
6 AC_REVISION
7
8 AC_CONFIG_AUX_DIR(config)
9 AC_CONFIG_HEADERS([config.h])
10 AC_CANONICAL_HOST
11 dnl AC_CANONICAL_TARGET
12
13 AM_INIT_AUTOMAKE
14 AM_MAINTAINER_MODE
15
16 API_VERSION=0.0
17
18 # -- V A R I A B L E S ----------------------------------------
19
20 SVN_REPOSITORY=https://synfig.svn.sourceforge.net/svnroot/synfig/synfig-studio
21
22 # -- P R O G R A M S ------------------------------------------
23
24 AC_PROG_CC
25 AC_GNU_SOURCE
26 AC_PROG_CXX
27 AC_PROG_CPP
28 AC_PROG_CXXCPP
29 AC_PROG_INSTALL
30
31 AC_LANG([C++])
32
33
34 AC_ARG_DEBUG
35
36 case "$debug" in
37         yes)
38                 AC_DEFINE(SHOW_EXTRA_INFO,[],[Show extra info in the about dialog])
39         ;;
40 esac
41
42 AC_ARG_OPTIMIZATION
43 AC_ARG_WARNINGS
44 AC_ARG_PROFILE_ARCS
45 AC_ARG_BRANCH_PROBABILITIES
46 AC_ARG_PROFILING
47
48 AC_ARG_ENABLE(g5opt,[
49   --enable-g5opt           enable optimizations specific to G5 proc],[
50     G5OPTFLAGS="-mpowerpc-gpopt -mno-multiple -mno-update -mcpu=970  -mtune=970 -falign-loops=16 -falign-functions=16"
51 ],
52 [
53     G5OPTFLAGS=
54 ])
55
56 AC_WIN32_QUIRKS
57
58 AC_LIBTOOL_WIN32_DLL
59 AC_LIBTOOL_DLOPEN
60 AC_DISABLE_STATIC
61 AC_ENABLE_SHARED
62 AC_PROG_LIBTOOL
63 AC_SUBST(LIBTOOL_DEPS)
64 AC_LIBTOOL_PATCH
65
66 ## FIXME: add i18n for .desktop and other non-compiled files
67 ## AM_GLIB_GNU_GETTEXT([external])
68 ## AC_PROG_INTLTOOL(0.11)
69 ALL_LINGUAS="ca fr es it ru"
70 AM_GNU_GETTEXT([external])
71 # This is here so autoreconf will run autopoint
72 AM_GNU_GETTEXT_VERSION([0.15])
73
74 case "$host" in
75         *mingw* | *cygwin*)
76                 AM_CONDITIONAL(WIN32_PKG, true)
77                 AM_CONDITIONAL(MACOSX_PKG, false)
78         ;;
79         *darwin*)
80                 AM_CONDITIONAL(WIN32_PKG, false)
81                 AM_CONDITIONAL(MACOSX_PKG, true)
82                 AC_DEFINE(USE_OPEN_FOR_URLS,[],[On MacOS X "open <URL>" works, on Linux it tries to open a virtual console.] )
83         ;;
84         *)
85                 AM_CONDITIONAL(WIN32_PKG, false)
86                 AM_CONDITIONAL(MACOSX_PKG, false)
87         ;;
88 esac
89 # -- L I B R A R I E S ----------------------------------------
90
91 PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 gthread-2.0,[
92         AC_MSG_CHECKING([for Gtk::AboutDialog::set_program_name])
93         synfigstudio_save_cxxflags="$CXXFLAGS"
94         CXXFLAGS="$GTKMM_CFLAGS $CXXFLAGS"
95         AC_COMPILE_IFELSE(
96                 [
97                         AC_LANG_PROGRAM([
98                                 [#include <gtkmm/aboutdialog.h>]
99                         ],[
100                                 [Gtk::AboutDialog about; about.set_program_name(PACKAGE_NAME)]
101                         ])
102                 ],[
103                         AC_MSG_RESULT([yes])
104                         AC_DEFINE(HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME,[],[Define if GTKmm provides Gtk::AboutDialog::set_program_name()] )
105                         AM_CONDITIONAL(HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME,true)
106                 ],[
107                         AC_MSG_RESULT([no])
108                         AM_CONDITIONAL(HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME,false)
109                 ]
110         )
111         CXXFLAGS="$synfigstudio_save_cxxflags"
112         AC_MSG_CHECKING([for Gtk::AboutDialog::set_wrap_license])
113         synfigstudio_save_cxxflags="$CXXFLAGS"
114         CXXFLAGS="$GTKMM_CFLAGS $CXXFLAGS"
115         AC_COMPILE_IFELSE(
116                 [
117                         AC_LANG_PROGRAM([
118                                 [#include <gtkmm/aboutdialog.h>]
119                         ],[
120                                 [Gtk::AboutDialog about; about.set_wrap_license(true)]
121                         ])
122                 ],[
123                         AC_MSG_RESULT([yes])
124                         AC_DEFINE(HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE,[],[Define if GTKmm provides Gtk::AboutDialog::set_wrap_license()] )
125                         AM_CONDITIONAL(HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE,true)
126                 ],[
127                         AC_MSG_RESULT([no])
128                         AM_CONDITIONAL(HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE,false)
129                 ]
130         )
131         CXXFLAGS="$synfigstudio_save_cxxflags"
132 ],[
133         AC_MSG_ERROR([ ** Gtkmm-2.4 Is a required library, aborting.])
134 ])
135 AC_SUBST(GTKMM_CFLAGS)
136 AC_SUBST(GTKMM_LIBS)
137
138 PKG_CHECK_MODULES(SYNFIG, [synfig >= 0.62.00] [ETL >= 0.04.13] sigc++-2.0,,[
139         AC_MSG_ERROR([ ** Unable to set up dependent libraries (synfig >= 0.62.00, ETL >= 0.04.13)])
140 ])
141 AC_SUBST(SYNFIG_CFLAGS)
142 AC_SUBST(SYNFIG_LIBS)
143
144 windowsys="gtkmm"
145 AC_DEFINE(STUDIO_WINSYS_H,"gtkmm/winsys.h",[blah])
146 AM_CONDITIONAL(WINDOWSYS_GTKMM,true)
147
148 AC_ARG_WITH(userdir,[
149   --with-userdir=(dirname)         Relative path to user directory],[
150 ],[
151 case "$host" in
152         *mingw* | *cygwin*)
153                 with_userdir="Synfig"
154         ;;
155         *darwin*)
156                 with_userdir="Library/Synfig"
157         ;;
158         *)
159                 with_userdir=".synfig"
160         ;;
161 esac
162 ])
163 AC_DEFINE_UNQUOTED(SYNFIG_USER_APP_DIR,"$with_userdir",[Synfig User Data Directory])
164
165 # --- FMOD CHECK -------------
166 AC_ARG_WITH(libfmod,[
167   --with-libfmod         Enable support for FMOD],[
168 ],[
169         AC_CHECK_LIB(fmod, FSOUND_Init,[
170                 with_libfmod="yes"
171         ],[
172                 with_libfmod="no"
173         ])
174 ])
175 if test $with_libfmod = "yes" ; then {
176         AM_CONDITIONAL(WITH_FMOD,true)
177         FMOD_LIBS="/usr/lib/libfmod.so"
178         AC_DEFINE(WITH_FMOD,"I'm here damnit",[blah])
179 } else {
180         AM_CONDITIONAL(WITH_FMOD,false)
181         FMOD_LIBS=
182 } ; fi
183
184 # Check for unordered_map or hash_map headers
185 AC_MSG_CHECKING([for unordered_map<int,int>::const_iterator])
186 AC_COMPILE_IFELSE([
187         AC_LANG_PROGRAM([
188                 [#include <tr1/unordered_map>]
189         ],[
190                 [std::tr1::unordered_map<int,int>::const_iterator iter;]
191         ])],[
192         AC_MSG_RESULT([yes])
193         AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::unordered_map],[The template name for unordered maps.])
194         AC_DEFINE([HASH_MAP_H],[<tr1/unordered_map>],[The header file to include for unordered maps.])
195         AC_DEFINE([HASH_MAP_NAMESPACE],[std::tr1],[The namespace for unordered maps.])
196         AC_DEFINE([FUNCTIONAL_H],[<tr1/functional>],[The header file for hash<T>.])
197         AC_DEFINE([FUNCTIONAL_HASH_ON_STRING],[1],[Define to 1 if hash<T> needs to use T=String rather than T=char* to hash strings.])
198 ],[
199         AC_MSG_RESULT([no])
200         AC_CHECK_HEADERS([ext/hash_map],[
201                 AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::hash_map],[The template name for unordered maps.])
202                 AC_DEFINE([HASH_MAP_H],[<ext/hash_map>],[The header file to include for unordered maps.])
203                 AC_DEFINE([HASH_MAP_NAMESPACE],[__gnu_cxx],[The namespace for unordered maps.])
204                 AC_DEFINE([FUNCTIONAL_H],[<ext/functional>],[The header file for hash<T>.])
205         ],[
206                 AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
207         ])
208 ])
209
210 # Check for unordered_set or hash_set headers
211 AC_MSG_CHECKING([for unordered_set<int,int>::const_iterator])
212 AC_COMPILE_IFELSE([
213         AC_LANG_PROGRAM([
214                 [#include <tr1/unordered_set>]
215         ],[
216                 [std::tr1::unordered_set<int,int>::const_iterator iter;]
217         ])],[
218         AC_MSG_RESULT([yes])
219         AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::unordered_set],[The template name for unordered sets.])
220         AC_DEFINE([HASH_SET_H],[<tr1/unordered_set>],[The header file to include for unordered sets.])
221         AC_DEFINE([HASH_SET_NAMESPACE],[std::tr1],[The namespace for unordered sets.])
222 ],[
223         AC_MSG_RESULT([no])
224         AC_CHECK_HEADERS([ext/hash_set],[
225                 AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::hash_set],[The template name for unordered sets.])
226                 AC_DEFINE([HASH_SET_H],[<ext/hash_set>],[The header file to include for unordered sets.])
227                 AC_DEFINE([HASH_SET_NAMESPACE],[__gnu_cxx],[The namespace for unordered sets.])
228         ],[
229                 AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
230         ])
231 ])
232
233 # -- H E A D E R S --------------------------------------------
234
235 AC_CHECK_HEADERS([unistd.h signal.h fcntl.h])
236 AC_CHECK_HEADERS([sys/types.h sys/wait.h sys/stat.h sys/time.h sys/resource.h sys/errno.h])
237
238 # -- T Y P E S & S T R U C T S --------------------------------
239
240 # -- F U N C T I O N S ----------------------------------------
241
242 AC_CHECK_FUNCS([fork])
243 AC_CHECK_FUNCS([kill])
244 AC_CHECK_FUNCS([pipe])
245 AC_CHECK_FUNCS([setpriority mkfifo stat])
246
247 # -- A R G U M E N T S ----------------------------------------
248
249 # -- O U T P U T ----------------------------------------------
250
251 AC_SUBST(CFLAGS)
252 AC_SUBST(CPPFLAGS)
253 AC_SUBST(CXXFLAGS)
254 AC_SUBST(LDFLAGS)
255 AC_SUBST(SVN_REPOSITORY)
256
257 AC_SUBST(API_VERSION)
258
259 # fmod stuff...
260 AC_SUBST(FMOD_LIBS)
261
262 imageext=png
263 AC_SUBST(imageext)
264
265 imagedir="${datadir}/pixmaps/synfigstudio"
266 AC_SUBST(imagedir)
267
268 AC_CONFIG_FILES([Makefile
269 build_tools/Makefile
270 doxygen.cfg
271 po/Makefile.in
272 synfigstudio.desktop
273 synfigstudio.mime
274 synfigstudio.keys
275 synfigstudio.xml
276 synfigstudio-thumbnailer.schemas
277 src/Makefile
278 src/gtkmm/Makefile
279 src/synfigapp/Makefile
280 images/Makefile
281 win32inst.nsi
282 pkg-info/macosx/synfig-studio.info
283 ])
284 AC_OUTPUT
285
286 # -- S U M M A R Y --------------------------------------------
287
288 echo "
289 $PACKAGE_NAME v.$VERSION
290 Configuration Summary
291 - - - - - -
292
293 Install Prefix -------------------> $prefix
294 Host Platform --------------------> $host
295 Icon Format ----------------------> $imageext
296 Debug Mode -----------------------> $debug
297 Profiling Mode -------------------> $profiling
298 Optimizations --------------------> $optimization
299 Window System --------------------> $windowsys
300 FMOD Enabled ---------------------> $with_libfmod
301
302 "'$'"CXX ------------------------------> '$CXX'
303 "'$'"CXXFLAGS -------------------------> '$CXXFLAGS'
304 "'$'"LDFLAGS --------------------------> '$LDFLAGS'
305 "'$'"SYNFIG_CFLAGS ---------------------> '$SYNFIG_CFLAGS'
306 "'$'"SYNFIG_LIBS -----------------------> '$SYNFIG_LIBS'
307 "'$'"GTKMM_CFLAGS ---------------------> '$GTKMM_CFLAGS'
308 "'$'"GTKMM_LIBS -----------------------> '$GTKMM_LIBS'
309 "