2020-05-04 22:42:15 +00:00
|
|
|
#!/usr/bin/env perl
|
2010-01-29 00:33:02 +00:00
|
|
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
|
|
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
|
|
|
#
|
2020-03-21 15:24:24 +00:00
|
|
|
# Copyright 2003 by Wilson Snyder. This program is free software; you
|
|
|
|
# can redistribute it and/or modify it under the terms of either the GNU
|
2010-01-29 00:33:02 +00:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
# Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2010-01-29 00:33:02 +00:00
|
|
|
|
2018-05-08 00:42:28 +00:00
|
|
|
scenarios(vlt => 1);
|
2010-03-18 16:03:08 +00:00
|
|
|
|
2018-05-08 00:42:28 +00:00
|
|
|
run(cmd => ["cd $Self->{obj_dir}"
|
2020-06-28 16:17:54 +00:00
|
|
|
." && $ENV{CXX} -c ../../t/t_flag_ldflags_a.cpp"
|
2019-10-27 15:30:25 +00:00
|
|
|
." && ar -cr t_flag_ldflags_a.a t_flag_ldflags_a.o"
|
2018-05-08 00:42:28 +00:00
|
|
|
." && ranlib t_flag_ldflags_a.a "],
|
|
|
|
check_finished => 0);
|
|
|
|
run(cmd => ["cd $Self->{obj_dir}"
|
2020-06-28 16:17:54 +00:00
|
|
|
." && $ENV{CXX} -fPIC -c ../../t/t_flag_ldflags_so.cpp"
|
|
|
|
." && $ENV{CXX} -shared -o t_flag_ldflags_so.so -lc t_flag_ldflags_so.o"],
|
2018-05-08 00:42:28 +00:00
|
|
|
check_finished => 0);
|
2010-01-29 00:33:02 +00:00
|
|
|
|
2018-05-07 02:39:18 +00:00
|
|
|
compile(
|
|
|
|
# Pass multiple -D's so we check quoting works properly
|
|
|
|
v_flags2 => ["-CFLAGS '-DCFLAGS_FROM_CMDLINE -DCFLAGS2_FROM_CMDLINE' ",
|
|
|
|
"t/t_flag_ldflags_c.cpp",
|
|
|
|
"t_flag_ldflags_a.a",
|
|
|
|
"t_flag_ldflags_so.so",],
|
|
|
|
);
|
2010-01-29 00:33:02 +00:00
|
|
|
|
2020-06-22 09:13:54 +00:00
|
|
|
|
|
|
|
# On OS X, LD_LIBRARY_PATH is ignored, so set rpath of the exe to find the .so
|
|
|
|
if ($^O eq "darwin") {
|
|
|
|
run(cmd => ["cd $Self->{obj_dir}"
|
|
|
|
." && install_name_tool -add_rpath \@executable_path/."
|
|
|
|
." $Self->{VM_PREFIX}"],
|
|
|
|
check_finished => 0);
|
|
|
|
run(cmd => ["cd $Self->{obj_dir}"
|
|
|
|
." && install_name_tool -change t_flag_ldflags_so.so"
|
|
|
|
." \@rpath/t_flag_ldflags_so.so $Self->{VM_PREFIX}"],
|
|
|
|
check_finished => 0);
|
|
|
|
}
|
|
|
|
|
2018-05-07 02:39:18 +00:00
|
|
|
execute(
|
|
|
|
check_finished => 1,
|
|
|
|
run_env => "LD_LIBRARY_PATH=$Self->{obj_dir}",
|
|
|
|
);
|
2010-01-29 00:33:02 +00:00
|
|
|
|
|
|
|
ok(1);
|
|
|
|
1;
|