iverilog: fix implicit declaration error

* fix build on macOS <10.7

Co-authored-by: Sergey Fedorov <barracuda@macos-powerpc.org>
This commit is contained in:
aeiouaeiouaeiouaeiouaeiouaeiou
2025-05-05 15:21:59 +03:00
committed by Renee Otten
parent 08ed39c59d
commit 8a71d8aed5
2 changed files with 21 additions and 1 deletions
+8 -1
View File
@@ -2,11 +2,15 @@
PortSystem 1.0
PortGroup github 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup legacysupport 1.1
# strndup
legacysupport.newest_darwin_requires_legacy 10
github.setup steveicarus iverilog 20250103 s
github.tarball_from archive
revision 0
revision 1
set major 12
set minor 0
@@ -47,6 +51,9 @@ configure.ldflags-append -Wl,-rpath,${prefix}/lib
patchfiles-append patch-vvp-Makefile.in.diff
# main.c:1065:17: error: implicit declaration of function '_NSGetExecutablePath' [-Wimplicit-function-declaration]
patchfiles-append patch-fix-headers.diff
platform darwin {
#under MacOS, this is needed, the library references were incorrect as-is
configure.cxxflags-append -fPIC
@@ -0,0 +1,13 @@
--- driver/main.c.orig
+++ driver/main.c
@@ -81,6 +81,10 @@
extern const char*optarg;
#endif
+#if defined(__APPLE__)
+#include <mach-o/dyld.h>
+#endif
+
#if !defined(WIFEXITED)
# define WIFEXITED(rc) ((rc&0x7f) == 0)
#endif