PageRenderTime 61ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/anoopjohn-gphpedit-fe8a12c/configure.ac

#
m4 | 235 lines | 189 code | 33 blank | 13 comment | 0 complexity | ba39dc1d508b97dfe6f9bcac876e8ab4 MD5 | raw file
Possible License(s): GPL-3.0, CC-BY-3.0
  1. dnl
  2. dnl This file is part of gPHPEdit
  3. dnl
  4. dnl Copyright (C) 2003, 2004, 2005 Andy Jeffries <andy@gphpedit.org>
  5. dnl Copyright (C) 2010 Jose Rostagno <joserostagno@hotmail.com>
  6. dnl
  7. dnl gPHPEdit is free software; you can redistribute it and/or modify
  8. dnl it under the terms of the GNU General Public License as published by
  9. dnl the Free Software Foundation; either version 2 of the License, or
  10. dnl (at your option) any later version.
  11. dnl
  12. dnl gPHPEdit is distributed in the hope that it will be useful,
  13. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. dnl GNU General Public License for more details.
  16. dnl
  17. dnl You should have received a copy of the GNU General Public License along
  18. dnl with this program; if not, write to the Free Software Foundation, Inc.,
  19. dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  20. dnl
  21. AC_PREREQ([2.59])
  22. AC_INIT([gPHPEdit],[0.9.98],[https://savannah.nongnu.org/support/?group=gphpedit],[gphpedit],[http://www.gphpedit.org])
  23. # give autoconf the name of a file whose existence is a hint that
  24. # autoconf has been started from the right directory.
  25. AC_CONFIG_SRCDIR([src/main.c])
  26. # tell autoconf where to put the temporary files it generates
  27. AC_CONFIG_AUX_DIR([build-aux])
  28. # Tell autoconf where to put the output file that contains all
  29. # definitions our C program will need
  30. AC_CONFIG_HEADERS([src/config.h])
  31. AC_CONFIG_MACRO_DIR([m4])
  32. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  33. # Initialize automake, and tell it to tell the C compiler to output as
  34. # many warnings as it can
  35. AM_INIT_AUTOMAKE([-Wall foreign])
  36. AM_MAINTAINER_MODE([enable])
  37. # Checks for programs.
  38. AC_PROG_CXX
  39. AC_PROG_AWK
  40. AC_PROG_CC
  41. AC_PROG_CPP
  42. AC_PROG_INSTALL
  43. AC_PROG_LN_S
  44. AC_PROG_MAKE_SET
  45. AC_LIBTOOL_DLOPEN
  46. AC_PROG_LIBTOOL
  47. AC_PROG_INTLTOOL
  48. # Checks for libraries.
  49. # Checks for header files.
  50. AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h unistd.h])
  51. # Checks for typedefs, structures, and compiler characteristics.
  52. AC_HEADER_STDBOOL
  53. AC_C_INLINE
  54. AC_TYPE_PID_T
  55. AC_TYPE_SIZE_T
  56. AC_C_CONST
  57. # Checks for library functions.
  58. AC_CHECK_FUNCS([isascii mblen memmove memset mkfifo strchr strncasecmp strrchr strstr strtol])
  59. dnl --------------
  60. dnl | dependencies |-----------------------------------------------------------
  61. dnl --------------
  62. # Checks for libraries.
  63. dnl Checking for the required libraries.
  64. GTK_REQUIRED_VERSION=2.0.0
  65. dnl LIBGNOMEUI_REQUIRED_VERSION=2.0.0
  66. GCONF_REQUIRED_VERSION=2.0.0
  67. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION)
  68. PKG_CHECK_MODULES(GCONF, gconf-2.0 >= $GCONF_REQUIRED_VERSION)
  69. PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
  70. PKG_CHECK_MODULES(WEBKIT,[webkit-1.0])
  71. AC_SUBST(GTK_CFLAGS)
  72. AC_SUBST(GTK_LIBS)
  73. AC_SUBST(GCONF_CFLAGS)
  74. AC_SUBST(GCONF_LIBS)
  75. AC_SUBST(GMODULE_CFLAGS)
  76. AC_SUBST(GMODULE_LIBS)
  77. AC_SUBST(WEBKIT_CFLAGS)
  78. AC_SUBST(WEBKIT_LIBS)
  79. dnl **********************
  80. dnl function declaration
  81. dnl **********************
  82. dnl $1: var
  83. dnl $2: file
  84. dnl $3: path
  85. AC_DEFUN([AC_CHECK_DIR],
  86. [path="$$1 \
  87. $3"
  88. $1=""
  89. for dir in $path ;
  90. do
  91. if test -f $dir/$2; then
  92. $1=$dir
  93. break
  94. fi
  95. done])
  96. dnl $1: var
  97. dnl $2: file
  98. AC_DEFUN([AC_ASK_DIR],
  99. [if test "$$1" == ""; then
  100. dnl AC_MSG_RESULT([Checking for php-doc])
  101. dnl echo -n "\$$1="
  102. read $1
  103. AC_MSG_CHECKING([for php-doc])
  104. if test -f $$1/$2; then
  105. AC_MSG_RESULT([$$1])
  106. else
  107. AC_MSG_RESULT([no])
  108. dnl AC_MSG_ERROR([still can not find $2 in $$1])
  109. fi
  110. fi ])
  111. dnl check for php-doc directory
  112. AC_CHECK_DIR([php_doc_dir],[index.html],
  113. [/usr/doc/php-docs-200403/html \
  114. /usr/share/doc/php-docs-20050822/html \
  115. /usr/share/doc/php-docs-20050822/html \
  116. /usr/doc/php-docs-4.2.3/html//usr/lib \
  117. /usr/share/doc/php-manual/en/html \
  118. /usr/share/doc/php-doc/html ])
  119. AC_ASK_DIR([php_doc_dir],[index.html])
  120. if test "$php_doc_dir" != ""; then
  121. AC_DEFINE_UNQUOTED(PHP_DOC_DIR, "$php_doc_dir",
  122. [php-doc directory])
  123. fi
  124. dnl define default font and font size
  125. AC_DEFINE_UNQUOTED(DEFAULT_FONT, "!Sans",[default font])
  126. AC_DEFINE_UNQUOTED(DEFAULT_FONT_SIZE, 12,[default font size])
  127. dnl define default translate url
  128. AC_DEFINE_UNQUOTED(TRANSLATE_URL, "https://www.transifex.net/projects/p/gphpedit/c/main/",[default tranlate url])
  129. dnl ------------------
  130. dnl | language support |-------------------------------------------------------
  131. dnl ------------------
  132. dnl ================================================================
  133. dnl Gettext stuff.
  134. dnl ================================================================
  135. GETTEXT_PACKAGE=gphpedit
  136. AC_SUBST(GETTEXT_PACKAGE)
  137. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
  138. AM_GLIB_GNU_GETTEXT
  139. dnl Please keep this in alphabetical order
  140. ALL_LINGUAS="de es"
  141. dnl AM_GNU_GETTEXT
  142. dnl AM_GLIB_GNU_GETTEXT sets $DATADIRNAME
  143. AC_MSG_CHECKING(locale directory)
  144. if test "x$prefix" = "xNONE"; then
  145. PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale
  146. else
  147. PACKAGE_LOCALE_DIR=$prefix/share/locale
  148. fi
  149. AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "$PACKAGE_LOCALE_DIR",
  150. [The directory in which gphpedit's locale data will be stored])
  151. AC_MSG_RESULT("$PACKAGE_LOCALE_DIR")
  152. dnl ************************
  153. dnl Locations
  154. dnl ************************
  155. if test "$prefix" == "NONE"; then
  156. AC_SUBST([prefix],[${ac_default_prefix}])
  157. fi
  158. if test "$exec_prefix" == "NONE"; then
  159. AC_SUBST([exec_prefix],[${prefix}])
  160. fi
  161. if test -z "$localedir"; then
  162. AC_SUBST([localedir],[${datadir}/locale])
  163. fi
  164. dnl define api data dir
  165. API_DIR=$prefix/share/gphpedit
  166. AC_DEFINE_UNQUOTED(API_DIR, "$API_DIR",
  167. [The directory in which gphpedit's api data will be stored])
  168. dnl ---------------------------------------------------------------------------
  169. dnl check for deprecated flags
  170. DISABLE_DEPRECATED_CFLAGS="\
  171. -DG_DISABLE_DEPRECATED \
  172. -DGDK_DISABLE_DEPRECATED \
  173. -DGTK_DISABLE_DEPRECATED \
  174. -DGDK_PIXBUF_DISABLE_DEPRECATED \
  175. -DGNOME_DISABLE_DEPRECATED"
  176. AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
  177. AC_CONFIG_FILES([
  178. Makefile
  179. gphpedit.desktop
  180. gphpedit.spec
  181. data/Makefile
  182. doc/Makefile
  183. pixmaps/Makefile
  184. po/Makefile.in
  185. src/Makefile
  186. ])
  187. AC_OUTPUT
  188. dnl *******************************
  189. dnl Feedback
  190. dnl *******************************
  191. echo
  192. echo "-------------------------------------------------"
  193. echo "gPHPEDIT version: $PACKAGE_VERSION"
  194. echo "gPHPEDIT prefix: $prefix"
  195. if test "$php_doc_dir" != ""; then
  196. echo "PHP-DOC help support: yes"
  197. else
  198. echo "PHP-DOC help support: no"
  199. fi
  200. echo "-------------------------------------------------"
  201. echo "Now type Make to compile gPHPEdit"
  202. echo "-------------------------------------------------"