#!/usr/bin/python
# Copyright 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that on compilers sensitive to library order on linker's command line,
# we generate the correct order.
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("main.cpp", """\
void a();
int main() { a(); }
""")
t.write("a.cpp", """\
void b();
void a() { b(); }
""")
t.write("b.cpp", """\
void c();
void b() { c(); }
""")
t.write("c.cpp", """\
void d();
void c() { d(); }
""")
t.write("d.cpp", """\
void d() {}
""")
# The order of libraries in 'main' is crafted so that we get an error unless we
# do something about the order ourselves.
t.write("jamroot.jam", """\
exe main : main.cpp libd libc libb liba ;
lib libd : d.cpp ;
lib libc : c.cpp : static