summaryrefslogtreecommitdiff
path: root/legacy/eina/configure.in
blob: 31857e280d3c08229fba7e1467d82156574a525f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# get rid of that stupid cache mechanism
rm -f config.cache

AC_INIT(eina, 0.0.1, enlightenment-devel@lists.sourceforge.net)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX

AM_INIT_AUTOMAKE(1.6 dist-bzip2)
AM_CONFIG_HEADER(config.h)

AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL

VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
AC_SUBST(VMAJ)
AC_SUBST(version_info)


### Needed information

MODULE_ARCH="$host_os-$host_cpu"
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")


### Additional options to configure

# Magic debug
AC_ARG_ENABLE([magic-debug],
   [AC_HELP_STRING([--enable-magic-debug], [enable magic debug of eina structure])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_magic_debug="yes"
    else
       enable_magic_debug="no"
    fi
   ],
   [enable_magic_debug="yes"]
)
AC_MSG_CHECKING([whether magic debug is enable])
AC_MSG_RESULT([${enable_magic_debug}])

EINA_MAGIC_DEBUG=0
if test "x${enable_magic_debug}" = "xyes" ; then
   EINA_MAGIC_DEBUG=1
fi
AC_SUBST(EINA_MAGIC_DEBUG)

# Unit tests

AC_ARG_ENABLE([tests],
   [AC_HELP_STRING([--enable-tests], [enable tests @<:@default=no@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_tests="yes"
    else
       enable_tests="no"
    fi
   ],
   [enable_tests="no"]
)
AC_MSG_CHECKING([whether tests are built])
AC_MSG_RESULT([${enable_tests}])

# Coverage

AC_ARG_ENABLE([coverage],
   [AC_HELP_STRING([--enable-coverage], [compile with coverage profiling instrumentation @<:@default=no@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_coverage="yes"
    else
       enable_coverage="no"
    fi
   ],
   [enable_coverage="no"]
)
AC_MSG_CHECKING([whether to use profiling instrumentation])
AC_MSG_RESULT([$enable_coverage])

# Benchmarking tests

AC_ARG_ENABLE([benchmark],
   [AC_HELP_STRING([--enable-benchmark], [enable tests @<:@default=no@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_bench="yes"
    else
       enable_bench="no"
    fi
   ],
   [enable_bench="no"]
)
AC_MSG_CHECKING([whether benchmark are built])
AC_MSG_RESULT([${enable_bench}])
AM_CONDITIONAL(EINA_ENABLE_BENCH, test "x${enable_bench}" = "xyes")

# Ememoa memory pool

AC_ARG_ENABLE([ememoa],
   [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_ememoa="yes"
    else
       enable_ememoa="no"
    fi
   ],
   [enable_ememoa="yes"]
)
AC_MSG_CHECKING([whether to use ememoa for memory pool])
AC_MSG_RESULT([$enable_ememoa])

# Static linking

EINA_CHECK_STATIC([chained-pool], [chained pool])
EINA_CHECK_STATIC([ememoa-fixed], [ememoa fixed])
EINA_CHECK_STATIC([ememoa-unknown], [ememoa unknown])
EINA_CHECK_STATIC([pass-through], [pass through])
EINA_CHECK_STATIC([fixed-bitmap], [fixed bitmap])

### Checks for libraries

PKG_PROG_PKG_CONFIG

# Evil library for compilation on Windows CE

case "$host_os" in
   mingw32ce* | cegcc*)
   PKG_CHECK_MODULES([EVIL], [evil])
   AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
   ;;
esac

# Check library for unit tests

if test "x${enable_tests}" = "xyes" ; then
   PKG_CHECK_MODULES([CHECK],
      [check >= 0.9.5],
      [dummy="yes"],
      [enable_tests="no"]
   )
fi

AM_CONDITIONAL(EINA_ENABLE_TESTS, test "x${enable_tests}" = "xyes")

# Glib library for comparison in the benchmark

have_glib="no"
if test "x${enable_bench}" = "xyes" ; then
   PKG_CHECK_MODULES([GLIB],
      [glib-2.0],
      [have_glib="yes"],
      [have_glib="no"]
   )
fi

AM_CONDITIONAL(EINA_HAVE_GLIB, test "x${have_glib}" = "xyes")

# Evas library for comparison in the benchmark

have_evas="no"
if test "x${enable_bench}" = "xyes" ; then
   PKG_CHECK_MODULES([EVAS],
      [evas],
      [have_evas="yes"],
      [have_evas="no"]
   )
fi

AM_CONDITIONAL(EINA_HAVE_EVAS, test "x${have_evas}" = "xyes")

# Ecore library for comparison in the benchmark

have_ecore="no"
if test "x${enable_bench}" = "xyes" ; then
   PKG_CHECK_MODULES([ECORE],
      [ecore],
      [have_ecore="yes"],
      [have_ecore="no"]
   )
fi

AM_CONDITIONAL(EINA_HAVE_ECORE, test "x${have_ecore}" = "xyes")

# Check if we want to benchmark on real data
enable_bench_e17="no"
AC_ARG_ENABLE([benchmark-e17],
   [AC_HELP_STRING([--enable-benchmark-e17], [disable heavy benchmark @<:@default=no@:>@])],
   [
    if test "x${enableval}" = "xyes" ; then
       enable_bench_e17="yes"
    else
       enable_bench_e17="no"
    fi
   ],
   [enable_bench_e17="no"]
)
AC_MSG_CHECKING([whether e17 real data benchmark are built])
AC_MSG_RESULT([${enable_bench_e17}])
AM_CONDITIONAL(EINA_ENABLE_BENCH_E17, test "x${enable_bench_e17}" = "xyes")

# Check ememoa memory pool library

if test "x${enable_ememoa}" = "xyes" ; then
   PKG_CHECK_MODULES([EMEMOA],
      [ememoa >= 0.0.26 ],
      [enable_ememoa="yes"],
      [enable_ememoa="no"]
   )
fi

AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
if test "x${enable_ememoa}" = "xyes"; then
   AC_DEFINE(EINA_EMEMOA_SUPPORT, 1, [Use by the test suite to try ememoa mempool])
fi

### Checks for header files
AC_HEADER_ASSERT
AC_HEADER_DIRENT
AC_HEADER_TIME


### Checks for programs
AC_PROG_CC

# lcov program for coverage report

if test "x$enable_tests" = "xno" -a "x$enable_coverage" = "xyes" ; then
   AC_MSG_WARN([Coverage report requested but tests not being built. Run configure with --enable-tests])
   enable_coverage="no"
fi

if test "x$enable_coverage" = "xyes" ; then
   AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
   if test "x$have_lcov" = "xyes" ; then
      COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
      COVERAGE_LIBS="-lgcov"
# remove any optimisation flag and force debug symbols
      DEBUG_CFLAGS="-g -O0 -DDEBUG"
   else
      AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
      enable_coverage="no"
   fi
fi
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)

AM_CONDITIONAL(EINA_ENABLE_COVERAGE, test "x${enable_coverage}" = "xyes")

# doxygen program for documentation building

EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])

AM_CONDITIONAL(EINA_BUILD_DOC, test "x${build_doc}" = "xyes")


### Checks for types


### Checks for structures


### Checks for compiler characteristics
AC_C_CONST
AC_C_BIGENDIAN
AC_PROG_CC_STDC
AC_C___ATTRIBUTE__

EINA_CFLAGS="${COVERAGE_CFLAGS}"
case "${host_os}" in
   cegcc*)
      EINA_CFLAGS="${EINA_CFLAGS} ${EVIL_CFLAGS} -mwin32"
   ;;
   mingw*)
      EINA_CFLAGS="${EINA_CFLAGS} ${EVIL_CFLAGS}"
   ;;
esac

if test "x$enable_coverage" = "xyes" ; then
   EINA_CFLAGS="${EINA_CFLAGS} ${DEBUG_CFLAGS}"
fi

if ! test "${VMIC}" = "x" ; then
   EINA_CFLAGS="${EINA_CFLAGS} -Wall -W -Wextra" # -Werror
fi

AC_SUBST(EINA_CFLAGS)


### Checks for linker characteristics
EINA_LIBS=""
lt_enable_auto_import=""
case "${host_os}" in
   mingw* | cegcc*)
      AC_DEFINE(EFL_EINA_BUILD, 1, [Define to mention that eina is built])
      EINA_LIBS="${COVERAGE_LIBS} ${EVIL_LIBS} -lm"
      lt_enable_auto_import="-Wl,--enable-auto-import"
   ;;
   *)
      EINA_LIBS="${COVERAGE_LIBS} -ldl -lrt -lm"
   ;;
esac
AC_SUBST(EINA_LIBS)
AC_SUBST(lt_enable_auto_import)


### Checks for library functions
AC_FUNC_ALLOCA


### Create the .pc.in file according to the major version
cat > eina-${VMAJ}.pc.in << EOF
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: Eina
Description: A Library that implements fast data types and miscellaneous tools
Requires:
Version: @VERSION@
Libs: -L${libdir} -leina
Libs.private: -ldl
Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
EOF


### Make the debug preprocessor configurable

AC_CONFIG_FILES([
Makefile
eina-${VMAJ}.pc
doc/Makefile
src/Makefile
src/include/Makefile
src/include/eina_config.h
src/lib/Makefile
src/modules/Makefile
src/modules/mp/Makefile
src/modules/mp/chained_pool/Makefile
src/modules/mp/ememoa_fixed/Makefile
src/modules/mp/ememoa_unknown/Makefile
src/modules/mp/pass_through/Makefile
src/modules/mp/fixed_bitmap/Makefile
src/tests/Makefile
])

AC_OUTPUT

#####################################################################
## Info

echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo "Configuration Options Summary:"
echo
echo "  Documentation........: ${build_doc}"
echo "  Tests................: ${enable_tests}"
echo "  Coverage.............: ${enable_coverage}"
echo "  Bench................: ${enable_bench}"
if test "x${enable_bench}" = "xyes" ; then
echo "    Glib...............: ${have_glib}"
echo "    Evas...............: ${have_evas}"
echo "    Ecore..............: ${have_ecore}"
echo "    E17 real data......: ${enable_bench_e17}"
fi
echo "  Magic debug..........: ${enable_magic_debug}"
echo
echo "  Memory pool:"
echo "    Ememoa.............: ${enable_ememoa}"
echo
echo "  Static build of memory pools:"
echo "    Chained pool.......: ${enable_static_chained_pool}"
echo "    Ememoa fixed.......: ${enable_static_ememoa_fixed}"
echo "    Ememoa unknown.....: ${enable_static_ememoa_unknown}"
echo "    Pass through.......: ${enable_static_pass_through}"
echo
echo "  Installation.........: make install"
echo
echo "    prefix.............: $prefix"
echo
echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE,"
echo "and then afterwards as root (or the user who will install this), type"
echo "'make install'. Change users with 'su' or 'sudo' appropriately."
echo