import os
Import('*')

parseConfigs = ['pkg-config --cflags --libs playerc++',
                'pkg-config --cflags --libs playerc']

sources = ['GazeboDriver.cc',
           'GazeboClient.cc',
           'GazeboInterface.cc',
           'GazeboTime.cc',
           'SimulationInterface.cc',
           'Position2dInterface.cc',
           'Position3dInterface.cc',
           'LaserInterface.cc',
           'CameraInterface.cc',
           'FiducialInterface.cc',
           'PTZInterface.cc',
           'OpaqueInterface.cc',
           'ActarrayInterface.cc',
           'GripperInterface.cc',
           'BumperInterface.cc',
           'IRInterface.cc'
           ]

# Position3dInterface.cc PowerInterface.cc SonarInterface.ccGpsInterface.cc ')

try:
  env["CCFLAGS"].index('-DHAVE_PLAYER')
  
  #staticPlayerObjs = env.StaticObject(sources)
  sharedPlayerObjs = env.SharedObject(sources)
    
  #staticPlayerObjs.append(staticObjs);
  sharedPlayerObjs.append(sharedObjs);
    
  sharedLib = env.SharedLibrary('gazeboplugin', sharedPlayerObjs)
  # staticLib = env.StaticLibrary('gazeboplugin', staticPlayerObjs)
    
  env.Install(install_prefix+'/lib', sharedLib)
  #env.Install(install_prefix+'/lib', staticLib)
except ValueError,e:
  garbage = 1
