Import("env_base", "env_etc")

env = env_base.Clone(
  SHLINKFLAGS=env_etc.shlinkflags)
if env_etc.gcc_version is not None and env_etc.gcc_version >= 30300:
  env_etc.enable_more_warnings(env=env)
env_etc.include_registry.append(
  env=env,
  paths=env_etc.iotbx_common_includes)
if (env_etc.static_libraries): builder = env.StaticLibrary
else:                          builder = env.SharedLibrary
builder(
  target="#lib/iotbx_pdb",
  source=[
    "hybrid_36_c.c",
    "hybrid_36_cpp.cpp",
    "utils.cpp",
    "write_utils.cpp",
    "hierarchy.cpp",
    "hierarchy_select.cpp",
    "hierarchy_atoms.cpp",
    "construct_hierarchy.cpp",
    "overall_counts.cpp",
    "hierarchy_write.cpp",
    "atom_selection.cpp",
    "input.cpp",
    "input_write.cpp"])

env = env.Clone()
env_etc.include_registry.append(env=env, paths=[env_etc.fable_include])
env.Program(target="hybrid_36_fem", source=["hybrid_36_fem.cpp"])

if (not env_etc.no_boost_python):
  Import("env_iotbx_boost_python_ext")
  env = env_iotbx_boost_python_ext.Clone()
  env.Prepend(LIBS=["iotbx_pdb", "cctbx", "scitbx_boost_python"])
  env_etc.enable_more_warnings(env=env)
  env.SharedLibrary(
    target="#lib/iotbx_pdb_ext",
    source=[
      "ext.cpp",
      "hybrid_36_bpl.cpp",
      "common_residue_names_bpl.cpp",
      "rna_dna_atom_names_bpl.cpp",
      "input_bpl.cpp",
      "xray_structure_bpl.cpp"])
  env.SharedLibrary(
    target="#lib/iotbx_pdb_hierarchy_ext",
    source=[
      "hierarchy_ext.cpp",
      "hierarchy_atom_bpl.cpp",
      "hierarchy_atoms_bpl.cpp"])
