Re: getgroups.c failes to compile

2019-05-27 Thread Bruno Haible
Mohammad Akhlaghi wrote: > if a program doesn't use anything from a library, > what are the downsides (performance maybe?) to link it with that library > anyway? Startup time of the program is increased. See [1], chapter 1, for the general theory. By how much is it increased? You have to measur

Re: getgroups.c failes to compile

2019-05-26 Thread Mohammad Akhlaghi
On 5/26/19 12:52 AM, Bruno Haible wrote: Additionally: Automake offers you a different *_LDFLAGS variable for every program. [1][2] This way, you can link some of your programs against a specific library, without forcing you to link _all_ the programs against it. It would be good to link each pr

Re: getgroups.c failes to compile

2019-05-25 Thread Bruno Haible
Mohammad Akhlaghi wrote: > > How can I get the `-L' part of `LTLIB' into LDFLAGS? > > The problem is fixed now. As suggested in the documentation, I just > appended the necessary `LIB' entries to `LDADD' and included > `LDADD' to the `program_LDADD' (of `Makefile.am'). Additionally: Automake of

Re: getgroups.c failes to compile

2019-05-23 Thread Mohammad Akhlaghi
On 5/19/19 10:15 PM, Mohammad Akhlaghi wrote: How can I get the `-L' part of `LTLIB' into LDFLAGS? The problem is fixed now. As suggested in the documentation, I just appended the necessary `LIB' entries to `LDADD' and included `LDADD' to the `program_LDADD' (of `Makefile.am'). It now works

Re: getgroups.c failes to compile

2019-05-19 Thread Mohammad Akhlaghi
On 5/19/19 12:14 AM, Bruno Haible wrote: Here's the relevant documentation: https://www.gnu.org/software/gnulib/manual/html_node/Searching-for-Libraries.html#Locating-Libraries Thanks, I am busy testing `AC_LIB_LINKFLAGS' now. The fact that it modifies CPPFLAGS and adds `rpath' when necessary

Re: getgroups.c failes to compile

2019-05-18 Thread Bruno Haible
Mohammad Akhlaghi wrote: > > It is be possible to search libraries using AC_RUN_IFELSE instead of > > AC_LINK_IFELSE, and add -rpath options as needed. The AC_LIB_LINKFLAGS > > macro from gnulib does this. It appears that you used the stock Autoconf > > macro, which does not do this. > > You are r

Re: getgroups.c failes to compile

2019-05-18 Thread Mohammad Akhlaghi
On 5/18/19 1:58 AM, Bruno Haible wrote: It is be possible to search libraries using AC_RUN_IFELSE instead of AC_LINK_IFELSE, and add -rpath options as needed. The AC_LIB_LINKFLAGS macro from gnulib does this. It appears that you used the stock Autoconf macro, which does not do this. You are rig

Re: getgroups.c failes to compile

2019-05-17 Thread Bruno Haible
Mohammad Akhlaghi wrote: > To avoid similar situations in the future, it may be good to add a check > in the `configure' script so if `getgroups' fails, but the system is a > GNU system, the configure script crashes with a warning (after all > `make' will crash, but a crash in `configure' is mor

Re: getgroups.c failes to compile

2019-05-17 Thread Mohammad Akhlaghi
Hi Bruno, Thank you very much for the great explanation and solution. The elaborations really made things clear and were very useful. We applied the second one (setting `rpath'), and the problem was solved. To avoid similar situations in the future, it may be good to add a check in the `conf

Re: getgroups.c failes to compile

2019-05-13 Thread Bruno Haible
Hi, Mohammad Akhlaghi wrote: > Recently in a build of Gnuastro 0.9 (which uses Gnulib > `v0.1-2539-gd6af24178'), we confronted a crash during the build of > Gnulib's `getgroups.c' (error summary is in P.S.). A log of the command "make" would be more useful than a log of the command "make -j8",