Skip to content

Commit

Permalink
Add support for OpenIndiana
Browse files Browse the repository at this point in the history
* Add support for OpenIndiana (Unix operating system derived
  from OpenSolaris and based on illumos):

    - Make binary plugin 'dern_ncurses' to compile
      on OpenIndiana.

    - Add 'how-to-build'-script for OpenIndiana.
  • Loading branch information
octaspire committed Jun 16, 2017
1 parent 47cc1ba commit 6e753b1
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 100 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.8.12)
project(octaspire-dern C)

set(OCTASPIRE_DERN_CONFIG_VERSION_MAJOR 0)
set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 134)
set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 135)
set(OCTASPIRE_DERN_CONFIG_VERSION_PATCH 0)

message("== Building ${PROJECT_NAME} ${OCTASPIRE_DERN_CONFIG_VERSION_MAJOR}.${OCTASPIRE_DERN_CONFIG_VERSION_MINOR}.${OCTASPIRE_DERN_CONFIG_VERSION_PATCH}")
Expand Down
2 changes: 1 addition & 1 deletion doc/book/Programming_in_Octaspire_Dern.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Programming in Octaspire Dern
:lang: en
:toc:

Documentation for Octaspire Dern programming language version 0.134.0
Documentation for Octaspire Dern programming language version 0.135.0

== About

Expand Down
4 changes: 2 additions & 2 deletions doc/book/Programming_in_Octaspire_Dern.html
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ <h1>Programming in Octaspire Dern</h1>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.134.0</p></div>
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.135.0</p></div>
</div>
</div>
<div class="sect1">
Expand Down Expand Up @@ -1753,7 +1753,7 @@ <h2 id="_using_the_amalgamated_source">Using the amalgamated source</h2>
<div id="footer">
<div id="footer-text">
Last updated
2017-06-15 22:01:56 EEST
2017-06-16 20:48:36 EEST
</div>
</div>
</body>
Expand Down
7 changes: 0 additions & 7 deletions doc/examples/plugins/dern_ncurses/dern-ncurses-example.dern
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,18 @@
(ncurses-print win 'ACS_DARROW)
(ncurses-print win 'ACS_DEGREE)
(ncurses-print win 'ACS_DIAMOND)
(ncurses-print win 'ACS_GEQUAL)
(ncurses-print win 'ACS_HLINE)
(ncurses-print win 'ACS_LANTERN)
(ncurses-print win 'ACS_LARROW)
(ncurses-print win 'ACS_LEQUAL)
(ncurses-print win 'ACS_LLCORNER)
(ncurses-print win 'ACS_LRCORNER)
(ncurses-print win 'ACS_LTEE)
(ncurses-print win 'ACS_NEQUAL)
(ncurses-print win 'ACS_PI)
(ncurses-print win 'ACS_PLMINUS)
(ncurses-print win 'ACS_PLUS)
(ncurses-print win 'ACS_RARROW)
(ncurses-print win 'ACS_RTEE)
(ncurses-print win 'ACS_S1)
(ncurses-print win 'ACS_S3)
(ncurses-print win 'ACS_S7)
(ncurses-print win 'ACS_S9)
(ncurses-print win 'ACS_STERLING)
(ncurses-print win 'ACS_TTEE)
(ncurses-print win 'ACS_UARROW)
(ncurses-print win 'ACS_ULCORNER)
Expand Down
92 changes: 92 additions & 0 deletions etc/how-to-build/OpenIndiana.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/usr/bin/env sh

echoAndRun() { echo "$@" ; "$@" ; }
echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; }

CC=gcc

echo "$(tput setaf 3) $(tput bold)"
cat << EnDoFmEsSaGe
1. Building stand alone unit test runner to test the release
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra \
-DOCTASPIRE_DERN_AMALGAMATED_UNIT_TEST_IMPLEMENTATION \
-DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \
-DGREATEST_ENABLE_ANSI_COLORS \
-I . octaspire-dern-amalgamated.c -lm \
-o octaspire-dern-unit-test-runner



echo "$(tput setaf 3) $(tput bold)"
cat << EnDoFmEsSaGe
2. Building the embedding example
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra \
-DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \
-I . examples/embedding-example.c -lm \
-o embedding-example



echo "$(tput setaf 3) $(tput bold)"
cat << EnDoFmEsSaGe
3. Building the binary library example
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c examples/mylib.c
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libmylib.so mylib.o



echo "$(tput setaf 3) $(tput bold)"
cat << EnDoFmEsSaGe
4. Building the interactive Dern REPL
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra \
-DOCTASPIRE_DERN_AMALGAMATED_REPL_IMPLEMENTATION \
-DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \
-I . octaspire-dern-amalgamated.c -lm \
-o octaspire-dern-repl



echo "$(tput setaf 3) $(tput bold)"
cat << EnDoFmEsSaGe
5. Building the 'dern_ncurses' (binary) plugin. PLEASE NOTE: This plugin
requires development version of 'ncurses' library (i.e. headers) to be
installed on the system; otherwise compilation will fail. Failure will
not affect other steps, so if this step fails and you don't want to use
binary plugin 'dern_ncurses', you don't have to do anything. Otherwise,
to install development version of library 'ncurses':
- OpenIndiana: sudo pkg install ncurses
-------------------------------------------------------------------------------
EnDoFmEsSaGe
echoToDefs
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c plugins/dern_ncurses.c
echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lcurses



echo " "
echo "$(tput bold)Done."
echo "$(tput setaf 2) $(tput bold)"
echo "=================================================================="
echo "Run programs and examples like this:"
echo "=================================================================="
echo "$(tput setaf 3)1)$(tput setaf 2) ./octaspire-dern-unit-test-runner"
echo "$(tput setaf 3)2)$(tput setaf 2) ./embedding-example"
echo "$(tput setaf 3)3)$(tput setaf 2) LD_LIBRARY_PATH=. ./octaspire-dern-repl examples/use-mylib.dern"
echo "$(tput setaf 3)4)$(tput setaf 2) ./octaspire-dern-repl -c"
echo "$(tput setaf 3)5)$(tput setaf 2) LD_LIBRARY_PATH=. ./octaspire-dern-repl examples/dern-ncurses-example.dern"
echo "=================================================================="
echoToDefs

4 changes: 2 additions & 2 deletions etc/octaspire_dern_amalgamated.c
Original file line number Diff line number Diff line change
Expand Up @@ -16007,10 +16007,10 @@ limitations under the License.
#define OCTASPIRE_DERN_CONFIG_H

#define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "135"
#define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0"

#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0"
#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.135.0"



Expand Down
48 changes: 12 additions & 36 deletions etc/plugins/dern_ncurses.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "octaspire-dern-amalgamated.c"

#ifdef __NetBSD__
#if defined(__NetBSD__)
#include <curses.h>
#elif defined(__sun) && defined(__SVR4)
// Solaris, OpenIndiana
#define NCURSES_ENABLE_STDBOOL_H 1
#undef bool
#include <curses.h>
#else
#include <ncurses.h>
Expand Down Expand Up @@ -543,10 +548,6 @@ static int dern_ncurses_private_print_symbol(
{
result = waddch(window, ACS_DIAMOND);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_GEQUAL"))
{
result = waddch(window, ACS_GEQUAL);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_HLINE"))
{
result = waddch(window, ACS_HLINE);
Expand All @@ -559,10 +560,6 @@ static int dern_ncurses_private_print_symbol(
{
result = waddch(window, ACS_LARROW);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LEQUAL"))
{
result = waddch(window, ACS_LEQUAL);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LLCORNER"))
{
result = waddch(window, ACS_LLCORNER);
Expand All @@ -575,14 +572,6 @@ static int dern_ncurses_private_print_symbol(
{
result = waddch(window, ACS_LTEE);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_NEQUAL"))
{
result = waddch(window, ACS_NEQUAL);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PI"))
{
result = waddch(window, ACS_PI);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PLMINUS"))
{
result = waddch(window, ACS_PLMINUS);
Expand All @@ -603,22 +592,10 @@ static int dern_ncurses_private_print_symbol(
{
result = waddch(window, ACS_S1);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S3"))
{
result = waddch(window, ACS_S3);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S7"))
{
result = waddch(window, ACS_S7);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S9"))
{
result = waddch(window, ACS_S9);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_STERLING"))
{
result = waddch(window, ACS_STERLING);
}
else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_TTEE"))
{
result = waddch(window, ACS_TTEE);
Expand Down Expand Up @@ -1465,13 +1442,12 @@ bool dern_ncurses_init(
"\twindow Target window, a value returned by some call to ncurses-initscr\n"
"\ty optional Y-coordinate (line) to print to\n"
"\tx optional X-coordinate (column) to print to\n"
"\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n"
"\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n"
"\t ACS_DIAMOND, ACS_GEQUAL, ACS_HLINE, ACS_LANTERN, ACS_LARROW,\n"
"\t ACS_LEQUAL, ACS_LLCORNER, ACS_LRCORNER, ACS_LTEE, ACS_NEQUAL,\n"
"\t ACS_PI, ACS_PLMINUS, ACS_PLUS, ACS_RARROW, ACS_RTEE,\n"
"\t ACS_S1, ACS_S3, ACS_S7, ACS_S9, ACS_STERLING,\n"
"\t ACS_TTEE, ACS_UARROW, ACS_ULCORNER, ACS_URCORNER, ACS_VLINE \n"
"\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n"
"\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n"
"\t ACS_DIAMOND, ACS_HLINE, ACS_LANTERN, ACS_LARROW, ACS_LLCORNER,\n"
"\t ACS_LRCORNER, ACS_LTEE, ACS_PLMINUS, ACS_PLUS, ACS_RARROW,\n"
"\t ACS_RTEE, ACS_S1, ACS_S9, ACS_TTEE, ACS_UARROW,\n"
"\t ACS_ULCORNER, ACS_URCORNER, ACS_VLINE\n"
"\tstring The text to print. To create formatted strings, use 'string-format'\n"
"\tcharacter The character to print.\n"
"\n"
Expand Down
6 changes: 3 additions & 3 deletions release/README
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
This is amalgamated single file source release for Octaspire Dern programming
language version 0.134.0. File 'octaspire-dern-amalgamated.c'
language version 0.135.0. File 'octaspire-dern-amalgamated.c'
is all that is needed; it has no other dependencies than a C compiler and
standard library supporting C99.

SHA-512 checksums for this and older releases can be found from:
https://octaspire.github.io/dern/
If you want to check this release, download checksums for version 0.134.0 from:
https://octaspire.github.io/dern/checksums-0.134.0
If you want to check this release, download checksums for version 0.135.0 from:
https://octaspire.github.io/dern/checksums-0.135.0

Building instructions for all supported platforms (and scripts for building
automatically) can be found in directory 'how-to-build'. Look for a file that
Expand Down
4 changes: 2 additions & 2 deletions release/documentation/Programming_in_Octaspire_Dern.html
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ <h1>Programming in Octaspire Dern</h1>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.134.0</p></div>
<div class="paragraph"><p>Documentation for Octaspire Dern programming language version 0.135.0</p></div>
</div>
</div>
<div class="sect1">
Expand Down Expand Up @@ -1753,7 +1753,7 @@ <h2 id="_using_the_amalgamated_source">Using the amalgamated source</h2>
<div id="footer">
<div id="footer-text">
Last updated
2017-06-15 22:01:56 EEST
2017-06-16 20:48:36 EEST
</div>
</div>
</body>
Expand Down
7 changes: 0 additions & 7 deletions release/examples/dern-ncurses-example.dern
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,18 @@
(ncurses-print win 'ACS_DARROW)
(ncurses-print win 'ACS_DEGREE)
(ncurses-print win 'ACS_DIAMOND)
(ncurses-print win 'ACS_GEQUAL)
(ncurses-print win 'ACS_HLINE)
(ncurses-print win 'ACS_LANTERN)
(ncurses-print win 'ACS_LARROW)
(ncurses-print win 'ACS_LEQUAL)
(ncurses-print win 'ACS_LLCORNER)
(ncurses-print win 'ACS_LRCORNER)
(ncurses-print win 'ACS_LTEE)
(ncurses-print win 'ACS_NEQUAL)
(ncurses-print win 'ACS_PI)
(ncurses-print win 'ACS_PLMINUS)
(ncurses-print win 'ACS_PLUS)
(ncurses-print win 'ACS_RARROW)
(ncurses-print win 'ACS_RTEE)
(ncurses-print win 'ACS_S1)
(ncurses-print win 'ACS_S3)
(ncurses-print win 'ACS_S7)
(ncurses-print win 'ACS_S9)
(ncurses-print win 'ACS_STERLING)
(ncurses-print win 'ACS_TTEE)
(ncurses-print win 'ACS_UARROW)
(ncurses-print win 'ACS_ULCORNER)
Expand Down
4 changes: 2 additions & 2 deletions release/octaspire-dern-amalgamated.c
Original file line number Diff line number Diff line change
Expand Up @@ -16007,10 +16007,10 @@ limitations under the License.
#define OCTASPIRE_DERN_CONFIG_H

#define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134"
#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "135"
#define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0"

#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0"
#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.135.0"



Expand Down
Loading

0 comments on commit 6e753b1

Please sign in to comment.