octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48757] build failure with --without-z due to


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #48757] build failure with --without-z due to missing unistd.h
Date: Thu, 11 Aug 2016 05:44:17 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0

URL:
  <http://savannah.gnu.org/bugs/?48757>

                 Summary: build failure with --without-z due to missing
unistd.h
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Wed 10 Aug 2016 10:44:15 PM PDT
                Category: Configuration and Build System
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Build Failure
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Building Octave with the --without-z option specified, build fails in
oct-procbuf.cc and toplev.cc with the following:


../libinterp/corefcn/oct-procbuf.cc: In member function ‘octave_procbuf*
octave_procbuf::open(const char*, int)’:
../libinterp/corefcn/oct-procbuf.cc:105:14: error: ‘::fork’ has not been
declared
   proc_pid = ::fork ();
              ^~
../libinterp/corefcn/oct-procbuf.cc:105:14: note: suggested alternative:
In file included from ../libinterp/corefcn/oct-procbuf.cc:34:0:
../liboctave/system/oct-syscalls.h:45:18: note:   ‘octave::sys::fork’
     extern OCTAVE_API pid_t fork (std::string&);
                  ^~~~
../libinterp/corefcn/oct-procbuf.cc:130:69: error: ‘execl’ was not
declared in this scope
       execl (SHELL_PATH, "sh", "-c", command, static_cast<void *> (0));
                                                                     ^
../libinterp/corefcn/toplev.cc: In function ‘octave_value_list Fsystem(const
octave_value_list&, int)’:
../libinterp/corefcn/toplev.cc:252:25: error: ‘fork’ was not declared in
this scope
       pid_t pid = fork ();
                         ^
../libinterp/corefcn/toplev.cc:252:25: note: suggested alternative:
In file included from ../libinterp/corefcn/toplev.cc:43:0:
../liboctave/system/oct-syscalls.h:45:18: note:   ‘octave::sys::fork’
     extern OCTAVE_API pid_t fork (std::string&);
                  ^~~~
../libinterp/corefcn/toplev.cc:260:41: error: ‘execl’ was not declared in
this scope
                  static_cast<char *> (0));
                                         ^


I believe this is because zlib.h is pulled in through one of the corefcn
header files, and unistd.h must be pulled in as an implicit dependency of that
normally.

Adding a simple include of unistd.h fixes the build errors for me, but this
probably needs the appropriate #if conditional logic.


diff --git a/libinterp/corefcn/oct-procbuf.cc
b/libinterp/corefcn/oct-procbuf.cc
--- a/libinterp/corefcn/oct-procbuf.cc
+++ b/libinterp/corefcn/oct-procbuf.cc
@@ -25,6 +25,7 @@ along with Octave; see the file COPYING.
 #endif
 
 #include <cerrno>
+#include <unistd.h>
 
 #include <iostream>
 
diff --git a/libinterp/corefcn/toplev.cc b/libinterp/corefcn/toplev.cc
--- a/libinterp/corefcn/toplev.cc
+++ b/libinterp/corefcn/toplev.cc
@@ -27,6 +27,7 @@ along with Octave; see the file COPYING.
 #include <cerrno>
 #include <cstdlib>
 #include <new>
+#include <unistd.h>
 
 #include <sstream>
 #include <string>


I see a mix of conditionals on WIN32, CYGWIN, MSC_VER, MINGW32, not sure which
of these to use for choosing whether to include unistd.h or not.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48757>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]