+Sat Sep 13 18:42:27 CDT 2003 Adam Heath <doogie@debian.org>
+
+ * Makefile.conf.in, archtable, configure.in, dselect/Makefile.in,
+ lib/varbuf.c, scripts/dpkg-{architecture,shlibdeps}.pl,
+ utils/start-stop-daemon.c: Support OpenBSD.
+
Sat Sep 13 18:39:41 CDT 2003 Adam Heath <doogie@debian.org>
* archtable: Added alphaev68-linux-gnu to archtable.
SSD_LIBS = @SSD_LIBS@
+CURSES_LIBS = @CURSES_LIBS@
+
ZLIB_CFLAGS = @ZLIB_CFLAGS@
ZLIB_LIBS = @ZLIB_LIBS@
ZLIB_LIBS_ALSO_STATIC = @ZLIB_LIBS_ALSO_STATIC@
s390-linux-gnu s390 s390
s390-ibm-linux-gnu s390 s390
s390-unknown-linux-gnu s390 s390
-i386-openbsd2.8 openbsd-i386 i386
+i386-openbsd openbsd-i386 openbsd-i386
+i386-unknown-openbsd openbsd-i386 openbsd-i386
powerpc-darwin darwin-powerpc darwin-powerpc
i386-darwin darwin-i386 darwin-i386
s390x-linux-gnu s390x s390x
AC_PREFIX_DEFAULT(/usr)
+# OpenBSD has decided to be odd and includ a version number
+# in the final field of the GNU system type.
+# This code strips it out in a generic way.
+os_type=''
+AC_MSG_CHECKING(Operating system type)
+case $target_os in
+ *linux* )
+ os_type="linux";;
+ *openbsd* )
+ os_type="openbsd";;
+ *netbsd* )
+ os_type="netbsd";;
+ *freebsd* )
+ os_type="freebsd";;
+ gnu )
+ os_type="hurd";;
+esac
+if test "x$os_type" = "x"; then
+ os_type=$target_os
+fi
+AC_MSG_RESULT([$os_type])
+AC_SUBST(os_type)
+
dpkg_archset=''
AC_MSG_CHECKING(Debian architecture)
-dpkg_archset="`awk '$1 == "'$target_cpu-$target_os'" { print $2 }' $srcdir/archtable`"
+dpkg_archset="`awk '$1 == "'$target_cpu-$os_type'" { print $2 }' $srcdir/archtable`"
# Finish off
if test "x$dpkg_archset" = "x"; then
- AC_MSG_RESULT([$target_cpu-$target_os, but not found in archtable])
- dpkg_archset=$target_cpu-$target_os
+ AC_MSG_RESULT([$target_cpu-$os_type, but not found in archtable])
+ dpkg_archset=$target_cpu-$os_type
else
AC_MSG_RESULT($dpkg_archset)
fi
AC_CHECK_LIB(kvm, kvm_openfiles, SSD_LIBS="-lkvm $SSD_LIBS")
AC_SUBST(SSD_LIBS)
+# check for the proper curses library. This can be either
+# -lcurses or -lncurses, we need to check for either one.
+AC_CHECK_LIB(ncurses,initscr, CURSES_LIBS="-lncurses $CURSES_LIBS", AC_CHECK_LIB(curses,initscr, CURSES_LIBS="-lcurses $CURSES_LIBS"))
+if test "x$CURSES_LIBS" = "x"; then
+ AC_MSG_WARN(no curses library found)
+fi
+AC_SUBST(CURSES_LIBS)
+
DPKG_CHECK_DEFINE(TIOCNOTTY,sys/ioctl.h)
ZLIB_CFLAGS=
} inline int foo (int x) {], AC_DEFINE(HAVE_INLINE,,[Define if inline functions a la GCC are available.]))
AC_MSG_CHECKING([for __va_copy])
-AC_TRY_COMPILE([
+# OpenBSD passes AC_TRY_COMPILE for __va_copy even though
+# it doesn't seem to exist, which is odd. We need to use
+# AC_TRY_RUN.
+AC_TRY_RUN([
#include <stdarg.h>
-],[
+main(){
va_list v1,v2;
__va_copy(v1, v2);
+exit(0);}
], [AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_VA_COPY,,[Define if you have the __va_copy macro])],[AC_MSG_RESULT(no)
+AC_DEFINE(HAVE_VA_COPY)],[AC_MSG_RESULT(no)
AC_MSG_CHECKING([for va_list assignment copy])
AC_TRY_COMPILE([
#include <stdarg.h>
Closes: #169359
* Falk Hueffner <falk@debian.org>:
Added alphaev68-linux-gnu to archtable. Closes: #199360
+ * Elie Rosenblum <fnord@debian.org>:
+ Apply patch to support OpenBSD. Closes: #154277
-- Wichert Akkerman <debian@extern.wiggy.net> UNRELEASED
done
dselect: $(OBJECTS) ../lib/libdpkg.a
- $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) -lncurses $(LIBS) $(NLS_LIBS)
+ $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(CURSES_LIBS) $(LIBS) $(NLS_LIBS)
basecmds.o: helpmsgs.h
curkeys.o: curkeys.h
#include <dpkg.h>
#include <dpkg-db.h>
+#ifndef HAVE_VA_COPY
+#define __va_copy(dest,src) (dest) = (src)
+#endif
+
inline void varbufaddc(struct varbuf *v, int c) {
if (v->used >= v->size) varbufextend(v);
v->buf[v->used++]= c;
";
}
-sub rewrite_gnu_cpu {
+sub rewrite_gnu {
local ($_) = @_;
s/(?:i386|i486|i586|i686|pentium)(.*linux)/i386$1/;
s/ppc/powerpc/;
+ s/openbsd([\d\.]+$)/openbsd/;
+ s/-unknown-/-/;
return $_;
}
local (@list);
local ($a);
- $gnu = &rewrite_gnu_cpu($gnu);
+ $gnu = &rewrite_gnu($gnu);
foreach $a (keys %archtable) {
push @list, $a if $archtable{$a} eq $gnu;
if (m/^-a/) {
$req_host_arch = $';
} elsif (m/^-t/) {
- $req_host_gnu_type = &rewrite_gnu_cpu($');
+ $req_host_gnu_type = &rewrite_gnu($');
} elsif (m/^-[lsu]$/) {
$action = $_;
$action =~ s/^-//;
}
if ($d =~ /^\177ELF$/) { # ELF binary
return 1;
+ } elsif (unpack ('N', $d) == 2156265739) { # obsd dyn bin
+ return 1;
+ } elsif (unpack ('N', $d) == 8782091) { # obsd stat bin
+ return 1;
} elsif ($d =~ /^\#\!..$/) { # shell script
return 0;
} elsif (unpack ('N', $d) == 0xcafebabe) { # JAVA binary
# define OSHURD
#elif defined(__sparc__)
# define OSsunos
-#elif defined(OPENBSD)
+#elif defined(OPENBSD) || defined(__OpenBSD__)
# define OSOpenBSD
#elif defined(hpux)
# define OShpux