Re: Patch for pkg-config file

2019-08-22 Thread Hugh McMaster
On Thu, 22 Aug 2019 at 04:02, Niels Möller wrote:
> Applied now. Thanks!

Great news! Thank you, Niels and Marc.

Hugh
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-21 Thread Niels Möller
Hugh McMaster  writes:

> On Thu, 8 Aug 2019 at 21:13, Niels Möller wrote:
>> Hugh McMaster writes:
>> >  EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
>> > -  COPYING.LESSERv3 COPYINGv2 COPYINGv3
>> > +  COPYING.LESSERv3 COPYINGv2 COPYINGv3 \
>> > +  gmp.pc
>>
>> I think this should be gmp.pc.in, not gmp.pc.
>
> Yes, you're right. However, I've now removed that line, since template
> files are automatically included when running `make dist`.
>
> Updated patches attached.

Applied now. Thanks!

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-21 Thread Hugh McMaster
Are you happy to commit the pkg-config patches?

Thank you
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-21 Thread Hugh McMaster
On Fri, 16 Aug 2019 at 5:34 am, Niels Möller wrote:

> Marc Glisse writes:
>
> >> For gmpxx, perhaps -lgmp should be added as well, either
> >>
> >>  Libs: -L${libdir} -lgmpxx -lgmp
> >>
> >> or
> >>
> >>  Libs: -L${libdir} -lgmpxx
> >>  Libs.private: -lgmp
> >>
> >> ?
> >
> > I assume that "Requires: gmp" already handles that.
>
> Ah, so it references the gmp.pc file rather than the library directly
> (unlike the libm that was in an earlier version of the patch). Makes
> sense.


Correct. The output for `pkg-config --libs gmpxx’ is:  -lgmpxx -lgmp

‘Requires: gmp’ forces pkg-config to call gmp.pc, so if it isn’t found the
build fails.

You can do it by direct inclusion of the library, but won’t know if it’s
installed or not. I thought it best to Require since gmp is a public
dependency of gmpxx.

In answer to your question about installation directory for pkg-config, the
path is correct (i.e. /pkgconfig).

Thank you both for your review.

Hugh
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-15 Thread Niels Möller
Marc Glisse  writes:

>> For gmpxx, perhaps -lgmp should be added as well, either
>>
>>  Libs: -L${libdir} -lgmpxx -lgmp
>>
>> or
>>
>>  Libs: -L${libdir} -lgmpxx
>>  Libs.private: -lgmp
>>
>> ?
>
> I assume that "Requires: gmp" already handles that.

Ah, so it references the gmp.pc file rather than the library directly
(unlike the libm that was in an earlier version of the patch). Makes
sense.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-15 Thread Marc Glisse

On Thu, 15 Aug 2019, Niels Möller wrote:


Hugh McMaster  writes:


Generate and install a pkg-config file for the gmp library


This patch looks good to me. I take it you have tested that make install
does install a working gmp.pc in the right place? I'm not very familiar
with what automake does.


Generate and install a pkg-config file for the gmpxx library

[...]

diff -r 93c8fcc2cab4 -r 4b0e794dd777 gmpxx.pc.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/gmpxx.pc.in   Thu Aug 08 23:48:03 2019 +1000
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: @PACKAGE_NAME@ C++
+Description: GNU Multiple Precision Arithmetic Library (C++ bindings)
+URL: https://gmplib.org
+Version: @PACKAGE_VERSION@
+Requires: gmp
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgmpxx


For gmpxx, perhaps -lgmp should be added as well, either

 Libs: -L${libdir} -lgmpxx -lgmp

or

 Libs: -L${libdir} -lgmpxx
 Libs.private: -lgmp

?


I assume that "Requires: gmp" already handles that.

--
Marc Glisse
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-15 Thread Niels Möller
Hugh McMaster  writes:

> Generate and install a pkg-config file for the gmp library

This patch looks good to me. I take it you have tested that make install
does install a working gmp.pc in the right place? I'm not very familiar
with what automake does.

> Generate and install a pkg-config file for the gmpxx library
[...]
> diff -r 93c8fcc2cab4 -r 4b0e794dd777 gmpxx.pc.in
> --- /dev/null Thu Jan 01 00:00:00 1970 +
> +++ b/gmpxx.pc.in Thu Aug 08 23:48:03 2019 +1000
> @@ -0,0 +1,12 @@
> +prefix=@prefix@
> +exec_prefix=@exec_prefix@
> +includedir=@includedir@
> +libdir=@libdir@
> +
> +Name: @PACKAGE_NAME@ C++
> +Description: GNU Multiple Precision Arithmetic Library (C++ bindings)
> +URL: https://gmplib.org
> +Version: @PACKAGE_VERSION@
> +Requires: gmp
> +Cflags: -I${includedir}
> +Libs: -L${libdir} -lgmpxx

For gmpxx, perhaps -lgmp should be added as well, either

  Libs: -L${libdir} -lgmpxx -lgmp

or

  Libs: -L${libdir} -lgmpxx
  Libs.private: -lgmp

?

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-12 Thread Hugh McMaster
On Thu, 8 Aug 2019 at 11:57 pm, Hugh McMaster wrote:

> Hello Niels,
>
> On Thu, 8 Aug 2019 at 21:13, Niels Möller wrote:
> > Hugh McMaster writes:
> > >  EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
> > > -  COPYING.LESSERv3 COPYINGv2 COPYINGv3
> > > +  COPYING.LESSERv3 COPYINGv2 COPYINGv3 \
> > > +  gmp.pc
> >
> > I think this should be gmp.pc.in, not gmp.pc.
>
> Yes, you're right. However, I've now removed that line, since template
> files are automatically included when running `make dist`.
>
> Updated patches attached.


Could you please review these patches again?

Thank you
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-12 Thread Hugh McMaster
Hello Niels,

On Thu, 8 Aug 2019 at 21:13, Niels Möller wrote:
> Hugh McMaster writes:
> >  EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
> > -  COPYING.LESSERv3 COPYINGv2 COPYINGv3
> > +  COPYING.LESSERv3 COPYINGv2 COPYINGv3 \
> > +  gmp.pc
>
> I think this should be gmp.pc.in, not gmp.pc.

Yes, you're right. However, I've now removed that line, since template
files are automatically included when running `make dist`.

Updated patches attached.


0001-gmp-pkg-config.patch
Description: Binary data


0002-gmpxx-pkg-config.patch
Description: Binary data
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-08 Thread Hugh McMaster
On Tue, 6 Aug 2019 at 12:17 am, Hugh McMaster wrote:

> Hi Niels and Marc,
>
> On Mon, 5 Aug 2019 at 19:43, Niels Möller wrote:
> > Anyway, it's not required for linking programs with the gmp library.
>
> I've updated the changeset with the Libs.private line removed.
>
> I've also added a changeset to generate a pkg-config file for gmpxx.
>
> Please see the attached patches.


Hello Niels and Marc,

Have you had a chance to review these patches?

Thank you,

Hugh

>
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-08 Thread Niels Möller
Hugh McMaster  writes:

> diff -r 930d6b8c5dc1 -r caf8ccb06e18 Makefile.am
> --- a/Makefile.am Fri Aug 02 18:02:54 2019 +0200
> +++ b/Makefile.am Sun Aug 04 22:35:15 2019 +1000
> @@ -113,7 +113,11 @@
>  SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
>  
>  EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
> -  COPYING.LESSERv3 COPYINGv2 COPYINGv3
> +  COPYING.LESSERv3 COPYINGv2 COPYINGv3 \
> +  gmp.pc

I think this should be gmp.pc.in, not gmp.pc. 

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-05 Thread Hugh McMaster
Hi Niels and Marc,

On Mon, 5 Aug 2019 at 19:43, Niels Möller wrote:
> Anyway, it's not required for linking programs with the gmp library.

I've updated the changeset with the Libs.private line removed.

I've also added a changeset to generate a pkg-config file for gmpxx.

Please see the attached patches.

--
Hugh McMaster


0001-pkg-config-gmp.patch
Description: Binary data


0002-pkg-config-gmpxx.patch
Description: Binary data
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-05 Thread Niels Möller
Marc Glisse  writes:

> IIRC -lm is used in the build, the tuning, the tests, the demos, but
> not in the library itself.

Ah, I see. I only checked the top-level Makefile.am, which used
LIBM_FOR_BUILD only.

Anyway, it's not required for linking programs with the gmp library.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-04 Thread Marc Glisse

On Mon, 5 Aug 2019, Niels Möller wrote:


Hugh McMaster  writes:


--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/gmp.pc.in Sun Aug 04 22:35:15 2019 +1000


Should there also be a gmpxx.pc ?


@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: @PACKAGE_NAME@
+Description: GNU Multiple Precision Arithmetic Library
+URL: https://gmplib.org
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgmp
+Libs.private: @LIBM@


@LIBM@ shouldn't be needed. I don't know why configure checks for it,
from comments, possibly libtool-related.


IIRC -lm is used in the build, the tuning, the tests, the demos, but not 
in the library itself.


(the use in tests/cxx looks bad, it does -lm instead of using the result 
of autoconf)


--
Marc Glisse
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-04 Thread Niels Möller
Hugh McMaster  writes:

> --- /dev/null Thu Jan 01 00:00:00 1970 +
> +++ b/gmp.pc.in   Sun Aug 04 22:35:15 2019 +1000
> @@ -0,0 +1,12 @@
> +prefix=@prefix@
> +exec_prefix=@exec_prefix@
> +includedir=@includedir@
> +libdir=@libdir@
> +
> +Name: @PACKAGE_NAME@
> +Description: GNU Multiple Precision Arithmetic Library
> +URL: https://gmplib.org
> +Version: @PACKAGE_VERSION@
> +Cflags: -I${includedir}
> +Libs: -L${libdir} -lgmp
> +Libs.private: @LIBM@

@LIBM@ shouldn't be needed. I don't know why configure checks for it,
from comments, possibly libtool-related.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-04 Thread Hugh McMaster
Hello Marc,

Thank you for your reply.

On Sun, 4 Aug 2019 at 19:19, Marc Glisse wrote:
> Please send it here, but first check previous discussions.

I have reviewed the threads you copied in, and searched for others.
My implementation is very similar to the previous attempts, but adopts
a more modern and automated approach.

Please find the changeset attached.

If you require any changes and/or explanation, please let me know.

--
Hugh McMaster


add_pkg-config_file.patch
Description: Binary data
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel


Re: Patch for pkg-config file

2019-08-04 Thread Marc Glisse

On Sun, 4 Aug 2019, Hugh McMaster wrote:


Dear GMP developers,

I would like to submit a patch to generate and install a pkg-config file.

Currently, detecting gmp is harder than it needs to be.

Where should I send the patch to?


Please send it here, but first check previous discussions.

quick google check:
https://gmplib.org/list-archives/gmp-devel/2006-May/thread.html
https://gmplib.org/list-archives/gmp-discuss/2006-June/thread.html
https://gmplib.org/list-archives/gmp-discuss/2013-May/thread.html
https://gmplib.org/list-archives/gmp-bugs/2013-May/003062.html
https://gmplib.org/list-archives/gmp-devel/2016-June/thread.html
https://gmplib.org/list-archives/gmp-devel/2016-August/thread.html

--
Marc Glisse
___
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel