add back in libs.private/requires to pc files with some fixes for
[framework/uifw/efreet.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [2])
5 m4_define([v_mic], [0])
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 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 relname])
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([efreet], [v_ver]-alpha, [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 ### Needed information
61
62 AC_CANONICAL_BUILD
63 AC_CANONICAL_HOST
64
65
66 ### Additional options to configure
67
68 AC_ARG_ENABLE([strict-spec],
69    [AC_HELP_STRING([--enable-strict-spec], [Enable strict spec compliance @<:@default=disabled@:>@])],
70    [
71     if test "x${enableval}" = "xyes" ; then
72        enable_strict_spec="yes"
73     else
74        enable_strict_spec="no"
75     fi
76    ],
77    [enable_strict_spec="no"])
78
79 if test "x${enable_strict_spec}" = "xyes" ; then
80    AC_DEFINE([STRICT_SPEC], [1], [Strict Spec Compliance])
81 fi
82
83 AC_ARG_ENABLE([sloppy-spec],
84    [AC_HELP_STRING([--disable-sloppy-spec], [Enable sloppy spec compliance @<:@default=enabled@:>@])],
85    [
86     if test "x${enableval}" = "xyes" ; then
87        enable_sloppy_spec="yes"
88     else
89        enable_sloppy_spec="no"
90     fi
91    ],
92    [enable_sloppy_spec="yes"])
93
94 if test "x${enable_sloppy_spec}" = "xyes" ; then
95    AC_DEFINE([SLOPPY_SPEC], [1], [Sloppy Spec Compliance])
96 fi
97
98
99 #AC_ARG_ENABLE(hidden-visibility,
100 #       [AC_HELP_STRING([--enable-hidden-visibility],[Enable hidden visibility])],
101 #       [enable_hidden_visibility=$enableval], [enable_hidden_visibility="auto"])
102 #if test "x$enable_hidden_visibility" = "xyes" ; then
103 #    CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
104 #else
105 #    AC_DEFINE(DEFAULT_VISIBLITY, 1, [Default visibility])
106 #fi
107 #AM_CONDITIONAL(DEFAULT_VISIBILITY, test "x$enable_hidden_visibility" != "xyes")
108 AM_CONDITIONAL(DEFAULT_VISIBILITY, false)
109
110
111 ### Checks for programs
112 AC_PROG_CC
113
114 # pkg-config
115 PKG_PROG_PKG_CONFIG
116
117 # Check whether pkg-config supports Requires.private
118 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
119    pkgconfig_requires_private="Requires.private"
120 else
121    pkgconfig_requires_private="Requires"
122 fi
123 AC_SUBST(pkgconfig_requires_private)
124
125 # doxygen program for documentation building
126 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
127
128
129 ### Checks for libraries
130
131 # Evil library for compilation on Windows CE
132
133 EFL_EFREET_BUILD=""
134 EFL_EFREET_MIME_BUILD=""
135 EFL_EFREET_TRASH_BUILD=""
136 case "$host_os" in
137    mingw*)
138       PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
139       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
140       requirement_efreet="evil"
141       EFL_EFREET_BUILD="-DEFL_EFREET_BUILD"
142       EFL_EFREET_MIME_BUILD="-DEFL_EFREET_MIME_BUILD"
143       EFL_EFREET_TRASH_BUILD="-DEFL_EFREET_TRASH_BUILD"
144    ;;
145 esac
146 AC_SUBST(EFL_EFREET_BUILD)
147 AC_SUBST(EFL_EFREET_MIME_BUILD)
148 AC_SUBST(EFL_EFREET_TRASH_BUILD)
149
150 requirement_efreet="ecore-file >= 1.1.0 ecore >= 1.1.0 eet >= 1.5.0 eina >= 1.1.0 ${requirement_efreet}"
151 PKG_CHECK_MODULES(EFREET, [${requirement_efreet}])
152 PKG_CHECK_MODULES(EINA, [eina >= 1.1.0])
153
154
155 ### Checks for header files
156
157 AC_CHECK_HEADERS([netinet/in.h arpa/inet.h])
158
159 ### Checks for types
160
161
162 ### Checks for structures
163
164
165 ### Checks for compiler characteristics
166
167 AC_C_CONST
168 AC_C___ATTRIBUTE__
169 AM_PROG_CC_STDC
170 AC_HEADER_STDC
171
172 case "${host_os}" in
173    mingw*)
174       EFREET_CFLAGS="${EFREET_CFLAGS} ${EVIL_CFLAGS}"
175    ;;
176 esac
177
178 if ! test "x${VMIC}" = "x" ; then
179    EFL_COMPILER_FLAG([-Wall])
180    EFL_COMPILER_FLAG([-W])
181 fi
182
183 EFL_COMPILER_FLAG([-Wshadow])
184
185 EFL_CHECK_PATH_MAX
186
187
188 ### Checks for linker characteristics
189 lt_enable_auto_import=""
190 WIN32_LIBS=""
191 case "${host_os}" in
192    mingw*)
193       WIN32_LIBS="-lws2_32"
194       lt_enable_auto_import="-Wl,--enable-auto-import"
195    ;;
196 esac
197 AC_SUBST(WIN32_LIBS)
198 AC_SUBST(lt_enable_auto_import)
199
200
201 ### Checks for library functions
202 AC_ISC_POSIX
203 AC_FUNC_ALLOCA
204 AC_CHECK_FUNCS(strlcpy clearenv)
205
206 ### Unit tests, coverage
207
208 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
209
210 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
211 EFREET_CFLAGS="${EFREET_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
212 EFREET_LIBS="${EFREET_LIBS} ${EFL_COVERAGE_LIBS}"
213 if test "x$enable_coverage" = "xyes" ; then
214    EFREET_CFLAGS="${EFREET_CFLAGS} ${EFL_DEBUG_CFLAGS}"
215 fi
216
217 AC_SUBST(requirement_efreet)
218
219 AC_OUTPUT([
220 efreet.spec
221 efreet.pc
222 efreet-mime.pc
223 efreet-trash.pc
224 Makefile
225 doc/Makefile
226 doc/Doxyfile
227 src/Makefile
228 src/lib/Makefile
229 src/bin/Makefile
230 src/tests/Makefile
231 src/tests/data/Makefile
232 src/tests/data/sub/Makefile
233 src/tests/compare/Makefile
234 ])
235
236
237 #####################################################################
238 ## Info
239
240 echo
241 echo
242 echo
243 echo "------------------------------------------------------------------------"
244 echo "$PACKAGE $VERSION"
245 echo "------------------------------------------------------------------------"
246 echo
247 echo "Configuration Options Summary:"
248 echo
249 echo "  Specification compliance:"
250 echo "    Strict.............: ${enable_strict_spec}"
251 echo "    Sloppy.............: ${enable_sloppy_spec}"
252 echo
253 echo "  Tests................: ${enable_tests}"
254 echo "  Coverage.............: ${enable_coverage}"
255 echo
256 echo "  Documentation........: ${build_doc}"
257 echo
258 echo "Compilation............: make (or gmake)"
259 echo "  CPPFLAGS.............: $CPPFLAGS"
260 echo "  CFLAGS...............: $CFLAGS"
261 echo "  LDFLAGS..............: $LDFLAGS"
262 echo
263 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
264 echo "  prefix...............: $prefix"
265 echo