1 # Try to configure the XAW client (gui-xaw)
4 # Test for X and XAW libraries needed for gui-xaw
6 AC_DEFUN([FC_XAW_CLIENT],
8 AC_REQUIRE([AC_PATH_XTRA])
9 if test "x$gui_xaw" = "xyes" || test "x$client" = "xall" ||
10 test "x$client" = "xauto" ; then
14 dnl Determine the Xfuncproto control definitions:
15 FC_CHECK_X_PROTO_DEFINE(FUNCPROTO)
16 if test -n "$fc_x_proto_value"; then
17 AC_DEFINE_UNQUOTED([FUNCPROTO], [$fc_x_proto_value], [Xfuncproto])
19 FC_CHECK_X_PROTO_DEFINE(NARROWPROTO)
20 if test -n "$fc_x_proto_value"; then
21 AC_DEFINE_UNQUOTED([NARROWPROTO], [$fc_x_proto_value], [Narrowproto])
27 PKG_CHECK_MODULES([PNG], [libpng],
29 X_LIBS="$X_LIBS $PNG_LIBS"
30 X_CFLAGS="$X_CFLAGS $PNG_CFLAGS"
33 AC_CHECK_LIB([png12], [png_read_image], [X_LIBS="$X_LIBS -lpng12 -lm"],
35 AC_CHECK_LIB([png], [png_read_image], [X_LIBS="$X_LIBS -lpng -lm"],
37 FC_NO_CLIENT([xaw], [Could not find PNG library.])
41 AC_CHECK_HEADER([png.h],,
43 FC_NO_CLIENT([xaw], [libpng found but not png.h.
44 You may need to install a libpng "development" package.])
49 dnl Try to get additional Xpm paths:
52 if test "$xpm_incdir" != "no"; then
53 X_CFLAGS="$X_CFLAGS -I$xpm_incdir"
55 if test "$xpm_libdir" != "no"; then
56 X_LIBS="$X_LIBS -L$xpm_libdir"
57 dnl Try using R values set in AC_PATH_XTRA:
58 if test "$ac_R_nospace" = "yes"; then
59 X_LIBS="$X_LIBS -R$xpm_libdir"
60 elif test "$ac_R_space" = "yes"; then
61 X_LIBS="$X_LIBS -R $xpm_libdir"
63 dnl Some sites may put xpm.h in a directory whose parent isn't "X11"
64 if test "x$xpm_h_no_x11" = "xyes"; then
65 AC_DEFINE([XPM_H_NO_X11], [1], [XPM support])
69 dnl Checks for X libs:
70 fc_save_X_LIBS="$X_LIBS"
71 X_LIBS="$X_LIBS $X_PRE_LIBS"
72 FC_CHECK_X_LIB(X11, XOpenDisplay, , haveX11=no)
73 if test "x$haveX11" != "xno"; then
74 FC_CHECK_X_LIB(Xext, XShapeCombineMask)
76 dnl Insert X_PRE_LIBS (eg -lSM -lICE) into X_EXTRA_LIBS here:
77 X_EXTRA_LIBS="$X_PRE_LIBS $X_EXTRA_LIBS"
78 X_LIBS="$fc_save_X_LIBS"
80 FC_CHECK_X_LIB(Xt, main)
81 FC_CHECK_X_LIB(Xmu, main)
82 FC_CHECK_X_LIB(Xpm, XpmReadFileToPixmap, , haveXpm=no)
83 if test "x$haveXpm" != "xno"; then
85 if test -n "$WITH_XAW3D"; then
86 FC_CHECK_X_LIB(Xaw3d, main, , AC_MSG_ERROR(did not find Xaw3d library))
88 FC_CHECK_X_LIB(Xaw, main, , AC_MSG_ERROR(did not find Xaw library))
91 gui_xaw_cflags="$X_CFLAGS"
92 gui_xaw_libs="$X_LIBS $X_EXTRA_LIBS"
98 if test "x$found_client" = "xyes" && test "x$no_png" != "xyes"; then
100 if test "x$client" = "xauto" ; then
103 elif test "x$gui_xaw" = "xyes"; then
104 if test "x$haveXpm" = "xno"; then
105 AC_MSG_ERROR(specified client 'xaw' not configurable -- need Xpm library and development headers; perhaps try/adjust --with-xpm-lib)
107 AC_MSG_ERROR(specified client 'xaw' not configurable -- need X11 libraries and development headers; perhaps try/adjust --x-libraries)