aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xBuildIt.sh4
-rw-r--r--src/sledjchisl/sledjchisl.c87
2 files changed, 48 insertions, 43 deletions
diff --git a/BuildIt.sh b/BuildIt.sh
index 7f4f308..ea2b418 100755
--- a/BuildIt.sh
+++ b/BuildIt.sh
@@ -3,6 +3,4 @@
3pushd src >/dev/null 3pushd src >/dev/null
4time ./BuildIt.sh 4time ./BuildIt.sh
5popd >/dev/null 5popd >/dev/null
6sudo chown -R opensimsc:opensimsc * 6time bin/sledjchisl build -v
7sudo chown -R opensimsc:opensimsc .??*
8bin/sledjchisl build -v
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 3d1e645..673b576 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -1307,14 +1307,23 @@ static void buildOpensim()
1307{ 1307{
1308 char *t = xmprintf("%s/current_NEW", scRoot); 1308 char *t = xmprintf("%s/current_NEW", scRoot);
1309 1309
1310 I("Building opensim-SC in %s", t); 1310 if (BUILD == currentMode)
1311 copyOpenSim(t); 1311 {
1312 free(t);
1313 t = xmprintf(".");
1314 I("Building opensim-SC in current directory.");
1315 }
1316 else
1317 {
1318 copyOpenSim(t);
1319 I("Building opensim-SC in %s", t);
1312 1320
1313 if (shellMeFail("chmod -R a+x %s/*.sh", t)) C("Can't set proper permissions for %s/*.sh", t); 1321 if (shellMeFail("chmod -R a+x %s/*.sh", t)) C("Can't set proper permissions for %s/*.sh", t);
1314 if (shellMeFail("chmod -R a+x %s/scripts/*.sh", t)) C("Can't set proper permissions for %s/scripts/*.sh", t); 1322 if (shellMeFail("chmod -R a+x %s/scripts/*.sh", t)) C("Can't set proper permissions for %s/scripts/*.sh", t);
1315 if (shellMeFail("chmod -R a+x %s/scripts/install/*.sh", t)) C("Can't set proper permissions for %s/scripts/install/*.sh", t); 1323 if (shellMeFail("chmod -R a+x %s/scripts/install/*.sh", t)) C("Can't set proper permissions for %s/scripts/install/*.sh", t);
1316 if (shellMeFail("chmod a+x %s/scripts/show-console", t)) C("Can't set proper permissions for %s/scripts/show-console", t); 1324 if (shellMeFail("chmod a+x %s/scripts/show-console", t)) C("Can't set proper permissions for %s/scripts/show-console", t);
1317 if (shellMeFail("chmod a+x %s/scripts/start-sim", t)) C("Can't set proper permissions for %s/scripts/start-sim", t); 1325 if (shellMeFail("chmod a+x %s/scripts/start-sim", t)) C("Can't set proper permissions for %s/scripts/start-sim", t);
1326 }
1318 1327
1319/* 1328/*
1320# Poor mans git sub modules / subtrees, coz otherwise it gets complex. 1329# Poor mans git sub modules / subtrees, coz otherwise it gets complex.
@@ -1362,20 +1371,25 @@ fi
1362 if (shellMeFail("cd %s; msbuild /p:Configuration=Debug /verbosity:minimal", t)) C("Failed to msbuild!"); 1371 if (shellMeFail("cd %s; msbuild /p:Configuration=Debug /verbosity:minimal", t)) C("Failed to msbuild!");
1363// if (shellMeFail("cd %s; msbuild /p:Configuration=Release /verbosity:minimal", t)) C("Failed to msbuild!"); 1372// if (shellMeFail("cd %s; msbuild /p:Configuration=Release /verbosity:minimal", t)) C("Failed to msbuild!");
1364// #cp -f addon-modules/Gloebit/GloebitMoneyModule/bin/Gloebit.dll bin 1373// #cp -f addon-modules/Gloebit/GloebitMoneyModule/bin/Gloebit.dll bin
1365 if (shellMeFail("cd %s/src; ./BuildIt.sh", t)) C("Failed to compile sledjchisl!"); 1374
1366 free(t); 1375 if (BUILD != currentMode)
1367 t = xmprintf("%s/current", scRoot);
1368 if (readlink0(t, toybuf, sizeof(toybuf)))
1369 { 1376 {
1370 I("Making a backup of %s", toybuf); 1377 if (shellMeFail("cd %s/src; ./BuildIt.sh", t)) C("Failed to compile sledjchisl!");
1371 if (shellMeFail("rm -fr %s_BACKUP", toybuf)) W("Failed to remove old backup."); 1378 free(t);
1372 if (shellMeFail("mv %s %s_BACKUP", toybuf, toybuf)) C("Failed to create backup!"); 1379 t = xmprintf("%s/current", scRoot);
1380 if (readlink0(t, toybuf, sizeof(toybuf)))
1381 {
1382 I("Making a backup of %s", toybuf);
1383 if (shellMeFail("rm -fr %s_BACKUP", toybuf)) W("Failed to remove old backup.");
1384 if (shellMeFail("mv %s %s_BACKUP", toybuf, toybuf)) C("Failed to create backup!");
1385 }
1386 free(t);
1387 snprintf(toybuf, sizeof(toybuf), "%s/current", scRoot);
1388 t = xmprintf("%s/current_NEW", scRoot);
1389 if (shellMeFail("rm -fr %s", toybuf)) C("Failed to remove old symlink.");
1390 if (0 != symlink(t, toybuf)) perror_msg("Symlinking %s to %s", t, toybuf);
1373 } 1391 }
1374 free(t); 1392
1375 snprintf(toybuf, sizeof(toybuf), "%s/current", scRoot);
1376 t = xmprintf("%s/current_NEW", scRoot);
1377 if (shellMeFail("rm -fr %s", toybuf)) C("Failed to remove old symlink.");
1378 if (0 != symlink(t, toybuf)) perror_msg("Symlinking %s to %s", t, toybuf);
1379 I("Done building opensim-SC in %s", t); 1393 I("Done building opensim-SC in %s", t);
1380 free(t); 1394 free(t);
1381} 1395}
@@ -8656,6 +8670,15 @@ jit library is loaded or the JIT compiler will not be activated.
8656*/ 8670*/
8657 luaL_openlibs(L); // Load Lua libraries. 8671 luaL_openlibs(L); // Load Lua libraries.
8658 8672
8673////////////////////////////////////////////////////////////////////////////////////////////////////
8674// Build all of opensim-SC
8675////////////////////////////////////////////////////////////////////////////////////////////////////
8676 if (BUILD == currentMode)
8677 {
8678 buildOpensim();
8679 goto finished;
8680 }
8681
8659/* Load the config scripts. 8682/* Load the config scripts.
8660Normally we start in /opt/opensim_SC 8683Normally we start in /opt/opensim_SC
8661 current/bin/sledjchisl here is a symlink to ../src/build/toybox/toybox or ../src/build/toybox/generated/unstripped/toybox 8684 current/bin/sledjchisl here is a symlink to ../src/build/toybox/toybox or ../src/build/toybox/generated/unstripped/toybox
@@ -8884,17 +8907,11 @@ Copy correct config/config.ini to there.
8884 // After the session is created, we rely on the scRun directory to be group sticky, so that anyone in the opensim group can attach to the tmux socket. 8907 // After the session is created, we rely on the scRun directory to be group sticky, so that anyone in the opensim group can attach to the tmux socket.
8885 pre = xmprintf("sudo -Hu %s ", scUser); 8908 pre = xmprintf("sudo -Hu %s ", scUser);
8886 } 8909 }
8887 if (BUILD == currentMode) 8910 if (BUILD == currentMode) // Shouldn't happen, we deal with this above.
8888 snprintf(toybuf, sizeof(toybuf), 8911 {
8889 "%s %s %s/%s set-option -g default-command 'export PATH=%s:$PATH; bash'\\; " 8912 free(pre);
8890 // Set x,y to huge values, to work around an OpenSim bug. 8913 goto finished;
8891 "new-session -d -x 256 -y 420 -s %s -n '%s' bash -c 'export PATH=%s:$PATH; printf \"\\033]0;SledjChisl\\007\"; " 8914 }
8892 "/usr/bin/valgrind --leak-check=full %s/current/bin/sledjchisl %s %s; cd %s; bash' \\; "
8893 ,
8894 pre, Tcmd, scRun, Tsocket, scBin,
8895 Tconsole, Ttab, scBin,
8896 scRoot, modeStrings[currentMode], FLAG(v) ? "-v" : "", scRoot
8897 );
8898 else 8915 else
8899 snprintf(toybuf, sizeof(toybuf), 8916 snprintf(toybuf, sizeof(toybuf),
8900 "%s %s %s/%s set-option -g default-command 'export PATH=%s:$PATH; bash'\\; " 8917 "%s %s %s/%s set-option -g default-command 'export PATH=%s:$PATH; bash'\\; "
@@ -9048,16 +9065,6 @@ Copy correct config/config.ini to there.
9048 perror_msg("Symlinking %s to %s", newPath, tmp); 9065 perror_msg("Symlinking %s to %s", newPath, tmp);
9049 free(tmp); 9066 free(tmp);
9050 free(newPath); 9067 free(newPath);
9051
9052
9053////////////////////////////////////////////////////////////////////////////////////////////////////
9054// Build all of opensim-SC
9055////////////////////////////////////////////////////////////////////////////////////////////////////
9056 if (BUILD == currentMode)
9057 {
9058 buildOpensim();
9059 goto finished;
9060 }
9061 } 9068 }
9062 9069
9063 9070