Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QoolBox VMDK] My Personal SDK with Fajo ToolChain
#16
You must cross compiled dependency first and rpath link them With ldflags also set cflags cppflags cxxflags
You never have to touch toolchain directory. Mediatomb is a mess to compil. Why not use the precompiled binaries.
I already test it on thecus and it works.
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#17
Qoolbox Wrote:You must cross compiled dependency first and rpath link them With ldflags also set cflags cppflags cxxflags
You never have to touch toolchain directory. Mediatomb is a mess to compil.
I DO agree !!!!!! I'm right now stuck with some missing dependencies like libmagic (!) but i plan to compile it by the next week lol

Quote:Why not use the precompiled binaries.
because it's never said which options they're compiled with.
the available mediatomb version from the official fc12 VMDK is mediatomb.0.12.1-2.fc12.x86_64 and do not include the liblastfm dependency, as an example.

moreover, in the practice, the fc16 available versions of mediatomb (for your VMDK, which I use by now) are incompatible with the Thecus kernel libraries :

mediatomb-0.12.1-12.fc16.x86_64
mediatomb-0.12.1-15.fc16.x86_64

they both depend from GLIBCXX_3.4.15 which depends from GLIBC_2.15, which is incompatible with the libstd version from ModBase1 :
Code:
root@N5550:/raid/data/share/SYSTEM/PACKAGES/mediatomb/bin # ldd mediatomb-0.12.1-15.fc16.x86_64
./mediatomb-0.12.1-15.fc16.x86_64: /raid/data/module/ModBase1/system/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)
./mediatomb-0.12.1-15.fc16.x86_64: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)
./mediatomb-0.12.1-15.fc16.x86_64: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)

then if you get the libstdc++ & libc-2.14.90.so & libm-2.14.90.so from the VMDK into the Thecus mediatomb lib directory AND as a consequence make them available in the LD_LIBRARY_PATH, you obtain an incompatibility crash for the kernel, which leads to an unavailability of all commands :
Code:
root@N5550:/raid/data/share/SYSTEM/PACKAGES/mediatomb/bin # ls
/bin/bash: relocation error: /raid/data/share/SYSTEM/PACKAGES/mediatomb/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

moreover these fc16 precompiled binaries depends from
libmysqlclient.so.18 => not found (Thecus MySQL version is libmysqlclient.so.16)
libmozjs185.so.1.0 => not found (I'm using 1.8.0)
Quote:I already test it on thecus and it works.
=> I can create links to my local versions but well, I would like to know which precompiled version you tested ?


my personal conclusion is that *tell me if I'm wrong* using precompiled binaries is not always possible, depending on the VMDK you work on, because of the kernel libraries the VMDK kernel rely on.
I already experienced such incompatibilities by the past, which lead me to have to compile some binaries from the sources, despite their precompiled availability.
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#18
Qoolbox Wrote:You must cross compiled dependency first and rpath link them With ldflags also set cflags cppflags cxxflags
You never have to touch toolchain directory. Mediatomb is a mess to compil.
I DO agree !!!!!! I'm right now stuck with some missing dependencies like libmagic (!) but i plan to compile it by the next week lol

Quote:Why not use the precompiled binaries.
because it's never said which options they're compiled with.
the available mediatomb version from the official fc12 VMDK is mediatomb.0.12.1-2.fc12.x86_64 and do not include the liblastfm dependency, as an example.

moreover, in the practice, the fc16 available versions of mediatomb (for your VMDK, which I use by now) are incompatible with the Thecus kernel libraries :

mediatomb-0.12.1-12.fc16.x86_64
mediatomb-0.12.1-15.fc16.x86_64

they both depend from GLIBCXX_3.4.15 which depends from GLIBC_2.15, which is incompatible with the libstd version from ModBase1 :
Code:
root@N5550:/raid/data/share/SYSTEM/PACKAGES/mediatomb/bin # ldd mediatomb-0.12.1-15.fc16.x86_64
./mediatomb-0.12.1-15.fc16.x86_64: /raid/data/module/ModBase1/system/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)
./mediatomb-0.12.1-15.fc16.x86_64: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)
./mediatomb-0.12.1-15.fc16.x86_64: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./mediatomb-0.12.1-15.fc16.x86_64)

then if you get the libstdc++ & libc-2.14.90.so & libm-2.14.90.so from the VMDK into the Thecus mediatomb lib directory AND as a consequence make them available in the LD_LIBRARY_PATH, you obtain an incompatibility crash for the kernel, which leads to an unavailability of all commands :
Code:
root@N5550:/raid/data/share/SYSTEM/PACKAGES/mediatomb/bin # ls
/bin/bash: relocation error: /raid/data/share/SYSTEM/PACKAGES/mediatomb/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

moreover these fc16 precompiled binaries depends from
libmysqlclient.so.18 => not found (Thecus MySQL version is libmysqlclient.so.16)
libmozjs185.so.1.0 => not found (I'm using 1.8.0)
Quote:I already test it on thecus and it works.
=> I can create links to my local versions but well, I would like to know which precompiled version you tested ?


my personal conclusion is that *tell me if I'm wrong* using precompiled binaries is not always possible, depending on the VMDK you work on, because of the kernel libraries the VMDK kernel rely on.
I already experienced such incompatibilities by the past, which lead me to have to compile some binaries from the sources, despite their precompiled availability.
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#19
i think libmagic is in the package called "file-5.tar.gz", if i remember i use it for my Subversion module.

to test mediatomb i used the static binaries 32bit version, i think to make it works on x64 X86base from Fajo should work


http://mediatomb.cc/pages/download#static


Wink
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#20
i think libmagic is in the package called "file-5.tar.gz", if i remember i use it for my Subversion module.

to test mediatomb i used the static binaries 32bit version, i think to make it works on x64 X86base from Fajo should work


http://mediatomb.cc/pages/download#static


Wink
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#21
well... it's hard enough to understand what to know with a cross compiler, if you add another puzzle part to the equation I'll be totally lost !

So I went into the Fajo cross compilation solution. it involves the recompilation of any elements not available in it's ModBase1.
The directory structures involved are quite long, but it can be managed.

Just FYI, maybe it's me but I went into (sometimes) an ELF error when making 32 bit nspr :
Code:
make[1]: Entering directory `/share/mediatomb-src/nspr-4.8.8/mozilla/nsprpub/config'
../config/./nsinstall -t -m 0755 nspr-config /data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/bin

when I tried to do it manually I got this nice message :
Code:
cd /share/mediatomb-src/nspr-4.8.8/mozilla/nsprpub/config
/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/binub/config # ../config/./nsinstall -t -m 0755 nspr-config /data/Development
-bash: ../config/./nsinstall: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

so in order to compile nspr successfully in 32 bit I had to install a missing i686 library :
Code:
yum install /lib/ld-linux.so.2
Installing:
glibc                                           i686                              2.14.90-24.fc16.9
nss-softokn-freebl                              i686                              3.14.1-3.fc16

after doing that the famous infamous error
Code:
make[3]: ../../../config/./nsinstall: Command not found
make[3]: *** [export] Error 127
would not happen anymore !
Did you install this library on your VMDK ? the Fajo 32 bit toolchain seems not to provide it.
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#22
simple

first create a directory as prefix to use for compilation :

Code:
mkdir -p /raid/data/module/MediaTomb/sys

and cross compile all MediaTomb dependecy in it with this kind of ./configure (can change regarding the dependency you have to cross compile first)
but generally it follow this... you have to tune them by enabling or disabling some option (./configure --help before any cross compilation to check all you need is enable)


Code:
PKG_CONFIG_PATH="/raid/data/module/MediaTomb/sys/lib/pkgconfig"  \
CFLAGS="-O2 -I/raid/data/module/MediaTomb/sys/include" \
CXXFLAGS="-O2 -I/raid/data/module/MediaTomb/sys/include"     \
LDFLAGS="-L/raid/data/module/MediaTomb/sys/lib -Wl,-rpath,/raid/data/module/MediaTomb/sys/lib" \
CPPFLAGS="-O2 -I/raid/data/module/MediaTomb/sys/include"     \
./configure \
--prefix=/raid/data/module/MediaTomb/sys \
--host=${HOST} \
--bindir=/raid/data/module/MediaTomb/sys/bin \
--sbindir=/raid/data/module/MediaTomb/sys/bin \
--libexecdir=/raid/data/module/MediaTomb/sys/libexec \
--libdir=/raid/data/module/MediaTomb/sys/lib \
--datadir=/raid/data/module/MediaTomb/sys/share \
--datarootdir=/raid/data/module/MediaTomb/sys/share \
--sysconfdir=/raid/data/module/MediaTomb/sys/etc \
--sharedstatedir=/raid/data/module/MediaTomb/sys/com \
--localstatedir=/raid/data/module/MediaTomb/sys/var \
--includedir=/raid/data/module/MediaTomb/sys/include \
--oldincludedir=/raid/data/module/MediaTomb/sys/include \
--infodir=/raid/data/module/MediaTomb/sys/share/info \
--localedir=/raid/data/module/MediaTomb/sys/share/locale \
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#23
thanks, i'll give it a try... but tell me if I'm wrong : what about the fajo toolchains & the fajo modbase1 dev needed ??

from his scripts i ended up this kind of a script :
Code:
###
### mediatomb build script
###
. /root/.profile

export MODULE_NAME="mediatomb"
export MODULE_SRC="/share/${MODULE_NAME}-src"

export    PREFIX="/raid/data/module/${MODULE_NAME}/system"
export WWWPREFIX="/raid/data/module/${MODULE_NAME}/www"

export CROSSBASE="/data/Development/Home/Thecus/Toolchains/x-tools"

export CROSSHOST32="i686-thecus32v5-linux-gnu"
export CROSSBASE32="${CROSSBASE}/${CROSSHOST32}"

export CROSSHOST64="x86_64-thecus64v1-linux-gnu"
export CROSSBASE64="${CROSSBASE}/${CROSSHOST64}"

export   TMPDST="/data/Development/Home/Thecus/Build/ROOT"
export TMPDST32="${TMPDST}32"
export TMPDST64="${TMPDST}64"
mkdir -p ${TMPDST} ${TMPDST32} ${TMPDST64}

export      MODBASE1="/raid/data/module/ModBase1"
export MODBASE1DEV32="/data/Development/Home/Thecus/Build/ROOT.DEV32${MODBASE1}/system"
export MODBASE1DEV64="/data/Development/Home/Thecus/Build/ROOT.DEV64${MODBASE1}/system"

[ ! -d ${MODBASE1DEV32} ] && mkdir -p ${MODBASE1DEV32}
[ ! -d ${MODBASE1DEV64} ] && mkdir -p ${MODBASE1DEV64}
nohup wget --no-clobber --output-document=${MODBASE1DEV32}/ModBase1-DEV32-1.04.00.tar.gz http://www.fajo.de/main/en/webfm_send/333 2>&1> /tmp/wget.$$.pid &
nohup wget --no-clobber --output-document=${MODBASE1DEV64}/ModBase1-DEV64-1.04.00.tar.gz http://www.fajo.de/main/en/webfm_send/334 2>&1> /tmp/wget.$$.pid &
wait

[ ! -d ${MODBASE1DEV32}/include ] && cd ${MODBASE1DEV32} && tar zxf ModBase1-DEV32-1.04.00.tar.gz && mv ModBase1.DEV32/* ./ && ./update_path_names.sh
[ ! -d ${MODBASE1DEV64}/include ] && cd ${MODBASE1DEV64} && tar zxf ModBase1-DEV64-1.04.00.tar.gz && mv ModBase1.DEV64/* ./ && ./update_path_names.sh

export CPPFLAGS32="-O2 -fno-inline -fPIC -I${TMPDST32}${PREFIX}/include -I${MODBASE1DEV32}/include"
export   CFLAGS32="-O2 -fno-inline -fPIC -I${TMPDST32}${PREFIX}/include -I${MODBASE1DEV32}/include"
export CXXFLAGS32="-O2 -fno-inline -fPIC -I${TMPDST32}${PREFIX}/include -I${MODBASE1DEV32}/include"
export  LDFLAGS32="-L${TMPDST32}${PREFIX}/lib -L${MODBASE1DEV32}/lib -Wl,-rpath,${PREFIX}/lib -Wl,-rpath,${MODBASE1}/system/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,${TMPDST32}${PREFIX}/lib -Wl,-rpath-link,${MODBASE1DEV32}/lib"

export CPPFLAGS64="-O2 -fno-inline -fPIC -I${TMPDST64}${PREFIX}/include -I${MODBASE1DEV64}/include"
export   CFLAGS64="-O2 -fno-inline -fPIC -I${TMPDST64}${PREFIX}/include -I${MODBASE1DEV64}/include"
export CXXFLAGS64="-O2 -fno-inline -fPIC -I${TMPDST64}${PREFIX}/include -I${MODBASE1DEV64}/include"
export  LDFLAGS64="-L${TMPDST64}${PREFIX}/lib64 -L${MODBASE1DEV64}/lib64 -Wl,-rpath,${PREFIX}/lib64 -Wl,-rpath,${MODBASE1}/system/lib64 -Wl,-rpath,/opt/lib64 -Wl,-rpath-link,${TMPDST64}${PREFIX}/lib64 -Wl,-rpath-link,${MODBASE1DEV64}/lib64"

export PKG_CONFIG_PATH32="${TMPDST32}${PREFIX}/lib/pkgconfig:${MODBASE1DEV32}/lib/pkgconfig"
export PKG_CONFIG_PATH64="${TMPDST64}${PREFIX}/lib64/pkgconfig:${MODBASE1DEV64}/lib64/pkgconfig"

#
#
#
switcher()
{
(($# == 1)) && export ARCH=$1 || export ARCH=64
export CROSSHOST=${CROSSHOST:-$CROSSHOST64}

# remove the current TOOLCHAIN_PATH from the PATH
export TOOLCHAIN_PATH=${CROSSBASE}/$CROSSHOST
removePath $TOOLCHAIN_PATH/bin
removePath $TOOLCHAIN_PATH/$CROSSHOST/bin

case $ARCH in
32)     export CROSSHOST=$CROSSHOST32 && removeLib ${MODBASE1DEV64}/lib64 && libmunge ${MODBASE1DEV32}/lib ;;
64)     export CROSSHOST=$CROSSHOST64 && removeLib ${MODBASE1DEV32}/lib && libmunge ${MODBASE1DEV64}/lib64 ;;
esac

# add up the new choosen TOOLCHAIN_PATH to the PATH
export TOOLCHAIN_PATH=${CROSSBASE}/$CROSSHOST
pathmunge ${TOOLCHAIN_PATH}/$CROSSHOST/bin
pathmunge ${TOOLCHAIN_PATH}/bin
}

fix_pc_32()
{
    for f in "$@" ; do
        sed -e "s|=${PREFIX}|=${TMPDST32}${PREFIX}|" -i "${TMPDST32}${PREFIX}/lib/pkgconfig/"$f
    done
}

fix_pc_64()
{
    for f in "$@" ; do
        sed -e "s|=${PREFIX}|=${TMPDST64}${PREFIX}|" -i "${TMPDST64}${PREFIX}/lib64/pkgconfig/"$f
    done
}

fix_la_32()
{
    for f in "$@" ; do
        sed -e "s| ${PREFIX}| ${TMPDST32}${PREFIX}|g;s|'${PREFIX}|'${TMPDST32}${PREFIX}|g" -i "${TMPDST32}${PREFIX}/lib/"$f
    done
}

fix_la_64()
{
    for f in "$@" ; do
        sed -e "s| ${PREFIX}| ${TMPDST64}${PREFIX}|g;s|'${PREFIX}|'${TMPDST64}${PREFIX}|g" -i "${TMPDST64}${PREFIX}/lib64/"$f
    done
}


cleanup() {
## ============================================================================
## Cleanup
## ============================================================================
rm -rf ${TMPDST32}${PREFIX}
rm -rf ${TMPDST64}${PREFIX}
mkdir -p ${MODULE_SRC}
}

yum_dependencies() {
## ============================================================================
## libraries
## ============================================================================
yum install /lib/ld-linux.so.2
yum install file-devel
yum install js js-devel
yum install libexif-devel libmp4v2-devel
yum install zlib zlib-devel
yum install mysql mysql-devel mysql-libs mysql-server mysql-utilities mysql++ mysql++-devel mysql-connector-c++ mysql-connector-c++-devel
yum install sqlite sqlite-devel
yum install taglib taglib-devel
yum install expat expat-devel
yum install magic file-libs
yum install curl curl-devel libcurl libcurl-devel
yum install liblastfm liblastfm-devel
yum install ffmpeg ffmpeg-libs ffmpeg-devel ffmpegthumbnailer ffmpegthumbnailer-devel
}

liblastfm() {
## ============================================================================
##  liblastfm-0.5 http://downloads.sourceforge.net/project/liblastfm/libclastfm-0.5.tar.gz
## ============================================================================
ARCH=$1
cd ${MODULE_SRC}
if [ ! -d libclastfm-0.5 ]; then
    wget --no-clobber http://downloads.sourceforge.net/project/liblastfm/libclastfm-0.5.tar.gz
    tar zxf libclastfm-0.5.tar.gz
fi
cd libclastfm-0.5

switcher $ARCH
case $ARCH in
32)
printf "$y"
$Debug && printf "\nPAUSE before compile $ARCH..." && read a
make distclean
CPPFLAGS="${CPPFLAGS32}" CFLAGS="${CFLAGS32}" CXXFLAGS="${CXXFLAGS32}"  \
  LDFLAGS="${LDFLAGS32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}"         \
  ./configure                       \
    --host=${CROSSHOST32}           \
    --prefix=${PREFIX}              \
    --libdir=${PREFIX}/lib

$Debug && printf "\nPAUSE before make $ARCH..." && read a
make
make DESTDIR=${TMPDST32} install
fix_pc_32 libclastfm.pc
fix_la_32 libclastfm.la
;;
#

64)
printf "$c"
$Debug && printf "\nPAUSE before compile $ARCH..." && read a
make distclean
CPPFLAGS="${CPPFLAGS64}" CFLAGS="${CFLAGS64}" CXXFLAGS="${CXXFLAGS64}"  \
  LDFLAGS="${LDFLAGS64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}"         \
  ./configure                       \
    --host=${CROSSHOST64}           \
    --prefix=${PREFIX}              \
    --libdir=${PREFIX}/lib64

$Debug && printf "\nPAUSE before make $ARCH..." && read a
make
make DESTDIR=${TMPDST64} install
fix_pc_64 libclastfm.pc
fix_la_64 libclastfm.la
;;
esac
echo $END
}

nspr() {
## ============================================================================
##  nspr-4.9.4 https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.9.4/src/nspr-4.9.4.tar.gz
## https://developer.mozilla.org/en-US/docs/NSPR_build_instructions
## http://www.mozilla.org/projects/nspr/tech-notes/platforms.html
## ============================================================================
ARCH=$1
cd ${MODULE_SRC}
if [ ! -d nspr-4.9.4/mozilla/nsprpub ]; then
    wget --no-clobber https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.9.4/src/nspr-4.9.4.tar.gz
    tar zxf nspr-4.9.4.tar.gz
    # wget --no-clobber https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
    # tar zxf nspr-4.8.8.tar.gz
fi
cd nspr-4.9.4/mozilla/nsprpub
# cd nspr-4.8.8/mozilla/nsprpub

switcher $ARCH
case $ARCH in
32)
printf "$y"
$Debug && printf "\nPAUSE before compile $ARCH..." && read a
make realclean
CPPFLAGS="${CPPFLAGS32}" CFLAGS="${CFLAGS32}" CXXFLAGS="${CXXFLAGS32}"  \
  LDFLAGS="${LDFLAGS32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}"         \
  ./configure                       \
    --host=${CROSSHOST32}           \
    --prefix=${PREFIX}              \
    --libdir=${PREFIX}/lib \
    --disable-debug \
    --enable-optimize \
    --with-arch=toolchain-default

$Debug && printf "\nPAUSE before make $ARCH..." && read a
make
make DESTDIR=${TMPDST32} install
fix_pc_32 nspr.pc
;;
#

64)
printf "$c"
$Debug && printf "\nPAUSE before compile $ARCH..." && read a
make realclean
CPPFLAGS="${CPPFLAGS64}" CFLAGS="${CFLAGS64}" CXXFLAGS="${CXXFLAGS64}"  \
  LDFLAGS="${LDFLAGS64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}"         \
  ./configure                       \
    --host=${CROSSHOST64}           \
    --prefix=${PREFIX}              \
    --libdir=${PREFIX}/lib64 \
    --disable-debug \
    --enable-optimize \
    --enable-64bit \
    --with-arch=toolchain-default

$Debug && printf "\nPAUSE before make $ARCH..." && read a
# make BUILD_OPT=1 USE_64=1
make
make DESTDIR=${TMPDST64} install
fix_pc_64 nspr.pc
;;
esac
echo $END

$Debug && printf "$g\nPAUSE before tests $ARCH..." && read a
cd ./pr/tests
make
PASS=$(LD_LIBRARY_PATH=../../dist/lib ./accept)
echo "${G}$PASS${END}"
}

many_other_compilation_dependencies...() {...}

main_module_compilation...() {...}

...from there I didn't test ....

prepare_prefix() {
## ============================================================================
##  Prepare Package
## ============================================================================

### create directories

rm -rf ${TMPDST}${PREFIX}

#

mkdir -m 0755 -p ${TMPDST}${PREFIX}

mkdir -m 0755 ${TMPDST}${PREFIX}/bin
mkdir -m 0755 ${TMPDST}${PREFIX}/etc
mkdir -m 0755 ${TMPDST}${PREFIX}/etc/squid
mkdir -m 0755 ${TMPDST}${PREFIX}/sbin
mkdir -m 0755 ${TMPDST}${PREFIX}/var
mkdir -m 0755 ${TMPDST}${PREFIX}/var/log
mkdir -m 0755 ${TMPDST}${PREFIX}/var/run
mkdir -m 0755 ${TMPDST}${PREFIX}/share
mkdir -m 0755 ${TMPDST}${PREFIX}/share/errors
mkdir -m 0755 ${TMPDST}${PREFIX}/share/icons
mkdir -m 0755 ${TMPDST}${PREFIX}/lib32
mkdir -m 0755 ${TMPDST}${PREFIX}/lib64
mkdir -m 0755 ${TMPDST}${PREFIX}/libexec
}

copy_files() {
### copy files

for f in mypasswd squidclient
do
    cp -pd ${TMPDST32}${PREFIX}/bin/$f ${TMPDST}${PREFIX}/bin/$f.i686
    cp -pd ${TMPDST64}${PREFIX}/bin/$f ${TMPDST}${PREFIX}/bin/$f.x86_64
done

for f in iptables iptables-restore iptables-save squid xtables-multi
do
    cp -pd ${TMPDST32}${PREFIX}/sbin/$f ${TMPDST}${PREFIX}/sbin/$f.i686
    cp -pd ${TMPDST64}${PREFIX}/sbin/$f ${TMPDST}${PREFIX}/sbin/$f.x86_64
done

for f in cachemgr.cgi digest_edir_auth digest_ldap_auth digest_pw_auth diskd        \
         fakeauth_auth getpwname_auth ip_user_check msnt_auth ncsa_auth no_check.pl \
         ntlm_smb_lm_auth pinger pop3.pl sasl_auth smb_auth smb_auth.pl smb_auth.sh \
         squid_db_auth squid_ldap_auth squid_ldap_group squid_radius_auth           \
         squid_session squid_unix_group wbinfo_group.pl mysql_auth
do
    cp -pd ${TMPDST32}${PREFIX}/libexec/$f ${TMPDST}${PREFIX}/libexec/$f.i686
    cp -pd ${TMPDST64}${PREFIX}/libexec/$f ${TMPDST}${PREFIX}/libexec/$f.x86_64
done

cp -Rpd ${TMPDST32}${PREFIX}/etc/squid/*       ${TMPDST}${PREFIX}/etc/squid/
}

copy_libraries() {
### copy libraries

cp -Rpd ${TMPDST32}${PREFIX}/lib/*   ${TMPDST}${PREFIX}/lib32/
cp -Rpd ${TMPDST64}${PREFIX}/lib64/* ${TMPDST}${PREFIX}/lib64/

rm -rf ${TMPDST}${PREFIX}/lib32/pkgconfig        ${TMPDST}${PREFIX}/lib64/pkgconfig
rm -rf ${TMPDST}${PREFIX}/lib32/*.a              ${TMPDST}${PREFIX}/lib64/*.a
rm -rf ${TMPDST}${PREFIX}/lib32/*.la             ${TMPDST}${PREFIX}/lib64/*.la

cp -Rpd ${TMPDST32}${PREFIX}/share/errors/*   ${TMPDST}${PREFIX}/share/errors/
cp -Rpd ${TMPDST32}${PREFIX}/share/icons/*    ${TMPDST}${PREFIX}/share/icons/

### create script to generate symlinks

if pushd ${TMPDST}${PREFIX} >/dev/null
then
    find . -type l -exec stat -c "%N" {} \; | \
        awk '{print "ln -sf",substr($3,2,length($3)-2),substr($1,2,length($1)-2)}' \
        | sort > sbin/make.symlinks

    find . -type l -exec rm {} \;

    popd >/dev/null
fi
}

strip_libraries() {
### strip libs/exe

chmod -R +w ${TMPDST}${PREFIX}

${CROSSHOST32}-strip ${TMPDST}${PREFIX}/bin/*.i686 ${TMPDST}${PREFIX}/lib32/lib*    \
    ${TMPDST}${PREFIX}/sbin/*.i686 ${TMPDST}${PREFIX}/libexec/*.i686

${CROSSHOST64}-strip ${TMPDST}${PREFIX}/bin/*.x86_64 ${TMPDST}${PREFIX}/lib64/lib*  \
    ${TMPDST}${PREFIX}/sbin/*.x86_64  ${TMPDST}${PREFIX}/libexec/*.x86_64
}

[[ $1 == debug ]] && export Debug=true || export Debug=false
# cleanup
# yum_dependencies
# liblastfm 32
# liblastfm 64
# nspr 32
# nspr 64
libjs 32
libjs 64
# mediatomb 32
# mediatomb 64
# prepare_prefix
# copy_files
# copy_libraries
# strip_libraries

it works well, but as you can see the working directories are far different, example with libjs :
Code:
BUILD_OPT=1 JS_HAS_FILE_OBJECT=1 JS_THREADSAFE=1 CPPFLAGS=-O2 -fno-inline -fPIC -I/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/include -I/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/include CFLAGS=-O2 -fno-inline -fPIC -I/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/include -I/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/include CXXFLAGS=-O2 -fno-inline -fPIC -I/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/include -I/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/include LDFLAGS=-L/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/lib -L/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/lib -Wl,-rpath,/raid/data/module/mediatomb/system/lib -Wl,-rpath,/raid/data/module/ModBase1/system/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/lib -Wl,-rpath-link,/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/lib -Wl,-rpath,/data/Development/Home/Thecus/Toolchains/x-tools/i686-thecus32v5-linux-gnu/i686-thecus32v5-linux-gnu/sys-root/lib PKG_CONFIG_PATH=/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system/lib/pkgconfig:/data/Development/Home/Thecus/Build/ROOT.DEV32/raid/data/module/ModBase1/system/lib/pkgconfig DIST=/data/Development/Home/Thecus/Build/ROOT32/raid/data/module/mediatomb/system ./configure --host=i686-thecus32v5-linux-gnu --prefix=/raid/data/module/mediatomb/system --localstatedir=/raid/data/module/mediatomb/system/var --libdir=/raid/data/module/mediatomb/system/lib

With this "original" derivated fajo method, i end up with modules under /data/Development/Home/Thecus/Build/ROOTxx/raid/data/module/<module>/system/

Plus, the little functions he wrote as fix_pc_xx & fix_la_xx are needed to modify the temporary la & pc files needed by the final module to compile, coz inside these files, the paths should point to the real directories the libraries are, instead of the final thecus directory (which is ${PREFIX})
On can tell the configure anything as a prefix, as long as you give the DESTDIR= to the make script, that's I understood from the time passed on it.

Plus, I definitely need the /lib/ld-linux.so.2 for the ldd script to work with 32 bit libraries. any other way ?
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#24
you doesnt need the /lib/ld-linux.so.2...

Why making complicated, when you can do it simple...

if you use Fajo ModeBase1 as dependecy, this one automaticatly set the right CFLAGS, FFLAGS, LDFLAGS....

use as i say a special directory creation on your VM /raid/data/module/MediaTomb/sys

export before the FLAG setted by ModBase1 (to be sure it works)

and launch your configure script with prefix /raid/data/module/MediaTomb/sys and as host = ${HOST} (pointing on the righ Toolchain)
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#25
you doesnt need the /lib/ld-linux.so.2...

Why making complicated, when you can do it simple...

if you use Fajo ModeBase1 as dependecy, this one automaticatly set the right CFLAGS, FFLAGS, LDFLAGS....

use as i say a special directory creation on your VM /raid/data/module/MediaTomb/sys

export before the FLAG setted by ModBase1 (to be sure it works)

and launch your configure script with prefix /raid/data/module/MediaTomb/sys and as host = ${HOST} (pointing on the righ Toolchain)
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#26
if i put everything under /raid/data/module/<module>/, where is the cross compile stuff ?
how do you differentiate the i686 files from the x86_64 ones ??
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#27
if i put everything under /raid/data/module/<module>/, where is the cross compile stuff ?
how do you differentiate the i686 files from the x86_64 ones ??
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply
#28
scavenger Wrote:if i put everything under /raid/data/module/<module>/, where is the cross compile stuff ?
how do you differentiate the i686 files from the x86_64 ones ??

The cross compile file will be in your prefix directory /raid/data/module/$name_of_module

generally i use /raid/data/module/$name_of_module/sys and once the module is ready i put them in the System directory from the generated mk_module.tar.gz

I prefer genreally make 2 modules one for x86 and another for x64
fajo rename the binaries and for lib create a lib32 and a lib64 and on module install he makes and detection OS with uname to create symlink and put the file on the right place

it is a choice...
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#29
scavenger Wrote:if i put everything under /raid/data/module/<module>/, where is the cross compile stuff ?
how do you differentiate the i686 files from the x86_64 ones ??

The cross compile file will be in your prefix directory /raid/data/module/$name_of_module

generally i use /raid/data/module/$name_of_module/sys and once the module is ready i put them in the System directory from the generated mk_module.tar.gz

I prefer genreally make 2 modules one for x86 and another for x64
fajo rename the binaries and for lib create a lib32 and a lib64 and on module install he makes and detection OS with uname to create symlink and put the file on the right place

it is a choice...
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#30
oh i see...
you don't cross compile each dependencies one after another, up to the end : you compile everything in 32 then redo the whole process in 64
got it.

well with my method I can do both since everything is functions. btw when i get stucked with a particular library, problem is the same :lol:
scavenger
N5550 V2.05.08.20150416.cdv + 4G patch
2*4GB Corsair CMSO8GX3M2A1333C9 = 8GB RAM
5 x 2To Hitashi HDS72202 (RAID5) @ write=72MB/s - read=91MB/s (802.3ad dual cable)
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [QoolBox VMDK] My Personal SDK with Fajo ToolChain 0 19,515 Less than 1 minute ago
Last Post:

Forum Jump:


Users browsing this thread: 1 Guest(s)