From bug-octave-request at bevo dot che dot wisc dot edu Mon Nov 9 14:54:58 1998 Subject: 2.1.10: Compile bug (+ rough patch) From: Erik de Castro Lopo To: bug-octave at bevo dot che dot wisc dot edu Date: Tue, 10 Nov 1998 07:58:16 +1100 To: bug-octave at bevo dot che dot wisc dot edu Cc: erikd Subject: 2.1.10: Compile bug (+ rough patch) -------- Bug report for Octave 2.1.10 configured for %CANONICAL_HOST_TYPE% Description: ----------- On a i586-pc-linux-gnulibc1 system, the macros WIFEXITED, WEXITSTATUS and WIFSIGNALLED aren't present in the headers octave is including. I suspect these macros are defined in and are named __WIFEXITED, __WEXITSTATUS and __WIFSIGNALED. Repeat-By: --------- Compile Octave 2.1.10 on my system :-). Fix: --- Everything seems to run and compile correctly if I include in src/help.cc, src/pager.cc and src/toplev.cc and change the macro names as above. Obviously this will not work on all systems. I'm not sure how to make this patch fit in with the autoconfiguration stuff, so I'll have to leave that to John. Anyway, here is the context diff: ______________________________________________________________________ Common subdirectories: ../octave-2.1.10/src/DLD-FUNCTIONS and src/DLD-FUNCTIONS Only in src/: Makefile Common subdirectories: ../octave-2.1.10/src/OPERATORS and src/OPERATORS Common subdirectories: ../octave-2.1.10/src/TEMPLATE-INST and src/TEMPLATE-INST diff -c ../octave-2.1.10/src/help.cc src/help.cc *** ../octave-2.1.10/src/help.cc Sat Oct 24 13:59:13 1998 --- src/help.cc Mon Nov 9 08:36:54 1998 *************** *** 44,49 **** --- 44,51 ---- #include "oct-env.h" #include "str-vec.h" + #include + #include #include "defun.h" #include "dirfns.h" *************** *** 609,616 **** octave_set_interrupt_handler (old_interrupt_handler); ! if (WIFEXITED (status)) ! status = WEXITSTATUS (status); else status = 127; --- 611,618 ---- octave_set_interrupt_handler (old_interrupt_handler); ! if (__WIFEXITED (status)) ! status = __WEXITSTATUS (status); else status = 127; Only in src/: octave diff -c ../octave-2.1.10/src/pager.cc src/pager.cc *** ../octave-2.1.10/src/pager.cc Mon May 11 15:43:22 1998 --- src/pager.cc Mon Nov 9 21:42:35 1998 *************** *** 29,34 **** --- 29,36 ---- #include #include + #include + #include "cmd-edit.h" #include "oct-env.h" *************** *** 103,109 **** { if (pid > 0) { ! if (WIFEXITED (status) || WIFSIGNALLED (status)) { // Avoid warning() or error(), since that will put us back in // the pager, which would be bad news. --- 105,111 ---- { if (pid > 0) { ! if (__WIFEXITED (status) || __WIFSIGNALED (status)) { // Avoid warning() or error(), since that will put us back in // the pager, which would be bad news. Only in src/: stamp-oct-links Only in src/: stamp-prereq diff -c ../octave-2.1.10/src/toplev.cc src/toplev.cc *** ../octave-2.1.10/src/toplev.cc Fri Oct 30 07:02:29 1998 --- src/toplev.cc Mon Nov 9 19:34:20 1998 *************** *** 44,49 **** --- 44,51 ---- #include #endif + #include + #include "cmd-edit.h" #include "file-ops.h" #include "lo-error.h" *************** *** 375,382 **** // status of the command. Otherwise, return 127 as a // failure code. ! if (WIFEXITED (cmd_status)) ! cmd_status = WEXITSTATUS (cmd_status); else cmd_status = 127; --- 377,384 ---- // status of the command. Otherwise, return 127 as a // failure code. ! if (__WIFEXITED (cmd_status)) ! cmd_status = __WEXITSTATUS (cmd_status); else cmd_status = 127; *************** *** 485,492 **** // status of the command. Otherwise, return 127 as a // failure code. ! if (WIFEXITED (status)) ! status = WEXITSTATUS (status); retval = static_cast (status); } --- 487,494 ---- // status of the command. Otherwise, return 127 as a // failure code. ! if (__WIFEXITED (status)) ! status = __WEXITSTATUS (status); retval = static_cast (status); } ______________________________________________________________________ Configuration (please do not edit this section): ----------------------------------------------- uname output: Linux hendrix 2.0.35 #14 Mon Aug 3 09:25:53 EST 1998 i586 configure opts: --enable-shared --disable-static --enable-dl --enable-lite-kernel Fortran compiler: g77 FFLAGS: -O F2C: F2CFLAGS: FLIBS: -lg2c -lm -L/usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.57 -L/usr/local/i586-pc-linux-gnulibc1/lib -L/usr/local/lib -lm CPPFLAGS: INCFLAGS: -I/usr/local/include/octave-2.1.10/octave -I/usr/local/include C compiler: gcc, version 2.91.57 19980901 (egcs-1.1 release) CFLAGS: -DHAVE_CONFIG_H -mieee-fp -g -O2 -Wall CPICFLAG: -fPIC C++ compiler: c++, version 2.91.57 19980901 (egcs-1.1 release) CXXFLAGS: -DHAVE_CONFIG_H -mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates -g -O2 -Wall CXXPICFLAG: -fPIC LDFLAGS: -g LIBFLAGS: -L/usr/local/lib/octave-2.1.10 RLD_FLAG: -Xlinker -rpath -Xlinker /usr/local/lib/octave-2.1.10 TERMLIBS: -lncurses LIBS: LEXLIB: LIBPLPLOT: LIBDLFCN: DEFS: -DOCTAVE_SOURCE=1 -DSEPCHAR=':' -DSEPCHAR_STR=":" -DUSE_READLINE=1 -D__NO_MATH_INLINES=1 -DCXX_NEW_FRIEND_TEMPLATE_DECL=1 -DF77_APPEND_UNDERSCORE=1 -DOCTAVE_LITE=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DNPOS=string::npos -DSTDC_HEADERS=1 -DHAVE_DIRENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_ASSERT_H=1 -DHAVE_CURSES_H=1 -DHAVE_DLFCN_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOAT_H=1 -DHAVE_FNMATCH_H=1 -DHAVE_GLOB_H=1 -DHAVE_GRP_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_NAN_H=1 -DHAVE_PWD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_TERMCAP_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L=1 -DWITH_DYNAMIC_LINKING=1 -DHAVE_TIMEVAL=1 -DHAVE_LIBM=1 -DHAVE_FINITE=1 -DHAVE_ISNAN=1 -DHAVE_ISINF=1 -DHAVE_ACOSH=1 -DHAVE_ASINH=1 -DHAVE_ATANH=1 -DHAVE_ERF=1 -DHAVE_ERFC=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_ST_BLOCKS=1 -DHAVE_ST_RDEV=1 -DHAVE_TZNAME=1 -DHAVE_GR_PASSWD=1 -DRETSIGTYPE=void -DSYS_SIGLIST_DECLARED=1 -DHAVE_SYS_SIGLIST=1 -DHAVE_POSIX_SIGNALS=1 -DHAVE_GETRUSAGE=1 -DHAVE_TIMES=1 -DGNUPLOT_HAS_MULTIPLOT=1 -DGNUPLOT_HAS_FRAMES=1 -- +-------------------------------------------------+ Erik de Castro Lopo erikd at zip dot com dot au +-------------------------------------------------+ Linux: generous programmers from around the world all join forces to help you shoot yourself in the foot for free.