Mercurial > projects > dwt2
changeset 57:e2ca9bdc80f2
[samples] build now also on D1 linux
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 28 Mar 2009 01:28:11 +0100 |
parents | b65696de7e3a |
children | 8a5386b204bb |
files | rakefile |
diffstat | 1 files changed, 45 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/rakefile Sat Mar 28 00:04:15 2009 +0100 +++ b/rakefile Sat Mar 28 01:28:11 2009 +0100 @@ -24,11 +24,11 @@ ########################################################################## # Constants # -DIR_OBJ = File.expand_path("obj") +DIR_OBJ = File.expand_path("obj") DIR_IMP = File.expand_path("imp") -DIR_LIB = File.expand_path("lib") +DIR_LIB = File.expand_path("lib") BINDIR = File.expand_path("bin") -FILE_RSP = File.expand_path("rsp") +FILE_RSP = File.expand_path("rsp") ALL_RESDIRS = [ "base/res", "res" ] LOG_STDOUT = File.expand_path("olog.txt") @@ -60,12 +60,13 @@ "zlib", "dwt-base" ] else - LIBNAMES_BASIC = [ "gtk-x11-2.0", "gdk-x11-2.0", "atk-1.0", "gdk_pixbuf-2.0", + SONAMES_BASIC = [ "gtk-x11-2.0", "gdk-x11-2.0", "atk-1.0", "gdk_pixbuf-2.0", "gthread-2.0", "pangocairo-1.0", "fontconfig", "Xtst", "Xext", "Xrender", "Xinerama", "Xi", "Xrandr", "Xcursor", "Xcomposite", "Xdamage", "X11", "Xfixes", "pango-1.0", "gobject-2.0", "gmodule-2.0", "dl", "glib-2.0", "cairo", - "dwt-base" ] + "gnomeui-2" ] + LIBNAMES_BASIC = [ "dwt-base" ] end LIBNAMES_SWT = [ BASEDIR_SWT ] @@ -171,7 +172,7 @@ if isWindows rsp.puts "-p512" rsp.puts "-n" - rsp.puts "-c #{DIR_LIB}/#{name}#{LIBEXT}" + rsp.puts "-c #{DIR_LIB}\\#{name}#{LIBEXT}" libobjs.each do |obj| rsp.puts obj.to_path end @@ -193,7 +194,7 @@ end -def buildApp( basedir, srcdir, resdir, dflags, appname, filelist, libnames ) +def buildApp( basedir, srcdir, resdir, dflags, appnameprefix, appname, filelist, libnames ) if filelist == nil filelist = FileList[ "**/#{appname}.d" ] end @@ -212,21 +213,33 @@ rsp.puts "-J#{File.expand_path(dir).to_path}" end - rsp.puts "-L/NOM" - libnames.each do | libname | - rsp.puts "-L+#{libname}#{LIBEXT}" - end - rsp.puts "-L+dwt-base.lib" - rsp.puts "-L+#{BASEDIR_SWT}.lib" - rsp.puts "-L+#{DIR_LIB.to_path}\\" - rsp.puts "-op" rsp.puts "-od#{DIR_OBJ.to_path}" - applfile = File.join(BINDIR,appname+EXEEXT) + applfile = File.join(BINDIR,appnameprefix+appname+EXEEXT) rsp.puts "-of#{applfile.to_path}" filelist.each do |path| rsp.puts File.expand_path(path).to_path[ srcdir_abs.size+1 .. -1 ] end + + if isWindows + rsp.puts "-L/NOM" + libnames.each do | libname | + rsp.puts "-L+#{libname}#{LIBEXT}" + end + rsp.puts "-L+dwt-base.lib" + rsp.puts "-L+#{BASEDIR_SWT}.lib" + rsp.puts "-L+#{DIR_LIB.to_path}\\" + else + rsp.puts "-L-L#{DIR_LIB.to_path}" + libnames.reverse.each do | libname | + absname = File.join( DIR_LIB, "#{libname}#{LIBEXT}" ); + rsp.puts absname + end + SONAMES_BASIC.reverse.each do | soname | + rsp.puts "-L-l#{soname}" + end + end + rsp.close Dir.chdir(srcdir_abs) do @@ -320,20 +333,27 @@ libnames = LIBNAMES_BASIC + LIBNAMES_SWT snps_browser = [ "Snippet128", "Snippet136" ] snps_opengl = [ "Snippet174", "Snippet195" ] + snps_ole = [ "Snippet81" ] - snps_exclude = snps_browser + snps_opengl + if isWindows + snps_exclude = snps_browser + snps_opengl + snps_ole + else + snps_exclude = snps_browser + snps_opengl + snps_ole + end + + PREFIX = "Swt" allsnippets = FileList[ File.join("org.eclipse.swt.snippets", "src", "**/Snippet*.d" )] if args.explicit_snp != nil snpname = args.explicit_snp puts "Building swtsnippets[#{snpname}]" - buildApp( "org.eclipse.swt.snippets", "src", "res", "", snpname, nil, libnames ) + buildApp( "org.eclipse.swt.snippets", "src", "res", "", PREFIX, snpname, nil, libnames ) else allsnippets.each do | snp | if snp =~ /.*(Snippet\w+)\.d$/ snpname = $1 puts "Building swtsnippets[#{snpname}]" if !snps_exclude.include? snpname - buildApp( "org.eclipse.swt.snippets", "src", "res", "", snpname, nil, libnames ) + buildApp( "org.eclipse.swt.snippets", "src", "res", "", PREFIX, snpname, nil, libnames ) end else raise "Name does not match #{snp}" @@ -345,20 +365,23 @@ desc "Build JFace Snippet Collection" task :jfacesnippets, :explicit_snp do | t, args | + PREFIX = "JFace" + SRCPATH = "EclipseJfaceSnippets" + BASEPATH = "org.eclipse.jface.snippets" libnames = LIBNAMES_BASIC + LIBNAMES_SWT + LIBNAMES_EQUINOX + LIBNAMES_CORE + LIBNAMES_JFACE snps_exclude = [] - allsnippets = FileList[ File.join("org.eclipse.jface.snippets", "EclipseJfaceSnippets", "**/*.d" )] + allsnippets = FileList[ File.join(BASEPATH, SRCPATH, "**/*.d" )] if args.explicit_snp != nil snpname = args.explicit_snp puts "Building jfacesnippets[#{snpname}]" - buildApp( "org.eclipse.jface.snippets", "src", "res", "", args.explicit_snp, nil, libnames ) + buildApp( BASEPATH, SRCPATH, "res", "", PREFIX, args.explicit_snp, nil, libnames ) else allsnippets.each do | snp | if snp =~ /.*[\\\/](\w+)\.d$/ snpname = $1 puts "Building jfacesnippets[#{snpname}]" if !snps_exclude.include? snpname - buildApp( "org.eclipse.jface.snippets", "src", "res", "", snpname, nil, libnames ) + buildApp( BASEPATH, SRCPATH, "res", "", PREFIX, snpname, nil, libnames ) end else puts snp