編 graphics/graphviz 遇到 'tsrm_ls' undeclared 的解決方法

這個也算是萬年 bug 了,
因為常常有人更新 ports 時會跑來哭,
所以趁這次更新遇到的時候來記錄一下。

並不是每個人都會遇到這個問題,
這要看裝 graphviz 時有沒有勾選到某些語言的 bindings 而定,
目前已知就算不勾 TCL 和 TK 也會遇到下面的錯誤訊息:

libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../lib/gvc -I../../lib/common -I../../lib/graph -I../../lib/cdt -I../../lib/pathplan -DDEMAND_LOADING=1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -I/usr/local/include -I/usr/local/include/php/Zend -I/usr/local/include -O2 -pipe -fno-strict-aliasing -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math -MT libgv_php_la-gv_php_init.lo -MD -MP -MF .deps/libgv_php_la-gv_php_init.Tpo -c gv_php_init.c -fPIC -DPIC -o .libs/libgv_php_la-gv_php_init.o
In file included from /usr/local/include/php/main/php.h:34,
from gv_php_init.c:17:
/usr/local/include/php/Zend/zend.h:691: warning: function declaration isn't a prototype
In file included from /usr/local/include/php/main/php.h:459,
from gv_php_init.c:17:
/usr/local/include/php/main/suhosin_patch.h:26: warning: function declaration isn't a prototype
gv_php_init.c: In function 'gv_string_writer':
gv_php_init.c:25: error: 'tsrm_ls' undeclared (first use in this function)
gv_php_init.c:25: error: (Each undeclared identifier is reported only once
gv_php_init.c:25: error: for each function it appears in.)
gv_php_init.c: In function 'gv_channel_writer':
gv_php_init.c:30: error: 'tsrm_ls' undeclared (first use in this function)
gmake[4]: *** [libgv_php_la-gv_php_init.lo] Error 1
gmake[4]: Leaving directory /usr/ports/graphics/graphviz/work/graphviz-2.26.3/tclpkg/gv' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory /usr/ports/graphics/graphviz/work/graphviz-2.26.3/tclpkg/gv'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory /usr/ports/graphics/graphviz/work/graphviz-2.26.3/tclpkg' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory /usr/ports/graphics/graphviz/work/graphviz-2.26.3'
gmake: *** [all] Error 2
*** Error code 1

Stop in /usr/ports/graphics/graphviz.
*** Error code 1

Stop in /usr/ports/graphics/graphviz.

其實這個也沒有什麼,
直接打開 /usr/ports/graphics/graphviz/work/graphviz-2.26.3/tclpkg/gv/gv_php_init.c 做以下修改即可: