Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
.gitignore | 3 +++
Makefile.am | 2 +-
src/Makefile.am | 33 +++++++++++++++++++--------------
tests/php.ini | 2 +-
4 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
index 698e97d..121adbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
+*.la
+*.lo
*.o
.deps
+.libs
.stamp
/aclocal.m4
/config.guess
diff --git a/Makefile.am b/Makefile.am
index bab66e4..3b33a99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,4 +2,4 @@ SUBDIRS = tools src docs tests
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = libvirt-php.spec.in
+EXTRA_DIST = libvirt-php.spec.in winsrc
diff --git a/src/Makefile.am b/src/Makefile.am
index 3f2de38..867f5df 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,18 +5,6 @@ DEFINES=-DHAVE_CONFIG_H
WL=@WL@
SHLIB_FLAGS=@SHLIB_FLAGS@
-EXTRA_DIST = libvirt-php.c sockets.c vncfunc.c libvirt-php.h
-
-
-all-am: build
-
-build:
- $(CC) $(CFLAGS) -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 $(PHPINC) -c -o libvirt-php.o
libvirt-php.c $(LIBXML_CFLAGS) $(LIBVIRT_CFLAGS) $(DEFINES)
- $(CC) $(CFLAGS) -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 -c -o vncfunc.o vncfunc.c $(PHPINC)
$(LIBXML_CFLAGS) $(LIBVIRT_CFLAGS) $(DEFINES)
- $(CC) $(CFLAGS) -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 -c -o sockets.o sockets.c $(PHPINC)
$(LIBXML_CFLAGS) $(LIBVIRT_CFLAGS) $(DEFINES)
- $(CC) $(CFLAGS) $(LDFLAGS) -Wall $(SHLIB_FLAGS) -o $(PACKAGE).so vncfunc.o sockets.o
libvirt-php.o -ldl -lvirt $(LIBXML_LIBS) $(LIBVIRT_LIBS) $(LIBS)
- $(ECHO) "Extension compiled as $(PACKAGE).so"
-
install-exec-local:
$(INSTALL) -m 644 -D $(PACKAGE).so $(DESTDIR)$(PHPEDIR)/$(PACKAGE).so
$(INSTALL) -m 755 -d $(DESTDIR)$(PHPCDIR)
@@ -34,5 +22,22 @@ uninstall-local:
$(RM) -f $(DESTDIR)$(PHPCDIR)/$(PACKAGE).ini
$(RM) -f $(DESTDIR)$(PHPEDIR)/$(PACKAGE).so
-clean-local:
- $(RM) -f *.o
+AM_CFLAGS = \
+ $(PHPINC) $(LIBXML_CFLAGS) \
+ $(LIBVIRT_CFLAGS) $(DEFINES) \
+ -I$(top_srcdir)/winsrc
+
+AM_LDFLAGS = \
+ $(SHLIB_LDFLAGS) \
+ $(LIBXML_LIBS) \
+ $(LIBVIRT_LIBS)
+
+lib_LTLIBRARIES = libvirt-php.la
+
+libvirt_php_la_SOURCES = \
+ vncfunc.c \
+ sockets.c \
+ libvirt-php.c libvirt-php.h
+libvirt_php_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -DCOMPILE_DL_LIBVIRT=1
diff --git a/tests/php.ini b/tests/php.ini
index a00a0ee..128286e 100644
--- a/tests/php.ini
+++ b/tests/php.ini
@@ -1,2 +1,2 @@
-extension_dir=../src/
+extension_dir=../src/.libs/
extension=libvirt-php.so
--
2.3.6