# -*- python -*-
import os
from lsst.sconsUtils import scripts, targets, env


#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

sourceFiles = ["context.c", "field.c", "field_utils.c", "misc.c", "wcs/poly.c", "prefs.c", "psf.c", "vignet.c",
               "homo.c", "fft.c", "pca.c", "makeit2.c", "xml.c", "diagnostic.c", "dummies.c",
               "fits/fitsmisc.c", "sample_utils.c", "wcs_utils.c", "lapack_stub.c"]

levmarSourceFiles = ["Axb.c", "lmbc.c", "lm.c", "lmblec.c", "lmbleic.c", "lmlec.c", "misc.c"]

objs = env.SourcesForSharedLibrary([os.path.join("#src", f) for f in
                                    sourceFiles + [os.path.join("levmar", f) for f in levmarSourceFiles]])
libs = env.getLibs("self")

# The source files in wcs (and potentially levmar) need to be able to find
# headers in the root src directory.
env.Append(CPPPATH = env['CPPPATH'].append('#/src'))
targets["lib"].extend(env.SharedLibrary(env["packageName"], objs,LIBS=libs))

