diff options
author | Francis Dupont <fdupont@isc.org> | 2016-10-06 14:56:49 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2016-10-06 14:56:49 +0200 |
commit | 13e5cc6cbe83ac7cd9285a54e870e4f8ab16a604 (patch) | |
tree | 8176d5eaddb7cd24e9e291db11c2cf433a25a170 /util | |
parent | 3a4fc3841ea817c848e5a231b9e5c8f5c9895e6d (diff) | |
download | isc-dhcp-13e5cc6cbe83ac7cd9285a54e870e4f8ab16a604.tar.gz |
Libtoolize build chain (unfinished)
Diffstat (limited to 'util')
-rw-r--r-- | util/Makefile.bind.in | 2 | ||||
-rw-r--r-- | util/lt.pl | 134 |
2 files changed, 135 insertions, 1 deletions
diff --git a/util/Makefile.bind.in b/util/Makefile.bind.in index b98e2bee..31fcb467 100644 --- a/util/Makefile.bind.in +++ b/util/Makefile.bind.in @@ -24,7 +24,7 @@ exec_prefix = @exec_prefix@ bindconfig = --without-openssl --without-libxml2 --without-libjson \ --without-gssapi --disable-threads \ --includedir=@includedir@ --libdir=@libdir@ \ - @BINDIOMUX@ @BINDCONFIG@ --enable-full-report + @BINDLT@ @BINDIOMUX@ @BINDCONFIG@ --enable-full-report @BIND_ATF_FALSE@cleandirs = ./lib ./include @BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf diff --git a/util/lt.pl b/util/lt.pl new file mode 100644 index 00000000..da493826 --- /dev/null +++ b/util/lt.pl @@ -0,0 +1,134 @@ +#!/usr/bin/perl +# +# Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# build configure.am with or without libtool stuff + +require 5.000; +use strict; + +# general arguments + +my @optionlist = ("with", "without", "verbose"); + +# usage + +my $usage = ("Usage: perl lt.pl [with|without] [verbose]\n"); + +# Parse arguments + +my $with = 0; +my $verbose = 0; + +foreach (@ARGV) { + if (/^with$/i) { + $with = 1; + } elsif (/^without$/i) { + $with = 0; + } elsif (/^verbose$/i) { + $verbose = 1; + } else { + die $usage; + } +} + +if ($verbose) { + if ($with) { + print STDERR "building the with libtool version\n"; + } else { + print STDERR "building the without libtool version\n"; + } +} + +# Perform + +my $line; +my $state = "top"; +my $directives = 0; +my $included = 0; +my $escaped = 0; + +foreach $line (<STDIN>) { + chomp $line; + if ($line =~ /^\@BEGIN WITH LIBTOOL$/) { + if ($state eq "top") { + $state = "with"; + } elsif ($state eq "with") { + die "got WITH begin in WITH context\n"; + } elsif ($state eq "without") { + die "got WITH begin in WITHOUT context\n"; + } + $directives += 1; + next; + } elsif ($line =~ /^\@BEGIN WITHOUT LIBTOOL$/) { + if ($state eq "top") { + $state = "without"; + } elsif ($state eq "with") { + die "got WITHOUT begin in WITH context\n"; + } elsif ($state eq "without") { + die "got WITHOUT begin in WITHOUT context\n"; + } + $directives += 1; + next; + } elsif ($line =~ /^\@END WITH LIBTOOL$/) { + if ($state eq "with") { + $state = "top"; + } elsif ($state eq "top") { + die "got WITH end outside context\n"; + } elsif ($state eq "without") { + die "got WITH end in WITHOUT context\n"; + } + $directives += 1; + next; + } elsif ($line =~ /^\@END WITHOUT LIBTOOL$/) { + if ($state eq "without") { + $state = "top"; + } elsif ($state eq "top") { + die "got WITHOUT end outside context\n"; + } elsif ($state eq "with") { + die "got WITHOUT end in WITH context\n"; + } + $directives += 1; + next; + } elsif ($line =~ /^@/) { + die "git unknown directive '$line'\n"; + } + + if ($state eq "with") { + if ($with) { + $included += 1; + } else { + $escaped += 1; + next; + } + } elsif ($state eq "without") { + if ($with) { + $escaped += 1; + next; + } else { + print $line. "\n"; + $included += 1; + } + } + print $line. "\n"; +} + +if ($verbose) { + print STDERR "directives: $directives\n"; + print STDERR "included: $included\n"; + print STDERR "escaped: $escaped\n"; +} + +exit 0; |