mokon
2013-01-26 04:07:10 UTC
Hello,
I trust this is the correct place to ask a question such as this. If
it is not and if you could direct me to the correct place that would
be great.
Ok, so a little background. I need to cross compile libpqxx but I am
running into a little trouble. First, I have my cross compiler and my
crosstool-ng directory which is where I am installing everything.
CROSS="arm-rpi-linux-gnueabi"
PREFIX="/home/xxx/repository/platform/cross/prefix/arm-rpi-linux-gnueabi/"
I have previously successfully cross compiled and installed libpq as
can be seen in the portion of a script below:
postgresql)
echo "Building PostgreSQL Libary"
cd deps
if [ ! -d "postgresql" ]; then
git://git.postgresql.org/git/postgresql.git
fi
cd postgresql
./configure --host=${CROSS} --prefix=${PREFIX} --without-readline
--without-zlib
make
make install
cd ../..
;;
The problem comes when I attempt to cross compile the libpqxx library.
Here is the portion of a script that does that:
pqxx)
echo "Building PostgreSQL libpqxx Libary"
cd deps
if [ ! -d "libpqxx" ]; then
svn co svn://pqxx.org/libpqxx/trunk/ libpqxx
fi
cd libpqxx
./configure --host=${CROSS} --prefix=${PREFIX} # --with-sysroot=${PREFIX}
make
make install
cd ../..
;;
I am failing in configure. Here is part of the error message I am getting:
checking /usr/include/libpq-fe.h usability... yes
checking /usr/include/libpq-fe.h presence... yes
checking for /usr/include/libpq-fe.h... yes
checking for ability to compile source files using libpq... yes
checking for main in -lpq... no
configure: error:
Could not link to libpq. Make sure you have the PostgreSQL client library
installed, and that the library binary can be found in the
location returned by
"pg_config --libdir".
So as you can see a few problems are occuring here. This pg_config is
my build servers installation of postgresql so of course its including
/usr/include when I need it to be including from my ${PREFIX}
directory. Similarly we get and error is pg_config --libdir since its
not using the tool chain correctly.
Am I doing something simple wrong? What is the correct way to cross
compile this? I might be able to hack it with my own script,
pg_config, that gives the correct tool chain location but I would like
to do it the correct way...
Thanks,
David
I trust this is the correct place to ask a question such as this. If
it is not and if you could direct me to the correct place that would
be great.
Ok, so a little background. I need to cross compile libpqxx but I am
running into a little trouble. First, I have my cross compiler and my
crosstool-ng directory which is where I am installing everything.
CROSS="arm-rpi-linux-gnueabi"
PREFIX="/home/xxx/repository/platform/cross/prefix/arm-rpi-linux-gnueabi/"
I have previously successfully cross compiled and installed libpq as
can be seen in the portion of a script below:
postgresql)
echo "Building PostgreSQL Libary"
cd deps
if [ ! -d "postgresql" ]; then
git://git.postgresql.org/git/postgresql.git
fi
cd postgresql
./configure --host=${CROSS} --prefix=${PREFIX} --without-readline
--without-zlib
make
make install
cd ../..
;;
The problem comes when I attempt to cross compile the libpqxx library.
Here is the portion of a script that does that:
pqxx)
echo "Building PostgreSQL libpqxx Libary"
cd deps
if [ ! -d "libpqxx" ]; then
svn co svn://pqxx.org/libpqxx/trunk/ libpqxx
fi
cd libpqxx
./configure --host=${CROSS} --prefix=${PREFIX} # --with-sysroot=${PREFIX}
make
make install
cd ../..
;;
I am failing in configure. Here is part of the error message I am getting:
checking /usr/include/libpq-fe.h usability... yes
checking /usr/include/libpq-fe.h presence... yes
checking for /usr/include/libpq-fe.h... yes
checking for ability to compile source files using libpq... yes
checking for main in -lpq... no
configure: error:
Could not link to libpq. Make sure you have the PostgreSQL client library
installed, and that the library binary can be found in the
location returned by
"pg_config --libdir".
So as you can see a few problems are occuring here. This pg_config is
my build servers installation of postgresql so of course its including
/usr/include when I need it to be including from my ${PREFIX}
directory. Similarly we get and error is pg_config --libdir since its
not using the tool chain correctly.
Am I doing something simple wrong? What is the correct way to cross
compile this? I might be able to hack it with my own script,
pg_config, that gives the correct tool chain location but I would like
to do it the correct way...
Thanks,
David