Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/DoConfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ system("echo '*** CompilerOutput.log ***' > CompilerOutput.log");

'TUNE' => 'generic',

'PACKAGE_VERSION' => undef,

);


Expand Down Expand Up @@ -283,6 +285,12 @@ if ($ConfigFlag{'NTL_GF2X_LIB'} eq 'on') {
}
}

# retrieve ntl version from DIRNAME
open(DIRNAME, "< DIRNAME");
@versionline = split('-',<DIRNAME>);
chomp($versionline[1]);
$MakeVal{'PACKAGE_VERSION'} = $versionline[1];
close(DIRNAME);

# copy %MakeVal and %MakeFlag as is into %MakeSub

Expand Down Expand Up @@ -397,7 +405,23 @@ sub GenFiles {
close(MFILE);
close(MFILEOUT);


# generate ntl.pc

open(NTLPCIN, "< ntl.pc.in");
open(NTLPC, "> ntl.pc");

while ($line = <NTLPCIN>) {

$line =~ s/@\{(.*?)\}/$MakeSub{$1}/ge;
$line =~ tr/()/{}/;

print NTLPC $line;

}

close(NTLPCIN);
close(NTLPC);

# generate config.h


Expand Down
4 changes: 3 additions & 1 deletion src/mfile
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ install:
@{LSTAT} cp -p ntl.a $(DESTDIR)$(LIBDIR)/libntl.a #LSTAT
@{LSTAT} - chmod a+r $(DESTDIR)$(LIBDIR)/libntl.a #LSTAT
@{LSHAR} $(LIBTOOL) --mode=install cp -p libntl.la $(DESTDIR)$(LIBDIR) #LSHAR

mkdir -p -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig
cp -p ntl.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
- chmod a+r $(DESTDIR)$(LIBDIR)/pkgconfig/ntl.pc

uninstall:
@{LSTAT} rm -f $(LIBDIR)/libntl.a #LSTAT
Expand Down
19 changes: 19 additions & 0 deletions src/ntl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Define these NTL configuration variables as they may not be
# substited by DoConfig
DEF_PREFIX=@{DEF_PREFIX}
PREFIX=@{PREFIX}
# optional dependencies
@{GF2X}GF2X_PKG=gf2x
@{GMP}GMP_PKG=gmp
# Normal pc file starts here
prefix=@{PREFIX}
libdir=@{LIBDIR}
includedir=@{INCLUDEDIR}

Name: ntl
URL: http://www.shoup.net/
Description: A library for doing number theory
Version: @{PACKAGE_VERSION}
Libs: -L${libdir} -lntl
Cflags: -I${includedir} @{CXXAUTOFLAGS}
Requires.private: ${GF2X_PKG} ${GMP_PKG}