Hi dragorians, I was trying to build some upgrades to D2 (Dragora 2.x) packages, and usually I found that the difference between dragbuild-32 and dragbuild-64 scripts are just the ARCH (i486 or x86_64) variable and the library directory (lib for 32 bits and lib64 for for 64 bits) I found that a little use of some coreutils commands like uname and the information provided by /proc/cpuinfo allow to autodetect architecture at runtime, and some bash lines to set up properly the library directory. I have a code prototype, based on some scripts the selk provides
case "$(uname -m)" in
i?86) export ARCH=i486
BANDERAS="-march=i486 -mtune=i686"
;;
x86_64) export ARCH=x86_64
BANDERAS="-mtune=generic"
SUFARQ=64
;;
*) export ARCH=$(uname -m)
esac
Then for the library directory
./configure \
--prefix=/usr \
--datarootdir=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib${SUFARQ} \
--libexecdir=/lib \
--build=${ARCH}-dragora-linux-gnu
It can be improved if we think in cross compilation, maybe we can add arguments checking to the script for setting up the architecture.
Is just an idea, to your consideration. What do you say ?