Skip to content
Snippets Groups Projects
Commit 2185dc93 authored by Lyle Johnson's avatar Lyle Johnson
Browse files

Cleaned up platform-specific config methods (mostly)

parent ae85b971
No related branches found
No related tags found
No related merge requests found
...@@ -72,112 +72,14 @@ def fxscintilla_support_suppressed? ...@@ -72,112 +72,14 @@ def fxscintilla_support_suppressed?
ARGV.include? "--without-fxscintilla" ARGV.include? "--without-fxscintilla"
end end
def do_cygwin_setup
extra_libs = %w{stdc++ glu32 opengl32 wsock32 comctl32 mpr gdi32 winspool}
extra_libs.each do |lib|
$libs = append_library($libs, lib)
end
have_header("sys/time.h")
have_header("signal.h")
if have_library("z", "deflate")
have_library("png", "png_create_read_struct")
end
have_library("jpeg", "jpeg_mem_init")
have_library("tiff", "TIFFSetErrorHandler")
$libs = append_library($libs, "FOX-1.6")
$CFLAGS = $CFLAGS + " -fpermissive -DWIN32 -I#{File.join(File.dirname(__FILE__), 'include')}"
if is_fxscintilla_build?
FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
$libs = append_library($libs, "fxscintilla")
else
FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
end
end
def do_mswin32_setup
extra_libs = %w{glu32 opengl32 mpr wsock32 comctl32 winspool shell32 advapi32 shell32 gdi32 user32}
extra_libs.each do |lib|
$libs = append_library($libs, lib)
end
have_header("sys/time.h")
have_header("signal.h")
have_library("zlib", "deflate")
have_library("libpng", "png_create_read_struct")
have_library("libjpeg", "jpeg_mem_init")
have_library("libtiff", "TIFFSetErrorHandler")
# $CFLAGS = $CFLAGS + " /DWIN32 /GR /GX /DFOXDLL /Iinclude"
# $LOCAL_LIBS = $LOCAL_LIBS + "foxdll.lib"
$CFLAGS = $CFLAGS + " /DWIN32 /DUNICODE /GR /GX /I#{File.join(File.dirname(__FILE__), 'include')}"
$LOCAL_LIBS = $LOCAL_LIBS + "FOX-1.6.lib"
if is_fxscintilla_build?
FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " /DWITH_FXSCINTILLA /DHAVE_FOX_1_6"
$libs = append_library($libs, "fxscintilla")
else
FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
end
end
def do_unix_setup
$libs = append_library($libs, "stdc++")
# $libs = append_library($libs, "supc++")
have_header("sys/time.h")
have_header("signal.h")
have_library("png", "png_create_read_struct")
have_library("z", "deflate")
have_library("jpeg", "jpeg_mem_init")
have_library("tiff", "TIFFSetErrorHandler")
find_library("Xext", "XShmQueryVersion", "/usr/X11R6/lib")
find_library("X11", "XFindContext", "/usr/X11R6/lib")
find_library("GL", "glXCreateContext", "/usr/X11R6/lib")
find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
$libs = append_library($libs, "FOX-1.6")
$libs = append_library($libs, "Xrandr")
$CFLAGS = $CFLAGS + " -O0 -I#{File.join(File.dirname(__FILE__), 'include')}"
if is_fxscintilla_build?
FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
$libs = append_library($libs, "fxscintilla")
else
FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
end
end
def do_darwin_setup
$libs = append_library($libs, "stdc++")
have_header("sys/time.h")
have_header("signal.h")
have_library("png", "png_create_read_struct")
have_library("z", "deflate")
have_library("jpeg", "jpeg_mem_init")
have_library("tiff", "TIFFSetErrorHandler")
find_library("Xext", "XShmQueryVersion", "/usr/X11R6/lib")
find_library("X11", "XFindContext", "/usr/X11R6/lib")
find_library("GL", "glXCreateContext", "/usr/X11R6/lib")
find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
$libs = append_library($libs, "FOX-1.6")
$libs = append_library($libs, "Xrandr")
$libs = append_library($libs, "Xcursor")
$libs = append_library($libs, "png")
$CFLAGS = $CFLAGS + " -O0 -I#{File.join(File.dirname(__FILE__), 'include')}"
if is_fxscintilla_build?
FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
$libs = append_library($libs, "fxscintilla")
else
FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
end
end
def do_rake_compiler_setup def do_rake_compiler_setup
$CFLAGS = $CFLAGS + " -I/usr/local/include" # Added for MinGW, to find libpng if RUBY_PLATFORM =~ /mingw/
$LDFLAGS = $LDFLAGS + " -I/usr/local/lib" # Added for MinGW, to find libpng $CFLAGS = $CFLAGS + " -I/usr/local/include"
# Prepend these Windows libs for MinGW build $LDFLAGS = $LDFLAGS + " -I/usr/local/lib"
%w{stdc++ glu32 opengl32 wsock32 comctl32 mpr gdi32 winspool}.each {|lib| $libs = append_library($libs, lib) } %w{stdc++ glu32 opengl32 wsock32 comctl32 mpr gdi32 winspool}.each {|lib| $libs = append_library($libs, lib) }
end
$libs = append_library($libs, "stdc++") $libs = append_library($libs, "stdc++")
# have_header("sys/time.h") # Breaks MinGW build have_header("sys/time.h") unless RUBY_PLATFORM =~ /mingw/
have_header("signal.h") have_header("signal.h")
if have_library("z", "deflate") if have_library("z", "deflate")
have_library("png", "png_create_read_struct") have_library("png", "png_create_read_struct")
...@@ -189,8 +91,8 @@ def do_rake_compiler_setup ...@@ -189,8 +91,8 @@ def do_rake_compiler_setup
find_library("GL", "glXCreateContext", "/usr/X11R6/lib") find_library("GL", "glXCreateContext", "/usr/X11R6/lib")
find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib") find_library("GLU", "gluNewQuadric", "/usr/X11R6/lib")
$libs = append_library($libs, "FOX-1.6") $libs = append_library($libs, "FOX-1.6")
# $libs = append_library($libs, "Xrandr") # breaks MinGW build $libs = append_library($libs, "Xrandr") unless RUBY_PLATFORM =~ /mingw/
# $libs = append_library($libs, "Xcursor") # breaks MinGW build $libs = append_library($libs, "Xcursor") unless RUBY_PLATFORM =~ /mingw/
$libs = append_library($libs, "png") $libs = append_library($libs, "png")
$CFLAGS = $CFLAGS + " -O0 -I#{File.join(File.dirname(__FILE__), 'include')}" $CFLAGS = $CFLAGS + " -O0 -I#{File.join(File.dirname(__FILE__), 'include')}"
if is_fxscintilla_build? if is_fxscintilla_build?
...@@ -227,16 +129,6 @@ end ...@@ -227,16 +129,6 @@ end
# Platform-specific modifications # Platform-specific modifications
do_rake_compiler_setup do_rake_compiler_setup
# if RUBY_PLATFORM =~ /cygwin/ || RUBY_PLATFORM =~ /mingw/
# do_cygwin_setup
# elsif RUBY_PLATFORM =~ /mswin32/
# do_mswin32_setup
# elsif RUBY_PLATFORM =~ /darwin/
# do_darwin_setup
# else
# do_unix_setup
# end
# Check for Ruby 1.9 # Check for Ruby 1.9
$CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./ $CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment