discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Compiler preprocessor defines


From: Michael Dickens
Subject: Re: [Discuss-gnuradio] Compiler preprocessor defines
Date: Tue, 4 Nov 2008 08:40:09 -0500

The general way to do this is to create an m4 file with a 'case' in it based on the "$host_os", e.g. (as taken and expanded from grc_gr_audio_osx.m4; the case strings may or not be entirely correct, and are used as examples):
-------------
passed=yes
[set some other global variables to expected values]
case "$host_os" in
 darwin*)
   [set some variable here for Darwin only]
   ;;
 freebsd*)
   [set some variable here for freebsd only]
   ;;
 linux*)
   [set some variable here for linux only]
   ;;
 *)
   [default, maybe print something?; set some variable?]
   passed=no
   ;;
esac
[perform checks on the variables, to make sure they work together; set "passed=no" on failure]
if test $passed = yes; then
  AC_MSG_RESULT ([passed; using tap/tun FOO])
else
  AC_MSG_RESULT ([failed; not using tap/tun])
fi
-------------
then one can change the "$host_os" case switch text to fit all needs. As another example, it's possible that there is a difference in the way OSX implements tap/tun between 10.4 and 10.5 ... in that case, there would be different 'darwin8*' and 'darwin9*' cases. The same might hold between Linux kernels 2.4.X and 2.6.X, and I'm sure there's a way to create cases for each of those.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]