Dockerfile
:
FROM alpine:3.20.3
RUN set -x && apk add git build-base autoconf gdb automake libtool gettext-dev perl-dev \
&& git clone https://github.com/taku910/mecab \
&& cd mecab \
&& git checkout 05481e751dd5aa536a2bace46715ce54568b972a \
&& sed -Ei '/if test -n "\$GCC"/,/fi/ s/^/# /' mecab/configure.in \
&& cd mecab \
&& autoreconf -i \
&& ./configure CXXFLAGS='-g3 -O0' \
&& make install \
&& cd perl \
&& sed -Ei '/CC/a"CCFLAGS" => "-g3", "OPTIMIZE" => "-O0",' Makefile.PL \
&& perl Makefile.PL \
&& { grep -E '^(CCFLAGS|OPTIMIZE|LDDLFLAGS) =' Makefile || true; } \
&& make install
$ docker build -t i .
...
+ grep -E '^(CCFLAGS|OPTIMIZE|LDDLFLAGS) =' Makefile
LDDLFLAGS = -shared -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -O2 -L/usr/local/lib -fstack-protector-strong
CCFLAGS = -g3
OPTIMIZE = -O0
+ make install
...
g++ -c -I/usr/local/include -g3 -O0 -DVERSION=\"0.996\" -DXS_VERSION=\"0.996\" -fPIC "-I/usr/lib/perl5/core_perl/CORE" MeCab_wrap.cxx
...
LD_RUN_PATH="/usr/local/lib:/usr/lib" g++ -shared -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -O2 -L/usr/local/lib -fstack-protector-strong MeCab_wrap.o -o blib/arch/auto/MeCab/MeCab.so \
-L/usr/local/lib -lmecab -lstdc++ \
...
To change LDDLFLAGS
:
Dockerfile
:
FROM alpine:3.20.3
RUN set -x && apk add git build-base autoconf gdb automake libtool gettext-dev perl-dev \
&& git clone https://github.com/taku910/mecab \
&& cd mecab \
&& git checkout 05481e751dd5aa536a2bace46715ce54568b972a \
&& sed -Ei '/if test -n "\$GCC"/,/fi/ s/^/# /' mecab/configure.in \
&& cd mecab \
&& autoreconf -i \
&& ./configure CXXFLAGS='-g3 -O0' \
&& make install \
&& cd perl \
&& sed -Ei '/CC/a"CCFLAGS" => "-g3", "OPTIMIZE" => "-O0", "LDDLFLAGS" => "-shared",' Makefile.PL \
&& sed -Ei '/foreach my \$m /anext if $m eq "lddlflags";' /usr/share/perl5/core_perl/ExtUtils/MM_Unix.pm \
&& perl Makefile.PL \
&& { grep -E '^(CCFLAGS|OPTIMIZE|LDDLFLAGS) =' Makefile || true; } \
&& make install
$ docker build -t i .
...
+ grep -E '^(CCFLAGS|OPTIMIZE|LDDLFLAGS) =' Makefile
LDDLFLAGS = -shared
CCFLAGS = -g3
OPTIMIZE = -O0
+ make install
...
g++ -c -I/usr/local/include -g3 -O0 -DVERSION=\"0.996\" -DXS_VERSION=\"0.996\" -fPIC "-I/usr/lib/perl5/core_perl/CORE" MeCab_wrap.cxx
...
LD_RUN_PATH="/usr/local/lib:/usr/lib" g++ -shared MeCab_wrap.o -o blib/arch/auto/MeCab/MeCab.so \
-L/usr/local/lib -lmecab -lstdc++ \