summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2014-09-04 16:43:12 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-09-04 17:33:05 +0200
commit4664b183e3babe46917f48870069cb5958df2f76 (patch)
tree173aa412027e5633b52f874db948bb61ecc3a462 /configure.ac
parentad9aa4a41697c9ea1ef394b5315f983a74bee34f (diff)
autotools: add m4 macro to check for options
This simplify autotools in elementary by recycling the same m4 and also compilation flags. Less code to read and maintain.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac143
1 files changed, 6 insertions, 137 deletions
diff --git a/configure.ac b/configure.ac
index 03c8ad751..19cfbaaef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,6 +234,12 @@ ELM_CHECK_BACKEND([Win32])
234ELM_CHECK_BACKEND([Wayland]) 234ELM_CHECK_BACKEND([Wayland])
235ELM_CHECK_BACKEND([DRM]) 235ELM_CHECK_BACKEND([DRM])
236 236
237ELM_CHECK_OPTION([elocation], [0.1.0])
238ELM_CHECK_OPTION([eweather], [0.2.0])
239# emap is in svn : trunk/PROTO
240ELM_CHECK_OPTION([emap], [0.1.0])
241ELM_CHECK_OPTION([eweb])
242
237PKG_CHECK_MODULES([ELEMENTARY], 243PKG_CHECK_MODULES([ELEMENTARY],
238 [${requirement_elm}]) 244 [${requirement_elm}])
239 245
@@ -438,143 +444,6 @@ case "$host_os" in
438esac 444esac
439 445
440 446
441
442
443
444ELM_ELOCATION_DEF="#undef"
445have_elementary_elocation="no"
446want_elementary_elocation="auto"
447AC_ARG_ENABLE([elocation],
448 [AS_HELP_STRING([--disable-elocation], [disable elocation support. @<:@default=detect@:>@])],
449 [want_elementary_elocation=$enableval], [])
450
451if test "x$want_elementary_elocation" != "xno"; then
452 PKG_CHECK_MODULES([ELEMENTARY_ELOCATION],
453 [
454 elocation >= 0.1.0
455 ],
456 [
457 AC_DEFINE(HAVE_ELEMENTARY_ELOCATION, 1, [Elocation support for Elementary])
458 have_elementary_elocation="yes"
459 ELM_ELOCATION_DEF="#define"
460 requirement_elm="elocation >= 0.1.0 ${requirement_elm}"
461 ],
462 [have_elementary_elocation="no"]
463 )
464else
465 have_elementary_elocation="no"
466fi
467if test "x$want_elementary_elocation" = "xyes" -a "x$have_elementary_elocation" = "xno"; then
468 AC_MSG_ERROR([elocation support requested, but elocation was not found by pkg-config.])
469fi
470AC_SUBST(ELM_ELOCATION_DEF)
471
472ELM_EWEATHER_DEF="#undef"
473have_elementary_eweather="no"
474want_elementary_eweather="auto"
475AC_ARG_ENABLE([eweather],
476 [AS_HELP_STRING([--disable-eweather], [disable eweather support. @<:@default=detect@:>@])],
477 [want_elementary_eweather=$enableval], [])
478
479if test "x$want_elementary_eweather" != "xno"; then
480 PKG_CHECK_MODULES([ELEMENTARY_EWEATHER],
481 [
482 eweather
483 ],
484 [
485 AC_DEFINE(HAVE_ELEMENTARY_EWEATHER, 1, [EWeather support for Elementary])
486 have_elementary_eweather="yes"
487 ELM_EWEATHER_DEF="#define"
488 requirement_elm="eweather ${requirement_elm}"
489 ],
490 [have_elementary_eweather="no"]
491 )
492else
493 have_elementary_eweather="no"
494fi
495if test "x$want_elementary_eweather" = "xyes" -a "x$have_elementary_eweather" = "xno"; then
496 AC_MSG_ERROR([Eweather support requested, but eweather was not found by pkg-config.])
497fi
498AC_SUBST(ELM_EWEATHER_DEF)
499
500ELM_EMAP_DEF="#undef"
501have_elementary_emap="no"
502want_elementary_emap="auto"
503AC_ARG_ENABLE([emap],
504 [AS_HELP_STRING([--disable-emap], [disable emap support. @<:@default=detect@:>@])],
505 [want_elementary_emap=$enableval], [])
506
507if test "x$want_elementary_emap" != "xno"; then
508 PKG_CHECK_MODULES([ELEMENTARY_EMAP],
509 [
510 emap
511 ],
512 [
513 AC_DEFINE(HAVE_ELEMENTARY_EMAP, 1, [EMap support for Elementary])
514 have_elementary_emap="yes"
515 ELM_EMAP_DEF="#define"
516 requirement_elm="emap ${requirement_elm}"
517 ],
518 [have_elementary_emap="no"]
519 )
520else
521 have_elementary_emap="no"
522fi
523if test "x$want_elementary_emap" = "xyes" -a "x$have_elementary_emap" = "xno"; then
524 AC_MSG_ERROR([Emap support requested, but emap was not found by pkg-config.])
525fi
526AC_SUBST(ELM_EMAP_DEF)
527
528ELM_WEB2_DEF="#undef"
529
530elementary_web_backend="detect"
531elementary_web="no"
532want_elementary_web=""
533AC_ARG_WITH([elementary-web-backend],
534 [AS_HELP_STRING([--with-elementary-web-backend=@<:@ewebkit2/detect/none@:>@], [Select the WebKit backend for Elementary to support web @<:@default=detect@:>@])],
535 [
536 elementary_web_backend=${withval}
537 ],
538 [elementary_web_backend="detect"])
539
540case "$elementary_web_backend" in
541 ewebkit2|detect|none) ;;
542 *) AC_MSG_ERROR([Invalid web backend: must be ewebkit2, detect or none]) ;;
543esac
544
545if test "x$elementary_web_backend" = "xdetect"; then
546 want_elementary_web="ewebkit2"
547else
548 want_elementary_web=$elementary_web_backend
549fi
550
551if test "x$want_elementary_web" != "xnone"; then
552 PKG_CHECK_MODULES([ELEMENTARY_WEB],
553 [$want_elementary_web],
554 [
555 AC_DEFINE(HAVE_ELEMENTARY_WEB, 1, [Web support for Elementary])
556 webkit_datadir=$($PKG_CONFIG $want_elementary_web --variable=datadir)
557 AC_DEFINE_UNQUOTED(WEBKIT_DATADIR,
558 "$webkit_datadir",
559 "WebKit's data dir")
560 ELM_WEB2_DEF="#define"
561o
562 elementary_web=$want_elementary_web
563 requirement_elm="${want_elementary_web} ${requirement_elm}"
564 ],
565 [elementary_web="no"]
566 )
567else
568 elementary_web="no"
569fi
570
571if test "x$elementary_web_backend" = "xewebkit2"; then
572 if test "x$elementary_web" = "xnone"; then
573 AC_MSG_ERROR([Web support requested, but no $elementary_web_backend found by pkg-config.])
574 fi
575fi
576AC_SUBST(ELM_WEB2_DEF)
577
578AC_CONFIG_FILES([ 447AC_CONFIG_FILES([
579Makefile 448Makefile
580elementary.spec 449elementary.spec