Skip to content
Browse files

remove configure

  • Loading branch information...
1 parent 7e4cc5a commit d4e1bdc32c273eb07e98a33a0ac88a6a36f055c7 @mauke committed Jul 30, 2011
Showing with 0 additions and 145 deletions.
  1. +0 −145 configure
View
145 configure
@@ -1,145 +0,0 @@
-#!/usr/bin/env perl
-# This code is in the public domain.
-use strict;
-BEGIN { $^W = 1 }
-
-use Getopt::Long;
-
-sub deref_link {
- my ($file) = @_;
- my $target = eval { readlink $file };
- defined $target ? $target : $file
-}
-
-sub uniq {
- my %seen;
- grep !$seen{$_}++, @_
-}
-
-sub esc {
- my ($s) = @_;
- $s =~ tr[\n][ ];
- $s =~ s/\$/\$\$/g;
- $s
-}
-
-{
- my %seen;
-
- sub expand_key {
- my ($h, $k) = @_;
- return if $seen{$k}++;
- $h->{$k} =~ s/\$(\w+|\$)/
- $1 eq "\$" ? $1 :
- !defined $h->{$1} ? "\$$1" :
- (expand_key($h, $1), $h->{$1})
- /ge;
- }
-
- sub expand {
- my ($h) = @_;
- %seen = ();
- expand_key $h, $_ for keys %$h;
- }
-}
-
-
-my %config = (
- PREFIX => '/usr/local',
- TERMINFO_DIRS => join(':',
- grep -d,
- uniq
- map deref_link($_),
- qw(/usr/share/terminfo /usr/local/share/terminfo /usr/lib/terminfo /etc/terminfo)
- ),
- CC => (
- map {
- my $path = `which \Q$_\E 2>/dev/null`;
- chomp $path;
- $? == 0 ? $path : ()
- } qw(gcc cc)
- )[0] || 'gcc',
- CDIAG => '-std=gnu99 -pedantic -Wall -W -Wno-missing-field-initializers -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization',
- COPT => '-O2',
- CFLAGS => '$CDIAG $COPT -pipe -fPIC',
- MAKEFILE => 'Makefile',
- LD => '$(LD)',
- SOFLAGS => '-shared -soname=$(SONAME)',
-);
-
-my %conf_opt =
- map {
- my $opt = lc $_;
- $opt =~ tr[a-z0-9][\-]c;
- $opt => $_
- } keys %config
-;
-
-Getopt::Long::Configure(qw(gnu_getopt));
-GetOptions(
- 'h|help' => sub {
- print <<EOF,
-Usage: $0 [OPTION]...
-
-EOF
- map sprintf(
- " %-30s [%s]\n",
- "--$_=$conf_opt{$_}",
- $config{$conf_opt{$_}},
- ), sort keys %conf_opt
- ;
- exit;
- },
- map +("$_=s" => \$config{$conf_opt{$_}}), keys %conf_opt
-) or exit 1;
-
-expand \%config;
-
-my $makefile = $config{MAKEFILE};
-open MAKEFILE, "> $makefile" or die "$0: $makefile: $!\n";
-
-print MAKEFILE <<EOF;
-# autogenerated by $0, ${\scalar localtime}
-
-PREFIX = ${\esc $config{PREFIX}}
-
-CC = ${\esc $config{CC}}
-CFLAGS = ${\esc $config{CFLAGS}}
-
-RM = rm -f
-
-VERSION_MAJOR = 0
-VERSION_MINOR = 3
-VERSION = \$(VERSION_MAJOR).\$(VERSION_MINOR)
-
-NAME = unibilium
-STALIBNAME = lib\$(NAME).a
-DYNLIBNAME = lib\$(NAME).so
-SONAME = \$(DYNLIBNAME).\$(VERSION_MAJOR)
-
-.PHONY: all clean install
-
-all: \$(STALIBNAME) \$(DYNLIBNAME).\$(VERSION)
-
-clean:
- \$(RM) uniutil.o uninames.o unibilium.o \$(STALIBNAME) \$(DYNLIBNAME).\$(VERSION)
-
-uninames.o: uninames.c unibilium.h
-unibilium.o: unibilium.c unibilium.h
-uniutil.o: uniutil.c unibilium.h
- \$(CC) -c \$(CFLAGS) -DTERMINFO_DIRS=${\quotemeta '"' . esc($config{TERMINFO_DIRS}) . '"'} -o \$@ \$<
-
-\$(STALIBNAME): unibilium.o uniutil.o uninames.o
- ar rcs \$(STALIBNAME) \$+
-
-\$(DYNLIBNAME).\$(VERSION): unibilium.o uniutil.o uninames.o
- $config{LD} $config{SOFLAGS} -o \$@ \$+
-
-install:
- cp -- \$(NAME).h "\$(PREFIX)/include/"
- cp -- \$(DYNLIBNAME).\$(VERSION) "\$(PREFIX)/lib/"
- ln -sf -- \$(DYNLIBNAME).\$(VERSION) "\$(PREFIX)/lib/\$(DYNLIBNAME).\$(VERSION_MAJOR)"
- ln -sf -- \$(DYNLIBNAME).\$(VERSION_MAJOR) "\$(PREFIX)/lib/\$(DYNLIBNAME)"
-EOF
-
-close MAKEFILE or die "$0: $makefile: $!\n";

0 comments on commit d4e1bdc

Please sign in to comment.
Something went wrong with that request. Please try again.