[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make distcheck creates directory that I don't have write permissions
From: |
Ralf Wildenhues |
Subject: |
Re: make distcheck creates directory that I don't have write permissions for - is this expected? |
Date: |
Sun, 6 Nov 2005 08:02:59 +0100 |
User-agent: |
Mutt/1.5.9i |
Hi Ed,
* Ed Hartnett wrote on Sat, Nov 05, 2005 at 07:52:01PM CET:
>
> My current problem is that I have some reference netCDF files, which
> ship with the distribution. I also have a test program, which produces
> data files that need to be identical to the reference files shipped
> with the dist.
>
> But the problem is the reference files are in the source directory,
> and the test files are in the build directory.
>
> At the moment, I am doing this with a one-line shell script, which
> does something like this:
>
> cmp nctest_classic.nc ref_nctest_classic.nc
>
> What I need to do, apparently, is somehow construct this shell script
> from the Makefile, using $(srcdir) somehow.
This would be one possibility. You could have a shell_script.in with
srcdir="@srcdir@"
cmp "$srcdir/ref_nctest_classic.nc" nctest_classic.nc
and list shell_script in configure.ac as
AC_CONFIG_FILES([shell_script], [chmod a+x shell_script])
But this is probably even overkill. You could just export a shell
variable containing srcdir from Makefile to the script -- no need to
construct that at all, then: If, for example, you use the Automake test
feature, as in
TESTS = shell_script ...
check_SCRIPTS = ...
check_PROGRAMS = ...
then you could just add
TESTS_ENVIRONMENT = srcdir="$(srcdir)" ...
and use "$srcdir" within the script. Or, if you have many scripts that
share some initialization, you could just substitute this initialization
part and source that from all shell scripts (by `. ./defs', for example).
> Or is there a way to use some make target for this? Any suggestions or
> web examples would be helpful. I'm going to take another look at the
> info files and around the web. There must be a better way to run this
> cmp test without a whole extra shell script!
Yep. Examples for test suites are contained in (sorry for the shameless
plugs):
Automake test suite: Automake, Libtool-1.5.x
Autotest test suite: Autoconf, Libtool-CVS
DejaGNU test suite: GCC
Cheers,
Ralf