I better buy a book on python, but in the mean time, can anyone help me 
here.

In 'polibori'


/polybori-0.5rc.p7/patches/SConstruct

there is this bit of code:

def sonameprefix(env):
     if env['PLATFORM']=="darwin":
         return "-Wl,-dylib_install_name -Wl,"
     else:
         return '-Wl,-soname,'


which obviously sets the linker flags differently on OS X. I'd like to 
modify this somewhat, to work on Solaris, but need to run a test Sun or 
GNU linker is used, since they take different options. I can test the 
linker quite easily, but calling

ld --version

and checking if 'GNU' is in the output.

In a shell script, something like:

#!/usr/bin/bash
if [ `uname` = "SunOS" -a "`ld  --version  2>&1  | grep GNU`" = "" ]; then
   echo "Solaris system. The linker is NOT the GNU linker"
   echo "The correct compiler flags are '-Wl,-h,'"
elif  [ `uname` = "darwin" ]; then
   echo "OS X"
   echo "Correct compiler flags are '-Wl,-h,'"
else
   echo "Not OSX, or Solaris with the Sun linker"
   echo "The correct flags are '-Wl,-soname,'"
fi

will do what I want.

Can anyone show me how to do this in python, so I can modify that bit of 
code in polybori to work?


Hopefully, in the next day or so I should have a working gcc on t2 which 
  uses the Sun linker, which is less troublesome than the GNU one. It 
just takes ages to build gcc on t2, due to the disk speed and is not 
helped by the fact that gcc is VERY tricky to build on Solaris.





--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to