Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Patch against DjView 4.7 to disable plug-in builds without an X11-based Qt, and make clear why
--- djview-4.7-pristine/configure.ac 2011-03-06 17:15:58.000000000 +0000
+++ djview-4.7-state-noCocoa/configure.ac 2011-04-13 08:21:08.000000000 +0100
@@ -59,12 +59,10 @@
case "$host" in
*-darwin* | *-macos10*)
if test -d /opt/local ; then
- CFLAGS="$CFLAGS -I/opt/local/include"
- CXXFLAGS="$CXXFLAGS -I/opt/local/include"
+ CPPFLAGS="$CPPFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"
elif test -d /sw ; then
- CFLAGS="$CFLAGS -I/sw/include"
- CXXFLAGS="$CXXFLAGS -I/sw/include"
+ CPPFLAGS="$CPPFLAGS -I/sw/include"
LDFLAGS="$LDFLAGS -L/sw/lib"
fi
;;
@@ -156,10 +154,30 @@
AC_PATH_X
AC_PATH_XTRA
if test "$no_x" = yes; then
- ac_nsdejavu = no
+ ac_nsdejavu=no
AC_MSG_WARN([Disabling plugin compilation (missing X11 include files).])
fi
-
+fi
+
+if test "$ac_nsdejavu" != no ; then
+ AC_MSG_CHECKING([whether Qt uses X11])
+ AC_EGREP_CPP(Q_WindowSystem_is_X11,
+ [
+ #include <QtCore/QtGlobal>
+ #ifdef Q_WS_X11
+ Q_WindowSystem_is_X11
+ #endif
+ ], is_QT_X11=yes, is_QT_X11=no)
+ AC_MSG_RESULT([$is_QT_X11])
+ if test "$is_QT_X11" != yes ; then
+ ac_nsdejavu=no
+ AC_MSG_WARN([Disabling plugin compilation (Qt isn't using X11).])
+ AC_MSG_NOTICE([If you have an X11-supporting Qt, try:])
+ AC_MSG_NOTICE([ CPPFLAGS=-D__USE_WS_X11__ ./configure ...])
+ fi
+fi
+
+if test "$ac_nsdejavu" != no ; then
ac_xt=yes
ac_glib=yes
AC_PATH_GLIB([],[ac_glib=no])
@@ -176,6 +194,7 @@
else
AC_MSG_WARN([Xt not found. Compiling plugin with XEmbed only.])
if test "$ac_glib" = no ; then
+ ac_nsdejavu=no
AC_MSG_WARN([Disabling plugin compilation (need Xt and/or Glib2.)])
fi
fi
@@ -362,7 +381,9 @@
# ----------------------------------------
AC_CONFIG_FILES(Makefile)
-AC_CONFIG_FILES(nsdejavu/Makefile)
+if test "$ac_nsdejavu" != no ; then
+ AC_CONFIG_FILES(nsdejavu/Makefile)
+fi
AC_CONFIG_FILES(desktopfiles/Makefile)
AC_OUTPUT
--- djview-4.7-pristine/nsdejavu/README 2011-03-06 17:15:58.000000000 +0000
+++ djview-4.7-state-noCocoa/nsdejavu/README 2011-04-13 08:13:45.000000000 +0100
@@ -1,6 +1,7 @@
-This is the main directory for UNIX-based DjVu netscape plugin. It's not
-enough to compile this module to obtain a fully functioning plugin. You also
-need to compile djview (standalone DjVu viewer)
-
-
-
+This is the main directory for the X11/UNIX-based DjVu NPAPI browser plug-in.
+It's not enough to compile just this module to obtain a fully functioning
+plug-in -- you also need to compile djview (the standalone DjVu viewer) using
+an X11-based Qt. The plug-in requires an X11-based browser supporting NPAPI's
+Xt or XEmbed. It's possible to build the plug-in for Mac OS X but you'll
+probably have to build your own X11-based browser too because the stock Safari
+and all downloadable builds of popular browsers for OS X are Cocoa-based.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment