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