--- nv-tv-out--upstream/ChangeLog Thu Oct 30 13:14:16 2003 +++ nv-tv-out--freebsd/ChangeLog Thu Oct 30 13:55:15 2003 @@ -1,3 +1,11 @@ +2003-10-30 Samuel Tardieu + + * configure: Use "sed" instead of "expr substr" for increased + portability ("expr substr" does not exist on some versions of + "expr", including the FreeBSD one). + * src/card_direct.c: Add iopl() and ioperm() compatibility + functions for FreeBSD. + 2003-06-02 Dirk Thierbach RELEASE alpha version 0.4.5 --- nv-tv-out--upstream/configure.in Thu Oct 30 13:14:16 2003 +++ nv-tv-out--freebsd/configure.in Thu Oct 30 13:15:01 2003 @@ -172,7 +172,7 @@ AC_DEFINE(HAVE_X,1,[Define to 1 if X is available and used.]) OBJS_EXTRA="$OBJS_EXTRA actions.o" if test ${have_gtk} != no ; then - have_gtk_version=`expr substr ${have_gtk} 4 1` + have_gtk_version=`echo ${have_gtk} | sed -e 's/^...\(.\).*/\1/'` AC_DEFINE(HAVE_GTK,1,[Define to 1 if GTK is available and used.]) AC_DEFINE_UNQUOTED(HAVE_GTK_VERSION,${have_gtk_version},[Define to 1/2 for GTK major version.]) OBJS_GUI="gui.o gui_bt.o gui_cx.o gui_ch.o gui_ph.o gui_nv.o gui_tdfx.o gui_i810.o" @@ -249,6 +249,12 @@ AC_CHECK_LIB(pci,pci_init,LIBS="$LIBS -lpci", AC_MSG_ERROR(pci library required)) fi + +dnl +dnl Check for GNU getopt (needed on FreeBSD systems) +dnl + +AC_CHECK_LIB(gnugetopt,getopt_long,LIBS="$LIBS -lgnugetopt") dnl dnl Check for other X libraries --- nv-tv-out--upstream/src/card_direct.c Thu Oct 30 13:14:16 2003 +++ nv-tv-out--freebsd/src/card_direct.c Thu Oct 30 13:01:19 2003 @@ -64,6 +64,21 @@ #include "winio.h" #endif +/* FreeBSD does not have ioperm() and iopl() but can easily emulate them */ + +#ifdef __FreeBSD__ + +#define ioperm i386_set_ioperm + +static int +iopl (int level) +{ + if (open ("/dev/io", O_RDWR) == -1) return EPERM; + return 0; +} + +#endif /* __FreeBSD__ */ + /* -------- mmap on devices -------- */ /* originally from os-support/linux/lnx_video.c */