@@ -58,7 +58,6 @@ class Configure
58
58
@gem = nil
59
59
60
60
# LLVM settings
61
- @llvm_enabled = true
62
61
@llvm_path = nil
63
62
@llvm_system_name = get_system_name
64
63
@llvm_configure = nil
@@ -336,10 +335,6 @@ class Configure
336
335
337
336
o . doc "\n LLVM settings"
338
337
339
- o . on "--disable-llvm" , "Don't build with LLVM" do
340
- @llvm_enabled = false
341
- end
342
-
343
338
o . on "--system-name" , "NAME" , "Name of OS (eg fedora-8, ubuntu-10.04)" do |name |
344
339
@llvm_system_name = name
345
340
end
@@ -565,11 +560,6 @@ class Configure
565
560
end
566
561
567
562
def setup_llvm
568
- unless @llvm_enabled
569
- @log . write "WARNING: LLVM disabled."
570
- return false
571
- end
572
-
573
563
@log . print " Checking for 'llvm-config': "
574
564
575
565
config = @llvm_configure
@@ -583,8 +573,8 @@ class Configure
583
573
if macports?
584
574
config = macports_llvm_config
585
575
else
586
- out = Bundler . with_clean_env { `brew --prefix llvm35 ` } . chomp
587
- config = "#{ out } /bin/llvm-config-3.5 " if $?. success?
576
+ out = Bundler . with_clean_env { `brew --prefix llvm ` } . chomp
577
+ config = "#{ out } /bin/llvm-config" if $?. success?
588
578
end
589
579
end
590
580
end
@@ -604,8 +594,8 @@ class Configure
604
594
unless failed
605
595
parts = version . sub ( /svn$/ , "" ) . split ( "." ) . map { |i | i . to_i }
606
596
api_version = ( "%d%02d" % parts [ 0 ..1 ] ) . to_i
607
- if api_version < 300 or api_version > 305
608
- @log . write "only LLVM 3.0-3.5 is supported"
597
+ if api_version < 306
598
+ @log . write "only LLVM 3.6+ is supported"
609
599
else
610
600
@log . write "found! (version #{ version } - api: #{ api_version } )"
611
601
@llvm = :config
@@ -666,19 +656,16 @@ int main() { LLVMContext &Context = getGlobalContext(); }
666
656
def check_llvm_flags
667
657
flags = '--ldflags'
668
658
669
- if @llvm_api_version >= 305
670
- # Starting with LLVM 3.5 the --system-libs option is required in order to
671
- # link against libraries such as zlib. Prior to 3.5 this was handled by
672
- # --ldflags.
673
- flags << ' --system-libs'
674
- end
659
+ @llvm_cxxflags << " -std=c++11"
660
+
661
+ # Starting with LLVM 3.5 the --system-libs option is required in order to
662
+ # link against libraries such as zlib. Prior to 3.5 this was handled by
663
+ # --ldflags.
664
+ flags << ' --system-libs'
675
665
676
666
# Generate the actual flags. For whatever reason llvm-config also includes
677
667
# newlines in the output, so lets get rid of those while we're at it.
678
668
@llvm_ldflags = `#{ @llvm_configure } #{ flags } ` . strip . gsub ( "\n " , ' ' )
679
-
680
- # We use some C++11 features in the VM source, so we need to enable support.
681
- @llvm_cxxflags << " -std=c++11"
682
669
end
683
670
684
671
def env ( which )
@@ -717,7 +704,7 @@ int main() { LLVMContext &Context = getGlobalContext(); }
717
704
check_tool_version @cc , '-dumpversion' , [ 4 , 1 ]
718
705
check_tool_version @cxx , '-dumpversion' , [ 4 , 1 ]
719
706
720
- unless @cc == " clang" and @cxx == " clang++"
707
+ unless @cc =~ / clang/ and @cxx =~ / clang\+ \+ /
721
708
@log . deprecated <<-EOM
722
709
Support for compilers other than clang/clang++ is deprecated and will be
723
710
removed soon. If your platform does not have support for clang/clang++,
@@ -1532,10 +1519,6 @@ int main() { return tgetnum(""); }
1532
1519
def write_configure_files
1533
1520
@log . write "\n Writing configuration files..."
1534
1521
1535
- unless @llvm_enabled
1536
- @llvm_configure = ""
1537
- end
1538
-
1539
1522
@bin_links . delete @program_name
1540
1523
1541
1524
config_settings = {
@@ -1544,7 +1527,6 @@ int main() { return tgetnum(""); }
1544
1527
:build_make => @make ,
1545
1528
:build_rake => @rake ,
1546
1529
:build_perl => @perl ,
1547
- :llvm_enabled => @llvm_enabled ,
1548
1530
:llvm_path => @llvm_path ,
1549
1531
:llvm_system_name => @llvm_system_name ,
1550
1532
:llvm_configure => @llvm_configure ,
@@ -2073,7 +2055,7 @@ Available commands are:
2073
2055
# Query MacPorts for the path to the latest installed version of
2074
2056
# llvm-config that is within the range of supported LLVM versions.
2075
2057
def macports_llvm_config
2076
- supported_versions = ( 3.0 .. 3.5 )
2058
+ supported_versions = ( 3.6 .. 3.9 )
2077
2059
installed_ports = `port installed | egrep -o 'llvm-[^ ]+'` . split
2078
2060
latest_usable_port = installed_ports . sort . select do |fname |
2079
2061
version = fname . match ( /-\K .*/ ) [ 0 ] . to_f
0 commit comments