diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index efc134f5..da9c61c0 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -18,10 +18,12 @@ # You should have received a copy of the GNU General Public License # along with GNU Mes. If not, see . -srcdir="@srcdir@" abs_top_srcdir="@abs_top_srcdir@" +export abs_top_srcdir abs_top_builddir="@abs_top_builddir@" +export abs_top_builddir prefix=${prefix-@prefix@} +export prefix program_prefix=${program_prefix-@program_prefix@} MES_PREFIX=${MES_PREFIX-${abs_top_srcdir}/mes} diff --git a/lib/tests/posix/50-open-read.c b/lib/tests/posix/50-open-read.c index 2b955b09..7e7ff0b8 100644 --- a/lib/tests/posix/50-open-read.c +++ b/lib/tests/posix/50-open-read.c @@ -30,9 +30,12 @@ main (int argc, char const *argv[]) { eputs ("test:getenv\n"); char file_name[PATH_MAX]; - char *srcdir = getenv ("srcdir"); - if (!srcdir) - return 1; + char *srcdir = getenv ("abs_top_srcdir"); + if (! srcdir) // for running by hand + srcdir = "."; + eputs ("srcdir="); + eputs (srcdir); + eputs ("\n"); strcpy (file_name, srcdir); strcpy (file_name + strlen (srcdir), "/lib/tests/posix/data/open-read"); eputs ("test open:"); @@ -40,13 +43,13 @@ main (int argc, char const *argv[]) eputs ("\n"); int filedes = open (file_name, 0, 0); if (filedes <= 2) - return 2; + return 1; char buf[20]; int n = read (filedes, buf, sizeof (buf)); if (n != 5) - return 3; + return 2; if (strcmp (buf, "hello")) - return 4; + return 3; eputs ("test read: "); eputs (buf); eputs ("\n");