mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 15:47:59 +02:00
Merge branch 'master' of ssh://git.freedesktop.org/git/dbus/dbus
This commit is contained in:
commit
04ddf2e3aa
8 changed files with 217 additions and 14 deletions
|
|
@ -208,7 +208,7 @@ if DBUS_UNIX
|
|||
fi
|
||||
$(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
|
||||
if test -f dbus-daemin-launch-helper$(EXEEXT) ; then \
|
||||
if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \
|
||||
$(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
|
||||
if test `id -u` -eq 0; then \
|
||||
chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ update_desktop_file_entry (BusActivation *activation,
|
|||
BusDesktopFile *desktop_file,
|
||||
DBusError *error)
|
||||
{
|
||||
char *name, *exec, *user;
|
||||
char *name, *exec, *user, *exec_tmp;
|
||||
BusActivationEntry *entry;
|
||||
DBusStat stat_buf;
|
||||
DBusString file_path;
|
||||
|
|
@ -266,6 +266,7 @@ update_desktop_file_entry (BusActivation *activation,
|
|||
name = NULL;
|
||||
exec = NULL;
|
||||
user = NULL;
|
||||
exec_tmp = NULL;
|
||||
entry = NULL;
|
||||
|
||||
dbus_error_init (&tmp_error);
|
||||
|
|
@ -300,7 +301,7 @@ update_desktop_file_entry (BusActivation *activation,
|
|||
if (!bus_desktop_file_get_string (desktop_file,
|
||||
DBUS_SERVICE_SECTION,
|
||||
DBUS_SERVICE_EXEC,
|
||||
&exec,
|
||||
&exec_tmp,
|
||||
error))
|
||||
goto failed;
|
||||
|
||||
|
|
@ -329,6 +330,9 @@ update_desktop_file_entry (BusActivation *activation,
|
|||
|
||||
entry = _dbus_hash_table_lookup_string (s_dir->entries,
|
||||
_dbus_string_get_const_data (filename));
|
||||
|
||||
exec = strdup (_dbus_replace_install_prefix (exec_tmp));
|
||||
|
||||
if (entry == NULL) /* New file */
|
||||
{
|
||||
/* FIXME we need a better-defined algorithm for which service file to
|
||||
|
|
@ -417,7 +421,7 @@ update_desktop_file_entry (BusActivation *activation,
|
|||
|
||||
failed:
|
||||
dbus_free (name);
|
||||
dbus_free (exec);
|
||||
dbus_free (exec_tmp);
|
||||
dbus_free (user);
|
||||
_dbus_string_free (&file_path);
|
||||
|
||||
|
|
|
|||
105
cmake/cross-compile.sh
Executable file
105
cmake/cross-compile.sh
Executable file
|
|
@ -0,0 +1,105 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# cross compile script for cmake
|
||||
#
|
||||
# initial written by Fridrich Strba
|
||||
# refactored to debian/lenny by Ralf Habacker
|
||||
#
|
||||
# reported to work at least on debian/lenny
|
||||
#
|
||||
|
||||
if test -f /usr/bin/i686-pc-mingw32-gcc; then
|
||||
cross_cc=i686-pc-mingw32
|
||||
elif test -f /usr/bin/i586-mingw32msvc-gcc; then
|
||||
cross_cc=i586-mingw32msvc
|
||||
else
|
||||
echo "could not determine mingw cross compiler"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -d ~/$cross_cc; then
|
||||
cross_root=~/$cross_cc
|
||||
elif test -d /usr/$cross_cc/sys-root/mingw; then
|
||||
cross_root=/usr/$cross_cc/sys-root/mingw
|
||||
elif test -d /usr/$cross_cc/lib; then
|
||||
cross_root=/usr/$cross_cc
|
||||
else
|
||||
echo "could not determine mingw cross compiler sdk"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make cmake happy
|
||||
export TEMP=/tmp
|
||||
|
||||
HOST_CC=gcc; export HOST_CC;
|
||||
|
||||
if test -d $cross_root/lib/pkgconfig; then
|
||||
PKG_CONFIG_PATH="$cross_root/lib/pkgconfig:$cross_root/share/pkgconfig"; export PKG_CONFIG_PATH;
|
||||
fi
|
||||
|
||||
if test -d "$MINGW32_CLASSPATH" || test -f "$cross_root/share/java/libgcj.jar"; then
|
||||
CLASSPATH="$CLASSPATH:${MINGW32_CLASSPATH:-$cross_root/share/java/libgcj.jar:$cross_root/share/java/libgcj-tools.jar}"; export CLASSPATH;
|
||||
fi
|
||||
|
||||
_PREFIX="/usr/bin/$cross_cc-";
|
||||
for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do
|
||||
x=`echo $i|sed "s,${_PREFIX},,"|sed "s,\.awk*,,"|tr "a-z+-" "A-ZX_"`;
|
||||
declare -x $x="$i" ; export $x;
|
||||
done;
|
||||
unset _PREFIX;
|
||||
|
||||
CC="${MINGW32_CC:-$cross_cc-gcc}"; export CC;
|
||||
CFLAGS="${MINGW32_CFLAGS:--O2 -g -pipe -Wall -fexceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls --param=ssp-buffer-size=4 -mms-bitfields}"; export CFLAGS;
|
||||
LDFLAGS="${MINGW32_LDFLAGS:--Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a}"; export LDFLAGS;
|
||||
|
||||
if [ -x "/usr/bin/$cross_cc-g++" ]; then
|
||||
CXX="${MINGW32_CXX:-$cross_cc-g++}"; export CXX;
|
||||
CXXFLAGS="${MINGW32_CXXFLAGS:--O2 -g -pipe -Wall -fexceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls --param=ssp-buffer-size=4 -mms-bitfields}"; export CXXFLAGS;
|
||||
else
|
||||
CXX=; export CXX;
|
||||
ac_cv_prog_CXX=no; export ac_cv_prog_CXX;
|
||||
CXXFLAGS=; export CXXFLAGS;
|
||||
fi;
|
||||
for i in `ls $cross_root/bin/*|grep -- "-config$"` ; do
|
||||
x=`basename $i|tr "a-z+-" "A-ZX_"|sed "s,\.,,"`;
|
||||
declare -x $x="$i" ; export $x;
|
||||
done;
|
||||
unset x i ;
|
||||
|
||||
if ! test -f "$cross_root/lib/libexpat.dll.a"; then
|
||||
(cd /tmp; wget http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/expat-2.0.1-bin.zip)
|
||||
(cd /tmp; wget http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/expat-2.0.1-lib.zip)
|
||||
(cd $cross_root; unzip -x /tmp/expat-2.0.1-bin.zip)
|
||||
(cd $cross_root; unzip -x /tmp/expat-2.0.1-lib.zip)
|
||||
fi
|
||||
|
||||
if test -f "$cross_root/lib/libexpat.dll.a"; then
|
||||
xml_library=-DDBUS_USE_EXPAT=On -DLIBEXPAT_INCLUDE_DIR:PATH=$cross_root/include -DLIBEXPAT_LIBRARIES:PATH=$cross_root/lib/libexpat.dll.a
|
||||
else
|
||||
echo "could not find a cross compile xml libraray"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-DCMAKE_SYSTEM_NAME="Windows" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$cross_root \
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=$cross_root/lib \
|
||||
-DINCLUDE_INSTALL_DIR:PATH=$cross_root/include \
|
||||
-DLIB_INSTALL_DIR:PATH=$cross_root/lib \
|
||||
-DSYSCONF_INSTALL_DIR:PATH=$cross_root/etc \
|
||||
-DSHARE_INSTALL_PREFIX:PATH=$cross_root/share \
|
||||
-DBUILD_SHARED_LIBS:BOOL=ON \
|
||||
-DCMAKE_C_COMPILER="/usr/bin/$cross_cc-gcc" \
|
||||
-DCMAKE_CXX_COMPILER="/usr/bin/$cross_cc-g++" \
|
||||
-DCMAKE_FIND_ROOT_PATH="$cross_root" \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
-DCMAKE_CXX_COMPILER="/usr/bin/$cross_cc-g++" \
|
||||
-DCMAKE_FIND_ROOT_PATH="$cross_root" \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
$xml_library \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
|
||||
$*
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
EXPORTS
|
||||
@DBUS_INTERNAL_EXPORTS@
|
||||
@DBUS_INTERNAL_TEST_EXPORTS@
|
||||
|
|
@ -1335,6 +1335,7 @@ AC_MSG_RESULT(yes)
|
|||
#### find the actual value for $prefix that we'll end up with
|
||||
## (I know this is broken and should be done in the Makefile, but
|
||||
## that's a major pain and almost nobody actually seems to care)
|
||||
AS_AC_EXPAND(EXPANDED_PREFIX, "$prefix")
|
||||
AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
|
||||
AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
|
||||
AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
|
||||
|
|
@ -1430,6 +1431,11 @@ fi
|
|||
AC_SUBST(DBUS_USER)
|
||||
AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
|
||||
|
||||
#### Prefix to install into
|
||||
DBUS_PREFIX=$EXPANDED_PREFIX
|
||||
AC_SUBST(DBUS_PREFIX)
|
||||
AC_DEFINE_UNQUOTED(DBUS_PREFIX,"$DBUS_PREFIX", [Prefix for installing DBUS])
|
||||
|
||||
#### Direcotry to install data files into
|
||||
DBUS_DATADIR=$EXPANDED_DATADIR
|
||||
AC_SUBST(DBUS_DATADIR)
|
||||
|
|
@ -1581,7 +1587,7 @@ echo "
|
|||
D-Bus $VERSION
|
||||
==============
|
||||
|
||||
prefix: ${prefix}
|
||||
prefix: ${EXPANDED_PREFIX}
|
||||
exec_prefix: ${exec_prefix}
|
||||
libdir: ${EXPANDED_LIBDIR}
|
||||
libexecdir: ${EXPANDED_LIBEXECDIR}
|
||||
|
|
|
|||
|
|
@ -3583,4 +3583,18 @@ _dbus_socket_can_pass_unix_fd(int fd) {
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* replaces the term DBUS_PREFIX in configure_time_path by the
|
||||
* current dbus installation directory. On unix this function is a noop
|
||||
*
|
||||
* @param configure_time_path
|
||||
* @return real path
|
||||
*/
|
||||
const char *
|
||||
_dbus_replace_install_prefix (const char *configure_time_path)
|
||||
{
|
||||
return configure_time_path;
|
||||
}
|
||||
|
||||
/* tests in dbus-sysdeps-util.c */
|
||||
|
|
|
|||
|
|
@ -2060,7 +2060,55 @@ _dbus_delete_file (const DBusString *filename,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_BUILD_TESTS)
|
||||
/* Forward declaration of prototype used in next function */
|
||||
static dbus_bool_t
|
||||
_dbus_get_install_root(char *prefix, int len);
|
||||
|
||||
/*
|
||||
* replaces the term DBUS_PREFIX in configure_time_path by the
|
||||
* current dbus installation directory. On unix this function is a noop
|
||||
*
|
||||
* @param configure_time_path
|
||||
* @return real path
|
||||
*/
|
||||
const char *
|
||||
_dbus_replace_install_prefix (const char *configure_time_path)
|
||||
{
|
||||
#ifndef DBUS_PREFIX
|
||||
return configure_time_path;
|
||||
#else
|
||||
static char retval[1000];
|
||||
static char runtime_prefix[1000];
|
||||
int len = 1000;
|
||||
int i;
|
||||
|
||||
if (!configure_time_path)
|
||||
return NULL;
|
||||
|
||||
if ((!_dbus_get_install_root(runtime_prefix, len) ||
|
||||
strncmp (configure_time_path, DBUS_PREFIX "/",
|
||||
strlen (DBUS_PREFIX) + 1))) {
|
||||
strcat (retval, configure_time_path);
|
||||
return retval;
|
||||
}
|
||||
|
||||
strcpy (retval, runtime_prefix);
|
||||
strcat (retval, configure_time_path + strlen (DBUS_PREFIX) + 1);
|
||||
|
||||
/* Somehow, in some situations, backslashes get collapsed in the string.
|
||||
* Since windows C library accepts both forward and backslashes as
|
||||
* path separators, convert all backslashes to forward slashes.
|
||||
*/
|
||||
|
||||
for(i = 0; retval[i] != '\0'; i++) {
|
||||
if(retval[i] == '\\')
|
||||
retval[i] = '/';
|
||||
}
|
||||
return retval;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined (DBUS_DISABLE_ASSERTS) || defined(DBUS_BUILD_TESTS)
|
||||
|
||||
#if defined(_MSC_VER) || defined(DBUS_WINCE)
|
||||
# ifdef BACKTRACES
|
||||
|
|
@ -2334,7 +2382,10 @@ static void dump_backtrace()
|
|||
CloseHandle(hThread);
|
||||
CloseHandle(hCurrentThread);
|
||||
}
|
||||
#endif
|
||||
#endif /* asserts or tests enabled */
|
||||
|
||||
#ifdef BACKTRACES
|
||||
void _dbus_print_backtrace(void)
|
||||
{
|
||||
init_backtrace();
|
||||
|
|
@ -2683,6 +2734,21 @@ _dbus_make_file_world_readable(const DBusString *filename,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* return the relocated DATADIR
|
||||
*
|
||||
* @returns relocated DATADIR static string
|
||||
*/
|
||||
|
||||
static const char *
|
||||
_dbus_windows_get_datadir (void)
|
||||
{
|
||||
return _dbus_replace_install_prefix(DBUS_DATADIR);
|
||||
}
|
||||
|
||||
#undef DBUS_DATADIR
|
||||
#define DBUS_DATADIR _dbus_windows_get_datadir ()
|
||||
|
||||
|
||||
#define DBUS_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
|
||||
#define DBUS_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
|
||||
|
|
@ -2697,7 +2763,7 @@ _dbus_make_file_world_readable(const DBusString *filename,
|
|||
*
|
||||
* and
|
||||
*
|
||||
* DBUS_DATADIR
|
||||
* relocated DBUS_DATADIR
|
||||
*
|
||||
* @param dirs the directory list we are returning
|
||||
* @returns #FALSE on OOM
|
||||
|
|
@ -2727,8 +2793,11 @@ _dbus_get_standard_session_servicedirs (DBusList **dirs)
|
|||
}
|
||||
}
|
||||
#else
|
||||
if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR _DBUS_PATH_SEPARATOR))
|
||||
goto oom;
|
||||
if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
|
||||
goto oom;
|
||||
|
||||
if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
|
||||
goto oom;
|
||||
#endif
|
||||
|
||||
common_progs = _dbus_getenv ("CommonProgramFiles");
|
||||
|
|
@ -2812,8 +2881,6 @@ _dbus_atomic_dec (DBusAtomic *atomic)
|
|||
return InterlockedDecrement (&atomic->value) + 1;
|
||||
}
|
||||
|
||||
#endif /* asserts or tests enabled */
|
||||
|
||||
/**
|
||||
* Called when the bus daemon is signaled to reload its configuration; any
|
||||
* caches should be nuked. Of course any caches that need explicit reload
|
||||
|
|
|
|||
|
|
@ -507,6 +507,16 @@ dbus_bool_t _dbus_change_to_daemon_user (const char *user,
|
|||
|
||||
void _dbus_flush_caches (void);
|
||||
|
||||
/*
|
||||
* replaces the term DBUS_PREFIX in configure_time_path by the
|
||||
* current dbus installation directory. On unix this function is a noop
|
||||
*
|
||||
* @param configure_time_path
|
||||
* @return real path
|
||||
*/
|
||||
const char *
|
||||
_dbus_replace_install_prefix (const char *configure_time_path);
|
||||
|
||||
/** @} */
|
||||
|
||||
DBUS_END_DECLS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue