[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gtags.conf.in ignores custom --libdir if set
From: |
Kevin Farshaw |
Subject: |
Re: gtags.conf.in ignores custom --libdir if set |
Date: |
Mon, 12 Oct 2015 19:57:43 +0200 |
Sent: Monday, October 12, 2015
From: "Shigio YAMAGUCHI"
> > Why not use the same approach used for "$prefix" in
> > configure.ac[http://configure.ac]?
> >
> > case "$prefix" in
> > NONE) prefix_QUOTED=`echo $ac_default_prefix | sed 's/:/\\\\:/g'`;;
> > *) prefix_QUOTED=`echo $prefix | sed 's/:/\\\\:/g'`;;
> > esac
> >
> > If libdir is set, use it, if not, use a defualt value.
>
> Would you please send a patch? If it works well, I'd like to take it.
Gladly, patch enclosed.
I have tested this on Fedora 22. The behavior is as follows :
configure
=> libdir_QUOTED = /usr/lib ($prefix_QUOTED/lib)
configure --prefix=/foo
=> libdir_QUOTED = /foo/lib ($prefix_QUOTED/lib)
configure --exec_prefix=/bar
=> libdir_QUOTED = /bar/lib ($exec_prefix/lib)
configure --prefix=/foo --exec_prefix=/bar
=> libdir_QUOTED = /bar/lib ($exec_prefix/lib)
configure --prefix=/foo --exec_prefix=/bar --libdir=/foo/lib64
=> libdir_QUOTED = /foo/lib64 ($libdir)
> > IIUC, the files referenced by gtags.conf end up as arguments to a dlopen()
> > call.
> > Why not name the .so files directly, or their platform-specific equivalent
> > depending on the compilation target?
>
> Because I don't want to make gtags.conf for each OS. '.so' is not a common
> extension. But now rereading the libtools manual, I have found lt_dlopenext()
> function. Using this, we can load library without extension.
>
> [derived from libtool manual]
> -----------------------------
> @deftypefun lt_dlhandle lt_dlopenext (const char address@hidden)
> The same as @code{lt_dlopen}, except that it tries to append
> different file name extensions to the file name.
> If the file with the file name @var{filename} cannot be found
> libltdl tries to append the following extensions:
>
> @enumerate 1
> @item the libtool archive extension @file{.la}
> @item the extension used for native dynamically loadable modules on the host
> platform, e.g., @file{.so}, @file{.> sl}, etc.
> @end enumerate
> -----------------------------
>
> I will rewrite dynamic loading code using this. It will be like follows:
>
> if (lt_dlopen('foo.la[http://foo.la]') == FAILED)
> if (lt_dlopenext('foo') == FAILED)
> error_and_exit();
>
> This code should work without '.la' files.
>
So if I understand correctly, gtags.conf.in will need to be revised to omit
the file extension altogether? yes, I think that will work perfectly.
> Thank you for giving me a chance of re-investigation.
>
> Regards,
> Shigio
Thank you for being so quick and responsive.
Regards,
Kevin
0001-Provide-sane-libdir_QUOTED-to-gtag.conf.in-and-use-i.patch
Description: Text Data