Thanks Brian, I will rework it.

I have one question. Why some applications go to /usr/lib? And seems not
all of them are daemons. So is there a policy tell us which type of
applications should go to /usr/lib?

Thanks,
lin

Brian Cameron wrote:
>
> Lin:
>
>> g-s-d invokes g_spawn_async to search esd in G_SPAWN_SEARCH_PATH which
>> is the user's PATH. Since esd is in /usr/lib in Solaris, so hard code it
>> as a branding.
>
> Great work tracking down this problem.  However, this patch cannot go
> upstream since hard-coding the path to "/usr/lib" is not appropriate.
>
> Note that the /usr/lib/esound.pc file specifies the location of the
> daemon.  If you run this command, it tells you the directory where the
> ESD daemon is installed:
>
> % pkg-config --variable=esd_serverdir esound
>
> Note the patch dbus-glib-01-findlaunch.diff which uses this same
> technique to find the location of the dbus-daemon.  I would recommend
> that you rework this patch so that it works similarly to the
> dbus-glib-01-findlaunch.diff patch.  Note how this patch adds the
> trailing "/" in the configure.ac file, so that if building with an
> older version of dbus which doesn't support the "daemondir" variable
> that it will still work.  I'd recommend using the same technique in
> case someone tries building g-s-d with an older version of esd which
> may not support the "esd_serverdir" variable.  In other words, I'd
> add something like this to configure.in
>
> +GSD_ESD_LOCATION=`pkg-config esound --variable=esd_serverdir`
> +if test x"$GSD_ESD_LOCATION" != "x"; then
> +    # Add slash, so that if the ESD pkgconfig file does not
> +    # specify esd_serverdir, the tools/Makefile.am file will look
> +    # in the PATH for the daemon, as was previous behavior.
> +    #
> +    GSD_ESD_LOCATION="$DBUS_DAEMONDIR/"
> +fi
> +AC_SUBST(GSD_ESD_LOCATION)
>
> Note that the AC_SUBST macro only modifies the Makefiles, so you
> probably want to add this to the plugins/sound/Makefile.am file which
> builds the gsd-sound-manager.c file:
>
>  libsound_la_CFLAGS = \
> +    -DGSD_ESD_LOCATION=\"$(GSD_ESD_LOCATION)\" \
>         $(SETTINGS_PLUGIN_CFLAGS)       \
>         $(GNOME_CFLAGS)                 \
>         $(ESD_CFLAGS)                   \
>         $(AM_CFLAGS)
>
> Then you could change gsd-sound-manager.c like this:
>
> +       char  *argv[] = { GSD_ESD_LOCATION "esd", "-nobeeps", NULL};
>
> Also I would leave the G_SPAWN_SEARCH_PATH in the g_spawn_asynch line.
> Then it should still work okay even if GSD_ESD_LOCATION ends up being ""
> if using an older version of esound.  Using G_SPAWN_SEARCH_PATH should
> work okay even if you pass in the full path.
>
> Then the patch could go upstream:
>
> Brian


-- 
x82120 / +86 10 82618200


Reply via email to