0.51.1 pre snapshot. Be careful, it may be buggy. It fixes some bugs though.
[wmaker-crm.git] / acinclude.m4
blobb7b89c9baaa3d54d9a44c46f8b4c19ed52aebaee
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="-DBEGIN $LDFLAGS -DEND $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 if test -f /etc/redhat-release; then
35 wm_check_flag=yes
37 AC_MSG_RESULT($wm_check_flag)
39 mins_found=no
40 bugs_found=no
41 if test "$wm_check_flag" = yes; then
42 echo
43 AC_MSG_WARN([it seems you are using a system packaged by RedHat.
44 I will now do some checks for RedHat specific bugs. If some check
45 fail, please read the INSTALL file regarding RedHat, resolve the
46 problem and retry to configure.])
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 AC_MSG_WARN([you seem to have an old version of Window Maker
56 installed at /usr/X11R6/bin. It is recommended that you uninstall
57 any previously installed packages of WindowMaker before installing
58 a new one.])
59 mins_found=yes
60 else
61 AC_MSG_RESULT(no apparent problems)
65 # Check for infamous en_RN bug
66 # Wont work because autoconf will change LANG in the beginning of the
67 # script.
70 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
71 #echo $LANG
72 #if test "x$LANG" = xen_RN; then
73 #AC_MSG_RESULT(uh oh)
74 #AC_MSG_WARN([the LANG environment variable is set to the en_RN
75 #locale. Please unset it or you will have mysterious problems when
76 #using various software packages.])
77 #bugs_found=yes
78 #else
79 #AC_MSG_RESULT(no problem)
80 #fi
82 # If binary installation path is /usr/local/bin, check if it's in PATH
84 if test "[$2]" = "/usr/local/bin"; then
85 AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
86 wm_check_flag=no
87 old_IFS="$IFS"
88 IFS=":"
89 for i in $PATH; do
90 if test "x$i" = "x/usr/local/bin"; then
91 wm_check_flag=yes
92 break;
94 done
95 IFS="$old_IFS"
96 if test "$wm_check_flag" = no; then
97 AC_MSG_RESULT(uh oh)
98 AC_MSG_WARN([/usr/local/bin is not in the PATH environment variable.
99 Please resolve the problem.])
100 bugs_found=yes
101 else
102 AC_MSG_RESULT(no problem)
106 # If library installation path is /usr/local/lib,
107 # check if it's in /etc/ld.so.conf
109 if test "[$3]" = "/usr/local/lib"; then
110 wm_check_flag=yes
111 AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
112 test -z "`grep /usr/local/lib /etc/ld.so.conf`"
113 test "$?" -eq 0 && wm_check_flag=no
114 if test "$wm_check_flag" = no; then
115 AC_MSG_RESULT(uh oh)
116 AC_MSG_WARN([/usr/local/lib is not in the /etc/ld.so.conf file.
117 Please add it there.])
118 bugs_found=yes
119 else
120 AC_MSG_RESULT(no problem)
124 # Check for symbolic links
126 AC_MSG_CHECKING(for /usr/X11 symbolic link)
127 if test -d "/usr/X11"; then
128 AC_MSG_RESULT(found)
129 else
130 AC_MSG_RESULT(uh oh)
131 AC_MSG_WARN([Please create a symbolic link from /usr/X11R6 to /usr/X11.])
132 mins_found=yes
134 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
135 if test -d "/usr/include/X11"; then
136 AC_MSG_RESULT(found)
137 else
138 AC_MSG_RESULT(uh oh)
139 AC_MSG_WARN([Please create a symbolic link from /usr/X11R6/include/X11
140 to /usr/include/X11.])
141 mins_found=yes
145 # Check for /lib/cpp
147 AC_MSG_CHECKING(for /lib/cpp)
148 if test -f "/lib/cpp"; then
149 AC_MSG_RESULT(found)
150 else
151 AC_MSG_RESULT(uh oh)
152 AC_MSG_WARN([Please create a symbolic link from the cpp (C preprocessor)
153 program to /lib/cpp])
154 bugs_found=yes
157 if test "x$bugs_found" = xyes; then
158 AC_MSG_ERROR([Some bugs that can potentially cause problems during
159 installation/execution were found. Please correct these problems
160 and retry later.])
161 exit 1
162 elif test "x$mins_found" = xyes; then
163 AC_MSG_WARN([Some minor problems that might or might not cause
164 problems were found. If you have any problems during
165 installation/execution, please resolve the pointed problems and try
166 to reinstall.])
167 echo "Press <Return> to continue."
168 read blabla
169 else
170 echo
171 echo "None of the RedHat problems known to this script were found."
172 echo