# HG changeset patch # User John W. Eaton # Date 1530026018 14400 # Node ID ace13ff63b908262fcf7acb2e21c2659e939fe23 # Parent ec2492a2af6ab335bab669ecbfaad3e368c1a934 undo previous change; use 0 instead of O_BINARY * mkoctfile.in.cc: Don't include . Pass 0 instead of O_BINARY to mkostemps. Add some explanation about the CROSS macro usage. diff -r ec2492a2af6a -r ace13ff63b90 src/mkoctfile.in.cc --- a/src/mkoctfile.in.cc Tue Jun 26 09:52:19 2018 -0400 +++ b/src/mkoctfile.in.cc Tue Jun 26 11:13:38 2018 -0400 @@ -36,13 +36,22 @@ #include #include +// Programming note: The CROSS macro here refers to building a +// cross-compiler aware version of mkoctfile that can be used to cross +// compile .oct file for Windows builds of Octave, not that mkoctfile +// itself is being cross compiled. +// +// We don't use the wrapper and gnulib functions when we are building +// with CROSS defined. This configuration is only expected to work on +// modern systems that should not need to have gnulib to fix POSIX +// portability problems. So we just assume a working POSIX system when +// CROSS is defined. + #if defined (CROSS) -# include # include # include # include # include - # ifndef OCTAVE_UNUSED # define OCTAVE_UNUSED # endif @@ -73,7 +82,7 @@ static int octave_mkostemps_wrapper (char *tmpl, int suffixlen) { - return mkostemps (tmpl, suffixlen, O_BINARY); + return mkostemps (tmpl, suffixlen, 0); } static int @@ -173,10 +182,10 @@ std::string DEFAULT_LFLAGS; -#if defined (OCTAVE_USE_WINDOWS_API) || defined(CROSS) +#if defined (OCTAVE_USE_WINDOWS_API) || defined (CROSS) - // We'll be linking with -loctinterp and -loctave, so we need to know - // where to find them. + // We'll be linking the files we compile with -loctinterp and + // -loctave, so we need to know where to find them. DEFAULT_LFLAGS += "-L" + quote_path (vars["OCTLIBDIR"]); #endif