Here are the issues I faced when building r190 on Solaris:
*Unresolved issues*
These are issues that still need to be addressed:
*Warning when running ./configure:*
...
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for shared library run path origin... done
*./configure: line 16152: gt_INTL_MACOSX: command not foun**d*
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
...
*Another warning in ./configure:*
...
checking term.h usability... no
checking term.h presence... yes
*configure: WARNING: term.h: present but cannot be compiled*
*configure: WARNING: term.h: check for missing prerequisite headers?*
*configure: WARNING: term.h: see the Autoconf documentation*
*configure: WARNING: term.h: section "Present But Cannot Be Compiled"*
*configure: WARNING: term.h: proceeding with the compiler's result*
*configure: WARNING: ## ------------------------------ ##*
*configure: WARNING: ## Report this to [email protected]
<[email protected]> ##*
*configure: WARNING: ## ------------------------------ ##*
checking for term.h... no
checking execinfo.h usability... no
checking execinfo.h presence... no
...
*Dynamic arrays detection doesn't seem to work*
Is there any detection magic for dynamic arrays in configure?
HAVE_DYNAMIC_ARRAYS was set to 1 in config.h for me.
If not, I could give it a try to write it for you.
*The flag -rdynamic does not worn on Sun C++*
This flag is GCC-specific. It can't be used on non-GCC compilers.
*Fixed issues*
The following issues are things I have fixed, and that is addressed in the
attached patch:
*Need to include <sstream> in several files in emacs_mode*
On Linux, this seems to be included by something else. I've fixed it in the
repository and it's part of the attached patch as well.
*Overloading ambiguity (int to double vs float)*
In IntCell.cc, line 299. Changed the line:
new (Z) FloatCell(log(value.ival));
to:
new (Z) FloatCell(log(static_cast<double>(value.ival)));
*Avoiding zero-length arrays:*
Changed:
static VH_entry history[VALUEHISTORY_SIZE];
to:
static VH_entry history[VALUEHISTORY_SIZE == 0 ? 1 : VALUEHISTORY_SIZE];
*NOMACROS definition*
On Solaris, NOMACROS needs to be defined prior to including <curses.h>.
Even though it has been defined, it seems to define the macro "tab" which
messes up some template definitions later. #undef tab fixes it.
*TPUTS_arg3 was not used in Output.hh*
Simple problem. I've updated the file.
*tparm10 passed too many arguments*
The definition actually passed 12 values instead of 10.
*Dyanamic arrays without DynArray*
Instances of dynamic arrays which has not been converted to DynArray.
Index: src/IntCell.cc
===================================================================
--- src/IntCell.cc (revision 190)
+++ src/IntCell.cc (working copy)
@@ -296,7 +296,7 @@
{
if (value.ival > 0)
{
- new (Z) FloatCell(log(value.ival));
+ new (Z) FloatCell(log(static_cast<double>(value.ival)));
}
else if (value.ival < 0)
{
Index: src/Output.cc
===================================================================
--- src/Output.cc (revision 190)
+++ src/Output.cc (working copy)
@@ -21,13 +21,14 @@
#include "../config.h" // for HAVE_ macros from configure
#if HAVE_CURSES_H && HAVE_CURSES_H
-
+#if defined(__sun) && defined(__SVR4)
+#define NOMACROS
+#endif
#include <curses.h>
#include <term.h>
-// curses #defines erase() on Solaris, conflicting with vector::erase()
-#ifdef erase
-#undef erase
+#ifdef tab
+#undef tab
#endif
#else
@@ -228,7 +229,7 @@
}
//-----------------------------------------------------------------------------
/// make Solaris happy
-#define tparm10(x, y) tparm(x, y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+#define tparm10(x, y) tparm(x, y, 0, 0, 0, 0, 0, 0, 0, 0)
void
Output::set_color_mode(Output::ColorMode mode)
Index: src/Output.hh
===================================================================
--- src/Output.hh (revision 190)
+++ src/Output.hh (working copy)
@@ -147,10 +147,10 @@
static bool colors_changed;
/// print one byte on stdout
- static int putc_stderr(int ch);
+ static int putc_stderr(TPUTS_arg3 ch);
/// print one byte on stderr
- static int putc_stdout(int ch);
+ static int putc_stdout(TPUTS_arg3 ch);
/// the current color mode
static ColorMode color_mode;
Index: src/SkalarFunction.cc
===================================================================
--- src/SkalarFunction.cc (revision 190)
+++ src/SkalarFunction.cc (working copy)
@@ -555,7 +555,7 @@
Value_P Z(new Value(aa, LOC));
-uint32_t idx_B[set_size];
+DynArray(uint32_t, idx_B, set_size);
loop(c, set_size) idx_B[c] = c + qio;
loop(z, aa)
Index: src/ValueHistory.cc
===================================================================
--- src/ValueHistory.cc (revision 190)
+++ src/ValueHistory.cc (working copy)
@@ -30,7 +30,7 @@
#include "Value.hh"
#include "ValueHistory.hh"
-VH_entry VH_entry::history[VALUEHISTORY_SIZE];
+VH_entry VH_entry::history[VALUEHISTORY_SIZE == 0 ? 1 : VALUEHISTORY_SIZE];
int VH_entry::idx = 0;
//----------------------------------------------------------------------------
Index: src/ValueHistory.hh
===================================================================
--- src/ValueHistory.hh (revision 190)
+++ src/ValueHistory.hh (working copy)
@@ -40,7 +40,7 @@
static void init();
- static VH_entry history[VALUEHISTORY_SIZE];
+ static VH_entry history[VALUEHISTORY_SIZE == 0 ? 1 : VALUEHISTORY_SIZE];
static int idx;
protected:
Index: src/emacs_mode/DefCommand.cc
===================================================================
--- src/emacs_mode/DefCommand.cc (revision 190)
+++ src/emacs_mode/DefCommand.cc (working copy)
@@ -24,6 +24,8 @@
#include "../Quad_FX.hh"
+#include <sstream>
+
static void log_error( Error &error, ostream &out )
{
UCS_string l1 = error.get_error_line_1();
Index: src/emacs_mode/FnCommand.cc
===================================================================
--- src/emacs_mode/FnCommand.cc (revision 190)
+++ src/emacs_mode/FnCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "FnCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
void FnCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
std::string name = args[1];
Index: src/emacs_mode/FnTagCommand.cc
===================================================================
--- src/emacs_mode/FnTagCommand.cc (revision 190)
+++ src/emacs_mode/FnTagCommand.cc (working copy)
@@ -24,6 +24,8 @@
#include "../UserFunction.hh"
+#include <sstream>
+
void FnTagCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
std::string name = args[1];
Index: src/emacs_mode/FollowCommand.cc
===================================================================
--- src/emacs_mode/FollowCommand.cc (revision 190)
+++ src/emacs_mode/FollowCommand.cc (working copy)
@@ -26,6 +26,7 @@
#include "LockWrapper.hh"
#include "../Symbol.hh"
+#include <sstream>
#include <map>
#include <stdlib.h>
#include <string.h>
Index: src/emacs_mode/SiCommand.cc
===================================================================
--- src/emacs_mode/SiCommand.cc (revision 190)
+++ src/emacs_mode/SiCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "SiCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
void SiCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
std::stringstream out;
Index: src/emacs_mode/SystemFnCommand.cc
===================================================================
--- src/emacs_mode/SystemFnCommand.cc (revision 190)
+++ src/emacs_mode/SystemFnCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "SystemFnCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
void SystemFnCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
stringstream out;
Index: src/emacs_mode/SystemVariableCommand.cc
===================================================================
--- src/emacs_mode/SystemVariableCommand.cc (revision 190)
+++ src/emacs_mode/SystemVariableCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "SystemVariableCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
void SystemVariableCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
stringstream out;
Index: src/emacs_mode/TcpListener.cc
===================================================================
--- src/emacs_mode/TcpListener.cc (revision 190)
+++ src/emacs_mode/TcpListener.cc (working copy)
@@ -23,6 +23,7 @@
#include "NetworkConnection.hh"
#include "TcpListener.hh"
+#include <sstream>
#include <memory>
#include <pthread.h>
#include <sys/types.h>
Index: src/emacs_mode/TraceData.cc
===================================================================
--- src/emacs_mode/TraceData.cc (revision 190)
+++ src/emacs_mode/TraceData.cc (working copy)
@@ -23,6 +23,8 @@
#include "FollowCommand.hh"
#include "../Workspace.hh"
+#include <sstream>
+
TraceData::TraceData( Symbol *symbol_in ) : symbol( symbol_in )
{
}
@@ -35,7 +37,7 @@
symbol->set_monitor_callback( symbol_assignment );
}
- active_listeners.insert( pair<NetworkConnection *, int>( connection,
cr_level ) );
+ active_listeners.insert( pair<NetworkConnection *, TraceDataEntry>(
connection, TraceDataEntry( cr_level ) ) );
}
void TraceData::remove_listener( NetworkConnection *connection )
Index: src/emacs_mode/UnixSocketListener.cc
===================================================================
--- src/emacs_mode/UnixSocketListener.cc (revision 190)
+++ src/emacs_mode/UnixSocketListener.cc (working copy)
@@ -23,6 +23,7 @@
#include "UnixSocketListener.hh"
#include "NetworkConnection.hh"
+#include <sstream>
#include <memory>
#include <pthread.h>
#include <sys/types.h>
Index: src/emacs_mode/VariablesCommand.cc
===================================================================
--- src/emacs_mode/VariablesCommand.cc (revision 190)
+++ src/emacs_mode/VariablesCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "VariablesCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
enum TypeSpec {
ALL,
VARIABLE,
@@ -48,7 +50,7 @@
}
int num_symbols = Workspace::symbols_allocated();
- Symbol *symbols[num_symbols];
+ Symbol **symbols = new Symbol *[num_symbols];
Workspace::get_all_symbols( symbols, num_symbols );
for( int i = 0 ; i < num_symbols ; i++ ) {
Symbol *symbol = symbols[i];
@@ -63,4 +65,6 @@
}
conn.send_reply( out.str() );
+
+ delete[] symbols;
}
Index: src/emacs_mode/VersionCommand.cc
===================================================================
--- src/emacs_mode/VersionCommand.cc (revision 190)
+++ src/emacs_mode/VersionCommand.cc (working copy)
@@ -22,6 +22,8 @@
#include "VersionCommand.hh"
#include "emacs.hh"
+#include <sstream>
+
void VersionCommand::run_command( NetworkConnection &conn, const
std::vector<std::string> &args )
{
stringstream out;