[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Detecting kfreebsd kernel while compiling



Hello,

since some hours I want to compile a package for kfreebsd. Inside the
source code are code snippets for different systems:

  #ifdef SUNOS4
  ..

  /*#ifdef SUNOS5*/
  #ifdef __sun
  ..

  #ifdef OSF1
  ..

  #ifdef AIX3
  ..

  #ifdef ULTRIX
  ..

  /*#ifdef HPUX*/
  #ifdef __hpux
  ..

  /*#ifdef LINUX*
  #ifdef linux
  ..

Compiling on systems with linux kernel runs fine - it seems "linux" is
detected and the right code is used.

For kfreebsd compiling I have added:

  #ifdef kfreebsd
  ..

But on systems with kfreebsd kernel no code is used - not the "linux"
code and not the "kfreebsd" code. Then I have tested it compiling with
CFLAGS=-Dkfreebsd and it runs. 

But is there a way for not hardcoding the kernel name ?


Fondest regards,
 Joachim Wiedorn

Attachment: signature.asc
Description: PGP signature


Reply to: