Hi Omar --

On 1/25/2022 3:09 PM, Omar Polo wrote:
> Brian Callahan <[email protected]> writes:
> 
>> Hi Omar --
>>
>> On 1/25/2022 5:36 AM, Omar Polo wrote:
>>> Hello,
>>>
>>> algol68g saw some further developments recently with a major version
>>> released some time ago.  Among various things, it also includes the fix
>>> for the usleep issue we found :)
>>>
>>
>> I took at quick look at this. It looks like upstream still gets the
>> check wrong though. IIRC, it checks to see if the return value for
>> usleep is EINTR instead of the return value being -1 and errno being set
>> to EINTR.
> 
> Yes...  I just grepped for usleep and stopped when seeing the ASSERT.
> it needs to the same fix for the previous version.  (which is strange
> since upstream merged the correct fix a couple of months ago.)
> 
>> [...]
>>
>> I had a half-finished diff that was a little different than yours. I'll
>> triangulate and see if I can't figure out this shared object issue in
>> the test over the new few days.
> 
> thanks!
> 

Sorry this took so long, but I've finally gotten a68g updated and the
compiler working again. There's a new version, 3.0.4, that this updates
to. It appears to fix your executing binaries problem by compiling the
shared library into the pseudo-executable itself.

I have the same test results on this version as you did previously.

And while here, drop all the $OpenBSD$ tags.

OK?

~Brian
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/algol68g/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile    7 Nov 2021 20:33:01 -0000       1.4
+++ Makefile    6 Mar 2022 22:09:25 -0000
@@ -1,8 +1,5 @@
-# $OpenBSD: Makefile,v 1.4 2021/11/07 20:33:01 bcallah Exp $
-
 COMMENT =      Algol 68 Genie compiler-interpreter
-DISTNAME =     algol68g-2.8.5
-REVISION =     0
+DISTNAME =     algol68g-3.0.4
 CATEGORIES =   lang
 
 HOMEPAGE =     https://jmvdveer.home.xs4all.nl/algol.html
@@ -13,15 +10,25 @@ PERMIT_PACKAGE =    Yes
 
 MASTER_SITES = https://jmvdveer.home.xs4all.nl/
 
-WANTLIB += c curses gsl gslcblas m pthread readline
-
-LIB_DEPENDS =  devel/gsl
+WANTLIB += c curses m pthread
 
-CONFIGURE_STYLE =      gnu
-CONFIGURE_ARGS =       --disable-plotutils --disable-postgresql
+CONFIGURE_STYLE =      autoreconf
+CONFIGURE_ARGS =       --disable-gsl \
+                       --disable-mathib \
+                       --disable-mpfr \
+                       --disable-plotutils \
+                       --disable-postgresql
 CONFIGURE_ENV =                CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
                        LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
 
-NO_TEST =      Yes
+AUTOCONF_VERSION =     2.69
+AUTOMAKE_VERSION =     1.16
+
+# configure needs to be writeable otherwise autoconf won't regen it
+post-extract:
+       chmod +w ${WRKSRC}/configure
+
+do-gen:
+       sed -i "s,LOCALBASE,${LOCALBASE},g" ${WRKSRC}/src/a68g/a68g.c
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/algol68g/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo    14 Aug 2018 00:50:17 -0000      1.2
+++ distinfo    6 Mar 2022 22:09:25 -0000
@@ -1,2 +1,2 @@
-SHA256 (algol68g-2.8.5.tar.gz) = D3V8ZKg0L+OOxQG95oth0m0FHf/UV0LKWLcoipnH4tg=
-SIZE (algol68g-2.8.5.tar.gz) = 543905
+SHA256 (algol68g-3.0.4.tar.gz) = JrrOXe1grvq32946NLAHs80xsmYF5o3SKWiNqFbp+HA=
+SIZE (algol68g-3.0.4.tar.gz) = 622123
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure     14 Aug 2018 00:50:17 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,375 +0,0 @@
-$OpenBSD: patch-configure,v 1.2 2018/08/14 00:50:17 bcallah Exp $
-
-Enable compiler on OpenBSD (regenerated configure script)
-
-Index: configure
---- configure.orig
-+++ configure
-@@ -708,7 +708,6 @@ infodir
- docdir
- oldincludedir
- includedir
--runstatedir
- localstatedir
- sharedstatedir
- sysconfdir
-@@ -792,7 +791,6 @@ datadir='${datarootdir}'
- sysconfdir='${prefix}/etc'
- sharedstatedir='${prefix}/com'
- localstatedir='${prefix}/var'
--runstatedir='${localstatedir}/run'
- includedir='${prefix}/include'
- oldincludedir='/usr/include'
- docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-@@ -1045,15 +1043,6 @@ do
-   | -silent | --silent | --silen | --sile | --sil)
-     silent=yes ;;
- 
--  -runstatedir | --runstatedir | --runstatedi | --runstated \
--  | --runstate | --runstat | --runsta | --runst | --runs \
--  | --run | --ru | --r)
--    ac_prev=runstatedir ;;
--  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
--  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
--  | --run=* | --ru=* | --r=*)
--    runstatedir=$ac_optarg ;;
--
-   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-     ac_prev=sbindir ;;
-   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-@@ -1191,7 +1180,7 @@ fi
- for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
-               datadir sysconfdir sharedstatedir localstatedir includedir \
-               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
--              libdir localedir mandir runstatedir
-+              libdir localedir mandir
- do
-   eval ac_val=\$$ac_var
-   # Remove trailing slashes.
-@@ -1344,7 +1333,6 @@ Fine tuning of the installation directories:
-   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-   --sharedstatedir=DIR    modifiable architecture-independent data 
[PREFIX/com]
-   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
--  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
-   --libdir=DIR            object code libraries [EPREFIX/lib]
-   --includedir=DIR        C header files [PREFIX/include]
-   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-@@ -2383,10 +2371,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- 
- 
- 
--# Check whether $1 is in dl.
--
--
--
- #
- # Platform ids.
- #
-@@ -2601,15 +2585,15 @@ $as_echo "netbsd" >&6; }
- #
- # OpenBSD.
- #
--*86-*-openbsd* | *86_64-*-openbsd*)
-+i386-*-openbsd* | amd64-*-openbsd* | x86_64-*-openbsd* | arm*-*-openbsd* | 
aarch64-*-openbsd*)
- 
- $as_echo "#define HAVE_OPENBSD 1" >>confdefs.h
- 
--  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configuring 
interpreter-only on OpenBSD" >&5
--$as_echo "$as_me: WARNING: configuring interpreter-only on OpenBSD" >&2;}
-+
-+$as_echo "#define HAVE_IEEE_754 1" >>confdefs.h
-+
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: openbsd" >&5
- $as_echo "openbsd" >&6; }
--  enable_compiler=no
-   ;;
- #
- # Others, untested.
-@@ -18564,287 +18548,6 @@ fi
- 
- 
- $as_echo "#define HAVE_POSTGRESQL 1" >>confdefs.h
--
--  fi
--fi
--
--if test "x$enable_compiler" = "xyes"; then
--  { $as_echo "$as_me:${as_lineno-$LINENO}: Dynamic loader..." >&5
--$as_echo "$as_me: Dynamic loader..." >&6;}
--  for ac_header in dlfcn.h
--do :
--  ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" 
"$ac_includes_default"
--if test "x$ac_cv_header_dlfcn_h" = xyes; then :
--  cat >>confdefs.h <<_ACEOF
--#define HAVE_DLFCN_H 1
--_ACEOF
--
--fi
--
--done
--
--  ac_fn_c_check_decl "$LINENO" "dlopen" "ac_cv_have_decl_dlopen" "
--#include <dlfcn.h>
--
--"
--if test "x$ac_cv_have_decl_dlopen" = xyes; then :
--
--else
--  enable_compiler=no
--fi
--
--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
--$as_echo_n "checking for dlopen in -ldl... " >&6; }
--if ${ac_cv_lib_dl_dlopen+:} false; then :
--  $as_echo_n "(cached) " >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-ldl  $LIBS"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--/* Override any GCC internal prototype to avoid an error.
--   Use char because int might match the return type of a GCC
--   builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char dlopen ();
--int
--main ()
--{
--return dlopen ();
--  ;
--  return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_dl_dlopen=yes
--else
--  ac_cv_lib_dl_dlopen=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
--    conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
--$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
--if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
--  a68g_unexpected=yes
--else
--  enable_compiler=no
--fi
--
--
--  if test "x$enable_compiler" = "xyes"; then
--    ac_fn_c_check_decl "$LINENO" "dlsym" "ac_cv_have_decl_dlsym" "
--#include <dlfcn.h>
--
--"
--if test "x$ac_cv_have_decl_dlsym" = xyes; then :
--
--else
--  enable_compiler=no
--fi
--
--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
--$as_echo_n "checking for dlsym in -ldl... " >&6; }
--if ${ac_cv_lib_dl_dlsym+:} false; then :
--  $as_echo_n "(cached) " >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-ldl  $LIBS"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--/* Override any GCC internal prototype to avoid an error.
--   Use char because int might match the return type of a GCC
--   builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char dlsym ();
--int
--main ()
--{
--return dlsym ();
--  ;
--  return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_dl_dlsym=yes
--else
--  ac_cv_lib_dl_dlsym=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
--    conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5
--$as_echo "$ac_cv_lib_dl_dlsym" >&6; }
--if test "x$ac_cv_lib_dl_dlsym" = xyes; then :
--  a68g_unexpected=yes
--else
--  enable_compiler=no
--fi
--
--
--    ac_fn_c_check_decl "$LINENO" "dlerror" "ac_cv_have_decl_dlerror" "
--#include <dlfcn.h>
--
--"
--if test "x$ac_cv_have_decl_dlerror" = xyes; then :
--
--else
--  enable_compiler=no
--fi
--
--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlerror in -ldl" >&5
--$as_echo_n "checking for dlerror in -ldl... " >&6; }
--if ${ac_cv_lib_dl_dlerror+:} false; then :
--  $as_echo_n "(cached) " >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-ldl  $LIBS"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--/* Override any GCC internal prototype to avoid an error.
--   Use char because int might match the return type of a GCC
--   builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char dlerror ();
--int
--main ()
--{
--return dlerror ();
--  ;
--  return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_dl_dlerror=yes
--else
--  ac_cv_lib_dl_dlerror=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
--    conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlerror" >&5
--$as_echo "$ac_cv_lib_dl_dlerror" >&6; }
--if test "x$ac_cv_lib_dl_dlerror" = xyes; then :
--  a68g_unexpected=yes
--else
--  enable_compiler=no
--fi
--
--
--    ac_fn_c_check_decl "$LINENO" "dlclose" "ac_cv_have_decl_dlclose" "
--#include <dlfcn.h>
--
--"
--if test "x$ac_cv_have_decl_dlclose" = xyes; then :
--
--else
--  enable_compiler=no
--fi
--
--  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlclose in -ldl" >&5
--$as_echo_n "checking for dlclose in -ldl... " >&6; }
--if ${ac_cv_lib_dl_dlclose+:} false; then :
--  $as_echo_n "(cached) " >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-ldl  $LIBS"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--/* Override any GCC internal prototype to avoid an error.
--   Use char because int might match the return type of a GCC
--   builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char dlclose ();
--int
--main ()
--{
--return dlclose ();
--  ;
--  return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_dl_dlclose=yes
--else
--  ac_cv_lib_dl_dlclose=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
--    conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlclose" >&5
--$as_echo "$ac_cv_lib_dl_dlclose" >&6; }
--if test "x$ac_cv_lib_dl_dlclose" = xyes; then :
--  a68g_unexpected=yes
--else
--  enable_compiler=no
--fi
--
--
--  fi
--  if test "x$enable_compiler" = "xyes"; then
--    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
--$as_echo_n "checking for dlopen in -ldl... " >&6; }
--if ${ac_cv_lib_dl_dlopen+:} false; then :
--  $as_echo_n "(cached) " >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-ldl  $LIBS"
--cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--/* Override any GCC internal prototype to avoid an error.
--   Use char because int might match the return type of a GCC
--   builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char dlopen ();
--int
--main ()
--{
--return dlopen ();
--  ;
--  return 0;
--}
--_ACEOF
--if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_dl_dlopen=yes
--else
--  ac_cv_lib_dl_dlopen=no
--fi
--rm -f core conftest.err conftest.$ac_objext \
--    conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
--$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
--if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
--  cat >>confdefs.h <<_ACEOF
--#define HAVE_LIBDL 1
--_ACEOF
--
--  LIBS="-ldl $LIBS"
--
--fi
--
--
--$as_echo "#define HAVE_DL 1" >>confdefs.h
- 
-   fi
- fi
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac  6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,58 @@
+Build the compiler
+Mention that we are IEEE 754 compliant
+Remove hardcoded optimization flags
+Remove broken configure tests
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -245,9 +245,8 @@ case "$host" in
+ #
+ *86-*-openbsd* | *86_64-*-openbsd*) 
+   AC_DEFINE(BUILD_BSD, 1, [Define this if OpenBSD was detected]) 
+-  AC_MSG_WARN([configuring interpreter-only])
++  AC_DEFINE(HAVE_IEEE_754, 1, [Define this if IEEE_754 compliant]) 
+   AC_MSG_RESULT([openbsd])
+-  enable_compiler=no
+   ;;
+ #
+ # Haiku.
+@@ -318,7 +317,6 @@ if test "x$GCC" != "xyes"; then
+   AC_MSG_WARN([gcc is the preferred C compiler; configuring interpreter-only])
+ else
+   AC_DEFINE(HAVE_GCC, 1, [Define this if GCC was detected]) 
+-  CFLAGS="-g -O2 -Wall"
+   A68G_AC_PROG_CC_CFLAGS([-Wshadow])
+   A68G_AC_PROG_CC_CFLAGS([-Wunused-variable])
+   A68G_AC_PROG_CC_CFLAGS([-Wunused-parameter])
+@@ -333,12 +331,6 @@ else
+   [AC_MSG_RESULT(no)
+    AC_MSG_FAILURE([stop -- C compiler does not support __attribute__aligned 
directive])],
+   [])
+-  AC_MSG_CHECKING([attribute inline supported])
+-  AC_RUN_IFELSE([AC_LANG_PROGRAM([], [inline void skip (void) {;}])],
+-  [AC_MSG_RESULT(yes)],
+-  [AC_MSG_RESULT(no)
+-   AC_MSG_FAILURE([stop -- C compiler does not support __attribute__aligned 
directive])],
+-  [])
+ #
+ # Check -Wl,--export-dynamic, needed for creating shared objects.
+ #
+@@ -732,17 +724,6 @@ if test "x$enable_postgresql" = "xyes"; then
+   AC_CHECK_LIB([pq], [PQbackendPID], [], [enable_postgresql=no])
+   if test "x$enable_postgresql" = "xyes"; then
+     AC_DEFINE(HAVE_POSTGRESQL, 1, [Define this if a good PostgreSQL 
installation was detected]) 
+-  fi
+-fi
+-
+-if test "x$enable_compiler" = "xyes"; then
+-  libdl_found=no
+-  AC_MSG_NOTICE([Dynamic loader via libdl...])
+-  AC_CHECK_HEADERS([dlfcn.h])
+-  AC_CHECK_LIB([dl], [dlopen], [], enable_compiler=no)
+-  if test "x$enable_compiler" = "xyes"; then
+-    AC_DEFINE(HAVE_DL, 1, [Define this if a good DL installation was 
detected]) 
+-    libdl_found=yes
+   fi
+ fi
+ 
Index: patches/patch-source_a68g_c
===================================================================
RCS file: patches/patch-source_a68g_c
diff -N patches/patch-source_a68g_c
--- patches/patch-source_a68g_c 14 Aug 2018 00:50:17 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-$OpenBSD: patch-source_a68g_c,v 1.2 2018/08/14 00:50:17 bcallah Exp $
-
-Enable compiler on OpenBSD.
-
-Index: source/a68g.c
---- source/a68g.c.orig
-+++ source/a68g.c
-@@ -903,7 +903,7 @@ Accept various silent extensions.
- /*
- Compilation on Linux, FreeBSD or NetBSD using gcc
- */
--#if (defined HAVE_LINUX || defined HAVE_FREEBSD || defined HAVE_NETBSD)
-+#if (defined HAVE_LINUX || defined HAVE_FREEBSD || defined HAVE_NETBSD || 
defined HAVE_OPENBSD)
- #if defined HAVE_TUNING
-       ASSERT (snprintf (options, SNPRINTF_SIZE, "%s %s %s -g", extra_inc, 
optimisation, HAVE_TUNING) >= 0);
- #else
-@@ -1679,7 +1679,7 @@ set_options (OPTION_LIST_T * i, BOOL_T cmd_line)
-               a68g_exit (EXIT_SUCCESS);
-             }
- #endif
--#if (! defined HAVE_LINUX)
-+#if (! (defined HAVE_LINUX || defined HAVE_OPENBSD))
-             if (eq (q, "linux")) {
-               WRITELN (STDOUT_FILENO, "linux required - exiting graciously");
-               a68g_exit (EXIT_SUCCESS);
-@@ -1832,7 +1832,7 @@ set_options (OPTION_LIST_T * i, BOOL_T cmd_line)
-         }
- /* COMPILE and NOCOMPILE switch on/off compilation */
-         else if (eq (p, "Compile")) {
--#if defined HAVE_LINUX
-+#if defined HAVE_LINUX || defined HAVE_OPENBSD
-           OPTION_COMPILE (&program) = A68_TRUE;
-           OPTION_OPTIMISE (&program) = A68_TRUE;
-           OPTION_OPT_LEVEL (&program) = 2;
-@@ -1885,7 +1885,7 @@ set_options (OPTION_LIST_T * i, BOOL_T cmd_line)
-         }
- /* RUN-SCRIPT runs a comiled .sh script */
-         else if (eq (p, "RUN-SCRIPT")) {
--#if defined HAVE_LINUX
-+#if defined HAVE_LINUX || defined HAVE_OPENBSD
-           FORWARD (i);
-           if (i != NO_OPTION_LIST) {
-             if (!name_set) {
-@@ -1908,7 +1908,7 @@ set_options (OPTION_LIST_T * i, BOOL_T cmd_line)
-         }
- /* RUN-QUOTE-SCRIPT runs a comiled .sh script */
-         else if (eq (p, "RUN-QUOTE-SCRIPT")) {
--#if defined HAVE_LINUX
-+#if defined HAVE_LINUX || defined HAVE_OPENBSD
-           FORWARD (i);
-           if (i != NO_OPTION_LIST) {
-             if (!name_set) {
Index: patches/patch-source_a68g_h
===================================================================
RCS file: patches/patch-source_a68g_h
diff -N patches/patch-source_a68g_h
--- patches/patch-source_a68g_h 14 Aug 2018 00:50:17 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-source_a68g_h,v 1.2 2018/08/14 00:50:17 bcallah Exp $
-
-Enable compiler on OpenBSD.
-
-Index: source/a68g.h
---- source/a68g.h.orig
-+++ source/a68g.h
-@@ -54,7 +54,7 @@ Top level include file.
- #undef HAVE_COMPILER
- #elif ((defined HAVE_LINUX || defined HAVE_MAC_OS_X) && defined HAVE_DL)
- #define HAVE_COMPILER 1
--#elif (defined HAVE_FREEBSD || defined HAVE_NETBSD)
-+#elif (defined HAVE_FREEBSD || defined HAVE_NETBSD || defined HAVE_OPENBSD)
- #define HAVE_COMPILER 1
- #else
- #undef HAVE_COMPILER
-@@ -63,7 +63,7 @@ Top level include file.
- /* Can we access the internet? */
- 
- #if (defined HAVE_NETDB_H && defined HAVE_NETINET_IN_H && defined 
HAVE_SYS_SOCKET_H)
--#if (defined HAVE_LINUX || defined HAVE_MAC_OS_X || defined HAVE_FREEBSD || 
defined HAVE_NETBSD)
-+#if (defined HAVE_LINUX || defined HAVE_MAC_OS_X || defined HAVE_FREEBSD || 
defined HAVE_NETBSD || defined HAVE_OPENBSD)
- #define HAVE_HTTP
- #endif
- #endif
Index: patches/patch-source_genie_c
===================================================================
RCS file: patches/patch-source_genie_c
diff -N patches/patch-source_genie_c
--- patches/patch-source_genie_c        7 Nov 2021 20:33:01 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-source_genie_c,v 1.1 2021/11/07 20:33:01 bcallah Exp $
-
-Ignore usleep(3) return value.
-It can only fail with EINTR and shouldn't stop execution.
-
-Index: source/genie.c
---- source/genie.c.orig
-+++ source/genie.c
-@@ -7204,7 +7204,7 @@ genie_down_sema (NODE_T * p)
-         }
-         UNLOCK_THREAD;
- /* Waiting a bit relaxes overhead */
--        ASSERT (usleep (10) == 0);
-+        usleep (10);
-         LOCK_THREAD;
- /* Garbage may be collected, so recalculate 'k' */
-         k = DEREF (A68_INT, &s);
Index: patches/patch-src_a68g_a68g_c
===================================================================
RCS file: patches/patch-src_a68g_a68g_c
diff -N patches/patch-src_a68g_a68g_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_a68g_a68g_c       6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,14 @@
+Use cc(1) rather than gcc to build shared libraries.
+
+Index: src/a68g/a68g.c
+--- src/a68g/a68g.c.orig
++++ src/a68g/a68g.c
+@@ -448,7 +448,7 @@ static void compiler_interpreter (void)
+       bufcat (options, " ", BUFFER_SIZE);
+       bufcat (options, HAVE_PIC, BUFFER_SIZE);
+ #endif
+-      ASSERT (snprintf (cmd, SNPRINTF_SIZE, "gcc %s -c -o \"%s\" \"%s\"", 
options, FILE_BINARY_NAME (&A68_JOB), FILE_OBJECT_NAME (&A68_JOB)) >= 0);
++      ASSERT (snprintf (cmd, SNPRINTF_SIZE, "cc -ILOCALBASE/include %s -c -o 
\"%s\" \"%s\"", options, FILE_BINARY_NAME (&A68_JOB), FILE_OBJECT_NAME 
(&A68_JOB)) >= 0);
+       ABEND (system (cmd) != 0, ERROR_ACTION, cmd);
+       ASSERT (snprintf (cmd, SNPRINTF_SIZE, "ld -export-dynamic -shared -o 
\"%s\" \"%s\"", FILE_LIBRARY_NAME (&A68_JOB), FILE_BINARY_NAME (&A68_JOB)) >= 
0);
+       ABEND (system (cmd) != 0, ERROR_ACTION, cmd);
Index: patches/patch-src_a68g_options_c
===================================================================
RCS file: patches/patch-src_a68g_options_c
diff -N patches/patch-src_a68g_options_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_a68g_options_c    6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,32 @@
+We built the compiler, so we need to be able to use it.
+
+Index: src/a68g/options.c
+--- src/a68g/options.c.orig
++++ src/a68g/options.c
+@@ -701,7 +701,7 @@ BOOL_T set_options (OPTION_LIST_T * i, BOOL_T cmd_line
+         }
+ // COMPILE and NOCOMPILE switch on/off compilation.
+         else if (eq (p, "Compile")) {
+-#if defined (BUILD_LINUX)
++#if defined (BUILD_LINUX) || defined (BUILD_BSD)
+           OPTION_COMPILE (&A68_JOB) = A68_TRUE;
+           OPTION_COMPILE_CHECK (&A68_JOB) = A68_TRUE;
+           if (OPTION_OPT_LEVEL (&A68_JOB) < OPTIMISE_1) {
+@@ -745,7 +745,7 @@ BOOL_T set_options (OPTION_LIST_T * i, BOOL_T cmd_line
+         }
+ // RUN-SCRIPT runs a compiled .sh script.
+         else if (eq (p, "RUN-SCRIPT")) {
+-#if defined (BUILD_LINUX)
++#if defined (BUILD_LINUX) || defined (BUILD_BSD)
+           FORWARD (i);
+           if (i != NO_OPTION_LIST) {
+             if (!name_set) {
+@@ -766,7 +766,7 @@ BOOL_T set_options (OPTION_LIST_T * i, BOOL_T cmd_line
+         }
+ // RUN-QUOTE-SCRIPT runs a compiled .sh script.
+         else if (eq (p, "RUN-QUOTE-SCRIPT")) {
+-#if defined (BUILD_LINUX)
++#if defined (BUILD_LINUX) || defined (BUILD_BSD)
+           FORWARD (i);
+           if (i != NO_OPTION_LIST) {
+             if (!name_set) {
Index: patches/patch-src_a68g_parallel_c
===================================================================
RCS file: patches/patch-src_a68g_parallel_c
diff -N patches/patch-src_a68g_parallel_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_a68g_parallel_c   6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,14 @@
+Ignore usleep(3) return value.
+It can only fail with EINTR and shouldn't stop execution.
+
+Index: src/a68g/parallel.c
+--- src/a68g/parallel.c.orig
++++ src/a68g/parallel.c
+@@ -519,7 +519,6 @@ void genie_down_sema (NODE_T * p)
+         UNLOCK_THREAD;
+ // Waiting a bit relaxes overhead.
+         int rc = usleep (10);
+-        ASSERT (rc == 0 || rc == EINTR);
+         LOCK_THREAD;
+ // Garbage may be collected, so recalculate 'k'.
+         k = DEREF (A68_INT, &s);
Index: patches/patch-src_include_a68g-includes_h
===================================================================
RCS file: patches/patch-src_include_a68g-includes_h
diff -N patches/patch-src_include_a68g-includes_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_include_a68g-includes_h   6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,15 @@
+configure misdetects this but we need it to compile the compiler
+
+Index: src/include/a68g-includes.h
+--- src/include/a68g-includes.h.orig
++++ src/include/a68g-includes.h
+@@ -66,9 +66,7 @@
+ #include <dirent.h>
+ #endif
+ 
+-#if defined (HAVE_DL)
+ #include <dlfcn.h>
+-#endif
+ 
+ #if defined (HAVE_ERRNO_H)
+ #include <errno.h>
Index: patches/patch-src_include_a68g-platform_h
===================================================================
RCS file: patches/patch-src_include_a68g-platform_h
diff -N patches/patch-src_include_a68g-platform_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_include_a68g-platform_h   6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,14 @@
+Use correct configuration file.
+
+Index: src/include/a68g-platform.h
+--- src/include/a68g-platform.h.orig
++++ src/include/a68g-platform.h
+@@ -24,8 +24,6 @@
+ 
+ #if defined (BUILD_WIN32)
+ #include "a68g-config.win32.h"
+-#elif defined (BUILD_BSD)
+-#include "a68g-config.bsd.h"
+ #else
+ #include "a68g-config.h"
+ #endif
Index: patches/patch-src_include_a68g_h
===================================================================
RCS file: patches/patch-src_include_a68g_h
diff -N patches/patch-src_include_a68g_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_include_a68g_h    6 Mar 2022 22:09:25 -0000
@@ -0,0 +1,14 @@
+Build the compiler on OpenBSD.
+
+Index: src/include/a68g.h
+--- src/include/a68g.h.orig
++++ src/include/a68g.h
+@@ -32,7 +32,7 @@
+ 
+ // Build switches depending on platform.
+ 
+-#if (defined (BUILD_LINUX) && defined (HAVE_GCC) && defined (HAVE_DL))
++#if (defined (HAVE_GCC))
+ #  define BUILD_A68_COMPILER
+ #else
+ // Untested, so disabled.
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/algol68g/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   29 Jun 2017 15:56:14 -0000      1.1.1.1
+++ pkg/PLIST   6 Mar 2022 22:09:25 -0000
@@ -1,11 +1,43 @@
-@comment $OpenBSD: PLIST,v 1.1.1.1 2017/06/29 15:56:14 bcallah Exp $
 @bin bin/a68g
 include/algol68g/
+include/algol68g/a68g-common.h
+include/algol68g/a68g-compiler.h
 include/algol68g/a68g-config.h
+include/algol68g/a68g-defines.h
+include/algol68g/a68g-diagnostics.h
+include/algol68g/a68g-double.h
+include/algol68g/a68g-enums.h
+include/algol68g/a68g-environ.h
+include/algol68g/a68g-frames.h
+include/algol68g/a68g-generic.h
+include/algol68g/a68g-genie.h
+include/algol68g/a68g-includes.h
+include/algol68g/a68g-level-3.h
+include/algol68g/a68g-lib.h
+include/algol68g/a68g-listing.h
+include/algol68g/a68g-masks.h
+include/algol68g/a68g-math.h
+include/algol68g/a68g-mp.h
+include/algol68g/a68g-nil.h
+include/algol68g/a68g-numbers.h
+include/algol68g/a68g-optimiser.h
+include/algol68g/a68g-options.h
+include/algol68g/a68g-parser.h
+include/algol68g/a68g-physics.h
+include/algol68g/a68g-platform.h
+include/algol68g/a68g-postulates.h
+include/algol68g/a68g-prelude-gsl.h
+include/algol68g/a68g-prelude-mathlib.h
+include/algol68g/a68g-prelude.h
+include/algol68g/a68g-stack.h
+include/algol68g/a68g-stddef.h
+include/algol68g/a68g-transput.h
+include/algol68g/a68g-types.h
 include/algol68g/a68g.h
 @man man/man1/a68g.1
 share/doc/algol68g/
 share/doc/algol68g/AUTHORS
 share/doc/algol68g/COPYING
+share/doc/algol68g/LICENSE
 share/doc/algol68g/NEWS
 share/doc/algol68g/README

Reply via email to