~ chicken-core (master) 55bb0762b39bd935d1d4e0eb29b65486cff51145
commit 55bb0762b39bd935d1d4e0eb29b65486cff51145
Author: felix <bunny351@gmail.com>
AuthorDate: Tue May 25 13:44:44 2010 +0200
Commit: felix <bunny351@gmail.com>
CommitDate: Tue May 25 13:44:44 2010 +0200
private-repo works for solaris (thanks to Semih Cemiloglu)
diff --git a/chicken.h b/chicken.h
index 4d656981..bb7c8d94 100644
--- a/chicken.h
+++ b/chicken.h
@@ -2226,13 +2226,17 @@ C_path_to_executable(C_char *fname)
if(buffer == NULL) return NULL;
-# ifdef __linux__
+# if defined(__linux__) || defined(__sun)
C_char linkname[64]; /* /proc/<pid>/exe */
pid_t pid;
int ret;
pid = C_getpid();
+# ifdef __linux__
C_sprintf(linkname, "/proc/%i/exe", pid);
+# else
+ C_sprintf(linkname, "/proc/%i/path/a.out", pid); /* SunOS / Solaris */
+# endif
ret = C_readlink(linkname, buffer, C_MAX_PATH - 1);
if(ret == -1 || ret >= C_MAX_PATH - 1)
diff --git a/tests/runtests.sh b/tests/runtests.sh
index 69bd0559..d28da238 100644
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -36,15 +36,8 @@ if test -n "$MSYSTEM"; then
cp ../libchicken.dll .
fi
-CSC_COMP_FLAGS=""
-if [ "$OS_NAME" = "SunOS" ]; then
- if [ "$C_COMPILER" = "cc" ]; then
- CSC_COMP_FLAGS="-cc cc -ld cc"
- fi
-fi
-
-compile="../csc $CSC_COMP_FLAGS -compiler $CHICKEN -v -I.. -L.. -include-path .. -o a.out"
-compile_s="../csc $CSC_COMP_FLAGS -s -compiler $CHICKEN -v -I.. -L.. -include-path .."
+compile="../csc -compiler $CHICKEN -v -I.. -L.. -include-path .. -o a.out"
+compile_s="../csc -s -compiler $CHICKEN -v -I.. -L.. -include-path .."
interpret="../csi -n -include-path .."
echo "======================================== compiler tests ..."
@@ -241,23 +234,15 @@ $compile -e embedded2.scm
./a.out
echo "======================================== private repository test ..."
-# Skip this test on Solaris/Sun CC
-if [ "$OS_NAME" != "SunOS" -o "$C_COMPILER" != "cc" ]; then
mkdir -p tmp
$compile private-repository-test.scm -private-repository -o tmp/xxx
tmp/xxx $PWD/tmp
PATH=$PWD/tmp:$PATH xxx $PWD/tmp
# this may crash, if the PATH contains a non-matching libchicken.dll on Windows:
#PATH=$PATH:$PWD/tmp xxx $PWD/tmp
-fi
echo "======================================== timing compilation ..."
-if [ "$OS_NAME" = "SunOS" -o "$C_COMPILER" = "cc" ]; then
- COMP_FLAGS=""
-else
- COMP_FLAGS="-C -Wa,-W"
-fi
-time $compile compiler.scm -O5 -debug pb -v $COMP_FLAGS
+time $compile compiler.scm -O5 -debug pb -v
echo "executing ..."
time ./a.out
Trap