Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Embedded Handbook Clarification: pkg-config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 477
Location: Salem, OR

PostPosted: Sat Jun 06, 2009 10:56 pm    Post subject: Embedded Handbook Clarification: pkg-config Reply with quote

Below is basically a repeat of what I had emailed to toolchain@gentoo.org.

I'm trying to install a cross compiler on my AMD64 for arm (SheevaPlug) and have been following your Gentoo Embedded Handbook at http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml

I do not fully understand Chapter 5 "Cross-Compiling with Portage", specifically the section 5.e on "Helper: pkg-config".

The instructions state:

Quote:
Many packages are moving to installing pkg-config files (*.pc) and using those to discover needed libraries and includes. To ease the build process, you should install a pkg-config wrapper for your target which will tell pkg-config to only search your cross-compiler paths rather than your host paths.

You should install this into your PATH so that configure scripts will detect it properly. Name it with a CTARGET prefix and the script will do the rest. In other words, if your CTARGET is set to arm-linux-uclibc, the canonical name is arm-linux-uclibc-pkg-config. Older configure scripts would only search for pkg-config, so in those cases you will need to export the PKG_CONFIG variable to the wrapper script.


So, I created a file arm-softfloat-linux-gnueabi-pkg-config and placed same under my directory "/usr/arm-softfloat-linux-gnueabi/etc". The contents of the file were copied form the web page, to wit:

Code:
#!/bin/sh
CTARGET=${0%-pkg-config}
SYSROOT="/usr/${CTARGET}"
export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig"
unset PKG_CONFIG_PATH PKG_CONFIG_ALLOW_SYSTEM_CFLAGS PKG_CONFIG_ALLOW_SYSTEM_LIBS
exec pkg-config "$@"


What I am not understanding is the instruction "install this into your PATH". My current PATH is:

Quote:

hermes etc # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin
hermes etc #


For the time that I would be cross-compiling and/or setting up this tool chain, should I add the directory this file is to my path as in:
hermes etc # export PATH=$PATH:/usr/arm-softfloat-linux-gnueabi/etc ?or hermes etc # export PATH=$PATH:/usr/arm-softfloat-linux-gnueabi/etc/arm-softfloat-linux-gnueabi-pkg-config

What brings me to posting this is that the emerge of sys-apps/coreutils-7.1 failed, and it looks like a directory/location issue; here is the error message:

Quote:
* The specific snippet of code:
* mv ${fhs} ../../bin/ || die "could not move fhs bins";
* The die message:
* could not move fhs bins


The ebuild section the die statement comes from is:

Code:
src_install() {
       emake install DESTDIR="${D}" || die
       dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO

       insinto /etc
       newins src/dircolors.hin DIR_COLORS || die

       if [[ ${USERLAND} == "GNU" ]] ; then
               cd "${D}"/usr/bin
               dodir /bin
               # move critical binaries into /bin (required by FHS)
               local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
                          mkdir mknod mv pwd rm rmdir stty sync true uname"
               mv ${fhs} ../../bin/ || die "could not move fhs bins"
               # move critical binaries into /bin (common scripts)
               local com="basename chroot cut dir dirname du env expr head mkfifo
                          mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
               mv ${com} ../../bin/ || die "could not move common bins"
               # create a symlink for uname in /usr/bin/ since autotools require it
               local x
               for x in ${com} uname ; do
                       dosym /bin/${x} /usr/bin/${x} || die
               done
       else
               # For now, drop the man pages, collides with the ones of the system.
               rm -rf "${D}"/usr/share/man
       fi
}


I'm guessing I do not have my environment set correctly and I have not harnessed the functionality of the helping pkg-config script.

Note, the word "PATH", as capitalized, appears for the first time in section 5.e, so I'm guessing it has a special meaning or is referencing the environmental variable "PATH"?

I also made a copy of arm-softfloat-linux-gnueabi-pkg-config under the SYSROOT directory of "/usr/arm-softfloat-linux-gnueabi", that didn't change the die outcome of a sysapps/coreutils-7.1 emerge.
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Mon Jun 08, 2009 9:21 am    Post subject: Reply with quote

Quote:
What I am not understanding is the instruction "install this into your PATH"


you just have to put the above script in /usr/bin f.ex., not in /usr/${CTARGET}/whatever ; chmod u+x it and you should be done.

cheers
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum