autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Why is srcdir passed as .


From: Bernard Dautrevaux
Subject: RE: Why is srcdir passed as .
Date: Fri, 27 Oct 2000 10:55:33 +0200

> -----Original Message-----
> From: Ben Woodard [mailto:address@hidden
> Sent: Thursday, October 26, 2000 11:46 PM
> To: Bernard Dautrevaux
> Cc: address@hidden
> Subject: Re: Why is srcdir passed as . 
> 
> 
> > I think there is two problems here:
> > 
> > Ben seems to use $srcdir where it meant $top_srcdir :-) (If we build
> > in-place, then $srcdir == $builddir in all the tree).
> > 
> > Mo on the contrary is bothered by the fact that $srcdir is 
> relative; just
> > calling "./configure -srcdir=/absolute/path/to/srcdir" 
> shoudl solve the
> > problem.
> > 
> 
> I think you are correct there are two problems.
> 
> Regarding "top_srcdir" when I was trying to figure out what which
> variable to use, "top_srcdir" seemed like the one that I wanted to
> use. However, it always seems to be empty.
> 
> The command that I'm using is:
> 
> ac_configure_args="${ac_configure_args} 
> --enable-local-tdb=${srcdir}/tdb"
> 
> To have the lower level configuration scripts called with an 
> extra parameter.
> 
> However:
> 
> If I use "--enable-local-tdb=${top_srcdir}/tdb" then it evaluates to
> "--enable-local-tdb=/tdb"
> 
> If I don't pass any parameters into the top level configure script and
> use "--enable-local-tdb=${srcdir}/tdb" then it evalutes to
> "--enable-local-tdb=./tdb" which seems to be the same problem with
> srcdir being relative that Mo was having.
> 
> The way that I am using "srcdir" now is:
> 
> srcdir=`cd $srcdir;pwd`
> AC_CHECK_LIB(tdb,tdb_exists,[
>   build_tdb=false
>   AC_CHECK_HEADERS(tdb.h,[],[
>     AC_MSG_ERROR(The tdb libraries were found but the header 
> files were missing. Please either install the headers or 
> uninstall the library and the version of tdb that is bundled 
> with gnulpr will be intsalled.)
> ])],[
>   ac_configure_args="${ac_configure_args} 
> --enable-local-tdb=${srcdir}/tdb"
>   subpackages="tdb ${subpackages}"
>   build_tdb=true
>   TDB_DIR="${srcdir}/tdb"
> ])
> AM_CONDITIONAL(BUILD_TDB, $build_tdb)
> AC_SUBST(TDB_DIR)
> 
> > Regards,
> > 
> >     Bernard
> > 
> > PS: IIUC, the special case of "." is just to avoid getting, 
> in some second
> > level subdirectory name lib/somelib, srcdir set to
> > "../lib/../../lib/somelib" which is almost equivalent (but 

    "../../lib/somelib"
Ooops... typing a bit too fast and being a bit too complicating ;-?

> a lot longer) to
> > "." ;-) The "almost" above is for the case where "lib" is 
> in fact a link to
> > "../../commonlibs". In this case "." would be correct while
> > "../lib/../../lib/somelib" would yield a "file not found" 
> error somewhere
> > ;-?
> 
> I'm having trouble following your example. Which "lib" is a link to
> "../../commonlibs". The directory tree as you portrayed it is:
> 
> lib/lib/
> lib/somelib/

no:

/the/top/srcdir contains:
        commonlibs      contains:
                somelib
        package contains:
                lib -> ../commonlibs

Then package has a sub-directory named lib/somelib, which srcdir is "." as
I'm configuring in the src tree; if there was no "." special case, then
configure will set srcdir (that is lib_srcdir_from_lib_builddir) to "../lib"
in lib; using this it will set srcdir in somelib (that is
lib_somelib_srcdir_from_lib_somelib_builddir) as
"../$lib_srcdir_from_lib_builddir/somelib" that is "../../lib/somelib"; the
problem is that in fact we are in /the/top/srcdir/commonlibs/somelib, not in
/the/top/srcdir/package/lib/somelib, so the ../.. bring us in
/the/top/srcdir, where there is *no* "lib" subdirectory 8-<

If on the contrary builddir != srcdir, then there is no problems as lib will
always be a proper subdirectory of package (it is *created* by configure)
:-) (of course here somelib will be re-compiled for all using packages where
if builddir = srcdir it will not).

Regards,

        Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:    +33 (0) 1 47 68 80 80
Fax:    +33 (0) 1 47 88 97 85
e-mail: address@hidden
                address@hidden
-------------------------------------------- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]