The SILC Project

source navigation ]
identifier search ]
freetext search ]
file search ]

silc/silcer/macros/gnome.m4

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

This page was automatically generated by the LXR engine.
Free-text search provided by Glimpse