Просмотр исходного кода

OpenBSD fixes
Author: jgg
Date: 1999-12-11 02:11:10 GMT
OpenBSD fixes

Arch Librarian лет назад: 22
Родитель
Сommit
b819effdc9
6 измененных файлов с 32 добавлено и 2 удалено
  1. 6 0
      buildlib/config.h.in
  2. 2 0
      buildlib/environment.mak.in
  3. 3 0
      buildlib/staticlibrary.mak
  4. 9 0
      buildlib/statvfs.h.in
  5. 10 1
      configure.in
  6. 2 1
      methods/rfc2553emu.cc

+ 6 - 0
buildlib/config.h.in

@@ -23,6 +23,12 @@
 /* Define if we have the X11 windowing system. */
 #undef HAVE_X11
 
+/* Define if we have sys/vfs.h */
+#undef HAVE_VFS_H
+
+/* Define if we have sys/mount.h */
+#undef HAVE_MOUNT_H
+
 /* Define if we have enabled pthread support */
 #undef HAVE_PTHREAD
 

+ 2 - 0
buildlib/environment.mak.in

@@ -14,6 +14,8 @@ LFLAGS+= @LDFLAGS@
 LEFLAGS+= 
 XLIBS:= @X_LIBS@ @X_PRE_LIBS@ @X11LIB@ @X_EXTRA_LIBS@
 SOCKETLIBS:= @SOCKETLIBS@
+AR:=@AR@
+RANLIB:=@RANLIB@
 
 # Dep generation - this only works for gnu stuff
 INLINEDEPFLAG = -MD

+ 3 - 0
buildlib/staticlibrary.mak

@@ -39,6 +39,9 @@ $($(LOCAL)-LIB): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
 	echo Building library $@
 	-rm $@ > /dev/null 2>&1
 	$(AR) cq $@ $(filter %.o,$^)
+ifneq ($(words $(RANLIB)),0)
+	$(RANLIB) $@
+endif
 
 # Compilation rules
 vpath %.cc $(SUBDIRS)

+ 9 - 0
buildlib/statvfs.h.in

@@ -1,4 +1,13 @@
 /* Compatibility for systems with out Single Unix Spec statvfs */
+#include <config.h>
+
+#ifdef HAVE_VFS_H
 #include <sys/vfs.h>
+#endif
+
+#ifdef HAVE_MOUNT_H
+#include <sys/param.h>
+#include <sys/mount.h>
+#endif
 
 #define statvfs statfs

+ 10 - 1
configure.in

@@ -31,7 +31,9 @@ AC_CHECK_TOOL_PREFIX	dnl recheck, in case the initial guess was wrong
 
 dnl Check for other programs
 AC_PROG_CXX
-#AC_LANG_CPLUSPLUS
+AC_PROG_CPP
+AC_PROG_RANLIB
+AC_CHECK_TOOL(AR,ar,"ar")
 
 dnl Checks for sockets
 SAVE_LIBS="$LIBS"
@@ -98,6 +100,13 @@ dnl Single Unix Spec statvfs
 AC_CHECK_FUNC(statvfs,[HAVE_STATVFS=yes])
 AC_SUBST(HAVE_STATVFS)
 
+dnl Arg, linux and bsd put their statfs function in different places
+if test x"$HAVE_STATVFS" != x"yes"; then
+   AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[
+   AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],[AC_MSG_ERROR(failed: Need statvfs)])
+   ])
+fi
+
 dnl Check the sizes etc. of the architecture
 changequote(,)
 if archline="`grep \"^$archset\" $srcdir/buildlib/sizetable | cut -f 2- -d ' '`";then

+ 2 - 1
methods/rfc2553emu.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: rfc2553emu.cc,v 1.5 1999/12/10 08:53:43 jgg Exp $
+// $Id: rfc2553emu.cc,v 1.6 1999/12/11 02:11:10 jgg Exp $
 /* ######################################################################
 
    RFC 2553 Emulation - Provides emulation for RFC 2553 getaddrinfo,
@@ -17,6 +17,7 @@
 #include "rfc2553emu.h"
 #include <stdlib.h>
 #include <arpa/inet.h>
+#include <netinet/in.h>
 #include <string.h>
 #include <stdio.h>