| 1 |
dnl |
| 2 |
dnl ice_find_athena.m4 |
| 3 |
dnl |
| 4 |
dnl ----------------------------------------------------------- |
| 5 |
dnl |
| 6 |
dnl * To: [email protected] |
| 7 |
dnl * Subject: ice_find_athena.m4 |
| 8 |
dnl * From: Andreas Zeller |
| 9 |
dnl * Date: Sat, 29 Nov 1997 17:14:09 +0100 (MET) |
| 10 |
dnl * Sender: [email protected] |
| 11 |
dnl |
| 12 |
dnl Modified by Andrey Kiselev <[email protected]>, 2006. |
| 13 |
dnl |
| 14 |
dnl ----------------------------------------------------------- |
| 15 |
dnl |
| 16 |
dnl ICE_FIND_ATHENA |
| 17 |
dnl --------------- |
| 18 |
dnl |
| 19 |
dnl Find Athena libraries and headers. |
| 20 |
dnl Put Athena include directory in athena_includes, |
| 21 |
dnl put Athena library directory in athena_libraries, |
| 22 |
dnl and set appropriate flags to XAW_CFLAGS and XAW_LIBS. |
| 23 |
dnl |
| 24 |
dnl |
| 25 |
AC_DEFUN([ICE_FIND_ATHENA], |
| 26 |
[ |
| 27 |
AC_REQUIRE([AC_PATH_XTRA]) |
| 28 |
athena_includes= |
| 29 |
athena_libraries= |
| 30 |
AC_ARG_WITH(athena, |
| 31 |
AS_HELP_STRING([--without-athena], [do not use Athena widgets])) |
| 32 |
dnl Treat --without-athena like |
| 33 |
dnl --without-athena-includes --without-athena-libraries. |
| 34 |
if test "$with_athena" = "no" |
| 35 |
then |
| 36 |
athena_includes=no |
| 37 |
athena_libraries=no |
| 38 |
fi |
| 39 |
AC_ARG_WITH(athena-includes, |
| 40 |
AS_HELP_STRING([--with-athena-includes=DIR], |
| 41 |
[Athena include files are in DIR]), |
| 42 |
[athena_includes="$withval"]) |
| 43 |
AC_ARG_WITH(athena-libraries, |
| 44 |
AS_HELP_STRING([--with-athena-libraries=DIR], |
| 45 |
[Athena libraries are in DIR]), |
| 46 |
[athena_libraries="$withval"]) |
| 47 |
AC_MSG_CHECKING(for Athena) |
| 48 |
# |
| 49 |
# |
| 50 |
# Search the include files. |
| 51 |
# |
| 52 |
if test "$athena_includes" = ""; then |
| 53 |
AC_CACHE_VAL(ice_cv_athena_includes, |
| 54 |
[ |
| 55 |
ice_athena_save_LIBS="$LIBS" |
| 56 |
ice_athena_save_CFLAGS="$CFLAGS" |
| 57 |
ice_athena_save_CPPFLAGS="$CPPFLAGS" |
| 58 |
ice_athena_save_LDFLAGS="$LDFLAGS" |
| 59 |
# |
| 60 |
LIBS="$X_PRE_LIBS -lXaw -lXmu -lXext -lXt -lX11 $X_EXTRA_LIBS $LIBS" |
| 61 |
CFLAGS="$X_CFLAGS $CFLAGS" |
| 62 |
CPPFLAGS="$X_CFLAGS $CPPFLAGS" |
| 63 |
LDFLAGS="$X_LIBS $LDFLAGS" |
| 64 |
# |
| 65 |
AC_TRY_COMPILE([ |
| 66 |
#include <X11/Intrinsic.h> |
| 67 |
#include <X11/Xaw/Text.h> |
| 68 |
],[int a;], |
| 69 |
[ |
| 70 |
# X11/Xaw/Text.h is in the standard search path. |
| 71 |
ice_cv_athena_includes= |
| 72 |
], |
| 73 |
[ |
| 74 |
# X11/Xaw/Text.h is not in the standard search path. |
| 75 |
# Locate it and put its directory in `athena_includes' |
| 76 |
# |
| 77 |
# /usr/include/Motif* are used on HP-UX (Motif). |
| 78 |
# /usr/include/X11* are used on HP-UX (X and Athena). |
| 79 |
# /usr/dt is used on Solaris (Motif). |
| 80 |
# /usr/openwin is used on Solaris (X and Athena). |
| 81 |
# Other directories are just guesses. |
| 82 |
for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ |
| 83 |
/usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \ |
| 84 |
/usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \ |
| 85 |
/usr/dt/include /usr/openwin/include \ |
| 86 |
/usr/dt/*/include /opt/*/include /usr/include/Motif* \ |
| 87 |
"${prefix}"/*/include /usr/*/include /usr/local/*/include \ |
| 88 |
"${prefix}"/include/* /usr/include/* /usr/local/include/*; do |
| 89 |
if test -f "$dir/X11/Xaw/Text.h"; then |
| 90 |
ice_cv_athena_includes="$dir" |
| 91 |
break |
| 92 |
fi |
| 93 |
done |
| 94 |
]) |
| 95 |
# |
| 96 |
LIBS="$ice_athena_save_LIBS" |
| 97 |
CFLAGS="$ice_athena_save_CFLAGS" |
| 98 |
CPPFLAGS="$ice_athena_save_CPPFLAGS" |
| 99 |
LDFLAGS="$ice_athena_save_LDFLAGS" |
| 100 |
]) |
| 101 |
athena_includes="$ice_cv_athena_includes" |
| 102 |
fi |
| 103 |
# |
| 104 |
# |
| 105 |
# Now for the libraries. |
| 106 |
# |
| 107 |
if test "$athena_libraries" = ""; then |
| 108 |
AC_CACHE_VAL(ice_cv_athena_libraries, |
| 109 |
[ |
| 110 |
ice_athena_save_LIBS="$LIBS" |
| 111 |
ice_athena_save_CFLAGS="$CFLAGS" |
| 112 |
ice_athena_save_CPPFLAGS="$CPPFLAGS" |
| 113 |
ice_athena_save_LDFLAGS="$LDFLAGS" |
| 114 |
# |
| 115 |
LIBS="$X_PRE_LIBS -lXaw -lXmu -lXext -lXt -lX11 $X_EXTRA_LIBS $LIBS" |
| 116 |
CFLAGS="$X_CFLAGS $CFLAGS" |
| 117 |
CPPFLAGS="$X_CFLAGS $CPPFLAGS" |
| 118 |
LDFLAGS="$X_LIBS $LDFLAGS" |
| 119 |
# |
| 120 |
AC_TRY_LINK([ |
| 121 |
#include <X11/Intrinsic.h> |
| 122 |
#include <X11/Xaw/Text.h> |
| 123 |
],[XtToolkitInitialize();], |
| 124 |
[ |
| 125 |
# libXaw.a is in the standard search path. |
| 126 |
ice_cv_athena_libraries="yes" |
| 127 |
], |
| 128 |
[ |
| 129 |
ice_cv_athena_libraries="no" |
| 130 |
]) |
| 131 |
# |
| 132 |
LIBS="$ice_athena_save_LIBS" |
| 133 |
CFLAGS="$ice_athena_save_CFLAGS" |
| 134 |
CPPFLAGS="$ice_athena_save_CPPFLAGS" |
| 135 |
LDFLAGS="$ice_athena_save_LDFLAGS" |
| 136 |
]) |
| 137 |
# |
| 138 |
if test "${ice_cv_athena_libraries}" = "no" ; then |
| 139 |
athena_libraries="no" |
| 140 |
fi |
| 141 |
fi |
| 142 |
|
| 143 |
# Set Athena definitions |
| 144 |
# |
| 145 |
if test "$athena_includes" != "" \ |
| 146 |
-a "$athena_includes" != "$x_includes" \ |
| 147 |
-a "$athena_includes" != "no" ; then |
| 148 |
XAW_CFLAGS="-I$athena_includes" |
| 149 |
else |
| 150 |
XAW_CFLAGS="" |
| 151 |
fi |
| 152 |
|
| 153 |
if test "$athena_libraries" != "" \ |
| 154 |
-a "$athena_libraries" != "$x_libraries" \ |
| 155 |
-a "$athena_libraries" != "no" ; then |
| 156 |
XAW_LIBS="-L$athena_libraries -lXaw" |
| 157 |
dnl case "$X_LIBS" in |
| 158 |
dnl *-R\ *) X_LIBS="-L$athena_libraries -R $athena_libraries $X_LIBS";; |
| 159 |
dnl *-R*) X_LIBS="-L$athena_libraries -R$athena_libraries $X_LIBS";; |
| 160 |
dnl *) X_LIBS="-L$athena_libraries $X_LIBS";; |
| 161 |
dnl esac |
| 162 |
else |
| 163 |
XAW_LIBS="-lXaw" |
| 164 |
fi |
| 165 |
# |
| 166 |
|
| 167 |
if test "x${athena_libraries}" = x"no" ; then |
| 168 |
no_xaw="yes" |
| 169 |
fi |
| 170 |
|
| 171 |
athena_libraries_result="$athena_libraries" |
| 172 |
athena_includes_result="$athena_includes" |
| 173 |
test "$athena_libraries_result" = "" && |
| 174 |
athena_libraries_result="in default path" |
| 175 |
test "$athena_includes_result" = "" && |
| 176 |
athena_includes_result="in default path" |
| 177 |
test "$athena_libraries_result" = "no" && |
| 178 |
athena_libraries_result="(none)" |
| 179 |
test "$athena_includes_result" = "no" && |
| 180 |
athena_includes_result="(none)" |
| 181 |
AC_MSG_RESULT( |
| 182 |
[libraries $athena_libraries_result, headers $athena_includes_result]) |
| 183 |
AC_SUBST([XAW_CFLAGS]) |
| 184 |
AC_SUBST([XAW_LIBS]) |
| 185 |
])dnl |
| 186 |
nn |