Bug 44645 - mjpegtools 1.6.2 won't compile without X
Bug#: 44645 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: major Priority: P2
Resolution: DUPLICATE Assigned To: media-video@gentoo.org Reported By: scott-gentoo@gelatinous.com
Component: Applications
URL: 
Summary: mjpegtools 1.6.2 won't compile without X
Keywords:  
Status Whiteboard: 
Opened: 2004-03-13 23:47 0000
Description:   Opened: 2004-03-13 23:47 0000
My machine does not have X11 installed, and I have '-X' in my USE flags. 
However compiling mjpegtools 1.6.2 gives the following error:

(cd .libs && rm -f liblavplay.la && ln -s ../liblavplay.la liblavplay.la)
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include
-DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.2\" -I/usr/local/include
-I/usr/include/quicktime  -I /usr/X11R6/include -I../utils 
-I/usr/include/jpeg-mmx    -mcpu=i686 -march=i686 -O3 -march=pentium2
-funroll-loops -pipe -mno-sse2 -Wall -Wunused -MT lavplay.o -MD -MP -MF
".deps/lavplay.Tpo" \
  -c -o lavplay.o `test -f 'lavplay.c' || echo './'`lavplay.c; \
then mv -f ".deps/lavplay.Tpo" ".deps/lavplay.Po"; \
else rm -f ".deps/lavplay.Tpo"; exit 1; \
fi
/bin/sh ../libtool --mode=link gcc  -mcpu=i686 -march=i686 -O3 -march=pentium2
-funroll-loops -pipe -mno-sse2 -Wall -Wunused   -o lavplay  lavplay.o
../utils/libmjpegutils.a liblavplay.la liblavjpeg.la liblavfile.la -lpthread
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread  -lX11 
gcc -mcpu=i686 -march=i686 -O3 -march=pentium2 -funroll-loops -pipe -mno-sse2
-Wall -Wunused -o .libs/lavplay lavplay.o -Wl,-rpath -Wl,/usr/lib 
../utils/libmjpegutils.a ./.libs/liblavplay.so ./.libs/liblavjpeg.so
-L/usr/include/jpeg-mmx ./.libs/liblavfile.so -L/usr/lib
/usr/lib/libquicktime.so /usr/lib/libjpeg.so -L/usr/local/lib /usr/lib/libdv.so
/usr/lib/libglib.so /usr/lib/libSDL.so -lm -ldl /usr/lib/libasound.so -lvga
-lpthread -lX11
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld:
cannot find -lX11
collect2: ld returned 1 exit status
distcc[3202] ERROR: compile on localhost failed
make[2]: *** [lavplay] Error 1
make[2]: Leaving directory
`/var/tmp/portage/mjpegtools-1.6.2/work/mjpegtools-1.6.2/lavtools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/mjpegtools-1.6.2/work/mjpegtools-1.6.2'
make: *** [all] Error 2

!!! ERROR: media-video/mjpegtools-1.6.2 failed.
!!! Function src_compile, Line 77, Exitcode 2
!!! compile problem


Reproducible: Always
Steps to Reproduce:
1. emerge unmerge xfree86
2. ACCEPT_KEYWORDS="~x86" USE="-X" emerge mjpegtools
3.




seems to be a problem with configure.in -- it checks if X_DISPLAY_MISSING is
defined in X_CFLAGS, but it should probably check CFLAGS or some other
variable.
 observe my config.log excerpt:

| #define HAVE_LIBDL 1
| #define HAVE_LIBDV 1
| #define X_DISPLAY_MISSING 1
| #define HAVE_X 1
| #define HAVE___PROGNAME
| /* end confdefs.h.  */

so it notices that X is missing, but the test for X_DISPLAY_MISSING didn't
execute correctly, so it set HAVE_X.  Here is the relevant configure.in code:

dnl *********************************************************************
dnl  Lets find where xwindows lives on this machine. Punt if not found.
AC_PATH_XTRA

have_x=false
if test x"-DX_DISPLAY_MISSING" = x"$X_CFLAGS"; then
  AC_MSG_WARN(can not find X11)
else
  have_x=true
  AC_DEFINE(HAVE_X, 1, [Whether XFree86 is available])
fi                
AM_CONDITIONAL(HAVE_X, test x$have_x = xtrue)

------- Comment #1 From Patrick Kursawe 2004-03-18 00:27:47 0000 -------
Just added the patch to this version aswell, should be soon in portage. Thanks
for reporting.

*** This bug has been marked as a duplicate of 36771 ***