summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ebourne <martin@ebourne.me.uk>2006-03-04 01:33:46 +0000
committerMartin Ebourne <martin@ebourne.me.uk>2006-03-04 01:33:46 +0000
commitdefac6623afe8b7d765a9477371fbc47da855c19 (patch)
treeb6d5c9e77d896a67ee1d56bc9ffa9d703ae45c81
parent6f868d48446f4196d2ad69e7ca9be42047ea2d5e (diff)
This is part 1 of a patch from James O'Gorman.
configure now detects perl executable location and updates all scripts to use the correct path; also adds PERL_EXECUTABLE define to BoxConfig.h. makebuildenv.pl adds PERL define to all makefiles.
-rwxr-xr-xbin/bbackupd/bbackupd-config2
-rw-r--r--bin/bbackupquery/Makefile.extra2
-rwxr-xr-xbin/bbackupquery/makedocumentation.pl2
-rw-r--r--bin/bbstored/Makefile.extra2
-rwxr-xr-xbin/bbstored/bbstored-certs2
-rwxr-xr-xbin/bbstored/bbstored-config2
-rw-r--r--configure.ac28
-rwxr-xr-xdistribution/boxbackup/contrib/cygwin/install-cygwin-service.pl2
-rwxr-xr-xinfrastructure/makebuildenv.pl3
-rwxr-xr-xinfrastructure/makedistribution.pl2
-rwxr-xr-xinfrastructure/makeparcels.pl2
-rwxr-xr-xinfrastructure/setupexternal.pl2
-rw-r--r--lib/backupclient/Makefile.extra4
-rw-r--r--lib/common/Makefile.extra4
-rwxr-xr-xlib/common/makeexception.pl2
-rw-r--r--lib/compress/Makefile.extra2
-rw-r--r--lib/crypto/Makefile.extra2
-rw-r--r--lib/raidfile/Makefile.extra2
-rwxr-xr-xlib/raidfile/raidfile-config2
-rw-r--r--lib/server/Makefile.extra4
-rwxr-xr-xlib/server/makeprotocol.pl2
-rwxr-xr-xruntest.pl2
-rw-r--r--test/backupstorefix/testbackupstorefix.cpp16
-rwxr-xr-xtest/backupstorefix/testfiles/testbackupstorefix.pl2
-rw-r--r--test/basicserver/Makefile.extra8
-rw-r--r--test/bbackupd/testfiles/bbackupd.conf2
-rwxr-xr-xtest/bbackupd/testfiles/extcheck1.pl2
-rwxr-xr-xtest/bbackupd/testfiles/extcheck2.pl2
-rwxr-xr-xtest/bbackupd/testfiles/notifyscript.pl2
29 files changed, 66 insertions, 45 deletions
diff --git a/bin/bbackupd/bbackupd-config b/bin/bbackupd/bbackupd-config
index 0d8dd4d1..c06b818d 100755
--- a/bin/bbackupd/bbackupd-config
+++ b/bin/bbackupd/bbackupd-config
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# should be running as root
diff --git a/bin/bbackupquery/Makefile.extra b/bin/bbackupquery/Makefile.extra
index 633ec0fc..f347c451 100644
--- a/bin/bbackupquery/Makefile.extra
+++ b/bin/bbackupquery/Makefile.extra
@@ -1,6 +1,6 @@
# AUTOGEN SEEDING
autogen_Documentation.cpp: makedocumentation.pl documentation.txt
- perl makedocumentation.pl
+ $(PERL) makedocumentation.pl
diff --git a/bin/bbackupquery/makedocumentation.pl b/bin/bbackupquery/makedocumentation.pl
index a3632848..72e45a67 100755
--- a/bin/bbackupquery/makedocumentation.pl
+++ b/bin/bbackupquery/makedocumentation.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
print "Creating built-in documentation for bbackupquery...\n";
diff --git a/bin/bbstored/Makefile.extra b/bin/bbstored/Makefile.extra
index 187d53ef..94bc3fb9 100644
--- a/bin/bbstored/Makefile.extra
+++ b/bin/bbstored/Makefile.extra
@@ -5,5 +5,5 @@ GEN_CMD_SRV = $(MAKEPROTOCOL) Server backupprotocol.txt
# AUTOGEN SEEDING
autogen_BackupProtocolServer.cpp autogen_BackupProtocolServer.h: $(MAKEPROTOCOL) backupprotocol.txt
- perl $(GEN_CMD_SRV)
+ $(PERL) $(GEN_CMD_SRV)
diff --git a/bin/bbstored/bbstored-certs b/bin/bbstored/bbstored-certs
index d1fa8dea..e0554d94 100755
--- a/bin/bbstored/bbstored-certs
+++ b/bin/bbstored/bbstored-certs
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# validity period for root certificates -- default is a very long time
diff --git a/bin/bbstored/bbstored-config b/bin/bbstored/bbstored-config
index 0032f4c6..7bd79716 100755
--- a/bin/bbstored/bbstored-config
+++ b/bin/bbstored/bbstored-config
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# should be running as root
diff --git a/configure.ac b/configure.ac
index 714603b2..ef0cfeb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([Box Backup], 0.09, [box@fluffy.co.uk])
+AC_INIT([Box Backup], 0.10, [box@fluffy.co.uk])
AC_CONFIG_SRCDIR([lib/common/Box.h])
AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
@@ -26,6 +26,12 @@ if test "x$GXX" = "xyes"; then
# Use -rdynamic if we have gcc. This is needed for backtrace
AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
fi
+AC_PATH_PROG([PERL], [perl], [no])
+if test "x$PERL" != "xno"; then
+ AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$PERL"], [Location of the perl executable])
+else
+ AC_MSG_ERROR([[perl executable was not found]])
+fi
### Checks for libraries.
@@ -203,13 +209,27 @@ AC_SUBST([bindir_expanded])
### Output files
-AC_CONFIG_FILES([infrastructure/BoxPlatform.pm])
+AC_CONFIG_FILES([bin/bbackupd/bbackupd-config
+ bin/bbackupquery/makedocumentation.pl
+ bin/bbstored/bbstored-certs
+ bin/bbstored/bbstored-config
+ infrastructure/BoxPlatform.pm
+ infrastructure/makebuildenv.pl
+ infrastructure/makeparcels.pl
+ lib/common/makeexception.pl
+ lib/raidfile/raidfile-config
+ lib/server/makeprotocol.pl
+ runtest.pl
+ test/backupstorefix/testfiles/testbackupstorefix.pl
+ test/bbackupd/testfiles/extcheck1.pl
+ test/bbackupd/testfiles/extcheck2.pl
+ test/bbackupd/testfiles/notifyscript.pl])
AC_OUTPUT
# Configure the Box build system
echo
-perl ./infrastructure/makebuildenv.pl &&
- perl ./infrastructure/makeparcels.pl
+$PERL ./infrastructure/makebuildenv.pl &&
+ $PERL ./infrastructure/makeparcels.pl
# Write summary of important info
cat <<EOC
diff --git a/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl b/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
index 65758067..a580e99c 100755
--- a/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
+++ b/distribution/boxbackup/contrib/cygwin/install-cygwin-service.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!@PERL@ -w
# Contributed to the boxbackup project by Per Reedtz Thomsen. pthomsen@reedtz.com
diff --git a/infrastructure/makebuildenv.pl b/infrastructure/makebuildenv.pl
index 7ce2e138..29479558 100755
--- a/infrastructure/makebuildenv.pl
+++ b/infrastructure/makebuildenv.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
use Symbol;
@@ -497,6 +497,7 @@ __E
CXX = g++
AR = ar
RANLIB = ranlib
+PERL = \@PERL\@
.ifdef RELEASE
CXXFLAGS = -DNDEBUG $release_flags -Wall $include_paths $extra_platform_defines -DBOX_VERSION="\\"$product_version\\""
OUTBASE = ../../release
diff --git a/infrastructure/makedistribution.pl b/infrastructure/makedistribution.pl
index 22057959..16f7409b 100755
--- a/infrastructure/makedistribution.pl
+++ b/infrastructure/makedistribution.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
use Symbol;
diff --git a/infrastructure/makeparcels.pl b/infrastructure/makeparcels.pl
index deea24af..e70dcf29 100755
--- a/infrastructure/makeparcels.pl
+++ b/infrastructure/makeparcels.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
use lib 'infrastructure';
diff --git a/infrastructure/setupexternal.pl b/infrastructure/setupexternal.pl
index e21403e1..87ec5560 100755
--- a/infrastructure/setupexternal.pl
+++ b/infrastructure/setupexternal.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# This script links in the essential directories and processes various
diff --git a/lib/backupclient/Makefile.extra b/lib/backupclient/Makefile.extra
index 66203e3c..925c880e 100644
--- a/lib/backupclient/Makefile.extra
+++ b/lib/backupclient/Makefile.extra
@@ -5,12 +5,12 @@ GEN_CMD_SRV = $(MAKEPROTOCOL) Client ../../bin/bbstored/backupprotocol.txt
# AUTOGEN SEEDING
autogen_BackupProtocolClient.cpp autogen_BackupProtocolClient.h: $(MAKEPROTOCOL) ../../bin/bbstored/backupprotocol.txt
- perl $(GEN_CMD_SRV)
+ $(PERL) $(GEN_CMD_SRV)
MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_BackupStoreException.h autogen_BackupStoreException.cpp: $(MAKEEXCEPTION) BackupStoreException.txt
- perl $(MAKEEXCEPTION) BackupStoreException.txt
+ $(PERL) $(MAKEEXCEPTION) BackupStoreException.txt
diff --git a/lib/common/Makefile.extra b/lib/common/Makefile.extra
index 92e6fbb3..04dd8e71 100644
--- a/lib/common/Makefile.extra
+++ b/lib/common/Makefile.extra
@@ -3,9 +3,9 @@ MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_CommonException.h autogen_CommonException.cpp: $(MAKEEXCEPTION) CommonException.txt
- perl $(MAKEEXCEPTION) CommonException.txt
+ $(PERL) $(MAKEEXCEPTION) CommonException.txt
# AUTOGEN SEEDING
autogen_ConversionException.h autogen_ConversionException.cpp: $(MAKEEXCEPTION) ConversionException.txt
- perl $(MAKEEXCEPTION) ConversionException.txt
+ $(PERL) $(MAKEEXCEPTION) ConversionException.txt
diff --git a/lib/common/makeexception.pl b/lib/common/makeexception.pl
index c0388286..1564b75b 100755
--- a/lib/common/makeexception.pl
+++ b/lib/common/makeexception.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
# global exception list file
my $global_list = '../../ExceptionCodes.txt';
diff --git a/lib/compress/Makefile.extra b/lib/compress/Makefile.extra
index 7ef9930c..3598f1c9 100644
--- a/lib/compress/Makefile.extra
+++ b/lib/compress/Makefile.extra
@@ -3,5 +3,5 @@ MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_CompressException.h autogen_CompressException.cpp: $(MAKEEXCEPTION) CompressException.txt
- perl $(MAKEEXCEPTION) CompressException.txt
+ $(PERL) $(MAKEEXCEPTION) CompressException.txt
diff --git a/lib/crypto/Makefile.extra b/lib/crypto/Makefile.extra
index a7e42000..f9d63a42 100644
--- a/lib/crypto/Makefile.extra
+++ b/lib/crypto/Makefile.extra
@@ -3,5 +3,5 @@ MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_CipherException.cpp autogen_CipherException.h: $(MAKEEXCEPTION) CipherException.txt
- perl $(MAKEEXCEPTION) CipherException.txt
+ $(PERL) $(MAKEEXCEPTION) CipherException.txt
diff --git a/lib/raidfile/Makefile.extra b/lib/raidfile/Makefile.extra
index 8d036633..4d904e8a 100644
--- a/lib/raidfile/Makefile.extra
+++ b/lib/raidfile/Makefile.extra
@@ -3,5 +3,5 @@ MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_RaidFileException.h autogen_RaidFileException.cpp: $(MAKEEXCEPTION) RaidFileException.txt
- perl $(MAKEEXCEPTION) RaidFileException.txt
+ $(PERL) $(MAKEEXCEPTION) RaidFileException.txt
diff --git a/lib/raidfile/raidfile-config b/lib/raidfile/raidfile-config
index b3f31077..f1098adc 100755
--- a/lib/raidfile/raidfile-config
+++ b/lib/raidfile/raidfile-config
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# should be running as root
diff --git a/lib/server/Makefile.extra b/lib/server/Makefile.extra
index 6cc0de2e..33fac0a1 100644
--- a/lib/server/Makefile.extra
+++ b/lib/server/Makefile.extra
@@ -3,9 +3,9 @@ MAKEEXCEPTION = ../../lib/common/makeexception.pl
# AUTOGEN SEEDING
autogen_ServerException.h autogen_ServerException.cpp: $(MAKEEXCEPTION) ServerException.txt
- perl $(MAKEEXCEPTION) ServerException.txt
+ $(PERL) $(MAKEEXCEPTION) ServerException.txt
# AUTOGEN SEEDING
autogen_ConnectionException.h autogen_ConnectionException.cpp: $(MAKEEXCEPTION) ConnectionException.txt
- perl $(MAKEEXCEPTION) ConnectionException.txt
+ $(PERL) $(MAKEEXCEPTION) ConnectionException.txt
diff --git a/lib/server/makeprotocol.pl b/lib/server/makeprotocol.pl
index 71355e62..3dce6118 100755
--- a/lib/server/makeprotocol.pl
+++ b/lib/server/makeprotocol.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
# Make protocol C++ classes from a protocol description file
diff --git a/runtest.pl b/runtest.pl
index 4430128f..f2b70a14 100755
--- a/runtest.pl
+++ b/runtest.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use lib 'infrastructure';
use BoxPlatform;
diff --git a/test/backupstorefix/testbackupstorefix.cpp b/test/backupstorefix/testbackupstorefix.cpp
index c36bb8b8..92928cc6 100644
--- a/test/backupstorefix/testbackupstorefix.cpp
+++ b/test/backupstorefix/testbackupstorefix.cpp
@@ -312,7 +312,7 @@ int test(int argc, const char *argv[])
TEST_THAT(ServerIsAlive(pid));
// Run the perl script to create the initial directories
- TEST_THAT_ABORTONFAIL(::system("perl testfiles/testbackupstorefix.pl init") == 0);
+ TEST_THAT_ABORTONFAIL(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl init") == 0);
int bbackupd_pid = LaunchServer("../../bin/bbackupd/bbackupd testfiles/bbackupd.conf", "testfiles/bbackupd.pid");
TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0);
@@ -367,7 +367,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is as it was
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 0") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 0") == 0);
// Check the random file doesn't exist
{
TEST_THAT(!RaidFileRead::FileExists(discSetNum, storeRoot + "01/randomfile"));
@@ -425,7 +425,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 1") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 1") == 0);
// Check the modified file doesn't exist
TEST_THAT(!RaidFileRead::FileExists(discSetNum, fn));
@@ -471,7 +471,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is as it should be
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 2") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 2") == 0);
{
BackupStoreDirectory dir;
LoadDirectory("Test1/foreomizes/stemptinevidate/ict", dir);
@@ -527,7 +527,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is as it should be
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 3") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 3") == 0);
{
BackupStoreDirectory dir;
LoadDirectory("Test1/foreomizes/stemptinevidate/ict", dir);
@@ -541,7 +541,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is where it is predicted to be
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 4") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 4") == 0);
// ------------------------------------------------------------------------------------------------
::printf(" === Corrupt file and dir\n");
@@ -552,7 +552,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is where it should be
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl check 5") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl check 5") == 0);
// ------------------------------------------------------------------------------------------------
::printf(" === Overwrite root with a file\n");
@@ -566,7 +566,7 @@ int test(int argc, const char *argv[])
// Fix it
RUN_CHECK
// Check everything is where it should be
- TEST_THAT(::system("perl testfiles/testbackupstorefix.pl reroot 6") == 0);
+ TEST_THAT(::system(PERL_EXECUTABLE " testfiles/testbackupstorefix.pl reroot 6") == 0);
// ------------------------------------------------------------------------------------------------
diff --git a/test/backupstorefix/testfiles/testbackupstorefix.pl b/test/backupstorefix/testfiles/testbackupstorefix.pl
index 99a4c041..b57f10ac 100755
--- a/test/backupstorefix/testfiles/testbackupstorefix.pl
+++ b/test/backupstorefix/testfiles/testbackupstorefix.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
my @words = split /\s+/,<<__E;
diff --git a/test/basicserver/Makefile.extra b/test/basicserver/Makefile.extra
index 51280db9..3feda961 100644
--- a/test/basicserver/Makefile.extra
+++ b/test/basicserver/Makefile.extra
@@ -6,16 +6,16 @@ GEN_CMD_CLI = $(MAKEPROTOCOL) Client testprotocol.txt
# AUTOGEN SEEDING
autogen_TestProtocolServer.cpp: $(MAKEPROTOCOL) testprotocol.txt
- perl $(GEN_CMD_SRV)
+ $(PERL) $(GEN_CMD_SRV)
autogen_TestProtocolServer.h: $(MAKEPROTOCOL) testprotocol.txt
- perl $(GEN_CMD_SRV)
+ $(PERL) $(GEN_CMD_SRV)
# AUTOGEN SEEDING
autogen_TestProtocolClient.cpp: $(MAKEPROTOCOL) testprotocol.txt
- perl $(GEN_CMD_CLI)
+ $(PERL) $(GEN_CMD_CLI)
autogen_TestProtocolClient.h: $(MAKEPROTOCOL) testprotocol.txt
- perl $(GEN_CMD_CLI)
+ $(PERL) $(GEN_CMD_CLI)
diff --git a/test/bbackupd/testfiles/bbackupd.conf b/test/bbackupd/testfiles/bbackupd.conf
index c25b4eab..6d381d5b 100644
--- a/test/bbackupd/testfiles/bbackupd.conf
+++ b/test/bbackupd/testfiles/bbackupd.conf
@@ -23,7 +23,7 @@ ExtendedLogging = yes
CommandSocket = testfiles/bbackupd.sock
-NotifyScript = perl testfiles/notifyscript.pl
+NotifyScript = @PERL@ testfiles/notifyscript.pl
Server
{
diff --git a/test/bbackupd/testfiles/extcheck1.pl b/test/bbackupd/testfiles/extcheck1.pl
index 7481593d..edbacd0a 100755
--- a/test/bbackupd/testfiles/extcheck1.pl
+++ b/test/bbackupd/testfiles/extcheck1.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac\" quit|")
diff --git a/test/bbackupd/testfiles/extcheck2.pl b/test/bbackupd/testfiles/extcheck2.pl
index a0c7d3cd..68baa045 100755
--- a/test/bbackupd/testfiles/extcheck2.pl
+++ b/test/bbackupd/testfiles/extcheck2.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
use strict;
unless(open IN,"../../bin/bbackupquery/bbackupquery -q -c testfiles/bbackupd.conf -l testfiles/query4.log \"compare -ac\" quit|")
diff --git a/test/bbackupd/testfiles/notifyscript.pl b/test/bbackupd/testfiles/notifyscript.pl
index a31d072e..df0e5a2d 100755
--- a/test/bbackupd/testfiles/notifyscript.pl
+++ b/test/bbackupd/testfiles/notifyscript.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!@PERL@
my $f = 'testfiles/notifyran.'.$ARGV[0].'.';