[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Porting KDE 2 (1.90) to other Unixes ...
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-05-11 7:03:06
[Download RAW message or body]

On Thu, May 11, 2000 at 08:10:43AM +0200, Michael Koch wrote:
> Am Don, 11 Mai 2000 schrieb Thomas Leitner:
> > On Wed, 10 May 2000, David Faure wrote:
> > 
> > > On Wed, May 10, 2000 at 08:39:44PM +0200, Thomas Leitner wrote:
> > > > 
> > > > The first problem: Under Tru64, there's no "setenv" system call. In my
> > > > 1.1.2 port, I used to work around this with something like this:
> > > > 
> > > > #define setenv(a, b, c) \
> > > >         { char buf[8192]; sprintf(buf, "%s=%s", a, b); putenv(buf); }
> > > > 
> > > > The question: Is there an include file which is included by *ALL* KDE 
> > > > source files where I can put such workarounds in order to avoid having
> > > > to mess with each individual source file? It would also help to work
> > > > around similar problems.
> > > 
> > > You don't need that.
> > > kdelibs/kdecore/fakes.cpp provides an implementation for setenv
> > > (obviously using putenv) if the system doesn't have it.
> > > And config.h.bot provides the prototype for setenv in this case.
> > > So the "real solution" is already in place. Did you actually hit a problem
> > > while trying to compile KDE ?
> > 
> > Yes I did. It first showed up here:
> > 
> > kapp.cpp: In method `void KApplication::propagateSessionManager()':
> > kapp.cpp:449: `::setenv' undeclared (first use here)
> > 
> > However, "setenv" was only an example. I've stumbled accross many
> > similar problems which could be solved easily without modifying the
> > source files when I had kind of an "os.h" include file which would
> > be included in each and every source file. 
> > 
> > Any ideas?
> 
> I think we need a header file for kdelibs/kdecore/fakes.cpp

No - the prototypes for those functions should be in config.h,
which gets them from config.h.bot.

Oh, and BTW it's there
#if !defined(HAVE_SETENV)
int setenv(const char *name, const char *value, int overwrite);
#endif

#if !defined(HAVE_UNSETENV)
int unsetenv(const char *name);
#endif


What does your config.h say about HAVE_SETENV ?

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic