On 2026/02/13 08:32, Chris Cappuccio wrote:
> Stuart Henderson [[email protected]] wrote:
> > 
> > you want CONFIGURE_STYLE=autoreconf here, drop AUTO*_VERSION from MAKE_ENV,
> > drop pre-configure
> > 
> 
> I tried that first and hit this little gem in V3Global.h:
> # error "Something failed during ./configure as config_package.h is 
> incomplete. Perhaps you used autoreconf, don't." 

that's strange. diff below fixes this the right way (it doesn't use
automake, and what you had didn't set the build dep). also fixes tests
and a few other tweaks.

i think this is not too bad now (there are still some issues e.g. around
the debug binaries it installs which get stripped, but not critical) so
if it still works for you, ok

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/verilator/Makefile,v
diff -u -p -r1.20 Makefile
--- Makefile    26 Sep 2023 12:02:04 -0000      1.20
+++ Makefile    15 Feb 2026 16:27:25 -0000
@@ -1,30 +1,40 @@
 COMMENT=       very fast free Verilog HDL simulator
 
-DISTNAME =     verilator-3.912
+GH_ACCOUNT =   verilator
+GH_PROJECT =   verilator
+GH_TAGNAME =   v5.044
+
 CATEGORIES=    lang devel
-REVISION =     3
 
 HOMEPAGE=      https://www.veripool.org/wiki/verilator/Intro
 
 # LGPLv3 or Perl
 PERMIT_PACKAGE=        Yes
 
-SITES=                 https://www.veripool.org/ftp/
-EXTRACT_SUFX=          .tgz
-
 WANTLIB=               c m ${COMPILER_LIBCXX}
 
 COMPILER =             base-clang ports-gcc base-gcc
 
-BUILD_DEPENDS +=       devel/bison
+BUILD_DEPENDS +=       devel/bison \
+                       devel/help2man
 
-CONFIGURE_STYLE=       gnu
+CONFIGURE_STYLE =      autoconf no-autoheader
 MAKE_FLAGS=            VERILATOR_ROOT=${PREFIX}/share/verilator/ \
                        COPT="${CFLAGS}"
 
+AUTOCONF_VERSION =     2.72
+
+CONFIGURE_ENV +=       YACC="${LOCALBASE}/bin/bison" \
+                       ac_cv_prog_OBJCACHE=""
+
 USE_GMAKE=             Yes
 
 TEST_TARGET=           test
-TEST_FLAGS=            VERILATOR_ROOT=${WRKSRC}
+TEST_DEPENDS=          sysutils/py-distro
+TEST_FLAGS=            MAKE=${MAKE_PROGRAM} \
+                       VERILATOR_ROOT=${WRKSRC}
+
+post-install:
+       mv ${PREFIX}/share/verilator/examples ${PREFIX}/share/examples/verilator
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/verilator/distinfo,v
diff -u -p -r1.7 distinfo
--- distinfo    5 Oct 2017 08:58:51 -0000       1.7
+++ distinfo    15 Feb 2026 16:27:25 -0000
@@ -1,2 +1,2 @@
-SHA256 (verilator-3.912.tgz) = J8ShF0GVu9c8eWWwGNgySMueeAMk+UBmsF5yVTVI0GQ=
-SIZE (verilator-3.912.tgz) = 2052609
+SHA256 (verilator-5.044.tar.gz) = 3tKkqW47g23cn9XQESeZnZga3uTRkTP/gZtxKYl9gBo=
+SIZE (verilator-5.044.tar.gz) = 5474674
Index: patches/patch-bin_verilator
===================================================================
RCS file: patches/patch-bin_verilator
diff -N patches/patch-bin_verilator
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-bin_verilator 15 Feb 2026 16:27:25 -0000
@@ -0,0 +1,30 @@
+Index: bin/verilator
+--- bin/verilator.orig
++++ bin/verilator
+@@ -101,7 +101,7 @@ if ($opt_gdb) {
+     # Generic GDB interactive
+     run (ulimit_stack_unlimited()
+          . aslr(0)
+-         . ($ENV{VERILATOR_GDB} || "gdb")
++         . ($ENV{VERILATOR_GDB} || "egdb")
+          . " " . verilator_bin()
+          # Note, uncomment to set breakpoints before running:
+          #  ." -ex 'break main'"
+@@ -124,7 +124,7 @@ if ($opt_gdb) {
+     # Run under GDB to get gdbbt
+     run (ulimit_stack_unlimited()
+          . aslr(0)
+-         . "gdb"
++         . "egdb"
+          . " " . verilator_bin()
+          . " --batch --quiet --return-child-result"
+          . " -ex \"run " . join(' ', @quoted_sw)."\""
+@@ -185,7 +185,7 @@ sub verilator_bin {
+ 
+ sub gdb_works {
+     $! = undef;  # Cleanup -x
+-    system("gdb /bin/echo"
++    system("egdb /bin/echo"
+            . " --batch-silent --quiet --return-child-result"
+            . " -ex 'run -n'"  # `echo -n`
+            . " -ex 'set width 0'"
Index: patches/patch-include_verilatedos_h
===================================================================
RCS file: patches/patch-include_verilatedos_h
diff -N patches/patch-include_verilatedos_h
--- patches/patch-include_verilatedos_h 11 Mar 2022 19:29:18 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-__builtin_unreachable() available with gcc>=4.5
-
-Index: include/verilatedos.h
---- include/verilatedos.h.orig
-+++ include/verilatedos.h
-@@ -46,7 +46,11 @@
- # define VL_FUNC  __func__
- # define VL_LIKELY(x) __builtin_expect(!!(x), 1)
- # define VL_UNLIKELY(x)       __builtin_expect(!!(x), 0)
--# define VL_UNREACHABLE __builtin_unreachable();
-+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || __GNUC__ > 4 || 
defined(__clang__)
-+#  define VL_UNREACHABLE __builtin_unreachable();
-+# else
-+#  define VL_UNREACHABLE ;
-+# endif
- # define VL_PREFETCH_RD(p) __builtin_prefetch((p),0)
- # define VL_PREFETCH_RW(p) __builtin_prefetch((p),1)
- #elif defined(_MSC_VER)
Index: patches/patch-src_V3EmitCSyms_cpp
===================================================================
RCS file: patches/patch-src_V3EmitCSyms_cpp
diff -N patches/patch-src_V3EmitCSyms_cpp
--- patches/patch-src_V3EmitCSyms_cpp   15 Nov 2023 19:44:31 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-Index: src/V3EmitCSyms.cpp
---- src/V3EmitCSyms.cpp.orig
-+++ src/V3EmitCSyms.cpp
-@@ -329,7 +329,7 @@ void EmitCSyms::emitSymHdr() {
-     {  // Scope names
-       bool did = false;
-       for (ScopeNames::iterator it = m_scopeNames.begin(); it != 
m_scopeNames.end(); ++it) {
--          if (!did++) puts("\n// SCOPE NAMES\n");
-+          if (!did) { did = true; puts("\n// SCOPE NAMES\n"); }
-           puts("VerilatedScope __Vscope_"+it->second.m_symName+";\n");
-       }
-     }
-@@ -432,7 +432,7 @@ void EmitCSyms::emitSymImp() {
-     {  // Setup scope names
-       bool did = false;
-       for (ScopeNames::iterator it = m_scopeNames.begin(); it != 
m_scopeNames.end(); ++it) {
--          if (!did++) puts("// Setup scope names\n");
-+          if (!did) { did = true; puts("// Setup scope names\n"); }
-           puts("__Vscope_"+it->second.m_symName+".configure(this,name(),");
-           putsQuoted(it->second.m_prettyName);
-           puts(");\n");
Index: patches/patch-src_V3EmitC_cpp
===================================================================
RCS file: patches/patch-src_V3EmitC_cpp
diff -N patches/patch-src_V3EmitC_cpp
--- patches/patch-src_V3EmitC_cpp       15 Nov 2023 19:44:31 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-Index: src/V3EmitC.cpp
---- src/V3EmitC.cpp.orig
-+++ src/V3EmitC.cpp
-@@ -1904,7 +1904,8 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
-       bool did = false;
-       for (AstNode* nodep=modp->stmtsp(); nodep; nodep = nodep->nextp()) {
-           if (AstCell* cellp=nodep->castCell()) {
--              if (!did++) {
-+              if (!did) {
-+                  did = true;
-                   putsDecoration("// CELLS\n");
-                   if (modp->isTop()) puts("// Public to allow access to 
/*verilator_public*/ items;\n");
-                   if (modp->isTop()) puts("// otherwise the application code 
can consider these internals.\n");
Index: patches/patch-src_bisonpre
===================================================================
RCS file: patches/patch-src_bisonpre
diff -N patches/patch-src_bisonpre
--- patches/patch-src_bisonpre  11 Mar 2022 19:29:18 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-Index: src/bisonpre
---- src/bisonpre.orig
-+++ src/bisonpre
-@@ -325,7 +325,7 @@ sub clean_input {
-       foreach my $line (@linesin) {
-           $l++;
-           if ($line =~ /BISONPRE_NOT/) {
--              ($line =~ s/BISONPRE_NOT\((\S+)\)\s*({[^}]+})\s*$//)
-+              ($line =~ s/BISONPRE_NOT\((\S+)\)\s*(\{[^}]+})\s*$//)
-                   or die "%Error: $filename:$l: Bad form of BISONPRE_NOT: 
$line\n";
-               my $endtok = $1;  my $action = $2;
-               my @endtoks = split (/,/, $endtok);
Index: patches/patch-src_verilog_y
===================================================================
RCS file: patches/patch-src_verilog_y
diff -N patches/patch-src_verilog_y
--- patches/patch-src_verilog_y 11 Mar 2022 19:29:18 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-Fix build with Bison 3.7 and newer
-https://github.com/verilator/verilator/commit/aa39d020d88dd1d5beb3810cf551ff879b7f88a4
-
-Index: src/verilog.y
---- src/verilog.y.orig
-+++ src/verilog.y
-@@ -207,6 +207,15 @@ static void ERRSVKWD(FileLine* fileline, const string&
- class AstSenTree;
- %}
- 
-+// We run bison with the -d argument. This tells it to generate a
-+// header file with token names. Old versions of bison pasted the
-+// contents of that file into the generated source as well; newer
-+// versions just include it.
-+//
-+// Since we run bison through ../bisonpre, it doesn't know the correct
-+// header file name, so we need to tell it.
-+BISONPRE_VERSION(3.7,%define api.header.include {"V3ParseBison.h"})
-+
- // When writing Bison patterns we use yTOKEN instead of "token",
- // so Bison will error out on unknown "token"s.
- 
Index: patches/patch-test_regress_driver_py
===================================================================
RCS file: patches/patch-test_regress_driver_py
diff -N patches/patch-test_regress_driver_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-test_regress_driver_py        15 Feb 2026 16:27:25 -0000
@@ -0,0 +1,30 @@
+Index: test_regress/driver.py
+--- test_regress/driver.py.orig
++++ test_regress/driver.py
+@@ -193,7 +193,7 @@ class Capabilities:
+     @staticproperty
+     def have_gdb() -> bool:  # pylint: disable=no-method-argument
+         if Capabilities._cached_have_gdb is None:
+-            out = VtOs.run_capture('gdb --version 2>/dev/null', check=False)
++            out = VtOs.run_capture('egdb --version 2>/dev/null', check=False)
+             Capabilities._cached_have_gdb = bool('Copyright' in out)
+         return Capabilities._cached_have_gdb
+ 
+@@ -1538,7 +1538,7 @@ class VlTest:
+             debugger_exec_cmd_start = ""
+             debugger_exec_cmd_end = ""
+             if Args.gdbsim:
+-                debugger = VtOs.getenv_def('VERILATOR_GDB', "gdb") + " "
++                debugger = VtOs.getenv_def('VERILATOR_GDB', "egdb") + " "
+                 debugger_exec_cmd_start = " -ex 'run "
+                 debugger_exec_cmd_end = "'"
+             cmd = [
+@@ -1859,7 +1859,7 @@ class VlTest:
+             if pid == 0:
+                 os.environ['TERM'] = "dumb"
+                 subprocess.run(["stty", "nl"], check=True)  # No carriage 
returns
+-                os.execlp("bash", "/bin/bash", "-c", command)
++                os.execlp("sh", "/bin/sh", "-c", command)
+             else:
+                 while True:
+                     try:
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/verilator/pkg/PLIST,v
diff -u -p -r1.8 PLIST
--- pkg/PLIST   11 Mar 2022 19:29:18 -0000      1.8
+++ pkg/PLIST   15 Feb 2026 16:27:25 -0000
@@ -3,28 +3,86 @@ bin/verilator
 @bin bin/verilator_bin_dbg
 bin/verilator_coverage
 @bin bin/verilator_coverage_bin_dbg
+bin/verilator_gantt
 bin/verilator_profcfunc
 @man man/man1/verilator.1
 @man man/man1/verilator_coverage.1
+@man man/man1/verilator_gantt.1
 @man man/man1/verilator_profcfunc.1
+share/examples/verilator/
+share/examples/verilator/cmake_hello_c/
+share/examples/verilator/cmake_hello_c/CMakeLists.txt
+share/examples/verilator/cmake_hello_c/Makefile
+share/examples/verilator/cmake_hello_sc/
+share/examples/verilator/cmake_hello_sc/CMakeLists.txt
+share/examples/verilator/cmake_hello_sc/Makefile
+share/examples/verilator/cmake_protect_lib/
+share/examples/verilator/cmake_protect_lib/CMakeLists.txt
+share/examples/verilator/cmake_protect_lib/Makefile
+share/examples/verilator/cmake_tracing_c/
+share/examples/verilator/cmake_tracing_c/CMakeLists.txt
+share/examples/verilator/cmake_tracing_c/Makefile
+share/examples/verilator/cmake_tracing_sc/
+share/examples/verilator/cmake_tracing_sc/CMakeLists.txt
+share/examples/verilator/cmake_tracing_sc/Makefile
+share/examples/verilator/json_py/
+share/examples/verilator/json_py/Makefile
+share/examples/verilator/json_py/sub.v
+share/examples/verilator/json_py/top.v
+share/examples/verilator/json_py/vl_file_copy
+share/examples/verilator/json_py/vl_hier_graph
+share/examples/verilator/make_hello_binary/
+share/examples/verilator/make_hello_binary/Makefile
+share/examples/verilator/make_hello_binary/top.v
+share/examples/verilator/make_hello_c/
+share/examples/verilator/make_hello_c/Makefile
+share/examples/verilator/make_hello_c/sim_main.cpp
+share/examples/verilator/make_hello_c/top.v
+share/examples/verilator/make_hello_sc/
+share/examples/verilator/make_hello_sc/Makefile
+share/examples/verilator/make_hello_sc/sc_main.cpp
+share/examples/verilator/make_hello_sc/top.v
+share/examples/verilator/make_protect_lib/
+share/examples/verilator/make_protect_lib/Makefile
+share/examples/verilator/make_protect_lib/secret_impl.v
+share/examples/verilator/make_protect_lib/sim_main.cpp
+share/examples/verilator/make_protect_lib/top.v
+share/examples/verilator/make_tracing_c/
+share/examples/verilator/make_tracing_c/Makefile
+share/examples/verilator/make_tracing_c/Makefile_obj
+share/examples/verilator/make_tracing_c/input.vc
+share/examples/verilator/make_tracing_c/sim_main.cpp
+share/examples/verilator/make_tracing_c/sub.v
+share/examples/verilator/make_tracing_c/top.v
+share/examples/verilator/make_tracing_sc/
+share/examples/verilator/make_tracing_sc/Makefile
+share/examples/verilator/make_tracing_sc/Makefile_obj
+share/examples/verilator/make_tracing_sc/input.vc
+share/examples/verilator/make_tracing_sc/sc_main.cpp
+share/examples/verilator/make_tracing_sc/sub.v
+share/examples/verilator/make_tracing_sc/top.v
 share/pkgconfig/verilator.pc
 share/verilator/
 share/verilator/bin/
+share/verilator/bin/verilator
+share/verilator/bin/verilator_bin
+share/verilator/bin/verilator_bin_dbg
+share/verilator/bin/verilator_ccache_report
+share/verilator/bin/verilator_coverage
+share/verilator/bin/verilator_coverage_bin_dbg
+share/verilator/bin/verilator_gantt
 share/verilator/bin/verilator_includer
-share/verilator/examples/
-share/verilator/examples/test_c/
-share/verilator/examples/test_c/Makefile
-share/verilator/examples/test_c/Makefile_obj
-share/verilator/examples/test_c/sim_main.cpp
-share/verilator/examples/test_sc/
-share/verilator/examples/test_sc/Makefile
-share/verilator/examples/test_sc/Makefile_obj
-share/verilator/examples/test_sc/sc_main.cpp
-share/verilator/examples/test_v/
-share/verilator/examples/test_v/input.vc
-share/verilator/examples/test_v/t.v
-share/verilator/examples/test_v/top.v
+share/verilator/bin/verilator_profcfunc
 share/verilator/include/
+share/verilator/include/gtkwave/
+share/verilator/include/gtkwave/fastlz.c
+share/verilator/include/gtkwave/fastlz.h
+share/verilator/include/gtkwave/fst_config.h
+share/verilator/include/gtkwave/fst_win_unistd.h
+share/verilator/include/gtkwave/fstapi.c
+share/verilator/include/gtkwave/fstapi.h
+share/verilator/include/gtkwave/lz4.c
+share/verilator/include/gtkwave/lz4.h
 share/verilator/include/verilated.cpp
 share/verilator/include/verilated.h
 share/verilator/include/verilated.mk
@@ -36,12 +94,36 @@ share/verilator/include/verilated_cov.h
 share/verilator/include/verilated_cov_key.h
 share/verilator/include/verilated_dpi.cpp
 share/verilator/include/verilated_dpi.h
-share/verilator/include/verilated_heavy.h
+share/verilator/include/verilated_fst_c.cpp
+share/verilator/include/verilated_fst_c.h
+share/verilator/include/verilated_fst_sc.cpp
+share/verilator/include/verilated_fst_sc.h
+share/verilator/include/verilated_funcs.h
 share/verilator/include/verilated_imp.h
+share/verilator/include/verilated_intrinsics.h
+share/verilator/include/verilated_probdist.cpp
+share/verilator/include/verilated_profiler.cpp
+share/verilator/include/verilated_profiler.h
+share/verilator/include/verilated_random.cpp
+share/verilator/include/verilated_random.h
+share/verilator/include/verilated_saif_c.cpp
+share/verilator/include/verilated_saif_c.h
+share/verilator/include/verilated_saif_sc.h
 share/verilator/include/verilated_save.cpp
 share/verilator/include/verilated_save.h
 share/verilator/include/verilated_sc.h
+share/verilator/include/verilated_sc_trace.h
+share/verilator/include/verilated_std.sv
+share/verilator/include/verilated_std_waiver.vlt
+share/verilator/include/verilated_sym_props.h
 share/verilator/include/verilated_syms.h
+share/verilator/include/verilated_threads.cpp
+share/verilator/include/verilated_threads.h
+share/verilator/include/verilated_timing.cpp
+share/verilator/include/verilated_timing.h
+share/verilator/include/verilated_trace.h
+share/verilator/include/verilated_trace_imp.h
+share/verilator/include/verilated_types.h
 share/verilator/include/verilated_vcd_c.cpp
 share/verilator/include/verilated_vcd_c.h
 share/verilator/include/verilated_vcd_sc.cpp
@@ -50,6 +132,11 @@ share/verilator/include/verilated_vpi.cp
 share/verilator/include/verilated_vpi.h
 share/verilator/include/verilatedos.h
 @comment share/verilator/include/verilatedos.h.orig
+share/verilator/include/verilatedos_c.h
 share/verilator/include/vltstd/
+share/verilator/include/vltstd/sv_vpi_user.h
 share/verilator/include/vltstd/svdpi.h
+share/verilator/include/vltstd/veriuser.h
 share/verilator/include/vltstd/vpi_user.h
+share/verilator/verilator-config-version.cmake
+share/verilator/verilator-config.cmake

Reply via email to