Tizen 2.1 base
[profile/mobile/embryo.git] / configure.in
1 # get rid of that stupid cache mechanism
2 rm -f config.cache
3
4 AC_INIT(embryo, 0.9.9.043, enlightenment-devel@lists.sourceforge.net)
5 AC_PREREQ(2.52)
6 AC_CONFIG_SRCDIR(configure.in)
7 AC_CANONICAL_BUILD
8 AC_CANONICAL_HOST
9 AC_ISC_POSIX
10
11 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
12 AM_CONFIG_HEADER(config.h)
13
14 AC_C_BIGENDIAN
15 AC_PROG_CC
16 AM_PROG_CC_STDC
17 AC_HEADER_STDC
18 AC_C_CONST
19 AM_PROG_CC_C_O
20
21 AC_LIBTOOL_WIN32_DLL
22 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
23 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
24 AC_PROG_LIBTOOL
25
26 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
27 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
28 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
29 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
30 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
31 AC_SUBST(version_info)
32
33 WIN32_CFLAGS=""
34 lt_no_undefined=""
35 lt_enable_auto_import=""
36 case "$host_os" in
37         mingw*|cegcc)
38                 PKG_CHECK_MODULES([EVIL], evil)
39                 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
40                 dnl needed for correct definition of EAPI
41                 AC_DEFINE(EFL_EMBRYO_BUILD, 1, [Define to mention that embryo is built])
42                 AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defined to 1 (MinGW / CeGCC platform)])
43                 if test "x$host_os" = "xcegcc" ; then
44                         WIN32_CFLAGS="-mwin32"
45                         lt_enable_auto_import="-Wl,--enable-auto-import"
46                 fi
47                 lt_no_undefined="-no-undefined"
48                 ;;
49         *)
50                 AC_CHECK_FUNCS(gettimeofday)
51 esac
52 AC_SUBST(WIN32_CFLAGS)
53 AC_SUBST(lt_no_undefined)
54 AC_SUBST(lt_enable_auto_import)
55
56 dnl Checking for __attribute__ support
57 AC_MSG_CHECKING([for __attribute__])
58 AC_CACHE_VAL(_cv_have___attribute__,
59   [
60     AC_TRY_COMPILE([#include <stdlib.h>],
61       [int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
62       [_cv_have___attribute__="yes"],
63       [_cv_have___attribute__="no"])
64   ]
65 )
66
67 if test "x${_cv_have___attribute__}" = "xyes" ; then
68    AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
69 fi
70 AC_MSG_RESULT(${_cv_have___attribute__})
71
72 AC_FUNC_ALLOCA
73
74 AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
75
76 fnmatch_libs=""
77 AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
78 if test "x$res" = "xno"; then
79         AC_CHECK_LIB(fnmatch, fnmatch, res=yes fnmatch_libs="-lfnmatch", res=no)
80 dnl Test for compilation with MinGW.
81 dnl fnmatch function is in the libiberty library
82         if test "x$res" = "xno"; then
83                 AC_CHECK_LIB(iberty, fnmatch, res=yes fnmatch_libs="-liberty", res=no)
84         fi
85         if test "x$res" = "xno"; then
86                 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty])
87         fi
88 fi
89
90 AC_SUBST(fnmatch_libs)
91
92 embryoincludedir='${datadir}/include'
93 AC_SUBST(embryoincludedir)
94
95 AC_OUTPUT([
96 Makefile
97 embryo.pc
98 include/Makefile
99 src/Makefile
100 src/lib/Makefile
101 src/bin/Makefile
102 README
103 embryo.spec
104 ])
105
106
107 #####################################################################
108 ## Info
109
110 echo
111 echo
112 echo
113 echo "------------------------------------------------------------------------"
114 echo "$PACKAGE $VERSION"
115 echo "------------------------------------------------------------------------"
116 echo
117 echo "Configuration Options Summary:"
118 echo
119 echo "  Compilation..........: make"
120 echo
121 echo "  Installation.........: make install"
122 echo
123 echo "    prefix.............: $prefix"
124 echo