clip arrow bevel
[wmaker-crm.git] / acinclude.m4
blobf0f906b182ee488c34aeb06948ef8cb4483fe0dd
1 #!/bin/sh
3 dnl
4 dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
5 dnl
6 AC_DEFUN(WM_CHECK_LIB,
8 LDFLAGS_old="$LDFLAGS"
9 LDFLAGS="$LDFLAGS $lib_search_path"
10 AC_CHECK_LIB([$1],[$2],yes=yes,no=no,[$3])
11 LDFLAGS="$LDFLAGS_old"
15 dnl
16 dnl WM_CHECK_HEADER(NAME)
17 dnl
18 AC_DEFUN(WM_CHECK_HEADER,
20 CPPFLAGS_old="$CPPFLAGS"
21 CPPFLAGS="$CPPFLAGS $inc_search_path"
22 AC_CHECK_HEADER([$1])
23 CPPFLAGS="$CPPFLAGS_old"
27 dnl
28 dnl WM_CHECK_REDCRAP_BUGS(prefix,bindir,libdir)
29 dnl
30 AC_DEFUN(WM_CHECK_REDCRAP_BUGS,
32 AC_MSG_CHECKING(for RedHat system)
33 wm_check_flag='no :)'
34 rh_is_redhat=no
35 if test -f /etc/redhat-release; then
36 wm_check_flag=yes
37 rh_is_redhat=yes
39 AC_MSG_RESULT($wm_check_flag)
41 mins_found=no
42 bugs_found=no
43 if test "$wm_check_flag" = yes; then
44 echo
45 AC_MSG_WARN([Red Hat system; checking for Red-Hat-specific bugs.])
46 echo
48 # Check old wmaker from RedHat
50 if test "[$1]" != "/usr/X11R6" -a "$prefix" != "/usr/X11"; then
51 AC_MSG_CHECKING(for multiple installed wmaker versions)
52 if test -f /usr/X11R6/bin/wmaker; then
53 AC_MSG_RESULT(uh oh)
54 mins_found=yes
55 rh_old_wmaker=yes
56 else
57 rh_old_wmaker=no
58 AC_MSG_RESULT(no apparent problems)
62 # Check for infamous en_RN bug
63 # Wont work because autoconf will change LANG in the beginning of the
64 # script.
67 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
68 #echo $LANG
69 #if test "x$LANG" = xen_RN; then
70 #AC_MSG_RESULT(uh oh)
71 #AC_MSG_WARN([the LANG environment variable is set to the en_RN
72 #locale. Please unset it or you will have mysterious problems when
73 #using various software packages.])
74 #bugs_found=yes
75 #else
76 #AC_MSG_RESULT(no problem)
77 #fi
79 # If binary installation path is /usr/local/bin, check if it's in PATH
81 if test "[$2]" = "/usr/local/bin"; then
82 AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
83 wm_check_flag=no
84 rh_missing_usr_local_bin=yes
85 old_IFS="$IFS"
86 IFS=":"
87 for i in $PATH; do
88 if test "x$i" = "x/usr/local/bin"; then
89 wm_check_flag=yes
90 rh_missing_usr_local_bin=no
91 break;
93 done
94 IFS="$old_IFS"
95 if test "$wm_check_flag" = no; then
96 AC_MSG_RESULT(uh oh)
97 bugs_found=yes
98 else
99 AC_MSG_RESULT(no problem)
103 # If library installation path is /usr/local/lib,
104 # check if it's in /etc/ld.so.conf
106 if test "[$3]" = "/usr/local/lib"; then
107 wm_check_flag=yes
108 rh_missing_usr_local_lib=no
109 AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
110 test -z "`grep /usr/local/lib /etc/ld.so.conf`"
111 test "$?" -eq 0 && wm_check_flag=no
112 if test "$wm_check_flag" = no; then
113 AC_MSG_RESULT(uh oh)
114 rh_missing_usr_local_lib=yes
115 bugs_found=yes
116 else
117 AC_MSG_RESULT(no problem)
121 # Check for symbolic links
123 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
124 rh_missing_usr_include_x11=no
125 if test -d "/usr/include/X11"; then
126 AC_MSG_RESULT(found)
127 else
128 AC_MSG_RESULT(uh oh)
129 rh_missing_usr_include_x11=yes
130 mins_found=yes
134 # Check for /lib/cpp
136 AC_MSG_CHECKING(for /lib/cpp)
137 rh_missing_lib_cpp=no
138 if test -f "/lib/cpp"; then
139 AC_MSG_RESULT(found)
140 else
141 AC_MSG_RESULT(uh oh)
142 rh_missing_lib_cpp=yes
143 bugs_found=yes
146 echo
152 dnl WM_PRINT_REDCRAP_BUG_STATUS()
154 AC_DEFUN(WM_PRINT_REDCRAP_BUG_STATUS,
156 if test "$rh_is_redhat" = yes; then
157 if test "$mins_found" = yes -o "$bugs_found" = yes; then
158 echo
159 AC_MSG_WARN([It seems you are using a system packaged by Red Hat.
160 I have done some checks for Red-Hat-specific bugs, and I found some
161 problems. Please read the INSTALL file regarding Red Hat, resolve
162 the problems, and try to run configure again.
164 Here are the problems I found:
166 if test "x$rh_old_wmaker" = xyes; then
167 echo "Problem: Old version of Window Maker in /usr/X11R6/bin."
168 echo "Description: You seem to have an old version of Window Maker"
169 echo " installed in /usr/X11R6/bin. It is recommended"
170 echo " that you uninstall any previously installed"
171 echo " packages of WindowMaker before installing a new one."
172 echo
174 if test "x$rh_missing_usr_local_bin" = xyes; then
175 echo "Problem: PATH is missing /usr/local/bin."
176 echo "Description: Your PATH environment variable does not appear to"
177 echo " contain the directory /usr/local/bin. Please add it."
178 echo
180 if test "x$rh_missing_usr_local_lib" = xyes; then
181 echo "Problem: /etc/ld.so.conf missing /usr/local/lib"
182 echo "Description: Your /etc/ld.so.conf file does not appear to contain"
183 echo " the directory /usr/local/lib. Please add it."
184 echo
186 if test "x$rh_missing_usr_x11" = xyes; then
187 echo "Problem: Missing /usr/X11 symbolic link."
188 echo "Description: Your system is missing a symbolic link from"
189 echo " /usr/X11R6 to /usr/X11. Please create one."
190 echo
192 if test "x$rh_missing_usr_include_x11" = xyes; then
193 echo "Problem: Missing /usr/include/X11 symbolic link."
194 echo "Description: Your system is missing a symbolic link from"
195 echo " /usr/X11R6/include/X11 to /usr/include/X11."
196 echo " Please create one."
197 echo
199 if test "x$rh_missing_lib_cpp" = xyes; then
200 echo "Problem: Missing /lib/cpp symbolic link."
201 echo "Description: Your system is missing a symbolic link from the"
202 echo " cpp (C preprocessor) program to /lib/cpp."
203 echo " Please create one."
204 echo
206 if test "x$bugs_found" = xyes; then
207 AC_MSG_ERROR([One or more of the problems above can potentially
208 cause Window Maker not to install or run properly. Please resolve
209 the problems and try to run configure again.])
210 exit 1
211 elif test "x$mins_found" = xyes; then
212 AC_MSG_WARN([The problems above may or may not cause Window Maker
213 not to install or run properly. If you have any problems during
214 installation or execution, please resolve the problems and try to
215 install Window Maker again.])
216 echo
218 else
219 echo
220 echo "You appear to have a system packaged by Red Hat, but I could"
221 echo "not find any Red-Hat-specific problems that I know about."
222 echo