[Fxruby-commits] CVS: FXRuby/ext/fox extconf.rb.in,NONE,1.1.2.1 extconf.rb.tmpl,1.17.2.1,NONE
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <ly...@us...> - 2002-05-10 05:04:05
|
Update of /cvsroot/fxruby/FXRuby/ext/fox
In directory usw-pr-cvs1:/tmp/cvs-serv11239/ext/fox
Added Files:
Tag: release10
extconf.rb.in
Removed Files:
Tag: release10
extconf.rb.tmpl
Log Message:
--- NEW FILE: extconf.rb.in ---
#!/bin/env ruby
require 'ftools'
require 'mkmf'
def getInstalledFOXVersion
incdir = "/usr/local/include/fox"
ARGV.each { |arg|
if arg =~ /--with-fox-include/
incdir = arg.split('=')[1]
end
}
filename = File.join(incdir, "fxver.h")
if FileTest.exists?(filename)
foxMajor, foxMinor, foxLevel = nil, nil, nil
File.foreach(filename) { |line|
if line =~ /FOX_MAJOR/
foxMajor = line.split()[2]
elsif line =~ /FOX_MINOR/
foxMinor = line.split()[2]
elsif line =~ /FOX_LEVEL/
foxLevel = line.split()[2]
end
}
if foxMajor && foxMinor && foxLevel
return foxMajor + "." + foxMinor + "." + foxLevel
else
return ""
end
else
puts "I couldn't locate the standard FOX header file \"fxver.h\" at this location:"
puts ""
puts " #{filename}"
puts ""
puts "Please specify the locations for the FOX header files and library using the"
puts "--with-fox-include and --with-fox-lib options to extconf.rb as described in"
puts "the FXRuby installation instructions."
exit
end
end
def is_scintilla_build?
args = ARGV.delete_if { |e| !(e =~ /--with-scintilla/) }
args.length > 0
end
# This directive processes the "--with-fox-include" and "--with-fox-lib"
# command line switches and modifies the CFLAGS and LDFLAGS accordingly.
dir_config('fox', '/usr/local/include/fox', '/usr/local/lib')
# This directive processes the "--with-scintilla-include" and
# "--with-scintilla-lib" command line switches and modifies the CFLAGS
# and LDFLAGS accordingly.
dir_config('scintilla', '/usr/local/include', '/usr/local/lib')
# Verify version number for FOX from the installed header files
installedVer = getInstalledFOXVersion().split('.')
thisVer = "@@FOX_VERSION@@".split('.')
if (installedVer[0] != thisVer[0]) || (installedVer[1] != thisVer[1])
puts "The version number for this installation of FOX appears to be inconsistent"
puts "with this release of FXRuby (@@FXRUBY_VERSION@@)."
exit
end
# Platform-specific modifications
if RUBY_PLATFORM =~ /cygwin/
$libs = append_library($libs, "stdc++")
$libs = append_library($libs, "glu32")
$libs = append_library($libs, "opengl32")
$libs = append_library($libs, "comctl32")
$libs = append_library($libs, "mpr")
$libs = append_library($libs, "gdi32")
$libs = append_library($libs, "winspool")
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")
$CFLAGS = $CFLAGS + " -fno-strict-prototype -fpermissive -DWIN32 -Iinclude"
if is_scintilla_build?
File.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exists?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " -DWITH_FXSCINTILLA"
$libs = append_library($libs, "scintilla")
else
File.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exists?('scintilla_wrap.cpp')
end
elsif RUBY_PLATFORM =~ /mswin32/
$libs = append_library($libs, "glu32")
$libs = append_library($libs, "opengl32")
$libs = append_library($libs, "mpr")
$libs = append_library($libs, "wsock32")
$libs = append_library($libs, "comctl32")
$libs = append_library($libs, "winspool")
$libs = append_library($libs, "shell32")
$libs = append_library($libs, "advapi32")
$libs = append_library($libs, "shell32")
$libs = append_library($libs, "gdi32")
$libs = append_library($libs, "user32")
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 /GR /GX /Iinclude"
$LOCAL_LIBS = $LOCAL_LIBS + "foxst.lib"
if is_scintilla_build?
File.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exists?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " /DWITH_FXSCINTILLA"
$libs = append_library($libs, "scintilla-static")
else
File.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exists?('scintilla_wrap.cpp')
end
else
$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")
$CFLAGS = $CFLAGS + "-O0 -Iinclude"
if is_scintilla_build?
File.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exists?('scintilla_wrap.cpp.bak')
$CFLAGS = $CFLAGS + " -DWITH_FXSCINTILLA"
$libs = append_library($libs, "scintilla")
else
File.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exists?('scintilla_wrap.cpp')
end
end
# Last step: build the makefile
create_makefile("fox")
--- extconf.rb.tmpl DELETED ---
|