28 #if defined (HAVE_CONFIG_H)
38 #if ! defined (OCTAVE_PREFIX)
39 # define OCTAVE_PREFIX %OCTAVE_PREFIX%
42 #if ! defined (OCTAVE_EXEC_PREFIX)
43 # define OCTAVE_EXEC_PREFIX %OCTAVE_EXEC_PREFIX%
47 # define OCTAVE_UNUSED
52 static std::map<std::string,std::string>
vars;
54 static std::string
usage_msg =
"usage: octave-config [options]";
60 " -h, -?, --help Print this message.\n"
62 " --m-site-dir Print the name of the directory where Octave\n"
63 " expects to find locally installed .m files.\n"
65 " --oct-site-dir Print the name of the directory where Octave\n"
66 " expects to find locally installed .oct files.\n"
68 " -p VAR, --print VAR Print the value of the given configuration\n"
69 " variable VAR. Recognized variables are:\n"
71 " API_VERSION LOCALFCNFILEDIR\n"
72 " ARCHLIBDIR LOCALOCTFILEDIR\n"
73 " BINDIR LOCALSTARTUPFILEDIR\n"
74 " CANONICAL_HOST_TYPE LOCALVERARCHLIBDIR\n"
75 " DATADIR LOCALVERFCNFILEDIR\n"
76 " DATAROOTDIR LOCALVEROCTFILEDIR\n"
77 " DEFAULT_PAGER MAN1DIR\n"
78 " EXEC_PREFIX MAN1EXT\n"
80 " FCNFILEDIR OCTAVE_EXEC_HOME\n"
81 " IMAGEDIR OCTAVE_HOME\n"
82 " INCLUDEDIR OCTDATADIR\n"
83 " INFODIR OCTDOCDIR\n"
84 " INFOFILE OCTFILEDIR\n"
85 " LIBDIR OCTFONTSDIR\n"
86 " LIBEXECDIR OCTINCLUDEDIR\n"
87 " LOCALAPIARCHLIBDIR OCTLIBDIR\n"
88 " LOCALAPIFCNFILEDIR STARTUPFILEDIR\n"
89 " LOCALAPIOCTFILEDIR VERSION\n"
92 " -v, --version Print the Octave version number.\n"
106 vars[
"EXEEXT"] = %OCTAVE_EXEEXT%;
153 for (
int i = 1; i < argc; i++)
155 std::string arg (argv[i]);
157 if (arg ==
"-h" || arg ==
"-?" || arg ==
"--help")
163 else if (arg ==
"--m-site-dir")
164 std::cout <<
vars[
"LOCALVERFCNFILEDIR"] << std::endl;
165 else if (arg ==
"--oct-site-dir")
166 std::cout <<
vars[
"LOCALVEROCTFILEDIR"] << std::endl;
167 else if (arg ==
"-v" || arg ==
"--version")
168 std::cout <<
vars[
"VERSION"] << std::endl;
169 else if (arg ==
"-p" || arg ==
"--print")
174 std::cout <<
vars[arg] << std::endl;
178 std::cerr <<
"octave-config: " << arg
179 <<
" options requires argument" << std::endl;
185 std::cerr <<
"octave-config: unrecognized argument " << arg
#define OCTAVE_LOCALSTARTUPFILEDIR
#define OCTAVE_LOCALVERFCNFILEDIR
#define OCTAVE_OCTINCLUDEDIR
#define OCTAVE_LOCALAPIOCTFILEDIR
#define OCTAVE_LIBEXECDIR
#define OCTAVE_LOCALVEROCTFILEDIR
#define OCTAVE_OCTFONTSDIR
#define OCTAVE_OCTDATADIR
#define OCTAVE_FCNFILEDIR
#define OCTAVE_LOCALOCTFILEDIR
#define OCTAVE_LOCALAPIARCHLIBDIR
#define OCTAVE_STARTUPFILEDIR
#define OCTAVE_INCLUDEDIR
#define OCTAVE_DEFAULT_PAGER
#define OCTAVE_OCTFILEDIR
#define OCTAVE_LOCALARCHLIBDIR
#define OCTAVE_LOCALVERARCHLIBDIR
#define OCTAVE_LOCALFCNFILEDIR
#define OCTAVE_LOCALAPIFCNFILEDIR
#define OCTAVE_DATAROOTDIR
#define OCTAVE_ARCHLIBDIR
static std::string help_msg
static std::map< std::string, std::string > vars
int main(int argc, char **argv)
static void initialize(void)
static std::string usage_msg
static std::string Voctave_home
static void set_octave_home(void)
static std::string prepend_octave_exec_home(const std::string &s)
static std::string Voctave_exec_home
static OCTAVE_UNUSED std::string prepend_octave_home(const std::string &s)
#define OCTAVE_CANONICAL_HOST_TYPE
#define OCTAVE_API_VERSION