[ 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. 


-------------------------------------------------------
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
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to