Last active
January 23, 2024 09:04
-
-
Save douglas-vaz/7399155 to your computer and use it in GitHub Desktop.
Add pkg-config support to the GMP source tree.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Add pkg-config support to GMP | |
#http://gmplib.org/list-archives/gmp-discuss/2013-May/005329.html | |
echo "Creating gmp.pc.in..." | |
echo """prefix=@prefix@ | |
exec_prefix=@exec_prefix@ | |
libdir=@libdir@ | |
includedir=@includedir@ | |
Name: gmp | |
Description: GNU Multiple Precision Arithmetic Library | |
URL: http://gmplib.org | |
Version: @PACKAGE_VERSION@ | |
Libs: -L\${libdir} -lgmp | |
Cflags: -I\${includedir}""" > gmp.pc.in | |
echo "Patching Makefile.am..." | |
sed -i "100ipkgconfigdir = \$(libdir)/pkgconfig\\ | |
pkgconfig_DATA = gmp.pc" Makefile.am | |
echo "Patching configure.ac..." | |
sed -i "3648iAC_CONFIG_FILES([gmp.pc])" configure.ac | |
echo """Running automake... | |
""" | |
automake --add-missing | |
autoreconf | |
echo """ | |
Completed. Run './configure' followed by 'make' and 'sudo make install' | |
gmp.pc will be added to /usr/local/lib/pkgconfig | |
Run 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' to set environment (should be default) | |
To check version after install: pkg-config --modversion gmp | |
To include during compilation: gcc program.c \$(pkg-config --cflags --libs gmp) | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to also add
aclocal && libtoolize --force
beforeautoreconf
, in order to avoid errors like "You should recreate aclocal.m4 with macros from libtool...", caused by alibtool
version mismatch.