embryo: add Exotic support.
[framework/uifw/embryo.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [1])
5 m4_define([v_mic], [99])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##--   When released, remove the dnl on the below line
9 dnl m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release ver-pre-svn-07])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15 m4_define([lt_cur], m4_eval(v_maj + v_min))
16 m4_define([lt_rev], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21 AC_INIT([embryo], [v_ver], [enlightenment-devel@lists.sourceforge.net])
22 AC_PREREQ([2.52])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
25
26 AC_CONFIG_HEADERS([config.h])
27 AH_TOP([
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
30 ])
31 AH_BOTTOM([
32 #endif /* EFL_CONFIG_H__ */
33 ])
34
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38 AC_LIBTOOL_WIN32_DLL
39 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
40 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
41 AC_PROG_LIBTOOL
42
43 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
44 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
45 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
46 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
47 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
48 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
49 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
50 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
51 version_info="lt_cur:lt_rev:lt_age"
52 release_info="v_rel"
53 AC_SUBST(version_info)
54 AC_SUBST(release_info)
55 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
56 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
57 VMAJ=v_maj
58 AC_SUBST(VMAJ)
59
60 ### Default options with respect to host
61
62 AC_CANONICAL_BUILD
63 AC_CANONICAL_HOST
64
65 requirement_embryo=""
66 embryoincludedir="${datadir}/include"
67
68
69 ### Additional options to configure
70
71 EFL_ENABLE_BIN([embryo-cc])
72
73
74 ### Checks for programs
75 AC_PROG_CC
76
77 # doxygen program for documentation building
78
79 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
80
81 # pkg-config
82
83 PKG_PROG_PKG_CONFIG
84
85 # Check whether pkg-config supports Requires.private
86 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
87    pkgconfig_requires_private="Requires.private"
88 else
89    pkgconfig_requires_private="Requires"
90 fi
91 AC_SUBST(pkgconfig_requires_private)
92
93
94 ### Checks for libraries
95
96 # Evil library for compilation on Windows
97
98 EFL_EMBRYO_BUILD=""
99 case "$host_os" in
100    mingw*)
101    PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
102    AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
103    requirement_embryo="evil ${requirement_embryo}"
104    EFL_EMBRYO_BUILD="-DEFL_EMBRYO_BUILD"
105    ;;
106 esac
107 AC_SUBST(EFL_EMBRYO_BUILD)
108
109 # For embryo_cc_prefix.c
110 PKG_CHECK_MODULES([EINA], [eina >= 1.1.0])
111
112 ### Checks for portability layer
113
114 PKG_CHECK_MODULES([EXOTIC],
115    [exotic],
116    [enable_exotic="yes"],
117    [enable_exotic="no"])
118
119 if test "x${enable_exotic}" = "xyes"; then
120     requirement_eina="exotic ${requirement_eina}"
121     EINA_CFLAGS="${EINA_CFLAGS} ${EXOTIC_CFLAGS}"
122     EINA_LIBS="${EXOTIC_LIBS}"
123
124     AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.])
125 fi
126
127 ### Checks for header files
128
129 AC_CHECK_HEADERS([unistd.h])
130 EFL_CHECK_PATH_MAX
131
132
133 ### Checks for types
134
135
136 ### Checks for structures
137
138
139 ### Checks for compiler characteristics
140 AC_C_BIGENDIAN
141 AM_PROG_CC_C_O
142 AC_C_CONST
143 AC_C_INLINE
144 AC_PROG_CC_STDC
145 AC_HEADER_STDC
146 AC_C___ATTRIBUTE__
147
148 EMBRYO_CPPFLAGS=""
149 EMBRYO_CFLAGS=""
150 case "$host_os" in
151    mingw32ce*)
152       EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420"
153       ;;
154 esac
155 AC_SUBST(EMBRYO_CPPFLAGS)
156 AC_SUBST(EMBRYO_CFLAGS)
157
158
159 ### Checks for linker characteristics
160
161 lt_enable_auto_import=""
162 case "$host_os" in
163    mingw*)
164       lt_enable_auto_import="-Wl,--enable-auto-import"
165       ;;
166 esac
167 AC_SUBST(lt_enable_auto_import)
168
169
170 ### Checks for library functions
171
172 AC_ISC_POSIX
173
174 # alloca
175 AC_FUNC_ALLOCA
176
177 # fnmatch
178 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
179
180 case "$host_os" in
181    mingw*)
182       AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defined to 1 (MinGW platform)])
183       ;;
184    *)
185       EFL_CHECK_GETTIMEOFDAY([], [AC_MSG_ERROR([Cannot find gettimeofday()])])
186       ;;
187 esac
188
189
190 AC_SUBST(requirement_embryo)
191 AC_SUBST(embryoincludedir)
192
193 AC_OUTPUT([
194 Makefile
195 doc/Makefile
196 doc/Doxyfile
197 doc/embryo.dox
198 embryo.pc
199 include/Makefile
200 src/Makefile
201 src/lib/Makefile
202 src/bin/Makefile
203 embryo.spec
204 ])
205
206
207 #####################################################################
208 ## Info
209
210 echo
211 echo
212 echo
213 echo "------------------------------------------------------------------------"
214 echo "$PACKAGE $VERSION"
215 echo "------------------------------------------------------------------------"
216 echo
217 echo "Configuration Options Summary:"
218 echo
219 echo "  Build embryo_cc......: $have_embryo_cc"
220 echo
221 echo "  Documentation........: ${build_doc}"
222 echo
223 echo "Compilation............: make (or gmake)"
224 echo "  CPPFLAGS.............: $CPPFLAGS"
225 echo "  CFLAGS...............: $CFLAGS"
226 echo "  LDFLAGS..............: $LDFLAGS"
227 echo
228 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
229 echo "  prefix...............: $prefix"
230 echo