summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2012-08-03 09:52:14 +0200
committerJürg Billeter <j@bitron.ch>2012-08-06 13:24:05 +0200
commitca020bf04a09fe16e5583eea5a3a341e7796bff5 (patch)
tree4ac881e9d36811d0d6673dec7a7b1f97080ed132 /compiler
parent5ea6dc05d62c71ba4e633f70b86e4dd0a5e9c089 (diff)
downloadvala-ca020bf04a09fe16e5583eea5a3a341e7796bff5.tar.gz
Drop POSIX profile
Diffstat (limited to 'compiler')
-rw-r--r--compiler/valacompiler.vala90
1 files changed, 37 insertions, 53 deletions
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 830c8b9eb..c30614f08 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -207,10 +207,7 @@ class Vala.Compiler {
context.thread = thread;
context.mem_profiler = mem_profiler;
context.save_temps = save_temps;
- if (profile == "posix") {
- context.profile = Profile.POSIX;
- context.add_define ("POSIX");
- } else if (profile == "gobject-2.0" || profile == "gobject" || profile == null) {
+ if (profile == "gobject-2.0" || profile == "gobject" || profile == null) {
// default profile
context.profile = Profile.GOBJECT;
context.add_define ("GOBJECT");
@@ -234,33 +231,26 @@ class Vala.Compiler {
context.add_define ("VALA_0_%d".printf (i));
}
- if (context.profile == Profile.POSIX) {
- if (!nostdpkg) {
- /* default package */
- context.add_external_package ("posix");
- }
- } else if (context.profile == Profile.GOBJECT) {
- int glib_major = 2;
- int glib_minor = 18;
- if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
- Report.error (null, "Invalid format for --target-glib");
- }
+ int glib_major = 2;
+ int glib_minor = 18;
+ if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
+ Report.error (null, "Invalid format for --target-glib");
+ }
- context.target_glib_major = glib_major;
- context.target_glib_minor = glib_minor;
- if (context.target_glib_major != 2) {
- Report.error (null, "This version of valac only supports GLib 2");
- }
+ context.target_glib_major = glib_major;
+ context.target_glib_minor = glib_minor;
+ if (context.target_glib_major != 2) {
+ Report.error (null, "This version of valac only supports GLib 2");
+ }
- for (int i = 16; i <= glib_minor; i += 2) {
- context.add_define ("GLIB_2_%d".printf (i));
- }
+ for (int i = 16; i <= glib_minor; i += 2) {
+ context.add_define ("GLIB_2_%d".printf (i));
+ }
- if (!nostdpkg) {
- /* default packages */
- context.add_external_package ("glib-2.0");
- context.add_external_package ("gobject-2.0");
- }
+ if (!nostdpkg) {
+ /* default packages */
+ context.add_external_package ("glib-2.0");
+ context.add_external_package ("gobject-2.0");
}
if (packages != null) {
@@ -282,11 +272,7 @@ class Vala.Compiler {
return quit ();
}
- if (context.profile == Profile.GOBJECT) {
- context.codegen = new GDBusServerModule ();
- } else {
- context.codegen = new CCodeDelegateModule ();
- }
+ context.codegen = new GDBusServerModule ();
bool has_c_files = false;
@@ -357,29 +343,27 @@ class Vala.Compiler {
if (library != null) {
if (gir != null) {
- if (context.profile == Profile.GOBJECT) {
- long gir_len = gir.length;
- int last_hyphen = gir.last_index_of_char ('-');
-
- if (last_hyphen == -1 || !gir.has_suffix (".gir")) {
+ long gir_len = gir.length;
+ int last_hyphen = gir.last_index_of_char ('-');
+
+ if (last_hyphen == -1 || !gir.has_suffix (".gir")) {
+ Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
+ } else {
+ string gir_namespace = gir.substring (0, last_hyphen);
+ string gir_version = gir.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
+ gir_version.canon ("0123456789.", '?');
+ if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
} else {
- string gir_namespace = gir.substring (0, last_hyphen);
- string gir_version = gir.substring (last_hyphen + 1, gir_len - last_hyphen - 5);
- gir_version.canon ("0123456789.", '?');
- if (gir_namespace == "" || gir_version == "" || !gir_version[0].isdigit () || gir_version.contains ("?")) {
- Report.error (null, "GIR file name `%s' is not well-formed, expected NAME-VERSION.gir".printf (gir));
- } else {
- var gir_writer = new GIRWriter ();
-
- // put .gir file in current directory unless -d has been explicitly specified
- string gir_directory = ".";
- if (directory != null) {
- gir_directory = context.directory;
- }
-
- gir_writer.write_file (context, gir_directory, gir_namespace, gir_version, library);
+ var gir_writer = new GIRWriter ();
+
+ // put .gir file in current directory unless -d has been explicitly specified
+ string gir_directory = ".";
+ if (directory != null) {
+ gir_directory = context.directory;
}
+
+ gir_writer.write_file (context, gir_directory, gir_namespace, gir_version, library);
}
}