6 $build="rel" unless $build;
8 my $cmake_build="RELEASE";
9 $cmake_build="DEBUG" if $build eq 'dbg';
11 my $cds_libs="cds-libs";
14 my $workspace=get_gen_prop("workspace") || "$HOME";
15 my $cds_source=get_gen_prop("libcds-source") || "../libcds";
16 my $make_jobs=get_gen_prop("make-job") || 2;
18 # get compiler-specific props
19 my $comp_root=get_prop("root");
20 my $boost=get_prop( "boost" );
21 my $boost_libs=get_prop( "boost-lib" );
22 my $gtest=get_prop("gtest");
23 my $gtest_lib=get_prop( "gtest-lib");
24 my $gtest_inc=get_prop("gtest-include") || get_gen_prop("gtest-include");
25 my $cxx=get_prop("cxx") or $compiler;
26 my $cc=get_prop("cc") or $compiler;
27 my $cxxflags=get_prop("cxxflags");
28 my $ldflags=get_prop("ldflags");
29 my $cmake_exe_ldflags=get_prop("exe-ldflags");
30 my $ext_lib=get_prop("extlib");
31 my $ld_lib_path=get_prop("ld-lib-path");
32 my $cmake_flags=get_prop("cmake-flags");
35 my $filename="cds-$build-$compiler-$bitness";
36 open( my $out, ">", $filename ) or die "Cannot open cds-$build-$compiler-$bitness";
38 print $out "#! /bin/sh\n\n";
39 print $out "root=$workspace\n";
40 print $out "CDS_SOURCE=\$root/$cds_source\n";
41 print $out "OBJ_ROOT=\$root/obj\n";
42 print $out "BIN_ROOT=\$root/bin\n";
43 print $out "GTEST_ROOT=$gtest\n" if $gtest;
45 print $out "rm -fr \$OBJ_ROOT\n";
46 print $out "rm -fr \$BIN_ROOT\n";
47 print $out "mkdir -p \$OBJ_ROOT\n";
48 print $out "#cp -f run-ctest-rel \$OBJ_ROOT/run-ctest\n" if $build eq 'rel';
49 print $out "#cp -f run-ctest-dbg \$OBJ_ROOT/run-ctest\n" unless $build eq 'rel';
50 print $out "cd \$OBJ_ROOT\n";
52 print $out "LD_LIBRARY_PATH=$ld_lib_path:\$LD_LIBRARY_PATH \\\n" if $ld_lib_path;
53 print $out "LDFLAGS=\"$ldflags\" \\\n" if $ldflags;
54 print $out "cmake -G \"Unix Makefiles\" \\\n";
55 print $out " -DCMAKE_BUILD_TYPE=$cmake_build \\\n";
56 print $out " -DCMAKE_C_COMPILER=$comp_root/$cc \\\n";
57 print $out " -DCMAKE_CXX_COMPILER=$comp_root/$cxx \\\n";
58 print $out " -DCMAKE_CXX_FLAGS=\"$cxxflags\" \\\n" if $cxxflags;
59 print $out " -DCMAKE_EXE_LINKER_FLAGS=\"$cmake_exe_ldflags\" \\\n" if $cmake_exe_ldflags;
60 print $out " -DCDS_BIN_DIR=\$BIN_ROOT \\\n";
61 print $out " -DWITH_TESTS=ON \\\n";
62 print $out " -DWITH_ASAN=ON \\\n" if $build eq 'asan';
63 print $out " -DWITH_TSAN=ON \\\n" if $build eq 'tsan';
64 print $out " -DBOOST_ROOT=$boost \\\n";
65 print $out " -DBOOST_LIBRARYDIR=\$BOOST_ROOT/$boost_libs \\\n" if $boost_libs;
66 print $out " -DGTEST_INCLUDE_DIRS=$gtest_inc \\\n" if $gtest_inc;
67 print $out " -DGTEST_LIBRARY=$gtest_lib \\\n" if $gtest_lib;
68 print $out " -DEXTERNAL_SYSTEM_LIBS=\"$ext_lib\" \\\n" if $ext_lib;
69 print $out " $cmake_flags \\\n" if $cmake_flags;
70 print $out " \$CDS_SOURCE && \\\n";
71 print $out "make -j $make_jobs \$* \n";
74 chmod 0755, $filename;
79 my $key="$compiler-$bitness-$build-$what:";
81 my $grep = `grep -P $key $cds_libs`;
83 my @ret = $grep =~ /^$key\s+(\S.*\S*)\s+/;
84 return $ret[0] if @ret;
87 $key = "$compiler-$bitness-$what:";
88 my $grep = `grep -P $key $cds_libs`;
90 my @ret = $grep =~ /^$key\s+(\S.*\S*)\s+/;
91 return $ret[0] if @ret;
94 $key = "$compiler-$what:";
95 my $grep = `grep -P $key $cds_libs`;
97 my @ret = $grep =~ /^$key\s+(\S.*\S*)\s+/;
98 return $ret[0] if @ret;
107 my $grep = `grep -P $key $cds_libs`;
109 my @ret = $grep =~ /^$key\s+(\S.*\S*)\s+/;
110 return $ret[0] if @ret;