summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:27 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:27 +0000
commit101030ab14d60497fcba5b1c2866d52fc5ac4780 (patch)
treeac6ecefeeeef51c4e7fa80577c6af064060174c3
parentabb9b874c5d1573a42c8c5519a38ac0575ef77ba (diff)
downloadapt-101030ab14d60497fcba5b1c2866d52fc5ac4780.tar.gz
More Solaris fixes
Author: jgg Date: 1999-12-10 06:30:42 GMT More Solaris fixes
-rw-r--r--apt-pkg/contrib/cdromutl.cc8
-rw-r--r--apt-pkg/deb/dpkgpm.cc4
-rw-r--r--buildlib/defaults.mak16
-rw-r--r--buildlib/environment.mak.in2
-rw-r--r--buildlib/makefile.in9
-rw-r--r--buildlib/statvfs.h.in4
-rw-r--r--cmdline/apt-get.cc8
-rw-r--r--configure.in4
8 files changed, 42 insertions, 13 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index f6e4bc216..f703621c8 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cdromutl.cc,v 1.9 1999/08/30 07:48:04 jgg Exp $
+// $Id: cdromutl.cc,v 1.10 1999/12/10 06:30:42 jgg Exp $
/* ######################################################################
CDROM Utilities - Some functions to manipulate CDROM mounts.
@@ -21,7 +21,7 @@
#include <sys/wait.h>
#include <sys/errno.h>
-#include <sys/vfs.h>
+#include <sys/statvfs.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -183,8 +183,8 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version)
// Some stats from the fsys
if (_config->FindB("Debug::identcdrom",false) == false)
{
- struct statfs Buf;
- if (statfs(CD.c_str(),&Buf) != 0)
+ struct statvfs Buf;
+ if (statvfs(CD.c_str(),&Buf) != 0)
return _error->Errno("statfs","Failed to stat the cdrom");
// We use a kilobyte block size to advoid overflow
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 874a9ba97..685bd4228 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: dpkgpm.cc,v 1.14 1999/09/10 02:40:31 jgg Exp $
+// $Id: dpkgpm.cc,v 1.15 1999/12/10 06:30:42 jgg Exp $
/* ######################################################################
DPKG Package Manager - Provide an interface to dpkg
@@ -356,7 +356,7 @@ bool pkgDPkgPM::Go()
/* No Job Control Stop Env is a magic dpkg var that prevents it
from using sigstop */
- setenv("DPKG_NO_TSTP","yes",1);
+ putenv("DPKG_NO_TSTP=yes");
execvp(Args[0],(char **)Args);
cerr << "Could not exec dpkg!" << endl;
_exit(100);
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 3e145f673..17a6b8ac8 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -40,13 +40,25 @@ BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
endif
BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
-BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
ifeq ($(words $(BUILDX)),0)
-error-all:
+
+# Check for a busted wildcard function. We use this function in several
+# places, it must work.
+ifeq ($(words $(wildcard *)),0)
+error-all/environment.mak:
+ echo You have a broken version of GNU Make - upgrade.
+else
+error-all/environment.mak:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
endif
+# Force include below to come to the error target
+BUILDX := error-all
+else
+BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
+endif
+
override BUILD := $(BUILDX)
# Base definitions
diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
index 83c52394e..b0b8f185e 100644
--- a/buildlib/environment.mak.in
+++ b/buildlib/environment.mak.in
@@ -32,4 +32,6 @@ SLANGLIB = @SLANGLIB@
XPMLIB = @XPMLIB@
PTHREADLIB = @PTHREADLIB@
+# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
+HAVE_STATVFS = @HAVE_STATVFS@
diff --git a/buildlib/makefile.in b/buildlib/makefile.in
index dbcc91cd6..677aee4d3 100644
--- a/buildlib/makefile.in
+++ b/buildlib/makefile.in
@@ -31,13 +31,20 @@ maintainer-clean dist-clean pristine sanity distclean:
.PHONY: dirs
MISSING_DIRS:= $(filter-out $(wildcard $(SUBDIRS)),$(SUBDIRS))
dirs:
+ @rm -f include/sys
ifneq ($(words $(MISSING_DIRS)),0)
@mkdir $(MISSING_DIRS)
else
@echo > /dev/null
endif
ifeq ($(HAVE_C9X),yes)
- -@rm include/inttypes.h > /dev/null 2>&1
+ @rm -f include/inttypes.h > /dev/null 2>&1
else
@cp $(SRCDIR)/buildlib/inttypes.h.in include/inttypes.h
endif
+ifeq ($(HAVE_STATVFS),yes)
+ @rm -f include/statvfs.h > /dev/null 2>&1
+else
+ @cp $(SRCDIR)/buildlib/statvfs.h.in include/statvfs.h
+ ln -sf . include/sys
+endif
diff --git a/buildlib/statvfs.h.in b/buildlib/statvfs.h.in
new file mode 100644
index 000000000..86b8c52cd
--- /dev/null
+++ b/buildlib/statvfs.h.in
@@ -0,0 +1,4 @@
+/* Compatibility for systems with out Single Unix Spec statvfs */
+#include <sys/vfs.h>
+
+#define statvfs statfs
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 88b4ffc2e..cb47666b4 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.92 1999/12/09 05:22:33 jgg Exp $
+// $Id: apt-get.cc,v 1.93 1999/12/10 06:30:42 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -47,7 +47,7 @@
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/vfs.h>
+#include <sys/statvfs.h>
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
@@ -629,9 +629,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
return false;
// Check for enough free space
- struct statfs Buf;
+ struct statvfs Buf;
string OutputDir = _config->FindDir("Dir::Cache::Archives");
- if (statfs(OutputDir.c_str(),&Buf) != 0)
+ if (statvfs(OutputDir.c_str(),&Buf) != 0)
return _error->Errno("statfs","Couldn't determine free space in %s",
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
diff --git a/configure.in b/configure.in
index 7387a48bd..6c8a1dc03 100644
--- a/configure.in
+++ b/configure.in
@@ -94,6 +94,10 @@ AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
[uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
c9x_ints=yes,c9x_ints=no)])
+dnl Single Unix Spec statvfs
+AC_CHECK_FUNC(statvfs)
+AC_SUBST(HAVE_STATVFS)
+
dnl Check the sizes etc. of the architecture
changequote(,)
if archline="`grep \"^$archset\" $srcdir/buildlib/sizetable | cut -f 2- -d ' '`";then