1<html lang="en"> 2<head> 3<title>System-wide configuration - Debugging with GDB</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Debugging with GDB"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Installing-GDB.html#Installing-GDB" title="Installing GDB"> 9<link rel="prev" href="Configure-Options.html#Configure-Options" title="Configure Options"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1988-2013 Free Software Foundation, Inc. 13 14Permission is granted to copy, distribute and/or modify this document 15under the terms of the GNU Free Documentation License, Version 1.3 or 16any later version published by the Free Software Foundation; with the 17Invariant Sections being ``Free Software'' and ``Free Software Needs 18Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 19and with the Back-Cover Texts as in (a) below. 20 21(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 22this GNU Manual. Buying copies from GNU Press supports the FSF in 23developing GNU and promoting software freedom.'' 24--> 25<meta http-equiv="Content-Style-Type" content="text/css"> 26<style type="text/css"><!-- 27 pre.display { font-family:inherit } 28 pre.format { font-family:inherit } 29 pre.smalldisplay { font-family:inherit; font-size:smaller } 30 pre.smallformat { font-family:inherit; font-size:smaller } 31 pre.smallexample { font-size:smaller } 32 pre.smalllisp { font-size:smaller } 33 span.sc { font-variant:small-caps } 34 span.roman { font-family:serif; font-weight:normal; } 35 span.sansserif { font-family:sans-serif; font-weight:normal; } 36--></style> 37<link rel="stylesheet" type="text/css" href="../cs.css"> 38</head> 39<body> 40<div class="node"> 41<a name="System-wide-configuration"></a> 42<a name="System_002dwide-configuration"></a> 43<p> 44Previous: <a rel="previous" accesskey="p" href="Configure-Options.html#Configure-Options">Configure Options</a>, 45Up: <a rel="up" accesskey="u" href="Installing-GDB.html#Installing-GDB">Installing GDB</a> 46<hr> 47</div> 48 49<h3 class="section">C.6 System-wide configuration and settings</h3> 50 51<p><a name="index-system_002dwide-init-file-2595"></a> 52<span class="sc">gdb</span> can be configured to have a system-wide init file; 53this file will be read and executed at startup (see <a href="Startup.html#Startup">What <span class="sc">gdb</span> does during startup</a>). 54 55 <p>Here is the corresponding configure option: 56 57 <dl> 58<dt><code>--with-system-gdbinit=</code><var>file</var><dd>Specify that the default location of the system-wide init file is 59<var>file</var>. 60</dl> 61 62 <p>If <span class="sc">gdb</span> has been configured with the option <samp><span class="option">--prefix=$prefix</span></samp>, 63it may be subject to relocation. Two possible cases: 64 65 <ul> 66<li>If the default location of this init file contains <samp><span class="file">$prefix</span></samp>, 67it will be subject to relocation. Suppose that the configure options 68are <samp><span class="option">--prefix=$prefix --with-system-gdbinit=$prefix/etc/gdbinit</span></samp>; 69if <span class="sc">gdb</span> is moved from <samp><span class="file">$prefix</span></samp> to <samp><span class="file">$install</span></samp>, the system 70init file is looked for as <samp><span class="file">$install/etc/gdbinit</span></samp> instead of 71<samp><span class="file">$prefix/etc/gdbinit</span></samp>. 72 73 <li>By contrast, if the default location does not contain the prefix, 74it will not be relocated. E.g. if <span class="sc">gdb</span> has been configured with 75<samp><span class="option">--prefix=/usr/local --with-system-gdbinit=/usr/share/gdb/gdbinit</span></samp>, 76then <span class="sc">gdb</span> will always look for <samp><span class="file">/usr/share/gdb/gdbinit</span></samp>, 77wherever <span class="sc">gdb</span> is installed. 78</ul> 79 80 <p>If the configured location of the system-wide init file (as given by the 81<samp><span class="option">--with-system-gdbinit</span></samp> option at configure time) is in the 82data-directory (as specified by <samp><span class="option">--with-gdb-datadir</span></samp> at configure 83time) or in one of its subdirectories, then <span class="sc">gdb</span> will look for the 84system-wide init file in the directory specified by the 85<samp><span class="option">--data-directory</span></samp> command-line option. 86Note that the system-wide init file is only read once, during <span class="sc">gdb</span> 87initialization. If the data-directory is changed after <span class="sc">gdb</span> has 88started with the <code>set data-directory</code> command, the file will not be 89reread. 90 91<ul class="menu"> 92<li><a accesskey="1" href="System_002dwide-Configuration-Scripts.html#System_002dwide-Configuration-Scripts">System-wide Configuration Scripts</a>: Installed System-wide Configuration Scripts 93</ul> 94 95 </body></html> 96 97