* use Requires.private field in embryo.pc if pkg-config 0.22 or later is installed...
[framework/uifw/embryo.git] / configure.ac
1 # get rid of that stupid cache mechanism
2 rm -f config.cache
3
4 AC_INIT([embryo], [0.9.9.062], [enlightenment-devel@lists.sourceforge.net])
5 AC_PREREQ([2.52])
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_MACRO_DIR([m4])
8 AC_CANONICAL_BUILD
9 AC_CANONICAL_HOST
10 AC_ISC_POSIX
11
12 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
13 AM_CONFIG_HEADER(config.h)
14
15 AC_LIBTOOL_WIN32_DLL
16 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
17 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
18 AC_PROG_LIBTOOL
19
20 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
21 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
22 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
23 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
24 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
25 AC_SUBST(version_info)
26
27 release="ver-pre-svn-04"
28 case "$host_os" in
29    mingw32ce* | cegcc*)
30       ;;
31    *)
32       release_info="-release $release"
33       ;;
34 esac
35 AC_SUBST(release_info)
36
37
38 ### Default options with respect to host
39
40 requirement_embryo=""
41 embryoincludedir="${datadir}/include"
42
43
44 ### Additional options to configure
45
46
47 ### Checks for programs
48 AC_PROG_CC
49
50 # doxygen program for documentation building
51
52 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
53
54 # pkg-config
55
56 PKG_PROG_PKG_CONFIG
57
58 # Check whether pkg-config supports Requires.private
59 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
60    pkgconfig_requires_private="Requires.private"
61 else
62    pkgconfig_requires_private="Requires"
63 fi
64 AC_SUBST(pkgconfig_requires_private)
65
66
67 ### Checks for libraries
68
69 # Evil library for compilation on Windows
70
71 EFL_EMBRYO_BUILD=""
72 case "$host_os" in
73    mingw* | cegcc*)
74    PKG_CHECK_MODULES([EVIL], [evil])
75    AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
76    requirement_embryo="evil ${requirement_embryo}"
77    EFL_EMBRYO_BUILD="-DEFL_EMBRYO_BUILD"
78    ;;
79 esac
80 AC_SUBST(EFL_EMBRYO_BUILD)
81
82
83 ### Checks for header files
84
85 AC_CHECK_HEADER([fnmatch.h],
86    [dummy="yes"],
87    [AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
88
89
90 ### Checks for types
91
92
93 ### Checks for structures
94
95
96 ### Checks for compiler characteristics
97 AC_C_BIGENDIAN
98 AM_PROG_CC_C_O
99 AC_C_CONST
100 AC_C_INLINE
101 AC_PROG_CC_STDC
102 AC_HEADER_STDC
103 AC_C___ATTRIBUTE__
104
105 EMBRYO_CPPFLAGS=""
106 EMBRYO_CFLAGS=""
107 case "$host_os" in
108    mingw32ce*)
109       EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420"
110       ;;
111    cegcc*)
112       EMBRYO_CPPFLAGS="-D_WIN32_WCE=0x0420"
113       EMBRYO_CFLAGS="-mwin32"
114       ;;
115 esac
116 AC_SUBST(EMBRYO_CPPFLAGS)
117 AC_SUBST(EMBRYO_CFLAGS)
118
119
120 ### Checks for linker characteristics
121
122 lt_enable_auto_import=""
123 case "$host_os" in
124    mingw* | cegcc*)
125       lt_enable_auto_import="-Wl,--enable-auto-import"
126       ;;
127 esac
128 AC_SUBST(lt_enable_auto_import)
129
130
131 ### Checks for library functions
132 AC_FUNC_ALLOCA
133
134 case "$host_os" in
135    mingw* | cegcc*)
136       AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defined to 1 (MinGW / CeGCC platform)])
137       ;;
138    *)
139       AC_CHECK_FUNCS(gettimeofday)
140       ;;
141 esac
142
143 fnmatch_libs=""
144 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
145 if test "x$res" = "xno"; then
146    AC_SEARCH_LIBS([fnmatch],
147       [fnmatch evil iberty],
148       [res="yes"],
149       [res="no"])
150    if test "x$res" = "xno"; then
151       AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
152    fi
153    fnmatch_libs="${ac_cv_search_fnmatch}"
154 fi
155 AC_SUBST(fnmatch_libs)
156
157
158 AC_SUBST(requirement_embryo)
159 AC_SUBST(embryoincludedir)
160
161 AC_OUTPUT([
162 Makefile
163 doc/Makefile
164 doc/embryo.dox
165 embryo.pc
166 include/Makefile
167 src/Makefile
168 src/lib/Makefile
169 src/bin/Makefile
170 README
171 embryo.spec
172 ])
173
174
175 #####################################################################
176 ## Info
177
178 echo
179 echo
180 echo
181 echo "------------------------------------------------------------------------"
182 echo "$PACKAGE $VERSION"
183 echo "------------------------------------------------------------------------"
184 echo
185 echo "Configuration Options Summary:"
186 echo
187 echo "  Documentation........: ${build_doc}"
188 echo
189 echo "  Compilation..........: make"
190 echo
191 echo "  Installation.........: make install"
192 echo
193 echo "    prefix.............: $prefix"
194 echo