Skip to contentSkip to conversation

netsnmp: disable build with external toolchain

PATCH New Darcy L. Watkins 1 participant 3 messages Jun 22, 2010 – Jun 23, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 12/12 netsnmp: disable build with external toolchain

Hello,

I need to be able to build net-snmp in my buildroot using a crosstool-ng external toolchain.

Has anyone made progress or determined the underlying cause of why net-snmp cannot properly locate the libraries even though --sysroot points to the buildroot staging area (instead of using the toolchain default)?

Would adding redundant -L<path> to the staging library area work (and likely also -I<path> to the includes if needed)?

Any insight as to why this happens with net-snmp (or is it observed with some other packages too)?

Regards,

Darcy

#1 lore raw

PATCH 12/12 netsnmp: disable build with external toolchain

Hello,

The fourth chunk in the buildroot-libtool.patch appears to be bogus. It adds a commented out chunk of code, but doesn't remove what appears to have been intended to be the code to comment out (around line # 29xx in ltmain.sh). It would seem that an "exit 1" was replaced with "exit $EXIT_FAILURE" so the patch broke. I think it's possible that the patch was refreshed without anyone catching this.

I also notice what appears to be two different variants of ltmain.sh floating around in the packages - one circa 2007 (ver 1.5.24), the other circa 2008 (ver 2.2.6). Only the former is compatible with the patch.

The ltmain.sh in the netsnmp package is the newer one (not compatible with the patch). Do we need a variant of buildroot-libtool.patch for the newer libtool, or is the newer ltmain.sh variant supposed to have the cross compile problems fixed?

Regards,

Darcy

Quoted 15 lines · Darcy L. Watkins

I need to be able to build net-snmp in my buildroot using a crosstool-ng
external toolchain.

Has anyone made progress or determined the underlying cause of why net-snmp cannot properly locate the libraries even though --sysroot points to the buildroot staging area (instead of using the toolchain default)?

Would adding redundant -L<path> to the staging library area work (and likely also -I<path> to the includes if needed)?

Any insight as to why this happens with net-snmp (or is it observed with
some other packages too)?

#2 lore raw

PATCH 12/12 netsnmp: disable build with external toolchain

Hello,

The patch below appears to get net-snmp to build OK (at least in my environment using crosstool-ng). It is a bit of a hack/kludge since it is basically saying, "just in case you don't understand the --sysroot directive, here are some redundant -I and -L directives to include with CFLAGS and LDFLAGS to point to the staging area includes and libraries."

Regards,

Darcy

------

package/Makefile.in +2 -0
Index: buildroot-2010.02_x86/package/Makefile.in
===================================================================
@@ -92,8 +92,10 @@ TARGET_CXXFLAGS=$(TARGET_CFLAGS)
 #########################################################################
 else
 TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) --sysroot $(STAGING_DIR)/
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
 TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/
+TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
 endif
 #########################################################################
 #ifeq ($(BR2_ROOTFS_SUFFIX),)