[libvirt] [libvirt-php 1/2] Add CFLAGS for compiler

The defualt CFLAGS is `-g -Wall'. We can change it with ./configure CFLAGS="your option". The `-g' options also make it able to build debugsource & debuginfo packages. --- src/Makefile.am | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 76ebee6..6fab5f0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,8 +8,8 @@ EXTRA_DIST = libvirt-php.c libvirt-php.h all-am: build clean-temp build: - $(CC) -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 $(PHPINC) -c -o $(PACKAGE).o libvirt-php.c $(LIBXML_CFLAGS) $(DEFINES) - $(CC) -Wall -shared $(LIBS) -rdynamic -o $(PACKAGE).so $(PACKAGE).o -ldl -lvirt $(LIBXML_LIBS) + $(CC) $(CFLAGS) -fpic -DCOMPILE_DL_LIBVIRT=1 $(PHPINC) -c -o $(PACKAGE).o libvirt-php.c $(LIBXML_CFLAGS) $(DEFINES) + $(CC) $(CFLAGS) -shared $(LIBS) -rdynamic -o $(PACKAGE).so $(PACKAGE).o -ldl -lvirt $(LIBXML_LIBS) $(ECHO) "Extension compiled as $(PACKAGE).so" install-exec-local: -- 1.7.3.4

--- src/libvirt-php.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 020da4e..d436e1c 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -1204,7 +1204,8 @@ char *get_string_from_xpath(char *xml, char *xpath, zval **val, int *retVal) xmlXPathObjectPtr result; xmlNodeSetPtr nodeset; int ret = 0, i; - char *value, key[8] = { 0 }; + char *value = NULL; + char key[8] = { 0 }; if ((xpath == NULL) || (xml == NULL)) { -- 1.7.3.4 /

On 04/14/2011 10:50 AM, Lyre wrote:
--- src/libvirt-php.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 020da4e..d436e1c 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -1204,7 +1204,8 @@ char *get_string_from_xpath(char *xml, char *xpath, zval **val, int *retVal) xmlXPathObjectPtr result; xmlNodeSetPtr nodeset; int ret = 0, i; - char *value, key[8] = { 0 }; + char *value = NULL; + char key[8] = { 0 };
if ((xpath == NULL) || (xml == NULL)) { Good change. Thanks and pushed.
Michal -- Michal Novotny <minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat

On 04/14/2011 10:50 AM, Lyre wrote:
The defualt CFLAGS is `-g -Wall'. We can change it with ./configure CFLAGS="your option". The `-g' options also make it able to build debugsource & debuginfo packages.
Thanks a lot. This is good to change to honor CFLAGS :) ACKed and pushed now! Michal -- Michal Novotny <minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat
participants (2)
-
Lyre
-
Michal Novotny