Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No rule to make target #32

Closed
alex9434 opened this issue Aug 9, 2022 · 5 comments
Closed

No rule to make target #32

alex9434 opened this issue Aug 9, 2022 · 5 comments

Comments

@alex9434
Copy link

alex9434 commented Aug 9, 2022

Hi @kjdev,

I am trying to integrate php-ext-lz4 into the official docker 8.1 php-fpm image. However, I get the following error message:

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
+ make
/bin/bash /tmp/php-ext-lz4-0.4.3/libtool --mode=compile cc -I. -I/tmp/php-ext-lz4-0.4.3 -I/tmp/php-ext-lz4-0.4.3/include -I/tmp/php-ext-lz4-0.4.3/main -I/tmp/php-ext-lz4-0.4.3 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/php-ext-lz4-0.4.3/lz4/lib  -DHAVE_CONFIG_H      -DZEND_COMPILE_DL_EXT=1 -c /tmp/php-ext-lz4-0.4.3/lz4.c -o lz4.lo  -MMD -MF lz4.dep -MT lz4.lo
mkdir .libs
 cc -I. -I/tmp/php-ext-lz4-0.4.3 -I/tmp/php-ext-lz4-0.4.3/include -I/tmp/php-ext-lz4-0.4.3/main -I/tmp/php-ext-lz4-0.4.3 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/php-ext-lz4-0.4.3/lz4/lib -DHAVE_CONFIG_H -DZEND_COMPILE_DL_EXT=1 -c /tmp/php-ext-lz4-0.4.3/lz4.c -MMD -MF lz4.dep -MT lz4.lo  -fPIC -DPIC -o .libs/lz4.o
make: *** No rule to make target '/tmp/php-ext-lz4-0.4.3/lz4/lib/lz4.c', needed by 'lz4/lib/lz4.lo'.  Stop.

Here is the relevant part from my Dockerfile:

	curl -L 'https://github.com/kjdev/php-ext-lz4/archive/refs/tags/0.4.3.tar.gz' | \
		tar xvz -C /tmp; \
	( \
		cd /tmp/php-ext-lz4-0.4.3; \
		phpize; \
		./configure; \
		make; \
		make install \
	); \
	rm -r /tmp/php-ext-lz4-0.4.3; \

Any idea how to fix this error?

@kjdev
Copy link
Owner

kjdev commented Aug 9, 2022

To use the system library

./configure --with-lz4-includedir=/usr

@alex9434
Copy link
Author

Excellent, thank you. That solved my first issue. Maybe you can kindly help me with another issue. I now use the following lines:

	debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
	curl -L 'https://github.com/kjdev/php-ext-lz4/archive/refs/tags/0.4.3.tar.gz' | \
		tar xvz -C /tmp; \
	( \
		cd /tmp/php-ext-lz4-0.4.3; \
		phpize; \
		./configure --with-lz4-includedir=/usr --with-libdir="lib/$debMultiarch"; \
		make -j "$(nproc)"; \
		make install \
	); \

However, I get the message:

Libraries have been installed in:
   /tmp/php-ext-lz4-0.4.3/modules

How do I get them installed instead in the correct directory instead?

@kjdev
Copy link
Owner

kjdev commented Aug 14, 2022

What is the procedure?

% docker run -it --rm --entrypoint=bash php:8.1-fpm
$
$ apt update
$ apt-get install -y liblz4-dev
$
$ debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"
$ curl -L 'https://github.com/kjdev/php-ext-lz4/archive/refs/tags/0.4.3.tar.gz' | tar xvz -C /tmp
$ cd /tmp/php-ext-lz4-0.4.3
$ phpize
$ ./configure --with-lz4-includedir=/usr --with-libdir="lib/$debMultiarch"
$ make -j "$(nproc)"
$ make install
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20210902/
$
$ ls /usr/local/lib/php/extensions/no-debug-non-zts-20210902/
lz4.so  opcache.so  sodium.so
$ echo "extension=lz4" > /usr/local/etc/php/conf.d/php-ext-lz4.ini
$ php -m | grep lz4
lz4

@alex9434
Copy link
Author

OK, thank you for your help. Will modify accordingly. BTW are you planning to set-up php-lz4 as a PECL? Would make installation easier. Will close this now.

@kjdev
Copy link
Owner

kjdev commented Aug 18, 2022

It was good.

I will try to apply for registration with PECL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants