Libtool
AR="/LinuxPPC/CDK/bin/power-linux-ar"
CC="/LinuxPPC/CDK/bin/power-linux-gcc"
//-------------------------------------------------------------------
So I use “make” to compile the program. But there is an error:
//----------------------------------------------------------------------------------
making all in /mnt/diskd/net-snmp-5.1.1-for-ppc/snmplib
make[1]: Entering directory `/mnt/diskd/net-snmp-5.1.1-for-ppc/snmplib'
/bin/sh ../libtool --mode=compile /LinuxPPC/CDK/bin/powerpc-linux-gcc
-I../include -I../include -I. -I.. -I. -I./.. -g -O2 -Dlinux -c -o mib.lo
mib.c
rm -f .libs/mib.lo
/LinuxPPC/CDK/bin/powerpc-linux-gcc -I../include -I../include -I. -I.. -I.
-I./.. -g -O2 -Dlinux -c mib.c -fPIC -DPIC -o .libs/mib.lo
In file included from ../include/net-snmp/utilities.h:39,
from mib.c:85:
../include/net-snmp/library/system.h:110: parse error before `get_myaddr'
../include/net-snmp/library/system.h:110: warning: data definition has no
type or storage class
make[1]: *** [mib.lo] Error 1
make[1]: Leaving directory `/mnt/diskd/net-snmp-5.1.1-for-ppc/snmplib'
make: *** [subdirs] Error 1
//----------------------------------------------------------------------------------------
Then I use the libtool without change(CC=gcc, AR=ar), the result of
compiling is right. But it is obviously that the file compiled can’t be
used in my target board.
What should I do with my makefile and libtool file? Thank you very much !
_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Net-snmp-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
You can't just change the Makefile. You need to re-run configure for the new
environment. There are some cross compiling tips here:
http://www.net-snmp.org/faqs/rstory/#cross
--=20
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=3Dnet-snmp-cod=
ers>
You are lost in a twisty maze of little standards, all different.=20
On Tue, 08 Jun 2004 13:52:55 +0800 =01 wrote:
> hello!
> I can't open open the webpage u gave=20
> me(http://www.net-snmp.org/faqs/rstory/#cross). Would u send me a copy of=
=20
> .txt or .html? Thank u very much!
From the net-snmp INSTALL file:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Specifying the System Type
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=3DTYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=3DTYPE' option to select the type of system they will
produce code for and the `--build=3DTYPE' option to select the type of
system on which you are compiling the package.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The most important configure options are:
--with-cc=3D[cross-compiler]
--with-ld=3D[cross-linker]
--target=3D[target-environment]
--with-endianness=3D[big|little]
Other potentially useful options:
--with-cflags=3D"..."
--with-ldlags=3D"..."
--with-ar=3D/path/ar
--enable-mini-agent
--enable-shared=3D"no"
--without-pic
Two simple examples of cross-compiling:
./configure --target=3Dppc-linux --with-cc=3Dppc_405-gcc --with-endianness=
=3Dbig
./configure --target=3Dpowerpc-snmc-linux-gnu --build=3Di386-redhat-linux \
--with-endianness=3Dbig
A more complex example involves setting environment variables for all
the flags for the tools needed for the cross compile:
export TOOLPATH=3D/opt/hardhat/devkit/ppc/405
export PATH=3D$TOOLPATH/bin:$PATH
export CFLAGS=3D' -g -fPIC -msoft-float -D_SOFT_FLOAT -Dlinux -mcpu=3D40=
3'
export CPPFLAGS=3D'-I$TOOLPATH/include -I$TOOLPATH/target/usr/include'
export ASFLAGS=3D'-g -gstabs'
export LDFLAGS=3D'-Wl,-soname,-Bdynamic -lc'=20
export LIB=3D'ar rcu'=20
./configure --build=3Di686-pc-linux-gnu --host=3Dpowerpc \
--target=3Dpowerpc-hardhat-linux-gnu --with-endianness=3Dbig
--=20
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=3Dnet-snmp-cod=
ers>
You are lost in a twisty maze of little standards, all different.=20
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
./configure --with-cc=/LinuxPPC/CDK/bin/powerpc-linux-gcc \
--with-ar=/LinuxPPC/CDK/bin/powerpc-linux-ar \
--build=i686-pc-linux-gnu --host=powerpc \
--target=ppc-linux --with-endianness=big \
--with-perl-modules \
--with-prefix=/netsnmp-for-ppc
With compiling the files again, the past parse error disappeared.
But I get a new error to substitute it:
/LinuxPPC/CDK/bin/powerpc-linux-gcc -g -O2 -Dlinux -o snmpd snmpd.o
./.libs/libnetsnmpagent.a ./.libs/libnetsnmpmibs.a
helpers/.libs/libnetsnmphelpers.a ../snmplib/.libs/libnetsnmp.a -ldl -lm
/LinuxPPC/CDK/powerpc-linux/bin/ld: snmp_version.o: compiled for a little
endian system and target is big endian
File in wrong format: failed to merge target specific data of file
../snmplib/.libs/libnetsnmp.a(snmp_version.o)
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory `/mnt/diskd/net-snmp-5.1.1/agent'
make: *** [subdirs] Error 1
I set the big endian in the step of configuration, and I don't the cause of
the error about endianess?
Would u give me some idea of this problem?
Thank u very much!
>From: Robert Story (Coders) <rst...@freesnmp.com>
>Reply-To: net-snm...@lists.sourceforge.net
>To: <zs...@hotmail.com>
>CC: net-snm...@lists.sourceforge.net
>Subject: Re: A question for the porting net-snmp to PowerPC.
>Date: Tue, 8 Jun 2004 13:07:18 -0400
>
> [ First - *please* don't mail me directly. Keep discussions on
> the list, where others can both learn and offer advice. Thanks.
]
>
>On Tue, 08 Jun 2004 13:52:55 +0800 wrote:
> > hello!
> > I can't open open the webpage u gave
> > me(http://www.net-snmp.org/faqs/rstory/#cross). Would u send me a copy
of
> > .txt or .html? Thank u very much!
>
> From the net-snmp INSTALL file:
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>Specifying the System Type
>==========================
>
> There may be some features `configure' can not figure out
>automatically, but needs to determine by the type of host the package
>will run on. Usually `configure' can figure that out, but if it prints
>a message saying it can not guess the host type, give it the
>`--host=TYPE' option. TYPE can either be a short name for the system
>type, such as `sun4', or a canonical name with three fields:
> CPU-COMPANY-SYSTEM
>
>See the file `config.sub' for the possible values of each field. If
>`config.sub' isn't included in this package, then this package doesn't
>need to know the host type.
>
> If you are building compiler tools for cross-compiling, you can also
>use the `--target=TYPE' option to select the type of system they will
>produce code for and the `--build=TYPE' option to select the type of
>system on which you are compiling the package.
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>The most important configure options are:
>
> --with-cc=[cross-compiler]
> --with-ld=[cross-linker]
> --target=[target-environment]
> --with-endianness=[big|little]
>
>Other potentially useful options:
>
> --with-cflags="..."
> --with-ldlags="..."
> --with-ar=/path/ar
>
> --enable-mini-agent
> --enable-shared="no"
> --without-pic
>
>Two simple examples of cross-compiling:
>
>./configure --target=ppc-linux --with-cc=ppc_405-gcc --with-endianness=big
>
>./configure --target=powerpc-snmc-linux-gnu --build=i386-redhat-linux \
> --with-endianness=big
>
>A more complex example involves setting environment variables for all
>the flags for the tools needed for the cross compile:
>
> export TOOLPATH=/opt/hardhat/devkit/ppc/405
> export PATH=$TOOLPATH/bin:$PATH
> export CFLAGS=' -g -fPIC -msoft-float -D_SOFT_FLOAT -Dlinux -mcpu=403'
> export CPPFLAGS='-I$TOOLPATH/include -I$TOOLPATH/target/usr/include'
> export ASFLAGS='-g -gstabs'
> export LDFLAGS='-Wl,-soname,-Bdynamic -lc'
> export LIB='ar rcu'
>
> ./configure --build=i686-pc-linux-gnu --host=powerpc \
> --target=powerpc-hardhat-linux-gnu --with-endianness=big
>
>
>--
>Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
><irc://irc.freenode.net/#net-snmp>
>Archive:
<http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
>
>You are lost in a twisty maze of little standards, all different.
_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/
-------------------------------------------------------
Did you 'make distclean' before you re-ran configure? I'm guessing not.
Try 'make clean' and then another make. If that doesn't help, them 'make
distclean', re-run configure and make. If that still doesn't help, let us know
and we'll go from there.
--
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
We have done something similar and have used:
./configure \
:
:
--host=3D"powerpc-linux" \
--with-endianness=3Dbig \
:
CC=3Dpowerpc-linux-gcc \
AR=3Dpowerpc-linux-ar \
RANLIB=3Dpowerpc-linux-ranlib \
STRIP=3Dpowerpc-linux-strip \
LD=3Dpowerpc-linux-ld
ie no --build, no --target
That works for us!
PS We didn't get everything to work without specifying the tools things =
this way. I do not recall exactely what failed and which of the tools =
that are used, but it was not CC or AR that failed.
=20
> -----Original Message-----
> From: net-snmp-c...@lists.sourceforge.net
> [mailto:net-snmp-c...@lists.sourceforge.net]On Behalf=20
> Of Robert
> Story (Coders)
> Sent: 10. juni 2004 16:13
> To: lew kenny
> Cc: net-snm...@lists.sourceforge.net
> Subject: Re: A question for the porting net-snmp to PowerPC.
>=20
>=20
> On Thu, 10 Jun 2004 10:28:21 +0800 lew wrote:
> LK> ./configure --with-cc=3D/LinuxPPC/CDK/bin/powerpc-linux-gcc \
> LK> --with-ar=3D/LinuxPPC/CDK/bin/powerpc-linux-ar \
> LK> --build=3Di686-pc-linux-gnu --host=3Dpowerpc \
> LK> --target=3Dppc-linux --with-endianness=3Dbig \
> LK> --with-perl-modules \
> LK> --with-prefix=3D/netsnmp-for-ppc =20
> LK>=20
> LK> With compiling the files again, the past parse error disappeared.=20
> LK>=20
> LK> But I get a new error to substitute it:
> LK> /LinuxPPC/CDK/powerpc-linux/bin/ld: snmp_version.o:=20
> compiled for a little=20
> LK> endian system and target is big endian
> LK> File in wrong format: failed to merge target specific=20
> data of file=20
> LK> ../snmplib/.libs/libnetsnmp.a(snmp_version.o)
> LK>=20
> LK> I set the big endian in the step of configuration, and I=20
> don't the cause of
> LK> the error about endianess?
> LK> Would u give me some idea of this problem?
>=20
> Did you 'make distclean' before you re-ran configure? I'm=20
> guessing not.
>=20
> Try 'make clean' and then another make. If that doesn't help,=20
> them 'make
> distclean', re-run configure and make. If that still doesn't=20
> help, let us know
> and we'll go from there.
>=20
> --=20
> Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
> <irc://irc.freenode.net/#net-snmp>
> Archive:=20
<http://sourceforge.net/mailarchive/forum.php?forum=3Dnet-snmp-coders>
You are lost in a twisty maze of little standards, all different.=20