Article View: aus.computers.linux
Article #58151Detecting versions of Linux
From: chris mcdonald
Date: Mon, 22 Jul 1996 00:00
Date: Mon, 22 Jul 1996 00:00
28 lines
1556 bytes
1556 bytes
I'm using the following construct in a Makefile to determine which
operating system I'm using:
$(NAME):
@if uname -s -r | grep "SunOS 4" ; then \
make -f Makefile.sunos $(NAME) ; fi
@if uname -s -r | grep "SunOS 5" ; then \
make -f Makefile.solaris $(NAME) ; fi
@if uname -s -r | grep "OSF1" ; then \
make -f Makefile.decosf1 $(NAME) ; fi
@if uname -s -r | grep "IRIX 5" ; then \
make -f Makefile.irix5 $(NAME) ; fi
However, if I use the same approach under Linux, uname reports "Linux"
for both a.out and ELF versions.
As I'm using the dynamic loading routines, and need to discern between
a.out and ELF, can anyone suggest a similar, simple scheme so that I may
use either Makefile.linuxaout or Makefile.linuxelf ?
Thanks,
_______________________________________________________________________________
Dr Chris McDonald EMAIL: chris@cs.uwa.edu.au
Department of Computer Science WWW: http://www.cs.uwa.edu.au/
The University of Western Australia PHONE: +61 9 380 2533
Crawley, Western Australia, 6907 FAX: +61 9 380 1089
Technical Details
Message-ID:
<chris.838019861@bison>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102983,ddcc9db46b4dacf9,start X-Google-Attributes: gid102983,public From: chris@cs.uwa.oz.au (chris mcdonald) Subject: Detecting versions of Linux Date: 1996/07/22 Message-ID: <chris.838019861@bison> X-Deja-AN: 169436527 organization: The University of Western Australia, Department of Computer Science keywords: in a Makefile newsgroups: aus.computers.linux