Hi, all, I am build CB use this bash script:
Quote./configure --prefix=/usr --with-contrib-plugins=all,-byogames,-Cccc,-cbkoders,-codesnippets,-copystrings,-envvars,-headerfixup,-libfinder,-NassiShneiderman,-exporter
make -j2
sudo make install
read -n1 -p "Press any key to continue..."
After build finished, I wonder how to make a portable CB?
In "make install" step, there have any options for portable?
Like this:
Quotemake install --enable-portable --DESTDIR=~
Thanks!
Quote from: Loaden on September 19, 2010, 02:57:03 AM
In "make install" step, there have any options for portable?
No. The best way to make C::B portable is NOT using automake for the build, but use C::B itself to compile C::B using the unix project file and then running the update script. This will create a run script which you can modify to make C::B "portable" by adjusting the CB_DATA_DIR (don't recall exactly the name of this environment variable atm...).
Loaden you could use --prefix=/home/loaden/cb, then all files will be placed in that dir, and you can copy them around (not sure if will be portable)...
On linux, too few people care about the 'portable' thing, it is pretty windowsish...
Quote from: oBFusCATed on September 19, 2010, 09:11:22 PM
Loaden you could use --prefix=/home/loaden/cb, then all files will be placed in that dir, and you can copy them around (not sure if will be portable)...
On linux, too few people care about the 'portable' thing, it is pretty windowsish...
On most linux system this will not work, because make install relinks the libraries with full path to avoid name conflicts.
I see, thanks a lot! :D
@Loaden and all other linux users (especially if the shell is not bash):
Can you try this patch for the update-script ?
It should make C::B portable (if it is compile dwith C::B and the directory/file-structure below output or devel is not changed), because it dynamically fetches the APP_DIR variable at runtime, but I did not test it on any other shell.
Index: update
===================================================================
--- update (revision 6620)
+++ update (working copy)
@@ -106,14 +106,14 @@
if [ "x$MSYSTEM" = "x" ] ; then
echo Creating launch-scripts
echo "#!/bin/sh" > output/run.sh
- echo -n "APP_DIR=" >> output/run.sh
- echo `pwd`/output >> output/run.sh
+ echo 'APP_DIR=`dirname "$0"`' >> output/run.sh
+ echo 'APP_DIR=`( cd "$APP_DIR" && pwd )`' >> output/run.sh
echo "export LD_LIBRARY_PATH=\$APP_DIR:\$LD_LIBRARY_PATH" >> output/run.sh
echo "\$APP_DIR/codeblocks \$@" >> output/run.sh
chmod +x output/run.sh
echo "#!/bin/sh" > devel/run.sh
- echo -n "APP_DIR=" >> devel/run.sh
- echo `pwd`/devel >> devel/run.sh
+ echo 'APP_DIR=`dirname "$0"`' >> devel/run.sh
+ echo 'APP_DIR=`( cd "$APP_DIR" && pwd )`' >> devel/run.sh
echo "export LD_LIBRARY_PATH=\$APP_DIR:\$LD_LIBRARY_PATH" >> devel/run.sh
echo "\$APP_DIR/codeblocks \$@" >> devel/run.sh
chmod +x devel/run.sh
Quote from: jens on September 21, 2010, 08:25:45 AM
@Loaden and all other linux users (especially if the shell is not bash):
Can you try this patch for the update-script ?
Works well! :)
Here is the run.sh content.
Quote#!/bin/sh
APP_DIR=`dirname "$0"`
APP_DIR=`( cd "$APP_DIR" && pwd )`
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
$APP_DIR/codeblocks $@
Quote from: Loaden on September 21, 2010, 11:55:38 AM
Quote from: jens on September 21, 2010, 08:25:45 AM
@Loaden and all other linux users (especially if the shell is not bash):
Can you try this patch for the update-script ?
Works well! :)
Thanks for testing.
Did anyone else test it ?
Especially if you do not have bash as default-shell ?
Any feedback is welcome !!
If there are no objection during the next days, I will commit the change to trunk.
Committed in svn r6646 .