Index: gap-4r6p5/cnf/gac.in
===================================================================
--- gap-4r6p5.orig/cnf/gac.in	2013-07-29 00:22:06.841061003 +0200
+++ gap-4r6p5/cnf/gac.in	2013-07-29 00:23:20.786225223 +0200
@@ -55,19 +55,14 @@
 ##  option is appended at the end of the link command after the .o
 ##  files to link.
 ##
-gap_bin=@gapbin@
 
-if [ "X${gap_bin}" = "X$0" ];  then
-    gap_dir="../../";
-    gap_compiler="./gap";
-    gap_binary="./";
-else
-    gap_dir="${gap_bin}/../..";
-    gap_compiler="${gap_bin}/gap";
-    gap_binary="${gap_bin}";
-fi
+gap_dir=/usr/lib/gap
+gap_compiler="/usr/bin/gap -R";
+gap_binary=/usr/lib/gap/bin;
+
 gap_options=""
-gap_include="${gap_dir}/src"
+gap_include=""
+
 stat_identifier="USER";
 
 # These three should be filled in by the standard autoconf procedures 
@@ -120,9 +115,9 @@
 ##
 c_compile () {
     echo ${c_compiler}  $3 -o $1 -I${gap_dir} \
-         -I${gap_bin} -DCONFIG_H -c $2
+         -DCONFIG_H -c $2
     ${c_compiler} $3 -o $1 -I${gap_dir} \
-         -I${gap_bin} -DCONFIG_H -c $2 || exit 1
+         -DCONFIG_H -c $2 || exit 1
 }
 
 
@@ -388,17 +383,17 @@
     objects="${gactmp}/$$compstat.o ${objects}"
 }
 
-make_tmpdir () {
-    basetmp=${TMPDIR:-/tmp}; #honor the TMPDIR environment variable.
-    gactmp="$basetmp/gac$$";
-    mkdir "$gactmp" || exit 1;
-}
-
-#On systems with mktemp(1) this function is better:
-#make_tmpdir ()
-#{
-#    gactmp=`mktemp -d -t "gacXXXXXXX"`;
+#make_tmpdir () {
+#    basetmp=${TMPDIR:-/tmp}; #honor the TMPDIR environment variable.
+#    gactmp="$basetmp/gac$$";
+#    mkdir "$gactmp" || exit 1;
 #}
+#
+#On systems with mktemp(1) this function is better:
+make_tmpdir ()
+{
+    gactmp=`mktemp -d -t "gacXXXXXXX"`;
+}
 
 #############################################################################
 ##
