#18728 [NEW]: Fails to compile using net-snmp 5.0.3
| From: | stover_david at hotmail dot com | Date: | Sat, 03 Aug 2002 22:01:42 +0000 |
| Subject: | #18728 [NEW]: Fails to compile using net-snmp 5.0.3 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-15947@lists.php.net to get a copy of this message | ||
From: stover_david@hotmail.com
Operating system: FreeBSD 4.6-RELEASE
PHP version: 4.2.2
PHP Bug Type: SNMP related
Bug description: Fails to compile using net-snmp 5.0.3
On a nearly blank, vanilla-flavored Intel installation of FreeBSD
4.6-RELEASE with apache-1.3.24_7 and mysql-3.23.49 (both built from the
ports tree), a pathing issue exists with the *.h files in net-snmp-5.0.3
when building php-4.2.2 configured --with-snmp=/usr/local:
Locally (not package installs, or builds from the ports tree), builds and
installs of zlib-1.1.4 (./configure --prefix=/usr/local
--libdir=/usr/local/lib --includedir=/usr/local/include), openssl-0.9.6e
(with no options to configure), and then net-snmp-5.0.3 (./configure
--with-openssl=/usr/local --with-mib-modules="host misc/ipfwacc
disman/event-mib" --enable-embedded-perl). After installation of
net-snmp, built gd-1.8.4, then started build of php-4.2.2 (./configure
--with-apxs --with-openssl=/usr/local/ssl --with-mysql=/usr/local
--with-gd=/usr/local --with-snmp=/usr/local --enable-ucd-snmp-hack).
Build failed when attempting to compile ext/snmp.c
Below are the unified diffs of a freshly untar'd copy of php-4.2.2, and
the modified version that built for me.
diff -ru php-4.2.2/configure php-4.2.2p1/configure
--- php-4.2.2/configure Sun Jul 21 05:56:19 2002
+++ php-4.2.2p1/configure Sat Aug 3 14:01:15 2002
@@ -57912,16 +57912,16 @@
if test "$PHP_SNMP" = "yes"; then
for i in /usr/include /usr/local/include; do
test -f $i/snmp.h && SNMP_INCDIR=$i
- test -f $i/ucd-snmp/snmp.h &&
SNMP_INCDIR=$i/ucd-snmp
+ test -f $i/net-snmp/snmp.h &&
SNMP_INCDIR=$i/net-snmp
test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp
- test -f $i/snmp/include/ucd-snmp/snmp.h &&
SNMP_INCDIR=$i/snmp/include/ucd-snmp
+ test -f $i/snmp/include/net-snmp/snmp.h &&
SNMP_INCDIR=$i/snmp/include/net-snmp
done
for i in /usr /usr/snmp /usr/local /usr/local/snmp; do
test -f $i/lib/libsnmp.a -o -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME
&& SNMP_LIBDIR=$i/lib
done
else
SNMP_INCDIR=$PHP_SNMP/include
- test -d $PHP_SNMP/include/ucd-snmp &&
SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp
+ test -d $PHP_SNMP/include/net-snmp &&
SNMP_INCDIR=$PHP_SNMP/include/net-snmp
SNMP_LIBDIR=$PHP_SNMP/lib
fi
@@ -57980,7 +57980,7 @@
#line 57981 "configure"
#include "confdefs.h"
- #include <ucd-snmp-config.h>
+ #include <net-snmp-config.h>
#if USE_OPENSSL
yes
#endif
diff -ru php-4.2.2/ext/snmp/config.m4 php-4.2.2p1/ext/snmp/config.m4
--- php-4.2.2/ext/snmp/config.m4 Wed Jan 16 14:32:40 2002
+++ php-4.2.2p1/ext/snmp/config.m4 Sat Aug 3 14:02:30 2002
@@ -10,16 +10,16 @@
if test "$PHP_SNMP" = "yes"; then
for i in /usr/include /usr/local/include; do
test -f $i/snmp.h && SNMP_INCDIR=$i
- test -f $i/ucd-snmp/snmp.h &&
SNMP_INCDIR=$i/ucd-snmp
+ test -f $i/net-snmp/snmp.h &&
SNMP_INCDIR=$i/net-snmp
test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp
- test -f $i/snmp/include/ucd-snmp/snmp.h &&
SNMP_INCDIR=$i/snmp/include/ucd-snmp
+ test -f $i/snmp/include/net-snmp/snmp.h &&
SNMP_INCDIR=$i/snmp/include/net-snmp
done
for i in /usr /usr/snmp /usr/local /usr/local/snmp; do
test -f $i/lib/libsnmp.a -o -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME
&& SNMP_LIBDIR=$i/lib
done
else
SNMP_INCDIR=$PHP_SNMP/include
- test -d $PHP_SNMP/include/ucd-snmp &&
SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp
+ test -d $PHP_SNMP/include/net-snmp &&
SNMP_INCDIR=$PHP_SNMP/include/net-snmp
SNMP_LIBDIR=$PHP_SNMP/lib
fi
@@ -35,7 +35,7 @@
if test "$ac_cv_header_default_store_h" = "yes"; then
AC_MSG_CHECKING(for OpenSSL support in SNMP libraries)
AC_EGREP_CPP(yes,[
- #include <ucd-snmp-config.h>
+ #include <net-snmp-config.h>
#if USE_OPENSSL
yes
#endif
diff -ru php-4.2.2/ext/snmp/snmp.c php-4.2.2p1/ext/snmp/snmp.c
--- php-4.2.2/ext/snmp/snmp.c Thu Feb 28 19:31:01 2002
+++ php-4.2.2p1/ext/snmp/snmp.c Sat Aug 3 14:26:18 2002
@@ -59,13 +59,14 @@
#ifdef HAVE_DEFAULT_STORE_H
#include "default_store.h"
#endif
-#include "asn1.h"
-#include "snmp_api.h"
-#include "snmp_client.h"
-#include "snmp_impl.h"
-#include "snmp.h"
-#include "parse.h"
-#include "mib.h"
+#include "net-snmp-config.h"
+#include "library/asn1.h"
+#include "library/snmp_api.h"
+#include "library/snmp_client.h"
+#include "library/snmp_impl.h"
+#include "library/snmp.h"
+#include "library/parse.h"
+#include "library/mib.h"
#include "version.h"
/* ucd-snmp 3.3.1 changed the name of a few #defines... They've been
changed back to the original ones in 3.5.3! */
@@ -130,7 +131,7 @@
{
php_info_print_table_start();
php_info_print_table_row(2, "UCD-SNMP Support", "enabled");
- php_info_print_table_row(2, "UCD-SNMP Version", VersionInfo);
+ php_info_print_table_row(2, "UCD-SNMP Version",
NetSnmpVersionInfo);
php_info_print_table_end();
}
/* }}} */
I made no changes other than those which would complete the build (no
cosmetic changes of 'ucd' to 'net'). I don't know the stability of this
build as I haven't stress-tested it yet, but wanted to pass this along
ASAP.
--
Edit bug report at http://bugs.php.net/?id=18728&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18728&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18728&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18728&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18728&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18728&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18728&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18728&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18728&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18728&r=globals