Re: recognize UNIX version
From: Levente KOVACS (Levente.Kovacs_at_cern.ch)
Date: 05/12/04
- Next message: Måns Rullgård: "Re: Is the unix kernel multithreaded?"
- Previous message: zb011 message: "Socket Read() does not return values"
- In reply to: Darko M.: "recognize UNIX version"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 May 2004 09:53:52 +0200
On 11 May 2004 10:58:55 -0700
mdanko@tesla.rcub.bg.ac.yu (Darko M.) wrote:
> Is there any portable way of recognizing which version of UNIX (or
> Linux, for me it's a sort of) is the software being installed on
> (preprocessor way), or which version of UNIX is the software being
> running on?
You should write a ./configure shell script, which generates makefile,
and config.h. You should include config.h in your program.
There's a program called uname, which comes with every UNIX platforms.
See man uname.
The ./configure shell script shall execute such commands like
SYSTEM=`uname -s`
.
.
.
echo "#define SYSTEM $SYSTEM" >>config.h
Or something like that.
You can add flags to your cc, and/or linker like
CCFLAGS=`gtk-config --cflags`
LDFLAGS=`gtk-config --link`
.
.
.
echo CCFLAGS=$CCFLAGS >>Makefile
echo LDFLAGS=$LDFALGS >>Makefile
And, the rest of your Makefile shall use thoes variables.
I know, that autoconf does this, but for me it's too complicated, and
sometime I run into problems (e.g. with the gEDA tools).
I just made this mail, I do not run things like this...yet. But I'm
thinkink about writing some scripts.
Anyway... I hope it helped.
Levente
-- Leva __ Email: levente.kovacs@cern.ch Home Page: http://web.interware.hu/leva Public key: http://web.interware.hu/leva/CERN/public_key ________________________________________ /"\ \ / ASCII Ribbon Campaign X against HTML email & vCards / \ http://arc.pasp.de/ Have Fun, & Linux! 73 for all by HA5OGL. This message was generated by Sylpheed.
- Next message: Måns Rullgård: "Re: Is the unix kernel multithreaded?"
- Previous message: zb011 message: "Socket Read() does not return values"
- In reply to: Darko M.: "recognize UNIX version"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|