/tags/rel-0-2-0/FreeSpeech/vflow/macros/gnome.m4

# · m4 · 124 lines · 113 code · 11 blank · 0 comment · 0 complexity · 77d5ae132b502eea4efadb6bdce5b946 MD5 · raw file

  1. dnl
  2. dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
  3. dnl
  4. dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
  5. dnl is not found.
  6. dnl
  7. AC_DEFUN([GNOME_INIT_HOOK],[
  8. AC_SUBST(GNOME_LIBS)
  9. AC_SUBST(GNOMEUI_LIBS)
  10. AC_SUBST(GNOMEGNORBA_LIBS)
  11. AC_SUBST(GTKXMHTML_LIBS)
  12. AC_SUBST(ZVT_LIBS)
  13. AC_SUBST(GNOME_LIBDIR)
  14. AC_SUBST(GNOME_INCLUDEDIR)
  15. AC_ARG_WITH(gnome-includes,
  16. [ --with-gnome-includes Specify location of GNOME headers],[
  17. CFLAGS="$CFLAGS -I$withval"
  18. ])
  19. AC_ARG_WITH(gnome-libs,
  20. [ --with-gnome-libs Specify location of GNOME libs],[
  21. LDFLAGS="$LDFLAGS -L$withval"
  22. gnome_prefix=$withval
  23. ])
  24. AC_ARG_WITH(gnome,
  25. [ --with-gnome Specify prefix for GNOME files],
  26. if test x$withval = xyes; then
  27. want_gnome=yes
  28. dnl Note that an empty true branch is not
  29. dnl valid sh syntax.
  30. ifelse([$1], [], :, [$1])
  31. else
  32. if test "x$withval" = xno; then
  33. want_gnome=no
  34. else
  35. want_gnome=yes
  36. LDFLAGS="$LDFLAGS -L$withval/lib"
  37. CFLAGS="$CFLAGS -I$withval/include"
  38. gnome_prefix=$withval/lib
  39. fi
  40. fi,
  41. want_gnome=yes)
  42. if test "x$want_gnome" = xyes; then
  43. AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
  44. if test "$GNOME_CONFIG" = "no"; then
  45. no_gnome_config="yes"
  46. else
  47. AC_MSG_CHECKING(if $GNOME_CONFIG works)
  48. if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
  49. AC_MSG_RESULT(yes)
  50. GNOME_GNORBA_HOOK([],$2)
  51. GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
  52. GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
  53. GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
  54. GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
  55. ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
  56. GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
  57. GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
  58. $1
  59. else
  60. AC_MSG_RESULT(no)
  61. no_gnome_config="yes"
  62. fi
  63. fi
  64. if test x$exec_prefix = xNONE; then
  65. if test x$prefix = xNONE; then
  66. gnome_prefix=$ac_default_prefix/lib
  67. else
  68. gnome_prefix=$prefix/lib
  69. fi
  70. else
  71. gnome_prefix=`eval echo \`echo $libdir\``
  72. fi
  73. if test "$no_gnome_config" = "yes"; then
  74. AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
  75. if test -f $gnome_prefix/gnomeConf.sh; then
  76. AC_MSG_RESULT(found)
  77. echo "loading gnome configuration from" \
  78. "$gnome_prefix/gnomeConf.sh"
  79. . $gnome_prefix/gnomeConf.sh
  80. $1
  81. else
  82. AC_MSG_RESULT(not found)
  83. if test x$2 = xfail; then
  84. AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
  85. fi
  86. fi
  87. fi
  88. fi
  89. if test -n "$3"; then
  90. n="$3"
  91. for i in $n; do
  92. AC_MSG_CHECKING(extra library \"$i\")
  93. case $i in
  94. applets)
  95. AC_SUBST(GNOME_APPLETS_LIBS)
  96. GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
  97. AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
  98. capplet)
  99. AC_SUBST(GNOME_CAPPLET_LIBS)
  100. GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
  101. AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
  102. *)
  103. AC_MSG_RESULT(unknown library)
  104. esac
  105. done
  106. fi
  107. ])
  108. dnl
  109. dnl GNOME_INIT ([additional-inits])
  110. dnl
  111. AC_DEFUN([GNOME_INIT],[
  112. GNOME_INIT_HOOK([],fail,$1)
  113. ])