1AC_INIT(src/agg_arc.cpp) # give me a source file, any source file...
2AC_CANONICAL_TARGET
3AC_CONFIG_HEADERS(include/config.h)
4AM_INIT_AUTOMAKE(agg, 2.5.0)
5
6
7dnl Checks for programs.
8AC_PROG_CC
9AC_PROG_CXX
10AC_ISC_POSIX
11AM_PROG_LIBTOOL
12AC_PROG_INSTALL
13
14dnl Checks for typedefs, structures, and compiler characteristics.
15AC_C_CONST
16
17AC_ARG_ENABLE(examples,
18    AC_HELP_STRING([--enable-examples],[Antigrain examples]))
19AM_CONDITIONAL(ENABLE_EXAMPLES,test x$enable_examples != xno)
20
21AC_ARG_ENABLE(ctrl,
22    AC_HELP_STRING([--enable-ctrl],[a gui libray used in examples]))
23
24AC_ARG_ENABLE(platform,
25    AC_HELP_STRING([--enable-platform],[portable platform layers]))
26
27if test x$enable_examples != xno  ; then
28  enable_platform="yes"
29fi
30if test x$enable_platform != xno  ; then
31  enable_ctrl="yes"
32fi
33AM_CONDITIONAL(ENABLE_CTRL,test x$enable_ctrl != xno)
34
35# used as platform library in examples:
36# todo, make the PREFERED_PLATFORM selectable, after the set of possible
37# Platforms to link the examples have been evaluated.
38PREFERED_PLATFORM=X11
39case "$host" in
40  *darwin* )
41    OSX_LIBS="-framework Carbon -framework QuickTime"
42    OSX_CFLAGS="-I/System/Library/Frameworks/Carbon.framework/Headers -I/System/Library/Frameworks/QuickTime.framework/Headers "
43    AC_SUBST(OSX_CFLAGS)
44    AC_SUBST(OSX_LIBS)
45    osx_host=yes
46    PREFERED_PLATFORM=mac
47  ;;
48dnl ####  Check if we are compiling for win32 #####
49  *mingw*)
50    win32_host=yes
51    WINDOWS_LIBS=-lgdi32
52    WINDOWS_CFLAGS=
53    AC_SUBST(WINDOWS_CFLAGS)
54    AC_SUBST(WINDOWS_LIBS)
55    PREFERED_PLATFORM=win32
56  ;;
57esac
58AM_CONDITIONAL(ENABLE_WIN32,[test x$win32_host = xyes -a x$enable_platform != xno ])
59AM_CONDITIONAL(ENABLE_OSX,[test x$osx_host = xyes -a x$enable_platform != xno ])
60dnl then enable font_win32tt
61AC_ARG_ENABLE(win32tt,
62    AC_HELP_STRING([--enable-win32tt],[Win32 TrueType font support library]),
63    enable_tt=$enable_win32tt,
64    enable_tt=$win32_host)
65AM_CONDITIONAL(ENABLE_WIN32_TT, test x$enable_tt = xyes )
66
67dnl #########  Check for FT2: #####################
68ft_enabled=""
69PKG_CHECK_MODULES([FREETYPE],
70    freetype2,
71    [ft_enabled="yes"],
72    AC_MSG_WARN([*** Freetype2 not found! Building without font library.])
73    )
74AC_ARG_ENABLE(freetype,
75    AC_HELP_STRING([--enable-freetype],[freetype font support library]),
76    ft_enabled=$enable_freetype)
77
78AM_CONDITIONAL(ENABLE_FT,[test xyes = x$ft_enabled])
79dnl ###############################################
80
81
82dnl #########  Ask for GPC: #######################
83AC_ARG_ENABLE(gpc,
84    AC_HELP_STRING([--enable-gpc],[gpc polygon clipper library]) )
85
86AM_CONDITIONAL(ENABLE_GPC,[test xyes = x$enable_gpc])
87dnl ###############################################
88
89
90
91
92dnl #########  Check for SDL: #####################
93dnl the sdl script pollutes our global values:
94temp_LIBS="$LIBS"
95temp_CFLAGS="$CFLAGS"
96temp_CXXFLAGS="$CXXFLAGS"
97sdl_enabled=""
98SDL_VERSION=1.2.0
99AM_PATH_SDL($SDL_VERSION,
100    [sdl_enabled="yes"],
101    AC_MSG_WARN([*** SDL version $SDL_VERSION not found! Omitting sdl layer.])
102    )
103dnl ### Restore old values
104CFLAGS=$temp_CFLAGS
105CXXFLAGS=$temp_CXXFLAGS
106LIBS=$temp_LIBS
107dnl ### the sdl script already does that:
108dnl AC_SUBST(SDL_CFLAGS)
109dnl AC_SUBST(SDL_LIBS)
110AM_CONDITIONAL(ENABLE_SDL,[test xyes = x$sdl_enabled -a xno != x$enable_platform -a x$win32_host != xyes])
111dnl ###############################################
112
113
114dnl #########  Checking for X11: ##################
115AC_PATH_X
116if test "$no_x" = "yes"; then
117  AC_MSG_WARN([*** X11 not found! Omitting X11 layer.])
118fi
119AM_CONDITIONAL(ENABLE_X11,[test x$no_x = x -a xno != x$enable_platform -a x$win32_host != xyes])
120AC_SUBST(x_includes)
121AC_SUBST(x_libraries)
122dnl ###############################################
123
124dnl Settung up library version
125AGG_LIB_VERSION="2:4:0"
126dnl     current-´ / /
127dnl    revision--´ /
128dnl         age---´
129dnl Update the version information only immediately before a public release of antigrain
130dnl If the library source code has changed, increment revision (c:r:a becomes c:r+1:a).
131dnl If any interfaces have been added, removed, or changed since the last update,
132dnl      increment current, and set revision to 0.
133dnl If any interfaces have been added since the last public release, then increment age.
134dnl If any interfaces have been removed since the last public release, then set age to 0.
135
136AC_SUBST(AGG_LIB_VERSION)
137AC_SUBST(PREFERED_PLATFORM)
138
139
140AC_OUTPUT(
141   Makefile
142   libagg.pc
143   gpc/Makefile
144   font_freetype/Makefile
145   font_win32_tt/Makefile
146   src/Makefile
147   src/ctrl/Makefile
148   src/platform/Makefile
149   src/platform/X11/Makefile
150   src/platform/sdl/Makefile
151   src/platform/mac/Makefile
152   src/platform/win32/Makefile
153   src/platform/BeOS/Makefile
154   src/platform/AmigaOS/Makefile
155   include/Makefile
156   include/ctrl/Makefile
157   include/util/Makefile
158   include/platform/Makefile
159   examples/Makefile
160)
161
162