28 #if defined (HAVE_CONFIG_H)
56 # include <sys/types.h>
57 # include <sys/wait.h>
59 # ifndef OCTAVE_UNUSED
60 # define OCTAVE_UNUSED
69 static std::map<std::string, std::string>
vars;
71 #if ! defined (OCTAVE_VERSION)
72 # define OCTAVE_VERSION %OCTAVE_CONF_VERSION%
75 #if ! defined (OCTAVE_PREFIX)
76 # define OCTAVE_PREFIX %OCTAVE_CONF_PREFIX%
79 #if ! defined (OCTAVE_EXEC_PREFIX)
80 # define OCTAVE_EXEC_PREFIX %OCTAVE_CONF_EXEC_PREFIX%
90 return mkostemps (tmpl, suffixlen, 0);
95 size_t srclen,
size_t *lengthp)
110 return WIFEXITED (status);
116 return WEXITSTATUS (status);
124 std::ostringstream buf;
128 int c = std::fgetc (fp);
130 if (c ==
'\n' || c == EOF)
133 buf << static_cast<char> (c);
142 const char *val = getenv (
name);
145 return std::string (val);
153 if (s.find (
' ') != std::string::npos && s[0] !=
'"')
154 return '"' + s +
'"';
162 const std::string match =
"${prefix}";
163 size_t pos = s.find (match);
164 while (pos != std::string::npos )
167 pos = s.find (match);
184 vars[
"EXEEXT"] = %OCTAVE_EXEEXT%;
215 vars[
"OCTINCLUDEDIR"]
230 #if defined (OCTAVE_USE_WINDOWS_API)
231 std::string DEFAULT_INCFLAGS
235 std::string DEFAULT_INCFLAGS
240 if (
vars[
"INCLUDEDIR"] !=
"/usr/include")
243 std::string DEFAULT_LDFLAGS;
245 #if (defined (OCTAVE_USE_WINDOWS_API) || defined (CROSS)) || (defined __APPLE__ && defined __MACH__)
252 if (
vars[
"LIBDIR"] !=
"/usr/lib")
280 vars[
"XTRA_CFLAGS"] =
get_variable (
"XTRA_CFLAGS", %OCTAVE_CONF_XTRA_CFLAGS%);
283 %OCTAVE_CONF_XTRA_CXXFLAGS%);
290 %OCTAVE_CONF_DEPEND_FLAGS%);
292 vars[
"DEPEND_EXTRA_SED_PATTERN"]
294 %OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%);
297 %OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%);
300 %OCTAVE_CONF_RDYNAMIC_FLAG%);
302 vars[
"LIBOCTAVE"] =
"-loctave";
304 vars[
"LIBOCTINTERP"] =
"-loctinterp";
306 vars[
"READLINE_LIBS"] =
"-lreadline";
308 vars[
"LAPACK_LIBS"] =
get_variable (
"LAPACK_LIBS", %OCTAVE_CONF_LAPACK_LIBS%);
312 vars[
"FFTW3_LDFLAGS"]
318 vars[
"FFTW3F_LDFLAGS"]
322 vars[
"FFTW3F_LIBS"] =
get_variable (
"FFTW3F_LIBS", %OCTAVE_CONF_FFTW3F_LIBS%);
330 %OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%);
333 %OCTAVE_CONF_OCTAVE_LINK_OPTS%);
336 %OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%);
338 vars[
"OCT_LINK_OPTS"]
346 %OCTAVE_CONF_LD_STATIC_FLAG%);
350 if (
vars[
"LFLAGS"] != DEFAULT_LDFLAGS)
351 std::cerr <<
"warning: LFLAGS is deprecated and will be removed in a future version of Octave, use LDFLAGS instead" << std::endl;
354 %OCTAVE_CONF_F77_INTEGER_8_FLAG%);
355 vars[
"ALL_FFLAGS"] =
vars[
"FFLAGS"] +
' ' +
vars[
"F77_INTEGER8_FLAG"];
358 =
vars[
"INCFLAGS"] +
' ' +
vars[
"XTRA_CFLAGS"] +
' ' +
vars[
"CFLAGS"];
361 =
vars[
"INCFLAGS"] +
' ' +
vars[
"XTRA_CXXFLAGS"] +
' ' +
vars[
"CXXFLAGS"];
364 =
vars[
"LD_STATIC_FLAG"] +
' ' +
vars[
"CPICFLAG"] +
' ' +
vars[
"LDFLAGS"];
367 = (
vars[
"LIBOCTINTERP"] +
' ' +
vars[
"LIBOCTAVE"] +
' '
368 +
vars[
"SPECIAL_MATH_LIB"]);
370 vars[
"FFTW_LIBS"] =
vars[
"FFTW3_LDFLAGS"] +
' ' +
vars[
"FFTW3_LIBS"] +
' '
371 +
vars[
"FFTW3F_LDFLAGS"] +
' ' +
vars[
"FFTW3F_LIBS"];
374 static std::string
usage_msg =
"usage: mkoctfile [options] file ...";
384 " -h, -?, --help Print this message.\n"
386 " -IDIR Add -IDIR to compile commands.\n"
388 " -idirafter DIR Add -idirafter DIR to compile commands.\n"
390 " -DDEF Add -DDEF to compile commands.\n"
392 " -lLIB Add library LIB to link command.\n"
394 " -LDIR Add -LDIR to link command.\n"
396 " -M, --depend Generate dependency files (.d) for C and C++\n"
398 #if ! defined (OCTAVE_USE_WINDOWS_API)
400 " -pthread Add -pthread to link command.\n"
403 " -RDIR Add -RDIR to link command.\n"
405 " -Wl,... Pass flags though the linker like -Wl,-rpath=...\n"
407 " -W... Pass flags though the compiler like -Wa,OPTION.\n"
409 " -c, --compile Compile, but do not link.\n"
411 " -o FILE, --output FILE Output filename. Default extension is .oct\n"
412 " (or .mex if --mex is specified) unless linking\n"
413 " a stand-alone executable.\n"
415 " -g Enable debugging options for compilers.\n"
417 " -p VAR, --print VAR Print configuration variable VAR. There are\n"
418 " three categories of variables:\n"
420 " Octave configuration variables that users may\n"
421 " override with environment variables. These are\n"
422 " used in commands that mkoctfile executes.\n"
424 " ALL_CFLAGS INCLUDEDIR\n"
425 " ALL_CXXFLAGS LAPACK_LIBS\n"
426 " ALL_FFLAGS LDFLAGS\n"
427 " ALL_LDFLAGS LD_STATIC_FLAG\n"
428 " BLAS_LIBS LIBDIR\n"
430 " CFLAGS LIBOCTINTERP\n"
431 " CPICFLAG OCTAVE_LINK_OPTS\n"
432 " CPPFLAGS OCTINCLUDEDIR\n"
434 " CXXFLAGS OCTAVE_LINK_DEPS\n"
436 " CXXPICFLAG OCT_LINK_DEPS\n"
437 " DL_LDFLAGS OCT_LINK_OPTS\n"
438 " F77 RDYNAMIC_FLAG\n"
439 " F77_INTEGER8_FLAG SPECIAL_MATH_LIB\n"
440 " FFLAGS XTRA_CFLAGS\n"
441 " FPICFLAG XTRA_CXXFLAGS\n"
444 " Octave configuration variables as above, but\n"
445 " currently unused by mkoctfile.\n"
448 " DEPEND_EXTRA_SED_PATTERN\n"
460 " Octave configuration variables that are provided\n"
461 " for informational purposes only. Except for\n"
462 " OCTAVE_HOME and OCTAVE_EXEC_HOME, users may not\n"
463 " override these variables.\n"
465 " If OCTAVE_HOME or OCTAVE_EXEC_HOME are set in\n"
466 " the environment, then other variables are adjusted\n"
467 " accordingly with OCTAVE_HOME or OCTAVE_EXEC_HOME\n"
468 " substituted for the original value of the directory\n"
469 " specified by the --prefix or --exec-prefix options\n"
470 " that were used when Octave was configured.\n"
472 " API_VERSION LOCALFCNFILEDIR\n"
473 " ARCHLIBDIR LOCALOCTFILEDIR\n"
474 " BINDIR LOCALSTARTUPFILEDIR\n"
475 " CANONICAL_HOST_TYPE LOCALVERARCHLIBDIR\n"
476 " DATADIR LOCALVERFCNFILEDIR\n"
477 " DATAROOTDIR LOCALVEROCTFILEDIR\n"
478 " DEFAULT_PAGER MAN1DIR\n"
479 " EXEC_PREFIX MAN1EXT\n"
481 " FCNFILEDIR OCTAVE_EXEC_HOME\n"
482 " IMAGEDIR OCTAVE_HOME\n"
483 " INFODIR OCTAVE_VERSION\n"
484 " INFOFILE OCTDATADIR\n"
485 " LIBEXECDIR OCTDOCDIR\n"
486 " LOCALAPIARCHLIBDIR OCTFILEDIR\n"
487 " LOCALAPIFCNFILEDIR OCTFONTSDIR\n"
488 " LOCALAPIOCTFILEDIR STARTUPFILEDIR\n"
491 " --link-stand-alone Link a stand-alone executable file.\n"
493 " --mex Assume we are creating a MEX file. Set the\n"
494 " default output extension to \".mex\".\n"
496 " -s, --strip Strip output file.\n"
498 " -n, --just-print, --dry-run\n"
499 " Print commands, but do not execute them.\n"
501 " -v, --verbose Echo commands as they are executed.\n"
503 " --silent Ignored. Intended to suppress output from\n"
506 " FILE Compile or link FILE. Recognized file types are:\n"
516 " .f Fortran source (fixed form)\n"
517 " .F Fortran source (fixed form)\n"
518 " .f90 Fortran source (free form)\n"
519 " .F90 Fortran source (free form)\n"
522 #if defined (_MSC_VER)
523 " .lib library file\n"
528 basename (
const std::string& s,
bool strip_path =
false)
532 size_t pos = s.rfind (
'.');
534 if (pos == std::string::npos)
537 retval = s.substr (0, pos);
541 size_t p1 =
retval.rfind (
'/'), p2 =
retval.rfind (
'\\');
543 pos = (p1 != std::string::npos && p2 != std::string::npos
544 ?
std::max (p1, p2) : (p2 != std::string::npos ? p2 : p1));
546 if (pos != std::string::npos)
556 return (s.length () >= prefix.length () && s.find (prefix) == 0);
560 ends_with (
const std::string& s,
const std::string& suffix)
562 return (s.length () >= suffix.length ()
563 && s.rfind (suffix) == s.length () - suffix.length ());
571 std::cout << cmd << std::endl;
576 std::cout << cmd << std::endl;
578 int result = system (cmd.c_str ());
589 return (s ==
"yes" || s ==
"true");
599 #if defined (__MINGW32__) || defined (_MSC_VER)
607 #if defined (P_tmpdir)
614 if (tempd.empty () || tempd == R
"(\)")
615 tempd = R"(c:\temp)";
619 #if defined (P_tmpdir)
637 char *ctmpl =
new char [tmpl.length () + 1];
639 ctmpl = strcpy (ctmpl, tmpl.c_str ());
646 std::string
retval (ctmpl);
655 for (
const auto& file : tmp_files)
670 if (argc == 2 && (!
strcmp (argv[1],
"-v")
671 || !
strcmp (argv[1],
"-version")
672 || !
strcmp (argv[1],
"--version")))
678 std::list<std::string> cfiles, ccfiles, f77files, tmp_objfiles;
679 std::string output_ext =
".oct";
680 std::string objfiles, libfiles, octfile, outputfile;
681 std::string incflags, defs, ldflags, pass_on_options;
683 bool no_oct_file_strip_on_this_platform =
is_true (
"%NO_OCT_FILE_STRIP%");
684 bool compile_only =
false;
685 bool link_stand_alone =
false;
687 bool printonly =
false;
688 bool output_file_option =
false;
690 for (
int i = 1; i < argc; i++)
692 std::string arg = argv[i];
699 cfiles.push_back (file);
707 ccfiles.push_back (file);
713 f77files.push_back (file);
725 else if (arg ==
"-d" || arg ==
"-debug" || arg ==
"--debug"
726 || arg ==
"-v" || arg ==
"-verbose" || arg ==
"--verbose")
729 if (
vars[
"CC"] ==
"cc-msvc")
731 if (
vars[
"CXX"] ==
"cc-msvc")
732 vars[
"CXX"] +=
" -d";
733 if (
vars[
"CXXLD"] ==
"cc-msvc")
734 vars[
"CXXLD"] +=
" -d";
736 else if (arg ==
"-silent" || arg ==
"--silent")
740 else if (arg ==
"-h" || arg ==
"-?" || arg ==
"-help" || arg ==
"--help")
750 else if (arg ==
"-idirafter")
755 incflags += (
" -idirafter " + arg);
758 std::cerr <<
"mkoctfile: include directory name missing"
765 else if (arg ==
"-largeArrayDims" || arg ==
"-compatibleArrayDims")
767 std::cerr <<
"warning: -largeArrayDims and -compatibleArrayDims are accepted for compatibility, but ignored" << std::endl;
774 #if ! defined (OCTAVE_USE_WINDOWS_API)
775 else if (arg ==
"-pthread")
777 ldflags += (
' ' + arg);
780 else if (arg ==
"-M" || arg ==
"-depend" || arg ==
"--depend")
784 else if (arg ==
"-o" || arg ==
"-output" || arg ==
"--output")
786 output_file_option =
true;
794 std::cerr <<
"mkoctfile: output filename missing" << std::endl;
796 else if (arg ==
"-n" || arg ==
"--dry-run" || arg ==
"--just-print")
800 else if (arg ==
"-p" || arg ==
"-print" || arg ==
"--print")
807 std::cerr <<
"warning: LFLAGS is deprecated and will be removed in a future version of Octave, use LDFLAGS instead" << std::endl;
809 std::cout <<
vars[arg] << std::endl;
813 std::cerr <<
"mkoctfile: --print requires argument" << std::endl;
815 else if (arg ==
"-s" || arg ==
"-strip" || arg ==
"--strip")
817 if (no_oct_file_strip_on_this_platform)
818 std::cerr <<
"mkoctfile: stripping disabled on this platform"
823 else if (arg ==
"-c" || arg ==
"-compile" || arg ==
"--compile")
827 else if (arg ==
"-g")
829 vars[
"ALL_CFLAGS"] +=
" -g";
830 vars[
"ALL_CXXFLAGS"] +=
" -g";
831 vars[
"ALL_FFLAGS"] +=
" -g";
833 else if (arg ==
"-link-stand-alone" || arg ==
"--link-stand-alone")
835 link_stand_alone =
true;
837 else if (arg ==
"-mex" || arg ==
"--mex")
840 #if defined (_MSC_VER)
841 ldflags +=
" -Wl,-export:mexFunction";
847 pass_on_options += (
' ' + arg);
851 pass_on_options += (
' ' + arg);
856 pass_on_options += (
' ' + arg);
864 pass_on_options += (
' ' + arg);
871 std::cerr <<
"mkoctfile: unrecognized argument " << arg << std::endl;
875 if (! file.empty () && octfile.empty ())
879 if (output_ext ==
".mex"
880 &&
vars[
"ALL_CFLAGS"].
find (
"-g") != std::string::npos)
882 defs +=
" -DMEX_DEBUG";
885 if (compile_only && output_file_option
886 && (cfiles.size () + ccfiles.size () + f77files.size ()) > 1)
888 std::cerr <<
"mkoctfile: may not use -c and -o with multiple source files"
893 std::string output_option;
895 if (link_stand_alone)
897 if (! outputfile.empty ())
898 output_option =
"-o " + outputfile;
902 if (! outputfile.empty ())
908 octfile = outputfile;
909 size_t len = octfile.length ();
910 size_t len_ext = output_ext.length ();
911 if (
len <= len_ext || octfile.substr (
len-len_ext) != output_ext)
912 octfile += output_ext;
915 octfile =
basename (octfile,
true) + output_ext;
920 for (
const auto&
f : cfiles)
927 = (
vars[
"CC"] +
' ' +
vars[
"DEPEND_FLAGS"] +
' '
928 +
vars[
"CPPFLAGS"] +
' ' +
vars[
"ALL_CFLAGS"] +
' '
932 FILE *fd =
popen (cmd.c_str (),
"r");
934 #if defined (OCTAVE_USE_WINDOWS_API)
938 size_t srclen = dfile.length ();
939 const uint8_t *src =
reinterpret_cast<const uint8_t *
>
943 wchar_t *wchar =
reinterpret_cast<wchar_t *
>
948 if (wchar !=
nullptr)
951 free (
static_cast<void *
> (wchar));
954 fo.open (dfile.c_str ());
962 if ((pos =
line.rfind (
".o:")) != std::string::npos)
964 size_t spos =
line.rfind (
'/', pos);
966 = (spos == std::string::npos
967 ?
line.substr (0, pos+2)
968 :
line.substr (spos+1, pos-spos+1));
969 fo <<
"pic/" << ofile <<
' ' << ofile <<
' '
970 << dfile <<
line.substr (pos) << std::endl;
973 fo <<
line << std::endl;
979 for (
const auto&
f : ccfiles)
986 = (
vars[
"CXX"] +
' ' +
vars[
"DEPEND_FLAGS"] +
' '
987 +
vars[
"CPPFLAGS"] +
' ' +
vars[
"ALL_CXXFLAGS"] +
' '
991 FILE *fd =
popen (cmd.c_str (),
"r");
993 #if defined (OCTAVE_USE_WINDOWS_API)
997 size_t srclen = dfile.length ();
998 const uint8_t *src =
reinterpret_cast<const uint8_t *
>
1002 wchar_t *wchar =
reinterpret_cast<wchar_t *
>
1007 if (wchar !=
nullptr)
1010 free (
static_cast<void *
> (wchar));
1013 fo.open (dfile.c_str ());
1021 if ((pos =
line.rfind (
".o:")) != std::string::npos)
1023 size_t spos =
line.rfind (
'/', pos);
1025 = (spos == std::string::npos
1026 ?
line.substr (0, pos+2)
1027 :
line.substr (spos+1, pos-spos+1));
1028 fo <<
"pic/" << ofile <<
' ' << ofile <<
' '
1029 << dfile <<
line.substr (pos+2) << std::endl;
1032 fo <<
line << std::endl;
1041 for (
const auto&
f : f77files)
1043 if (!
vars[
"F77"].empty ())
1048 if (! outputfile.empty ())
1057 tmp_objfiles.push_back (o);
1059 objfiles += (
' ' + o);
1063 = (
vars[
"F77"] +
" -c " +
vars[
"FPICFLAG"] +
' '
1064 +
vars[
"ALL_FFLAGS"] +
' ' + incflags +
' ' + defs +
' '
1065 + pass_on_options +
' ' +
f +
" -o " + o);
1074 std::cerr <<
"mkoctfile: no way to compile Fortran file " <<
f
1080 for (
const auto&
f : cfiles)
1082 if (!
vars[
"CC"].empty ())
1087 if (! outputfile.empty ())
1096 tmp_objfiles.push_back (o);
1098 objfiles += (
' ' + o);
1102 = (
vars[
"CC"] +
" -c " +
vars[
"CPPFLAGS"] +
' '
1103 +
vars[
"CPICFLAG"] +
' ' +
vars[
"ALL_CFLAGS"] +
' '
1104 + pass_on_options +
' ' + incflags +
' ' + defs +
' '
1114 std::cerr <<
"mkoctfile: no way to compile C file " <<
f
1120 for (
const auto&
f : ccfiles)
1122 if (!
vars[
"CXX"].empty ())
1127 if (! outputfile.empty ())
1136 tmp_objfiles.push_back (o);
1138 objfiles += (
' ' + o);
1142 = (
vars[
"CXX"] +
" -c " +
vars[
"CPPFLAGS"] +
' '
1143 +
vars[
"CXXPICFLAG"] +
' ' +
vars[
"ALL_CXXFLAGS"] +
' '
1144 + pass_on_options +
' ' + incflags +
' ' + defs +
' '
1154 std::cerr <<
"mkoctfile: no way to compile C++ file " <<
f
1165 if (objfiles.empty ())
1167 std::cerr <<
"mkoctfile: no objects to link" << std::endl;
1171 std::string octave_libs;
1173 if (link_stand_alone)
1175 if (!
vars[
"CXXLD"].empty ())
1178 +
' ' +
vars[
"OCTAVE_LIBS"];
1181 = (
vars[
"CXXLD"] +
' ' +
vars[
"CPPFLAGS"] +
' '
1182 +
vars[
"ALL_CXXFLAGS"] +
' ' +
vars[
"RDYNAMIC_FLAG"] +
' '
1183 + pass_on_options +
' ' + output_option +
' ' + objfiles +
' '
1184 + libfiles +
' ' +
vars[
"ALL_LDFLAGS"] +
' ' + ldflags +
' '
1185 +
vars[
"LFLAGS"] +
' ' + octave_libs +
' '
1186 +
vars[
"OCTAVE_LINK_OPTS"] +
' ' +
vars[
"OCTAVE_LINK_DEPS"]);
1198 <<
"mkoctfile: no way to link stand-alone executable file"
1205 #if defined (OCTAVE_USE_WINDOWS_API) || defined(CROSS)
1207 +
' ' +
vars[
"OCTAVE_LIBS"];
1211 = (
vars[
"CXXLD"] +
' ' +
vars[
"ALL_CXXFLAGS"] +
' '
1212 + pass_on_options +
" -o " + octfile +
' ' + objfiles +
' '
1213 + libfiles +
' ' +
vars[
"DL_LDFLAGS"] +
' ' +
vars[
"LDFLAGS"] +
' '
1214 + ldflags +
' ' +
vars[
"LFLAGS"] +
' ' + octave_libs +
' '
1215 +
vars[
"OCT_LINK_OPTS"] +
' ' +
vars[
"OCT_LINK_DEPS"]);
1217 #if defined (OCTAVE_USE_WINDOWS_API) || defined(CROSS)
1218 if (! f77files.empty () && !
vars[
"FLIBS"].empty ())
1219 cmd +=
' ' +
vars[
"FLIBS"];
1232 std::string cmd =
"strip " + octfile;
charNDArray max(char d, const charNDArray &m)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
#define OCTAVE_LOCALSTARTUPFILEDIR
#define OCTAVE_LOCALVERFCNFILEDIR
#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_DEFAULT_PAGER
#define OCTAVE_OCTFILEDIR
#define OCTAVE_LOCALARCHLIBDIR
#define OCTAVE_LOCALVERARCHLIBDIR
#define OCTAVE_LOCALFCNFILEDIR
#define OCTAVE_LOCALAPIFCNFILEDIR
#define OCTAVE_DATAROOTDIR
F77_RET_T const F77_DBLE const F77_DBLE * f
#define OCTAVE_ARCHLIBDIR
static std::string version_msg
static std::string quote_path(const std::string &s)
static std::string tmp_objfile_name(void)
static std::string get_line(FILE *fp)
static std::string help_msg
static std::string basename(const std::string &s, bool strip_path=false)
int main(int argc, char **argv)
bool is_true(const std::string &s)
bool ends_with(const std::string &s, const std::string &suffix)
static void initialize(void)
static std::string get_temp_directory(void)
static int run_command(const std::string &cmd, bool printonly=false)
static std::string get_variable(const char *name, const std::string &defval)
static std::string replace_prefix(std::string s)
static std::string usage_msg
bool starts_with(const std::string &s, const std::string &prefix)
static void clean_up_tmp_files(const std::list< std::string > &tmp_files)
static std::map< std::string, std::string > vars
int octave_mkostemps_wrapper(char *tmpl, int suffixlen)
bool strcmp(const T &str_a, const T &str_b)
True if strings are the same.
int unlink(const std::string &name)
std::ofstream ofstream(const std::string &filename, const std::ios::openmode mode)
FILE * popen(const char *command, const char *mode)
octave_value::octave_value(const Array< char > &chm, char type) return retval
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 std::string octave_getenv(const std::string &name)
static OCTAVE_UNUSED std::string prepend_octave_home(const std::string &s)
char * octave_u8_conv_to_encoding(const char *tocode, const uint8_t *src, size_t srclen, size_t *lengthp)
int octave_unlink_wrapper(const char *nm)
#define OCTAVE_CANONICAL_HOST_TYPE
#define OCTAVE_API_VERSION
int octave_wexitstatus_wrapper(int status)
bool octave_wifexited_wrapper(int status)