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

List:       kde-devel
Subject:    Re: kfm && tarfiles
From:       Stephan Kulow <coolo () kde ! org>
Date:       1998-01-19 1:23:42
[Download RAW message or body]

Alex wrote:
> 
> On Sun, 18 Jan 1998, Stephan Kulow wrote:
> 
> > > > So Alex, what is hosed?
> > >
> > > I've just noticed weird results with autoconf.  The test for the right
> > > kppp headers, forgot two headers needed to compile under BSD, so kppp will
> > > compile, but autoconf thinks it won't (sys/types.h and sys/time.h are
> > > missing). Some of the "kdepackages" are giving conflicting results as to
> > Well, I copied code out of kppp, maybe I missed something.
> 
> I had submitted a diff to the maintainer of kppp which made it into latest
> snapshot (your first shot at detecting what programs were suitable).
> Autoconf is still to me one of the last frontiers of Unix/X11 programming
> ;-)
Well, after a year using it to the limits, I must say, it's easy ;)
Look at this code out of kdenetwork/configure.in(.1):
AC_MSG_CHECKING(if kppp's headers are installed)
# this is a little piece of code out of kppp. If it doesn't compile,
# kppp is not good for this system. It doesn't do anything, but enough
# to fail ;)
cat > conftest.C <<EOF
#ifdef __svr4__
  #include <sys/stropts.h>
  #include <net/pppio.h>                /* SVR4, Solaris 2, etc. */     

[snipped]

  #endif
#endif
EOF   

AC_LANG_CPLUSPLUS
if AC_TRY_EVAL(ac_compile); then
  AC_MSG_RESULT(yes)
else
  DO_NOT_COMPILE="$DO_NOT_COMPILE kppp"
  AC_MSG_RESULT(no)
fi
rm -r conftest.*       

The first line prints out the famous text "checking ..."

After that I print a little program into conftest.C (til EOF).
Then I switch to C++ (following orders will use the C++ compiler and
such).
And now the most easiest part: if the compilation works, I print out
"yes". If not, I add kppp to $DO_NOT_COMPILE and print out "no".

Was it really that hard? ;-)

> 
> On another note this snippet should work best for generic BSD code:
> 
> #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD)
> #       undef __BSD__
> #       define __BSD__ 1 /* needed so that #elif __BSD__ will work with gcc */
> #endif
> 
This code belongs in config.h.bot, there is where I added it.

Greets, Stephan

-- 
Everyone makes mistakes -- but we are more experienced at it
                                      anonymous KDE developer

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

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