From: jean-pierre roux Date: Mon, 3 Jan 2011 11:58:02 +0000 (+0000) Subject: new way for make / make-install X-Git-Tag: Creatools2-0-3.creaToolsTools2-0-3.17Feb2011~58 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=17db007be226e04c428a47c85fa2e7320070420b;p=creaToolsTools.git new way for make / make-install --- diff --git a/Install/scripts/cmakemod.sh b/Install/scripts/cmakemod.sh index 088d842..88aa35d 100644 --- a/Install/scripts/cmakemod.sh +++ b/Install/scripts/cmakemod.sh @@ -14,7 +14,12 @@ echo " " echo " " echo " " echo " " - +echo " =======" +echo $1 +echo $2 +echo $3 +echo $4 +echo " =======" if [ $buildType = "Debug" ] then debug="ON" diff --git a/Install/scripts/configure.sh b/Install/scripts/configure.sh index 8f633b9..a7163e0 100644 --- a/Install/scripts/configure.sh +++ b/Install/scripts/configure.sh @@ -1,22 +1,13 @@ #!/bin/sh -# UNUSED, RIGHT NOW. # JPR - # used by make.sh and make-install.sh (that replace All.sh) # use 'source configure.sh' -if [ $# = 0 ] -then -echo "Use it as :" -echo "sh make-install.sh " -echo "with 'installPrefix' : /usr/local or /creatools_install" -echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" -echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" -exit 0 -fi + +#allow user to choose the generation dir +#allow user to choose to generate the doc or not +#allow user to choose where he wants to get the sources from : CVS / HTML echo $# echo "----------" @@ -32,20 +23,22 @@ echo "----------" if [ $# != 7 ] then -echo "sh make-install.sh " +echo +echo +echo "===================================================" +echo "WRONG NUMBER OF ARGUMENTS IN YOUR configure.sh FILE" +echo "===================================================" +echo +echo +echo "Should be :" +echo " " echo "with 'installPrefix' : /usr/local or /creatools_install" echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" +echo "with 'where are creaTools sources' : where do you want to get them from ? CVS / HTML" echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" exit 0 fi -# @echo off - -#allow user to choose the generation dir -#allow user to choose to generate the doc or not - generationdir=$1 docGeneration=$2 cvsUserName=$3 @@ -56,6 +49,14 @@ sourcesFrom=$7 scriptDir=$PWD +# start_point : used at debug time : start point of the script +# ex : if everything is OK, but bbtkGEditor, +# cvs upate bbtkGEditor manually,and use : +# start_point=10 +# in order not to 'cvs checkout' everything, nor recompile everything. + +start_point=0 + creadll=$generationdir/creatools_bin/creaBin diff --git a/Install/scripts/make-install.sh b/Install/scripts/make-install.sh index ced49fc..13d043b 100644 --- a/Install/scripts/make-install.sh +++ b/Install/scripts/make-install.sh @@ -1,254 +1,31 @@ #!/bin/sh -if [ $# = 0 ] -then +echo +echo +echo "===================================================" +echo "REMEMBER !" +echo "" +echo "YOU NEED TO RUN THIS ONE AS root" +echo "===================================================" +echo +echo -echo "Run it as 'root':" -echo "Use it as :" -echo "sh make-install.sh " -echo "with 'installPrefix' : /usr/local or /creatools_install" -echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" -echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" -exit 0 -fi - -echo $# -echo "----------" -echo $0 -echo $1 -echo $2 -echo $3 -echo $4 -echo $5 -echo $6 -echo $7 -echo "----------" - -if [ $# != 7 ] -then -echo "sh make-install.sh " -echo "with 'installPrefix' : /usr/local or /creatools_install" -echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" -echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" -exit 0 -fi - -# @echo off - -#allow user to choose the generation dir -#allow user to choose to generate the doc or not - -generationdir=$1 -docGeneration=$2 -cvsUserName=$3 -installPrefix=$4 -buildType=$5 -gdcmVersion=$6 -sourcesFrom=$7 - -scriptDir=$PWD - - creasource=crea - bbtksource=bbtk - creamaracassource=creaMaracasVisu - creaenvironmentsource=creaEnvironment - creabrukersource=creaBruker - creaimagesource=creaImageIO - creacontourssource=creaContours - crearigidregistrationssource=creaRigidRegistration - bbtkgeditorsource=bbtkGEditor - creatoolssource=creaTools - -cd $generationdir - -# start_point : used at debug time : start point of the script -# ex : if everything is OK, but bbtkGEditor, -# cvs upate bbtkGEditor manually,and use : -# start_point=10 -# in order not to cvs co everything, nor recompile everything. - -start_point=0 +# Set all local variables +source $PWD/configure.sh cd $scriptDir - -# ------------------------- -# start_point = 2 : CREA -#------------------------- -if [ $start_point -le 2 ] -then -# CREA -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then - sh installmod.sh $buildType $creasource $generationdir - -fi -fi - creadll=$generationdir/creatools_bin/creaBin - LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH - - - -# ------------------------- -# start_point = 3 : BBTK -#------------------------- -if [ $start_point -le 3 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# BBTK - sh installmod.sh $buildType $bbtksource $generationdir -fi -fi - bbtkdll=$generationdir/creatools_bin/bbtkBin - LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 4 : creaMaracasVisu -#------------------------- -if [ $start_point -le 4 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaMaracasVisu - sh installmod.sh $buildType $creamaracassource $generationdir -fi -fi - creamaracasdll=$generationdir/creatools_bin/creamaracasBin - LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 5 : creaEnvironment -#------------------------- -if [ $start_point -le 5 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaEnvironment - sh installmod.sh $buildType $creaenvironmentsource $generationdir -fi -fi - creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin - LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 6 : creaBruker -#------------------------- -if [ $start_point -le 6 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaBruker - sh installmod.sh $buildType $creabrukersource $generationdir - echo generationdir -fi -fi - creabrukerdll=$generationdir/creatools_bin/creabrukerBin - LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 7 : creaImageIO -#------------------------- -if [ $start_point -le 7 ] -then - # the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaImageIO - sh installmod.sh $buildType $creaimagesource $generationdir -fi -fi - creaimagedll=$generationdir/creatools_bin/creaimageBin - LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 8 : creaContour -#------------------------- -if [ $start_point -le 8 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaContours - sh installmod.sh $buildType $creacontourssource $generationdir -fi -fi -# creacontourdll=$generationdir/creatools_bin/creacontoursBin -# LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 9 : creaRigidRegistration -#------------------------- -if [ $start_point -le 9 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then - sh installmod.sh $buildType $crearigidregistrationssource $generationdir -fi -fi -# crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin -# LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 10 : bbtkGEditor -#------------------------- -if [ $start_point -le 10 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# bbtkGEditor - sh installmod.sh $buildType $bbtkgeditorsource $generationdir -fi -fi -# bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin -# LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH - - -# ------------------------- -# start_point = 11 : creaTools -#------------------------- -if [ $start_point -le 11 ] -then -# the following stupid test is used at debug time; Please don't remove! -#if [ true = false ] -if [ true = true ] -then -# creaTools - sh installmod.sh $buildType $creatoolssource $generationdir -fi -fi - - -# creatoolsdll=$generationdir/creatools_bin/creatoolsBin -# LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH + sh installmod.sh $buildType $creasource $generationdir + sh installmod.sh $buildType $bbtksource $generationdir + sh installmod.sh $buildType $creamaracassource $generationdir + sh installmod.sh $buildType $creaenvironmentsource $generationdir + sh installmod.sh $buildType $creabrukersource $generationdir + sh installmod.sh $buildType $creaimagesource $generationdir + sh installmod.sh $buildType $creacontourssource $generationdir + sh installmod.sh $buildType $crearigidregistrationssource $generationdir + sh installmod.sh $buildType $bbtkgeditorsource $generationdir + sh installmod.sh $buildType $creatoolssource $generationdir CREATOOLS_INSTALL_DIR=$installPrefix @@ -272,7 +49,3 @@ sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???) echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc - - -# shutdown /s -# exit /b diff --git a/Install/scripts/make.sh b/Install/scripts/make.sh index 6755d45..95e0b60 100644 --- a/Install/scripts/make.sh +++ b/Install/scripts/make.sh @@ -1,81 +1,36 @@ #!/bin/sh -if [ $# = 0 ] -then -echo "Use it as :" -echo "sh make-install.sh " -echo "with 'installPrefix' : /usr/local or /creatools_install" -echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" -echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" -exit 0 -fi +# Set all local variables + + +source $PWD/configure.sh +echo "------" +echo $PWD/configure.sh +echo generationdir +echo $generationdir +echo docgeneration +echo $docgeneration +echo installPrefix +echo $installPrefix +echo buildType +echo $buildType +echo gdcmVersion +echo $gdcmVersion +echo sourcesFrom +echo $sourcesFrom +echo scriptDir +echo $scriptDir +echo start_point +echo $start_point +echo "------" -echo $# -echo "----------" -echo $0 -echo $1 -echo $2 -echo $3 -echo $4 -echo $5 -echo $6 -echo $7 -echo "----------" - -if [ $# != 7 ] -then -echo "Use it as :" -echo "sh make-install.sh " -echo "with 'installPrefix' : /usr/local or /creatools_install" -echo "with 'GDCM Version' : GDCM1 / GDCM2" -echo "with 'creaTools sources' : where do you want to get them from ? CVS / HTML" -echo " " -echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML" -exit 0 -fi -# @echo off - -#allow user to choose the generation dir -#allow user to choose to generate the doc or not -#allow user to choose where he wants to get the sources from : CVS / HTML - -generationdir=$1 -docgeneration=$2 -cvsUserName=$3 -installPrefix=$4 -buildType=$5 -gdcmVersion=$6 -sourcesFrom=$7 - -scriptDir=$PWD - - creasource=crea - bbtksource=bbtk - creamaracassource=creaMaracasVisu - creaenvironmentsource=creaEnvironment - creabrukersource=creaBruker - creaimagesource=creaImageIO - creacontourssource=creaContours - crearigidregistrationssource=creaRigidRegistration - bbtkgeditorsource=bbtkGEditor - creatoolssource=creaTools - mkdir $generationdir mkdir $generationdir/creatools_source mkdir $generationdir/creatools_bin cd $generationdir -# start_point : used at debug time : start point of the script -# ex : if everything is OK, but bbtkGEditor, -# cvs upate bbtkGEditor manually,and use : -# start_point=10 -# in order not to cvs co everything, nor recompile everything. - -start_point=0 # -------------------------------- # start_point = 0 : remove everything that was created before @@ -121,16 +76,18 @@ then if [ $sourcesFrom = HTML ] then cd $generationdir/creatools_source - - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/crea.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/bbtk.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaMaracasVisu.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaEnvironment.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaBruker.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaImageIO.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaContours.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaRigidRegistration.tgz - wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/bbtkGEditor.tgz + wwwtargz=http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/ + + wget $wwwtargz/crea.tgz + wget $wwwtargz/bbtk.tgz + wget $wwwtargz/creaMaracasVisu.tgz + wget $wwwtargz/creaEnvironment.tgz + wget $wwwtargz/creaBruker.tgz + wget $wwwtargz/creaImageIO.tgz + wget $wwwtargz/creaContours.tgz + wget $wwwtargz/creaRigidRegistration.tgz + wget $wwwtargz/bbtkGEditor.tgz + wget $wwwtargz/creaTools.tgz tar xvzf crea.tgz tar xvzf bbtk.tgz @@ -140,7 +97,10 @@ then tar xvzf creaImageIO.tgz tar xvzf creaContours.tgz tar xvzf creaRigidRegistration.tgz - tar xvzf bbtkGEditor.tgz + tar xvzf bbtkGEditor.tgz + tar xvzf creaTools.tgz + + rm -f *.tgz fi fi fi @@ -157,17 +117,16 @@ then #if [ true = false ] if [ true = true ] then - sh cmakemod.sh $creasource $generationdir $installPrefix $buildType - sh creaVariables.sh $creasource $generationdir $docgeneration - sh compilemod.sh $buildType $creasource $generationdir - sh ctestmod.sh $creasource $generationdir + sh $scriptDir/cmakemod.sh $creasource $generationdir $installPrefix $buildType + sh $scriptDir/creaVariables.sh $creasource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $creasource $generationdir + sh $scriptDir/ctestmod.sh $creasource $generationdir fi fi creadll=$generationdir/creatools_bin/creaBin LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH - # ------------------------- # start_point = 3 : BBTK #------------------------- @@ -178,10 +137,10 @@ then if [ true = true ] then # BBTK - sh cmakemod.sh $bbtksource $generationdir $installPrefix $buildType - sh bbtkVariables.sh $bbtksource $generationdir $docgeneration $gdcmVersion - sh compilemod.sh $buildType $bbtksource $generationdir - sh ctestmod.sh $bbtksource $generationdir + sh $scriptDir/cmakemod.sh $bbtksource $generationdir $installPrefix $buildType + sh $scriptDir/bbtkVariables.sh $bbtksource $generationdir $docgeneration $gdcmVersion + sh $scriptDir/compilemod.sh $buildType $bbtksource $generationdir + sh $scriptDir/ctestmod.sh $bbtksource $generationdir fi fi bbtkdll=$generationdir/creatools_bin/bbtkBin @@ -198,10 +157,10 @@ then if [ true = true ] then # creaMaracasVisu - sh cmakemod.sh $creamaracassource $generationdir $installPrefix $buildType - sh creaMaracasVariables.sh $creamaracassource $generationdir $docgeneration - sh compilemod.sh $buildType $creamaracassource $generationdir - sh ctestmod.sh $creamaracassource $generationdir + sh $scriptDir/cmakemod.sh $creamaracassource $generationdir $installPrefix $buildType + sh $scriptDir/creaMaracasVariables.sh $creamaracassource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir + sh $scriptDir/ctestmod.sh $creamaracassource $generationdir fi fi creamaracasdll=$generationdir/creatools_bin/creamaracasBin @@ -218,10 +177,10 @@ then if [ true = true ] then # creaEnvironment - sh cmakemod.sh $creaenvironmentsource $generationdir $installPrefix $buildType - sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration - sh compilemod.sh $buildType $creaenvironmentsource $generationdir - sh ctestmod.sh $creaenvironmentsource $generationdir + sh $scriptDir/cmakemod.sh $creaenvironmentsource $generationdir $installPrefix $buildType + sh $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $creaenvironmentsource $generationdir + sh $scriptDir/ctestmod.sh $creaenvironmentsource $generationdir fi fi creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin @@ -238,10 +197,10 @@ then if [ true = true ] then # creaBruker - sh cmakemod.sh $creabrukersource $generationdir $installPrefix $buildType - sh creaBrukerVariables.sh $creabrukersource $generationdir $docgeneration $gdcmVersion - sh compilemod.sh $buildType $creabrukersource $generationdir - sh ctestmod.sh $creabrukersource $generationdir + sh $scriptDir/cmakemod.sh $creabrukersource $generationdir $installPrefix $buildType + sh $scriptDir/creaBrukerVariables.sh $creabrukersource $generationdir $docgeneration $gdcmVersion + sh $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir + sh $scriptDir/ctestmod.sh $creabrukersource $generationdir fi fi creabrukerdll=$generationdir/creatools_bin/creabrukerBin @@ -258,10 +217,10 @@ then if [ true = true ] then # creaImageIO - sh cmakemod.sh $creaimagesource $generationdir $installPrefix $buildType - sh creaImageIOVariables.sh $creaimagesource $generationdir $docgeneration $gdcmVersion - sh compilemod.sh $buildType $creaimagesource $generationdir - sh ctestmod.sh $creaimagesource $generationdir + sh $scriptDir/cmakemod.sh $creaimagesource $generationdir $installPrefix $buildType + sh $scriptDir/creaImageIOVariables.sh $creaimagesource $generationdir $docgeneration $gdcmVersion + sh $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir + sh $scriptDir/ctestmod.sh $creaimagesource $generationdir fi fi creaimagedll=$generationdir/creatools_bin/creaimageBin @@ -278,10 +237,10 @@ then if [ true = true ] then # creaContours - sh cmakemod.sh $creacontourssource $generationdir $installPrefix $buildType - sh creaContoursVariables.sh $creacontourssource $generationdir $docgeneration - sh compilemod.sh $buildType $creacontourssource $generationdir - sh ctestmod.sh $creacontourssource $generationdir + sh $scriptDir/cmakemod.sh $creacontourssource $generationdir $installPrefix $buildType + sh $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir + sh $scriptDir/ctestmod.sh $creacontourssource $generationdir fi fi # creacontourdll=$generationdir/creatools_bin/creacontoursBin @@ -297,10 +256,10 @@ then #if [ true = false ] if [ true = true ] then - sh cmakemod.sh $crearigidregistrationssource $generationdir $installPrefix $buildType - sh creaRigidRegistrationVariables.sh $crearigidregistrationssource $generationdir $docgeneration - sh compilemod.sh $buildType $crearigidregistrationssource $generationdir - sh ctestmod.sh $crearigidregistrationssource $generationdir + sh $scriptDir/cmakemod.sh $crearigidregistrationssource $generationdir $installPrefix $buildType + sh $scriptDir/creaRigidRegistrationVariables.sh $crearigidregistrationssource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $crearigidregistrationssource $generationdir + sh $scriptDir/ctestmod.sh $crearigidregistrationssource $generationdir fi fi # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin @@ -317,10 +276,10 @@ then if [ true = true ] then # bbtkGEditor - sh cmakemod.sh $bbtkgeditorsource $generationdir $installPrefix $buildType - sh bbtkGEditorVariables.sh $bbtkgeditorsource $generationdir $docgeneration - sh compilemod.sh $buildType $bbtkgeditorsource $generationdir - sh ctestmod.sh $bbtkgeditorsource $generationdir + sh $scriptDir/cmakemod.sh $bbtkgeditorsource $generationdir $installPrefix $buildType + sh $scriptDir/bbtkGEditorVariables.sh $bbtkgeditorsource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir + sh $scriptDir/ctestmod.sh $bbtkgeditorsource $generationdir fi fi # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin @@ -337,9 +296,9 @@ then if [ true = true ] then # creaTools - sh cmakemod.sh $creatoolssource $generationdir $installPrefix $buildType - sh creaToolsVariables.sh $creatoolssource $generationdir $docgeneration - sh compilemod.sh $buildType $creatoolssource $generationdir + sh $scriptDir/cmakemod.sh $creatoolssource $generationdir $installPrefix $buildType + sh $scriptDir/creaToolsVariables.sh $creatoolssource $generationdir $docgeneration + sh $scriptDir/compilemod.sh $buildType $creatoolssource $generationdir fi fi