SF.net SVN: geany: [2356] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Mon Mar 17 17:13:56 UTC 2008
Revision: 2356
http://geany.svn.sourceforge.net/geany/?rev=2356&view=rev
Author: eht16
Date: 2008-03-17 10:13:56 -0700 (Mon, 17 Mar 2008)
Log Message:
-----------
Remove old and useless code from build_link_file().
Don't add "-o" compiler option automatically instead make it configurable through linker command.
Modified Paths:
--------------
trunk/ChangeLog
trunk/data/filetypes.c
trunk/data/filetypes.caml
trunk/data/filetypes.cpp
trunk/data/filetypes.d
trunk/data/filetypes.fortran
trunk/src/build.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/ChangeLog 2008-03-17 17:13:56 UTC (rev 2356)
@@ -11,6 +11,11 @@
At startup, only load enabled plugins, all others are only loaded
when the plugin manager is opened and get completely unloaded when
it is closed.
+ * data/filetypes.caml, data/filetypes.cpp, data/filetypes.c,
+ data/filetypes.d, data/filetypes.fortran, src/build.c:
+ Remove old and useless code from build_link_file().
+ Don't add "-o" compiler option automatically instead make it
+ configurable through linker command.
2008-03-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/data/filetypes.c
===================================================================
--- trunk/data/filetypes.c 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/data/filetypes.c 2008-03-17 17:13:56 UTC (rev 2356)
@@ -62,8 +62,7 @@
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=gcc -Wall -c "%f"
-# the -o option is automatically added by Geany
-linker=gcc -Wall "%f"
+linker=gcc -Wall -o "%e" "%f"
run_cmd="./%e"
Modified: trunk/data/filetypes.caml
===================================================================
--- trunk/data/filetypes.caml 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/data/filetypes.caml 2008-03-17 17:13:56 UTC (rev 2356)
@@ -49,5 +49,5 @@
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=ocamlc -c "%f"
-linker=ocamlc "%f"
+linker=ocamlc -o "%e" "%f"
run_cmd="./%e"
Modified: trunk/data/filetypes.cpp
===================================================================
--- trunk/data/filetypes.cpp 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/data/filetypes.cpp 2008-03-17 17:13:56 UTC (rev 2356)
@@ -62,7 +62,6 @@
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=g++ -Wall -c "%f"
-# the -o option is automatically added by Geany
-linker=g++ -Wall "%f"
+linker=g++ -Wall -o "%e" "%f"
run_cmd="./%e"
Modified: trunk/data/filetypes.d
===================================================================
--- trunk/data/filetypes.d 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/data/filetypes.d 2008-03-17 17:13:56 UTC (rev 2356)
@@ -61,11 +61,10 @@
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=dmd -w -c "%f"
-# the -of option is automatically added by Geany
-linker=dmd -w "%f"
+linker=dmd -w -of"%e" "%f"
# you can also use the gdc compiler, please use the "gdmd" wrapper script(included with gdc)
#compiler=gdmd -w -c "%f"
-#linker=gdmd -w "%f"
+#linker=gdmd -w -of"%e" "%f"
run_cmd="./%e"
Modified: trunk/data/filetypes.fortran
===================================================================
--- trunk/data/filetypes.fortran 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/data/filetypes.fortran 2008-03-17 17:13:56 UTC (rev 2356)
@@ -54,7 +54,6 @@
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=g77 -Wall -c "%f"
-# the -o option is automatically added by Geany
-linker=g77 -Wall "%f"
+linker=g77 -Wall -o "%e" "%f"
run_cmd="./%e"
Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c 2008-03-17 15:48:15 UTC (rev 2355)
+++ trunk/src/build.c 2008-03-17 17:13:56 UTC (rev 2356)
@@ -351,92 +351,21 @@
static GPid build_compile_file(gint idx)
{
- const gchar *cmd;
+ if (! DOC_IDX_VALID(idx) || doc_list[idx].file_name == NULL)
+ return (GPid) 1;
- if (idx < 0 || doc_list[idx].file_name == NULL) return (GPid) 1;
-
- cmd = doc_list[idx].file_type->programs->compiler;
-
build_info.type = GBO_COMPILE;
- return build_spawn_cmd(idx, cmd, NULL);
+ return build_spawn_cmd(idx, doc_list[idx].file_type->programs->compiler, NULL);
}
static GPid build_link_file(gint idx)
{
- GString *cmdstr;
- GPid pid;
- gchar *executable = NULL;
- gchar *object_file, *locale_filename;
- struct stat st, st2;
-
- if (idx < 0 || doc_list[idx].file_name == NULL) return (GPid) 1;
-
- locale_filename = utils_get_locale_from_utf8(doc_list[idx].file_name);
-
- executable = utils_remove_ext_from_filename(locale_filename);
- /* check for filename extension and abort if filename doesn't have one */
- if (utils_str_equal(locale_filename, executable))
- {
- ui_set_statusbar(TRUE, _("Command stopped because the current file has no extension."));
- utils_beep();
- utils_free_pointers(locale_filename, executable, NULL);
+ if (! DOC_IDX_VALID(idx) || doc_list[idx].file_name == NULL)
return (GPid) 1;
- }
- object_file = g_strdup_printf("%s.o", executable);
-
- /* check whether object file (file.o) exists */
- if (g_stat(object_file, &st) == 0)
- { /* check whether src is newer than object file */
- if (g_stat(locale_filename, &st2) == 0)
- {
- if (st2.st_mtime > st.st_mtime)
- {
- /* set object_file to NULL, so the source file will be used for linking,
- * more precisely then we compile and link instead of just linking */
- g_free(object_file);
- object_file = NULL;
- }
- }
- else
- {
- dialogs_show_msgbox(GTK_MESSAGE_ERROR,
- _("Something very strange is occurred, could not stat %s (%s)."),
- doc_list[idx].file_name, g_strerror(errno));
- }
- }
-
- cmdstr = g_string_new(doc_list[idx].file_type->programs->linker);
- g_string_append_c(cmdstr, ' ');
-
- if (doc_list[idx].file_type->id == GEANY_FILETYPES_D)
- { /* the dmd compiler needs -of instead of -o and it accepts no whitespace after -of */
- gchar *tmp = g_path_get_basename(executable);
- /* add double quotes around the executable file name in case of filenames with spaces */
- g_string_append(cmdstr, "-of \"");
- g_string_append(cmdstr, tmp);
- g_string_append_c(cmdstr, '\"');
- g_free(tmp);
- }
- else
- {
- gchar *tmp = g_path_get_basename(executable);
- /* add double quotes around the executable file name in case of filenames with spaces */
- g_string_append(cmdstr, "-o \"");
- g_string_append(cmdstr, tmp);
- g_string_append_c(cmdstr, '\"');
- g_free(tmp);
- }
-
- g_free(executable);
- g_free(object_file);
- g_free(locale_filename);
-
build_info.type = GBO_BUILD;
- pid = build_spawn_cmd(idx, cmdstr->str, NULL);
- g_string_free(cmdstr, TRUE);
- return pid;
+ return build_spawn_cmd(idx, doc_list[idx].file_type->programs->linker, NULL);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list