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