SF.net SVN: geany: [2111] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Tue Dec 18 17:03:39 UTC 2007


Revision: 2111
          http://geany.svn.sourceforge.net/geany/?rev=2111&view=rev
Author:   eht16
Date:     2007-12-18 09:03:39 -0800 (Tue, 18 Dec 2007)

Log Message:
-----------
Add note about using autotools macros like DATADIR.
Add --print-prefix command line option to output installation paths.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/HACKING
    trunk/doc/geany.1.in
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/main.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/ChangeLog	2007-12-18 17:03:39 UTC (rev 2111)
@@ -3,6 +3,13 @@
  * Makefile.am: Don't install pixmaps/geany.ico by default.
  * geany.spec.in: Fix mandir path and don't delete icons
                   (patch by Yura Siamashka, thanks).
+ * src/Makefile.am:
+   Add PREFIX macro.
+   Don't construct LOCALEDIR manually but use autotools $(localedir)
+   variable instead.
+ * HACKING: Add note about using autotools macros like DATADIR.
+ * doc/geany.1.in, doc/geany.html, doc/geany.txt, src/main.c:
+   Add --print-prefix command line option to output installation paths.
 
 
 2007-12-18  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/HACKING
===================================================================
--- trunk/HACKING	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/HACKING	2007-12-18 17:03:39 UTC (rev 2111)
@@ -87,6 +87,15 @@
 (and api_version if changing elements). This is not needed if you're
 just appending fields to structs.
 
+Using pre-defined autotools values
+----------------------------------
+When you are use macros supplied by the autotools like PREFIX, LIBDIR,
+DATADIR and LOCALEDIR be aware that these might not be static strings
+when Geany is configured with --enable-binreloc. Then these macros will
+be replaced by function calls (in src/prefix.h). So, don't use anything
+like printf("Prefix: " PREFIX); but instead use
+printf("Prefix: %s", PREFIX);
+
 Adding a file foo.[hc] in src/ or plugins/
 ------------------------------------------
 Add foo.c, foo.h to SRCS in path/Makefile.am.

Modified: trunk/doc/geany.1.in
===================================================================
--- trunk/doc/geany.1.in	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/doc/geany.1.in	2007-12-18 17:03:39 UTC (rev 2111)
@@ -39,6 +39,10 @@
 For more information please see documentation.
 .IP "\fB-p\fP           \fB\-\-no-plugins\fP         " 10
 Don't load plugin support.
+.IP "\fB\fP             \fB\-\-print-prefix\fP         " 10
+Print installation prefix, the data directory, the lib directory and the locale directory (in
+this order) to stdout, each per line. This is mainly intended for plugin authors to detect
+installation paths.
 .IP "\fB-s\fP           \fB\-\-no-session\fP         " 10
 Don't load the previous session's files.
 .IP "\fB-t\fP           \fB\-\-no-terminal\fP         " 10

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/doc/geany.html	2007-12-18 17:03:39 UTC (rev 2111)
@@ -6,7 +6,7 @@
 <meta name="generator" content="Docutils 0.4.1: http://docutils.sourceforge.net/" />
 <title>Geany</title>
 <meta name="authors" content="Enrico Tröger  Nick Treleaven  Frank Lanitz" />
-<meta name="date" content="2007-12-07" />
+<meta name="date" content="2007-12-16" />
 <style type="text/css">
 
 /*
@@ -133,7 +133,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2007-12-07</td></tr>
+<td>2007-12-16</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.13</td></tr>
 </tbody>
@@ -485,6 +485,13 @@
 <td>--no-plugins</td>
 <td>Do not load plugins or plugin support.</td>
 </tr>
+<tr><td><em>none</em></td>
+<td>--print-prefix</td>
+<td>Print installation prefix, the data directory, the lib
+directory and the locale directory (in this order) to
+stdout, each per line. This is mainly intended for plugin
+authors to detect installation paths.</td>
+</tr>
 <tr><td>-s</td>
 <td>--no-session</td>
 <td>Do not load the previous session's files.</td>
@@ -3225,7 +3232,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2007-12-16 16:51 UTC.
+Generated on: 2007-12-18 17:03 UTC.
 Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/doc/geany.txt	2007-12-18 17:03:39 UTC (rev 2111)
@@ -208,6 +208,11 @@
 
 -p            --no-plugins             Do not load plugins or plugin support.
 
+*none*        --print-prefix           Print installation prefix, the data directory, the lib
+                                       directory and the locale directory (in this order) to
+                                       stdout, each per line. This is mainly intended for plugin
+                                       authors to detect installation paths.
+
 -s            --no-session             Do not load the previous session's files.
 
 -t            --no-terminal            Do not load terminal support. Use this option if you do

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2007-12-18 17:01:36 UTC (rev 2110)
+++ trunk/src/main.c	2007-12-18 17:03:39 UTC (rev 2111)
@@ -108,6 +108,7 @@
 static gboolean generate_tags = FALSE;
 static gboolean no_preprocessing = FALSE;
 static gboolean ft_names = FALSE;
+static gboolean print_prefix = FALSE;
 #ifdef HAVE_PLUGINS
 static gboolean no_plugins = FALSE;
 #endif
@@ -131,6 +132,7 @@
 #ifdef HAVE_PLUGINS
 	{ "no-plugins", 'p', 0, G_OPTION_ARG_NONE, &no_plugins, N_("Don't load plugins"), NULL },
 #endif
+	{ "print-prefix", 0, 0, G_OPTION_ARG_NONE, &print_prefix, N_("Print Geany's installation prefix"), NULL },
 	{ "no-session", 's', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &cl_options.load_session, N_("don't load the previous session's files"), NULL },
 #ifdef HAVE_VTE
 	{ "no-terminal", 't', 0, G_OPTION_ARG_NONE, &no_vte, N_("Don't load terminal support"), NULL },
@@ -445,6 +447,15 @@
 		exit(0);
 	}
 
+	if (print_prefix)
+	{
+		printf("%s\n", PREFIX);
+		printf("%s\n", DATADIR);
+		printf("%s\n", LIBDIR);
+		printf("%s\n", LOCALEDIR);
+		exit(0);
+	}
+
 #ifdef GEANY_DEBUG
 	app->debug_mode = TRUE;
 	geany_debug("debug mode built in (can't be disabled)");


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