Avoid some explicit paths.

SVN revision: 46895
This commit is contained in:
Kim Woelders 2010-03-05 18:54:02 +00:00
parent c8fdebba89
commit b14b9e0846
5 changed files with 19 additions and 8 deletions

View File

@ -497,6 +497,7 @@ void SignalsRestore(void);
__NORETURN__ void EExit(int exitcode);
__EXPORT__ const char *EDirRoot(void);
const char *EDirBin(void);
const char *EDirLib(void);
const char *EDirUser(void);
const char *EDirUserCache(void);
void EDirMake(const char *base, const char *name);

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2009 Kim Woelders
* Copyright (C) 2004-2010 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -60,7 +60,12 @@ ExecSetupEnv(int flags)
#if USE_ROOTHACKLIB
if (Mode.wm.window)
Esetenv("LD_PRELOAD", ENLIGHTENMENT_LIB "/libhack.so");
{
char buf[1024];
Esnprintf(buf, sizeof(buf), "%s/libhack.so", EDirLib());
Esetenv("LD_PRELOAD", buf);
}
#endif
}

View File

@ -229,7 +229,6 @@ static int
ConfigFilePreparse(const char *src, const char *dst, const char *themepath)
{
char execline[FILEPATH_LEN_MAX];
const char *epp_path = ENLIGHTENMENT_BIN "/epp";
char *def_home, *def_user, *def_shell;
const char *variant;
@ -246,7 +245,7 @@ ConfigFilePreparse(const char *src, const char *dst, const char *themepath)
themepath = Mode.theme.path;
variant = (Mode.theme.variant) ? Mode.theme.variant : "";
Esnprintf(execline, sizeof(execline), "%s " "-P " "-nostdinc " "-undef "
Esnprintf(execline, sizeof(execline), "%s/epp " "-P " "-nostdinc " "-undef "
"-include %s/config/definitions " "-I%s " "-I%s/config "
"-D ENLIGHTENMENT_VERSION=%s " "-D ENLIGHTENMENT_ROOT=%s "
"-D ENLIGHTENMENT_BIN=%s "
@ -257,7 +256,7 @@ ConfigFilePreparse(const char *src, const char *dst, const char *themepath)
"-D SCREEN_DEPTH_%i=1 " "-D USER_NAME=%s " "-D HOME_DIR=%s "
"-D USER_SHELL=%s "
"%s %s",
epp_path, EDirRoot(), themepath, EDirRoot(),
EDirBin(), EDirRoot(), themepath, EDirRoot(),
e_wm_version, EDirRoot(), EDirBin(), themepath, variant,
EDirUser(), EDirUserCache(),
WinGetW(VROOT), WinGetH(VROOT), WinGetW(VROOT), WinGetH(VROOT),

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2009 Kim Woelders
* Copyright (C) 2004-2010 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -495,6 +495,12 @@ EDirBin(void)
return ENLIGHTENMENT_BIN;
}
const char *
EDirLib(void)
{
return ENLIGHTENMENT_LIB;
}
const char *
EDirRoot(void)
{

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2008 Kim Woelders
* Copyright (C) 2004-2010 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -321,7 +321,7 @@ ModLoadSym(const char *lib, const char *sym, const char *name)
char buf[1024];
void *h;
Esnprintf(buf, sizeof(buf), "%s/lib%s_%s.so", ENLIGHTENMENT_LIB, lib, name);
Esnprintf(buf, sizeof(buf), "%s/lib%s_%s.so", EDirLib(), lib, name);
if (EDebug(1))
Eprintf("ModLoad %s\n", buf);
h = dlopen(buf, RTLD_NOW | RTLD_LOCAL);