PageRenderTime 227ms CodeModel.GetById 120ms app.highlight 4ms RepoModel.GetById 97ms app.codeStats 0ms

/configure.in

http://ftk.googlecode.com/
Autoconf | 373 lines | 299 code | 59 blank | 15 comment | 14 complexity | dd407e197d8e52f0ebf86c29e9686eb1 MD5 | raw file
  1#                                               -*- Autoconf -*-
  2# Process this file with autoconf to produce a configure script.
  3
  4AC_PREREQ([2.60])
  5
  6AC_INIT(ftk, 1.0, xianjimli@hotmail.com)
  7AC_CONFIG_SRCDIR([src/ftk_canvas.h])
  8AC_CONFIG_HEADERS([config_ftk.h])
  9AM_INIT_AUTOMAKE(ftk, 1.0)
 10AC_CONFIG_MACRO_DIR([m4])
 11
 12# Checks for programs.
 13AC_PROG_CC
 14AC_PROG_CXX
 15AC_PROG_LIBTOOL
 16AM_PROG_CC_C_O
 17AC_C_BIGENDIAN
 18PKG_PROG_PKG_CONFIG
 19
 20# Checks for libraries.
 21# FIXME: Replace `main' with a function in `-ljpeg':
 22AC_CHECK_LIB([jpeg], [main])
 23
 24dnl Test for libpng
 25
 26PNG=no
 27PKG_CHECK_MODULES(PNG, libpng, PNG="yes", [PNG="no"
 28  AC_MSG_WARN([*** libpng not found.])])
 29
 30if test "$PNG" = "yes"; then
 31	AC_SUBST(PNG_CFLAGS)
 32	AC_SUBST(PNG_LIBS)
 33
 34	CFLAGS="$CFLAGS $PNG_CFLAGS"
 35	LDFLAGS="$LDFLAGS $PNG_LIBS"
 36fi
 37
 38# Checks for header files.
 39AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/time.h unistd.h execinfo.h])
 40
 41AC_ARG_WITH(canvas, [AC_HELP_STRING([--with-canvas=default|skia|cairo|directfb],
 42                    [use which canvas])])
 43CFLAGS="$CFLAGS -DHAVE_CONFIG_FTK_H"
 44case "$with_canvas" in
 45	skia*) 
 46		canvas="skia"
 47		SKIA_ROOT="/work/skia/"
 48		CANVAS_CFLAGS="-I$SKIA_ROOT/include/core -I$SKIA_ROOT/include/config -I$SKIA_ROOT/include/images -I$SKIA_ROOT/include"
 49		SKIA_LIBS_ROOT="$SKIA_ROOT/out/Debug/obj.target/gyp/"
 50		CANVAS_LDFLAGS="-lstdc++ -lm -lfreetype -lpthread $SKIA_LIBS_ROOT/libcore.a $SKIA_LIBS_ROOT/libopts.a $SKIA_LIBS_ROOT/libimages.a $SKIA_LIBS_ROOT/libzlib.a $SKIA_LIBS_ROOT/libgr.a $SKIA_LIBS_ROOT/libutils.a";;
 51	directfb*)
 52		canvas="directfb";;
 53	cairo*)
 54		canvas="cairo";;
 55	dummy*)
 56		canvas="dummy";;
 57	*)
 58		canvas="default";;
 59esac
 60
 61AC_ARG_WITH(backend, [AC_HELP_STRING([--with-backend=linux-x11:WxH|linux-fb|linux-vlcd|linux-dfb|linux-st7781|linux-sigma|psp],[use which display/input backend])])
 62
 63CFLAGS="$CFLAGS -DHAVE_CONFIG_FTK_H"
 64case "$with_backend" in
 65	linux-x11*) 
 66		backend="x11"
 67		CFLAGS="$CFLAGS -I/usr/X11R6/include -DUSE_LINUX_X11 -DDISPLAY_PARAM=\"\\\"$with_backend\\\"\"";
 68		LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11 -lXext";;
 69	linux-vlcd*)
 70		backend="fb"
 71		CFLAGS="$CFLAGS -DUSE_LINUX_FB -DUSE_LINUX_NATIVE -DPC_EMU";;
 72	linux-dfb*)
 73		backend="dfb"
 74		canvas="directfb"
 75		DFB_VERSION=1.2.0
 76		PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DFB_VERSION])
 77
 78		CFLAGS="$CFLAGS -DUSE_LINUX_DFB $DIRECTFB_CFLAGS";
 79		LDFLAGS="$LDFLAGS $DIRECTFB_LIBS";;
 80	linux-sigma*)
 81		backend="sigma"
 82		CFLAGS="$CFLAGS $SIGMA_CFLAGS";
 83		LDFLAGS="$LDFLAGS $SIGMA_OBJS $SIGMA_LIBS";;
 84	psp*)
 85		backend="psp"
 86		CFLAGS="$CFLAGS $PSP_CFLAGS";
 87		LDFLAGS="$LDFLAGS $PSP_OBJS $PSP_LIBS $PSP_LDFLAGS";;
 88	linux-st7781)
 89		backend="st7781"
 90		CFLAGS="$CFLAGS -DUSE_LINUX_ST7781 -DUSE_LINUX_NATIVE ";;
 91	*)
 92		backend="fb"
 93		CFLAGS="$CFLAGS -DUSE_LINUX_FB -DUSE_LINUX_NATIVE ";;
 94esac
 95
 96AM_CONDITIONAL(FTK_BACKEND_X11, test "$backend" = "x11")
 97AM_CONDITIONAL(FTK_BACKEND_FB, test "$backend" = "fb")
 98AM_CONDITIONAL(FTK_BACKEND_ST7781, test "$backend" = "st7781")
 99AM_CONDITIONAL(FTK_BACKEND_DFB, test "$backend" = "dfb")
100AM_CONDITIONAL(FTK_BACKEND_SIGMA, test "$backend" = "sigma")
101AM_CONDITIONAL(FTK_BACKEND_PSP, test "$backend" = "psp")
102
103AC_SUBST(CANVAS_LDFLAGS)
104AC_SUBST(CANVAS_CFLAGS)
105
106if test "$with_canvas" = "" 
107then
108	with_canvas="default"
109fi
110AM_CONDITIONAL(FTK_CANVAS_DUMMY, test "$canvas" = "dummy")
111AM_CONDITIONAL(FTK_CANVAS_DEFAULT, test "$canvas" = "default")
112AM_CONDITIONAL(FTK_CANVAS_SKIA, test "$canvas" = "skia")
113AM_CONDITIONAL(FTK_CANVAS_DIRECTFB, test "$canvas" = "directfb")
114AM_CONDITIONAL(FTK_CANVAS_CAIRO, test "$canvas" = "cairo")
115
116AC_ARG_WITH(fontengine, [AC_HELP_STRING([--with-fontengine=default|freetype],
117                    [use which font engine])])
118
119case "$with_fontengine" in
120	freetype) 
121		dnl Test for freetype2
122		FREETYPE=no
123		PKG_CHECK_MODULES(FREETYPE, freetype2, FREETYPE="yes", [FREETYPE="no"
124		  AC_MSG_WARN([*** freetype2 not found.])])
125
126		if test "$FREETYPE" = "yes"; then
127		  AC_SUBST(FREETYPE_CFLAGS)
128		  AC_SUBST(FREETYPE_LIBS)
129		  CFLAGS="$CFLAGS $FREETYPE_CFLAGS -DUSE_FREETYPE"
130		  LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
131		fi		
132		font_engine="freetype";;
133	*)
134		CFLAGS="$CFLAGS -DUSE_DEFAULT_FONT"
135		font_engine="default";;
136esac
137
138AM_CONDITIONAL(FONT_ENGINE_FREETYPE, test "$font_engine" = "freetype")
139AM_CONDITIONAL(FONT_ENGINE_DEFAULT,  test "$font_engine" = "default")
140
141AC_ARG_WITH(inputmethod, [AC_HELP_STRING([--with-inputmethod=py_wb_hw|gpinyin],
142                    [use which input method])])
143case "$with_inputmethod" in
144	py_wb_hw) 
145		input_method="py_wb_hw";;
146	*)
147		CFLAGS="$CFLAGS  -DUSE_GPINYIN"
148		input_method="gpinyin";;
149esac
150
151AM_CONDITIONAL(ENABLE_GPINYIN, test "$input_method" = "gpinyin")
152
153AC_ARG_ENABLE(tslib,
154  [  --enable-tslib            build with tslib support [[default=no]]],,
155  enable_tslib=no)
156
157if test "$enable_tslib" = "yes"; then
158  dnl Check for tslib
159  PKG_CHECK_MODULES(TSLIB, tslib, TSLIB="yes", [TSLIB="no"
160    AC_MSG_WARN([*** tslib not found.])])
161
162  if test "$TSLIB" = "yes"; then
163      AC_SUBST(TSLIB_CFLAGS)
164      AC_SUBST(TSLIB_LIBS)
165
166      CFLAGS="$CFLAGS $TSLIB_CFLAGS -DUSE_TSLIB"
167      LDFLAGS="$LDFLAGS $TSLIB_LIBS"
168  fi
169fi
170
171AM_CONDITIONAL(ENABLE_TSLIB,  test "$enable_tslib" = "yes")
172
173AC_ARG_ENABLE(linebreak,
174  [  --enable-linebreak            build with linebreak support [[default=yes]]],,
175  enable_linebreak=yes)
176
177if test "$enable_linebreak" = "yes"; then
178  CFLAGS="$CFLAGS -DUSE_LINEBREAK "
179fi
180
181AM_CONDITIONAL(ENABLE_LINEBREAK,  test "$enable_linebreak" = "yes")
182
183AC_ARG_ENABLE(cairo,
184  [  --enable-cairo            build with cairo support [[default=no]]],,
185  enable_cairo=no)
186
187if test "$enable_cairo" = "yes"; then
188  dnl Check for cairo
189  PKG_CHECK_MODULES(CAIRO, cairo, CAIRO="yes", [CAIRO="no"
190    AC_MSG_WARN([*** cairo not found.])])
191
192  if test "$CAIRO" = "yes"; then
193    AC_SUBST(CAIRO_CFLAGS)
194    AC_SUBST(CAIRO_LIBS)
195
196    CFLAGS="$CFLAGS $CAIRO_CFLAGS -DUSE_CAIRO"
197    LDFLAGS="$LDFLAGS $CAIRO_LIBS"
198
199    dnl Test for pixman
200    PIXMAN=no
201    PKG_CHECK_MODULES(PIXMAN, pixman-1, PIXMAN="yes", [PIXMAN="no"
202      AC_MSG_WARN([*** pixman not found.])])
203
204    if test "$PIXMAN" = "yes"; then
205	AC_SUBST(PIXMAN_CFLAGS)
206	AC_SUBST(PIXMAN_LIBS)
207
208	CFLAGS="$CFLAGS $PIXMAN_CFLAGS"
209	LDFLAGS="$LDFLAGS $PIXMAN_LIBS"
210    fi
211  fi
212fi
213
214AM_CONDITIONAL(ENABLE_CAIRO,  test "$enable_cairo" = "yes")
215
216AC_ARG_ENABLE(fribidi,
217  [  --enable-fribidi            build with fribidi support [[default=no]]],,
218  enable_fribidi=no)
219
220if test "$enable_fribidi" = "yes"; then
221  CFLAGS="$CFLAGS -DUSE_FRIBIDI `pkg-config --cflags fribidi`"
222  LDFLAGS="$LDFLAGS `pkg-config --libs fribidi`"
223fi
224
225AM_CONDITIONAL(ENABLE_FRIBIDI,  test "$enable_fribidi" = "yes")
226
227AC_ARG_ENABLE(opengles,
228  [  --enable-opengles            build with opengles support [[default=no]]],,
229  enable_opengles=no)
230
231if test "$enable_opengles" = "yes"; then
232  CFLAGS="$CFLAGS -DUSE_OPENGLES"
233fi
234
235AM_CONDITIONAL(ENABLE_OPENGLES,  test "$enable_opengles" = "yes")
236
237AC_ARG_ENABLE(vnc,
238  [  --enable-vnc            build with vnc support [[default=yes]]],,
239  enable_vnc=yes)
240
241if test "$enable_vnc" = "yes"; then
242  CFLAGS="$CFLAGS -DUSE_VNC"
243fi
244
245AM_CONDITIONAL(ENABLE_VNC,  test "$enable_vnc" = "yes")
246
247AC_ARG_ENABLE(handwrite,
248  [  --enable-handwrite            build with handwrite support [[default=no]]],,
249  enable_handwrite=no)
250
251if test "$enable_handwrite" = "yes"; then
252  CFLAGS="$CFLAGS -DUSE_HANDWRITE"
253fi
254
255AM_CONDITIONAL(ENABLE_HANDWRITE,  test "$enable_handwrite" = "yes")
256
257AC_ARG_ENABLE(profile,
258  [  --enable-profile build with performance profile support [[default=no]]],,
259  enable_profile=no)
260
261if test "$enable_profile" = "yes"; then
262  CFLAGS="$CFLAGS -DFTK_PROFILE -DFTK_MEMORY_PROFILE"
263fi
264
265# Checks for typedefs, structures, and compiler characteristics.
266AC_C_INLINE
267AC_TYPE_SIZE_T
268
269# check for gtk-doc
270GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
271
272GETTEXT_PACKAGE=ftk
273AC_SUBST(GETTEXT_PACKAGE)
274AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
275
276dnl Add the languages which your application supports here.
277ALL_LINGUAS="zh_CN"
278AM_GLIB_GNU_GETTEXT
279
280# Checks for library functions.
281AC_CONFIG_FILES([ftk.pc
282				Makefile
283				ftk.cnf
284                docs/Makefile
285                docs/reference/Makefile
286                po/Makefile.in
287                theme/Makefile
288                theme/default/Makefile
289                data/Makefile
290                testdata/Makefile
291                src/rules.mk
292                src/Makefile
293                src/im/Makefile
294                src/im/default/Makefile
295                src/im/gpinyin/Makefile
296                src/demos/Makefile
297                src/test/Makefile
298                src/backend/Makefile
299                src/backend/directfb/Makefile
300                src/backend/native/Makefile
301                src/backend/ucosii/Makefile
302                src/backend/sigma/Makefile
303                src/backend/iphone/Makefile
304                src/backend/psp/Makefile
305                src/backend/x11-emu/Makefile
306                src/backend/win32/Makefile
307                src/os/Makefile
308                src/os/linux/Makefile
309                src/os/iphone/Makefile
310                src/os/windows/Makefile
311                src/os/psp/Makefile
312                src/os/ucos-ii/Makefile
313                src/compiler/Makefile
314                script_binding/Makefile
315                script_binding/lua/Makefile
316                script_binding/lua/lua/Makefile
317                apps/Makefile
318                apps/common/Makefile
319                apps/launcher/Makefile
320                apps/desktop/Makefile
321                apps/desktop/icons/Makefile
322                apps/desktop/xul/Makefile
323                apps/desktop/libvncserver/Makefile
324                apps/calculator/Makefile
325                apps/calculator/icons/Makefile
326                apps/calculator/data/Makefile
327                apps/filemanager/Makefile
328                apps/filemanager/icons/Makefile
329                apps/filemanager/data/Makefile
330                apps/shell/Makefile
331                apps/shell/icons/Makefile
332                apps/shell/data/Makefile
333                apps/gallery/Makefile
334                apps/gallery/icons/Makefile
335                apps/gallery/lua/Makefile
336                apps/gallery/data/Makefile
337                tools/Makefile
338                tools/cross-build/Makefile
339                tools/fontextract/Makefile
340                tools/imconvert/Makefile
341                tools/luagen/Makefile
342                tools/luagen/idl/Makefile
343                tools/fbusgen/Makefile
344                fbus/Makefile
345                fbus/demo/Makefile
346                fbus/demo/echo.service
347                services/Makefile
348                services/fconf/Makefile
349                services/fconf/fconf.service
350		opengles/ug/Makefile
351		opengles/include/Makefile
352		opengles/include/GLES/Makefile
353		opengles/src/Makefile
354		opengles/Makefile
355		opengles/opengles.pc
356		opengles/redbook/Makefile
357                ])
358AC_OUTPUT
359echo ================================================
360echo with_backend=$with_backend
361echo with_canvas=$with_canvas
362echo enable_cairo=$enable_cairo
363echo enable_opengles=$enable_opengles
364echo enable_vnc=$enable_vnc
365echo enable_profile=$enable_profile
366echo enable_handwrite=$handwrite
367echo enable_linebreak=$enable_linebreak
368echo ================================================
369echo CANVAS_CFLAGS=$CANVAS_CFLAGS
370echo CANVAS_LDFLAGS=$CANVAS_LDFLAGS
371echo ================================================
372
373