Again, don't be rude on people.
[wmaker-crm.git] / acinclude.m4
blob2b03013f5c7e8b373b24106db5c366a0ceb2f8f6
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"
28 dnl
29 dnl WM_CHECK_REDCRAP_BUGS(prefix,bindir,libdir)
30 dnl
31 AC_DEFUN(WM_CHECK_REDCRAP_BUGS,
33 AC_MSG_CHECKING(for RedHat system)
34 wm_check_flag='no :)'
35 rh_is_redhat=no
36 if test -f /etc/redhat-release; then
37 wm_check_flag=yes
38 rh_is_redhat=yes
40 AC_MSG_RESULT($wm_check_flag)
42 mins_found=no
43 bugs_found=no
44 if test "$wm_check_flag" = yes; then
45 echo
46 AC_MSG_WARN([Red Hat system; checking for Red-Hat-specific bugs.])
47 echo
49 # Check old wmaker from RedHat
51 if test "[$1]" != "/usr/X11R6" -a "$prefix" != "/usr/X11"; then
52 AC_MSG_CHECKING(for multiple installed wmaker versions)
53 if test -f /usr/X11R6/bin/wmaker; then
54 AC_MSG_RESULT(uh oh)
55 mins_found=yes
56 rh_old_wmaker=yes
57 else
58 rh_old_wmaker=no
59 AC_MSG_RESULT(no apparent problems)
63 # Check for infamous en_RN bug
64 # Wont work because autoconf will change LANG in the beginning of the
65 # script.
68 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
69 #echo $LANG
70 #if test "x$LANG" = xen_RN; then
71 #AC_MSG_RESULT(uh oh)
72 #AC_MSG_WARN([the LANG environment variable is set to the en_RN
73 #locale. Please unset it or you will have mysterious problems when
74 #using various software packages.])
75 #bugs_found=yes
76 #else
77 #AC_MSG_RESULT(no problem)
78 #fi
80 # If binary installation path is /usr/local/bin, check if it's in PATH
82 if test "[$2]" = "/usr/local/bin"; then
83 AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
84 wm_check_flag=no
85 rh_missing_usr_local_bin=yes
86 old_IFS="$IFS"
87 IFS=":"
88 for i in $PATH; do
89 if test "x$i" = "x/usr/local/bin"; then
90 wm_check_flag=yes
91 rh_missing_usr_local_bin=no
92 break;
94 done
95 IFS="$old_IFS"
96 if test "$wm_check_flag" = no; then
97 AC_MSG_RESULT(uh oh)
98 bugs_found=yes
99 else
100 AC_MSG_RESULT(no problem)
104 # If library installation path is /usr/local/lib,
105 # check if it's in /etc/ld.so.conf
107 if test "[$3]" = "/usr/local/lib"; then
108 wm_check_flag=yes
109 rh_missing_usr_local_lib=no
110 AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
111 test -z "`grep /usr/local/lib /etc/ld.so.conf`"
112 test "$?" -eq 0 && wm_check_flag=no
113 if test "$wm_check_flag" = no; then
114 AC_MSG_RESULT(uh oh)
115 rh_missing_usr_local_lib=yes
116 bugs_found=yes
117 else
118 AC_MSG_RESULT(no problem)
122 # Check for symbolic links
124 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
125 rh_missing_usr_include_x11=no
126 if test -d "/usr/include/X11"; then
127 AC_MSG_RESULT(found)
128 else
129 AC_MSG_RESULT(uh oh)
130 rh_missing_usr_include_x11=yes
131 mins_found=yes
135 # Check for /lib/cpp
137 AC_MSG_CHECKING(for /lib/cpp)
138 rh_missing_lib_cpp=no
139 if test -f "/lib/cpp"; then
140 AC_MSG_RESULT(found)
141 else
142 AC_MSG_RESULT(uh oh)
143 rh_missing_lib_cpp=yes
144 bugs_found=yes
147 echo
153 dnl WM_PRINT_REDCRAP_BUG_STATUS()
155 AC_DEFUN(WM_PRINT_REDCRAP_BUG_STATUS,
157 if test "$rh_is_redhat" = yes; then
158 if test "$mins_found" = yes -o "$bugs_found" = yes; then
159 echo
160 AC_MSG_WARN([It seems you are using a system packaged by Red Hat.
161 I have done some checks for Red-Hat-specific bugs, and I found some
162 problems. Please read the INSTALL file regarding Red Hat, resolve
163 the problems, and try to run configure again.
165 Here are the problems I found:
167 if test "x$rh_old_wmaker" = xyes; then
168 echo "Problem: Old version of Window Maker in /usr/X11R6/bin."
169 echo "Description: You seem to have an old version of Window Maker"
170 echo " installed in /usr/X11R6/bin. It is recommended"
171 echo " that you uninstall any previously installed"
172 echo " packages of WindowMaker before installing a new one."
173 echo
175 if test "x$rh_missing_usr_local_bin" = xyes; then
176 echo "Problem: PATH is missing /usr/local/bin."
177 echo "Description: Your PATH environment variable does not appear to"
178 echo " contain the directory /usr/local/bin. Please add it."
179 echo
181 if test "x$rh_missing_usr_local_lib" = xyes; then
182 echo "Problem: /etc/ld.so.conf missing /usr/local/lib"
183 echo "Description: Your /etc/ld.so.conf file does not appear to contain"
184 echo " the directory /usr/local/lib. Please add it."
185 echo
187 if test "x$rh_missing_usr_x11" = xyes; then
188 echo "Problem: Missing /usr/X11 symbolic link."
189 echo "Description: Your system is missing a symbolic link from"
190 echo " /usr/X11R6 to /usr/X11. Please create one."
191 echo
193 if test "x$rh_missing_usr_include_x11" = xyes; then
194 echo "Problem: Missing /usr/include/X11 symbolic link."
195 echo "Description: Your system is missing a symbolic link from"
196 echo " /usr/X11R6/include/X11 to /usr/include/X11."
197 echo " Please create one."
198 echo
200 if test "x$rh_missing_lib_cpp" = xyes; then
201 echo "Problem: Missing /lib/cpp symbolic link."
202 echo "Description: Your system is missing a symbolic link from the"
203 echo " cpp (C preprocessor) program to /lib/cpp."
204 echo " Please create one."
205 echo
207 if test "x$bugs_found" = xyes; then
208 AC_MSG_ERROR([One or more of the problems above can potentially
209 cause Window Maker not to install or run properly. Please resolve
210 the problems and try to run configure again.])
211 exit 1
212 elif test "x$mins_found" = xyes; then
213 AC_MSG_WARN([The problems above may or may not cause Window Maker
214 not to install or run properly. If you have any problems during
215 installation or execution, please resolve the problems and try to
216 install Window Maker again.])
217 echo
219 else
220 echo
221 echo "You appear to have a system packaged by Red Hat, but I could"
222 echo "not find any Red-Hat-specific problems that I know about."
223 echo