--- files/gentoo-config +++ files/gentoo-config @@ -41,3 +41,12 @@ INCTIFF = LIBTIFF = -ltiff INCX11 = LIBX11 = -lX11 + +# Most people have migrated libX11 to /usr/lib, but just in case ... +check_x11=$(shell \ + echo 'int main(){}' > test.c ; \ + if ! $(CC) test.c -lX11 -o /dev/null 2>/dev/null ; then \ + echo "-L/usr/X11R6/lib" ; \ + fi ; \ + rm -f test.c) +LIBX11 += $(call check_x11)