summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-20 01:17:04 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-20 01:17:04 +0000
commit43ea75c0b3b64f1ebde2c7048a64d1f5bb3242fe (patch)
treeaea7953750842e91efbcdf3cc15fefefc7e6c788 /configure
parent9facfd70b5a8ca4dca16fc93f6fcfe1c2bf6ce0f (diff)
Move ugly .*.inc files into make/template/ where they can be more easily found
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11929 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure114
1 files changed, 53 insertions, 61 deletions
diff --git a/configure b/configure
index 41b0cd0ee..06e1952e8 100755
--- a/configure
+++ b/configure
@@ -1044,74 +1044,66 @@ EOF
# but right now we only parse .inspircd.inc to form './inspircd'
prepare_dynamic_makefile();
- print "Writing \e[1;32mMakefiles\e[0m\n";
+ my @dotfiles = qw(main.mk inspircd);
+ push @dotfiles, 'org.inspircd.plist' if $config{OSNAME} eq 'darwin';
- opendir(DIRHANDLE, $this);
-
- foreach my $name (sort readdir(DIRHANDLE)) {
- if ($name =~ /^\.(.+)\.inc$/) {
- $file = $1;
-
- # Bug #353, omit this on non-darwin
- next if (($config{OSNAME} !~ /darwin/) && ($file eq "org.inspircd.plist"));
+ foreach my $file (@dotfiles) {
+ open(FILEHANDLE, "make/template/$file") or die "Can't open make/template/$file: $!";
+ $_ = join '', <FILEHANDLE>;
+ close(FILEHANDLE);
- # All .name.inc files need parsing!
- open(FILEHANDLE, ".$file.inc") or die ("Can't open .$file.inc");
- $_ = join '', <FILEHANDLE>;
- close(FILEHANDLE);
+ $config{BUILD_DIR} ||= resolve_directory($config{ME}."/build");
+ for my $var (qw(
+ CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR
+ STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE
+ )) {
+ s/\@$var\@/$config{$var}/g;
+ }
+ s/\@EXECUTABLE\@/$exe/ if defined $exe;
+ s/\@VERSION\@/$version/ if defined $version;
+
+ if ($file eq 'main.mk') {
+ print "Writing \e[1;32mGNUmakefile\e[0m ...\n";
+
+ my $mk_tmp = $_;
+ s/\@IFDEF (\S+)/ifdef $1/g;
+ s/\@IFNDEF (\S+)/ifndef $1/g;
+ s/\@IFEQ (\S+) (\S+)/ifeq ($1,$2)/g;
+ s/\@ELSIFEQ (\S+) (\S+)/else ifeq ($1,$2)/g;
+ s/\@ELSE/else/g;
+ s/\@ENDIF/endif/g;
+ s/ *\@BSD_ONLY .*\n//g;
+ s/\@GNU_ONLY //g;
+ s/\@DO_EXPORT (.*)/export $1/g;
+ open MKF, '>GNUmakefile' or die "Can't write to GNUmakefile: $!";
+ print MKF $_;
+ close MKF;
+
+ print "Writing \e[1;32mBSDmakefile\e[0m ...\n";
+ $_ = $mk_tmp;
+ s/\@IFDEF (\S+)/.if defined($1)/g;
+ s/\@IFNDEF (\S+)/.if !defined($1)/g;
+ s/\@IFEQ (\S+) (\S+)/.if $1 == $2/g;
+ s/\@ELSIFEQ (\S+) (\S+)/.elif $1 == $2/g;
+ s/\@ELSE/.else/g;
+ s/\@ENDIF/.endif/g;
+ s/\@BSD_ONLY //g;
+ s/ *\@GNU_ONLY .*\n//g;
+ $mk_tmp = $_;
+ $mk_tmp =~ s#\@DO_EXPORT (.*)#"MAKEENV += ".join ' ', map "$_='\${$_}'", split /\s/, $1#eg;
+ open MKF, '>BSDmakefile' or die "Can't write to BSDmakefile: $!";
+ print MKF $mk_tmp;
+ close MKF;
+ } else {
print "Writing \e[1;32m$file\e[0m ...\n";
-
- $config{BUILD_DIR} ||= resolve_directory($config{ME}."/build");
-
- for my $var (qw(
- CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR
- STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE
- )) {
- s/\@$var\@/$config{$var}/g;
- }
- s/\@EXECUTABLE\@/$exe/ if defined $exe;
- s/\@VERSION\@/$version/ if defined $version;
-
- if ($file eq 'Makefile') {
- my $mk_tmp = $_;
- s/\@IFDEF (\S+)/ifdef $1/g;
- s/\@IFNDEF (\S+)/ifndef $1/g;
- s/\@IFEQ (\S+) (\S+)/ifeq ($1,$2)/g;
- s/\@ELSIFEQ (\S+) (\S+)/else ifeq ($1,$2)/g;
- s/\@ELSE/else/g;
- s/\@ENDIF/endif/g;
- s/ *\@BSD_ONLY .*\n//g;
- s/\@GNU_ONLY //g;
- s/\@DO_EXPORT (.*)/export $1/g;
- open MKF, '>GNUmakefile' or die "Can't write to GNUmakefile: $!";
- print MKF $_;
- close MKF;
- $_ = $mk_tmp;
- s/\@IFDEF (\S+)/.if defined($1)/g;
- s/\@IFNDEF (\S+)/.if !defined($1)/g;
- s/\@IFEQ (\S+) (\S+)/.if $1 == $2/g;
- s/\@ELSIFEQ (\S+) (\S+)/.elif $1 == $2/g;
- s/\@ELSE/.else/g;
- s/\@ENDIF/.endif/g;
- s/\@BSD_ONLY //g;
- s/ *\@GNU_ONLY .*\n//g;
- $mk_tmp = $_;
- $mk_tmp =~ s#\@DO_EXPORT (.*)#"MAKEENV += ".join ' ', map "$_='\${$_}'", split /\s/, $1#eg;
- open MKF, '>BSDmakefile' or die "Can't write to BSDmakefile: $!";
- print MKF $mk_tmp;
- close MKF;
- } else {
- open(FILEHANDLE, ">$file") or die("Can't write to $file: $!\n");
- print FILEHANDLE $_;
- close(FILEHANDLE);
- }
+ open(FILEHANDLE, ">$file") or die("Can't write to $file: $!\n");
+ print FILEHANDLE $_;
+ close(FILEHANDLE);
}
}
- closedir(DIRHANDLE);
- # Make inspircd executable!
- chmod 0744, 'inspircd';
+ chmod 0755, 'inspircd';
}
sub depcheck