mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-31 19:12:32 +01:00
initiate
This commit is contained in:
329
plugins/aclocal.m4
vendored
329
plugins/aclocal.m4
vendored
@@ -10,6 +10,267 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
dnl
|
||||
dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
|
||||
dnl
|
||||
AC_DEFUN(WM_CHECK_LIB,
|
||||
[
|
||||
LDFLAGS_old="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $lib_search_path"
|
||||
AC_CHECK_LIB([$1],[$2],yes=yes,no=no,[$3])
|
||||
LDFLAGS="$LDFLAGS_old"
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl WM_CHECK_HEADER(NAME)
|
||||
dnl
|
||||
AC_DEFUN(WM_CHECK_HEADER,
|
||||
[
|
||||
CPPFLAGS_old="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $inc_search_path"
|
||||
AC_CHECK_HEADER([$1])
|
||||
CPPFLAGS="$CPPFLAGS_old"
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl WM_CHECK_PROPLIST_VERSION(MIN_VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
AC_DEFUN(WM_CHECK_PROPLIST_VERSION,
|
||||
[
|
||||
CPPFLAGS_old="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $inc_search_path"
|
||||
lPL_major_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
lPL_minor_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
lPL_micro_version=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
AC_MSG_CHECKING([whether libPropList is newer than $1])
|
||||
AC_CACHE_VAL(ac_cv_lib_proplist_version_ok,
|
||||
[AC_TRY_LINK(
|
||||
[/* Test version of libPropList we have */
|
||||
#include <proplist.h>
|
||||
|
||||
#if !defined(PROPLIST_VERSION) || PROPLIST_VERSION < $lPL_major_version*10000 + $lPL_minor_version*100 + $lPL_micro_version
|
||||
#error libPropList on this system is too old. Consider upgrading to at least $1
|
||||
#endif
|
||||
], [],
|
||||
eval "ac_cv_lib_proplist_version_ok=yes",
|
||||
eval "ac_cv_lib_proplist_version_ok=no")])
|
||||
if eval "test \"`echo '$ac_cv_lib_proplist_version_ok'`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$3], , , [$3
|
||||
])dnl
|
||||
fi
|
||||
CPPFLAGS="$CPPFLAGS_old"
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl WM_CHECK_REDCRAP_BUGS(prefix,bindir,libdir)
|
||||
dnl
|
||||
AC_DEFUN(WM_CHECK_REDCRAP_BUGS,
|
||||
[
|
||||
AC_MSG_CHECKING(for RedHat system)
|
||||
wm_check_flag='no :)'
|
||||
rh_is_redhat=no
|
||||
if test -f /etc/redhat-release; then
|
||||
wm_check_flag=yes
|
||||
rh_is_redhat=yes
|
||||
fi
|
||||
AC_MSG_RESULT($wm_check_flag)
|
||||
|
||||
mins_found=no
|
||||
bugs_found=no
|
||||
if test "$wm_check_flag" = yes; then
|
||||
echo
|
||||
AC_MSG_WARN([Red Hat system; checking for Red-Hat-specific bugs.])
|
||||
echo
|
||||
#
|
||||
# Check old wmaker from RedHat
|
||||
#
|
||||
if test "[$1]" != "/usr/X11R6" -a "$prefix" != "/usr/X11"; then
|
||||
AC_MSG_CHECKING(for multiple installed wmaker versions)
|
||||
if test -f /usr/X11R6/bin/wmaker; then
|
||||
AC_MSG_RESULT(uh oh)
|
||||
mins_found=yes
|
||||
rh_old_wmaker=yes
|
||||
else
|
||||
rh_old_wmaker=no
|
||||
AC_MSG_RESULT(no apparent problems)
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# Check for infamous en_RN bug
|
||||
# Wont work because autoconf will change LANG in the beginning of the
|
||||
# script.
|
||||
|
||||
#
|
||||
#AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
|
||||
#echo $LANG
|
||||
#if test "x$LANG" = xen_RN; then
|
||||
#AC_MSG_RESULT(uh oh)
|
||||
#AC_MSG_WARN([the LANG environment variable is set to the en_RN
|
||||
#locale. Please unset it or you will have mysterious problems when
|
||||
#using various software packages.])
|
||||
#bugs_found=yes
|
||||
#else
|
||||
#AC_MSG_RESULT(no problem)
|
||||
#fi
|
||||
#
|
||||
# If binary installation path is /usr/local/bin, check if it's in PATH
|
||||
#
|
||||
if test "[$2]" = "/usr/local/bin"; then
|
||||
AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
|
||||
wm_check_flag=no
|
||||
rh_missing_usr_local_bin=yes
|
||||
old_IFS="$IFS"
|
||||
IFS=":"
|
||||
for i in $PATH; do
|
||||
if test "x$i" = "x/usr/local/bin"; then
|
||||
wm_check_flag=yes
|
||||
rh_missing_usr_local_bin=no
|
||||
break;
|
||||
fi
|
||||
done
|
||||
IFS="$old_IFS"
|
||||
if test "$wm_check_flag" = no; then
|
||||
AC_MSG_RESULT(uh oh)
|
||||
bugs_found=yes
|
||||
else
|
||||
AC_MSG_RESULT(no problem)
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# If library installation path is /usr/local/lib,
|
||||
# check if it's in /etc/ld.so.conf
|
||||
#
|
||||
if test "[$3]" = "/usr/local/lib"; then
|
||||
wm_check_flag=yes
|
||||
rh_missing_usr_local_lib=no
|
||||
AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
|
||||
test -z "`grep /usr/local/lib /etc/ld.so.conf`"
|
||||
test "$?" -eq 0 && wm_check_flag=no
|
||||
if test "$wm_check_flag" = no; then
|
||||
AC_MSG_RESULT(uh oh)
|
||||
rh_missing_usr_local_lib=yes
|
||||
bugs_found=yes
|
||||
else
|
||||
AC_MSG_RESULT(no problem)
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# Check for symbolic links
|
||||
#
|
||||
AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
|
||||
rh_missing_usr_include_x11=no
|
||||
if test -d "/usr/include/X11"; then
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
AC_MSG_RESULT(uh oh)
|
||||
rh_missing_usr_include_x11=yes
|
||||
mins_found=yes
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for /lib/cpp
|
||||
#
|
||||
AC_MSG_CHECKING(for /lib/cpp)
|
||||
rh_missing_lib_cpp=no
|
||||
if test -f "/lib/cpp"; then
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
AC_MSG_RESULT(uh oh)
|
||||
rh_missing_lib_cpp=yes
|
||||
bugs_found=yes
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl WM_PRINT_REDCRAP_BUG_STATUS()
|
||||
dnl
|
||||
AC_DEFUN(WM_PRINT_REDCRAP_BUG_STATUS,
|
||||
[
|
||||
if test "$rh_is_redhat" = yes; then
|
||||
if test "$mins_found" = yes -o "$bugs_found" = yes; then
|
||||
echo
|
||||
AC_MSG_WARN([It seems you are using a system packaged by Red Hat.
|
||||
I have done some checks for Red-Hat-specific bugs, and I found some
|
||||
problems. Please read the INSTALL file regarding Red Hat, resolve
|
||||
the problems, and try to run configure again.
|
||||
|
||||
Here are the problems I found:
|
||||
])
|
||||
if test "x$rh_old_wmaker" = xyes; then
|
||||
echo "Problem: Old version of Window Maker in /usr/X11R6/bin."
|
||||
echo "Description: You seem to have an old version of Window Maker"
|
||||
echo " installed in /usr/X11R6/bin. It is recommended"
|
||||
echo " that you uninstall any previously installed"
|
||||
echo " packages of WindowMaker before installing a new one."
|
||||
echo
|
||||
fi
|
||||
if test "x$rh_missing_usr_local_bin" = xyes; then
|
||||
echo "Problem: PATH is missing /usr/local/bin."
|
||||
echo "Description: Your PATH environment variable does not appear to"
|
||||
echo " contain the directory /usr/local/bin. Please add it."
|
||||
echo
|
||||
fi
|
||||
if test "x$rh_missing_usr_local_lib" = xyes; then
|
||||
echo "Problem: /etc/ld.so.conf missing /usr/local/lib"
|
||||
echo "Description: Your /etc/ld.so.conf file does not appear to contain"
|
||||
echo " the directory /usr/local/lib. Please add it."
|
||||
echo
|
||||
fi
|
||||
if test "x$rh_missing_usr_x11" = xyes; then
|
||||
echo "Problem: Missing /usr/X11 symbolic link."
|
||||
echo "Description: Your system is missing a symbolic link from"
|
||||
echo " /usr/X11R6 to /usr/X11. Please create one."
|
||||
echo
|
||||
fi
|
||||
if test "x$rh_missing_usr_include_x11" = xyes; then
|
||||
echo "Problem: Missing /usr/include/X11 symbolic link."
|
||||
echo "Description: Your system is missing a symbolic link from"
|
||||
echo " /usr/X11R6/include/X11 to /usr/include/X11."
|
||||
echo " Please create one."
|
||||
echo
|
||||
fi
|
||||
if test "x$rh_missing_lib_cpp" = xyes; then
|
||||
echo "Problem: Missing /lib/cpp symbolic link."
|
||||
echo "Description: Your system is missing a symbolic link from the"
|
||||
echo " cpp (C preprocessor) program to /lib/cpp."
|
||||
echo " Please create one."
|
||||
echo
|
||||
fi
|
||||
if test "x$bugs_found" = xyes; then
|
||||
AC_MSG_ERROR([One or more of the problems above can potentially
|
||||
cause Window Maker not to install or run properly. Please resolve
|
||||
the problems and try to run configure again.])
|
||||
exit 1
|
||||
elif test "x$mins_found" = xyes; then
|
||||
AC_MSG_WARN([The problems above may or may not cause Window Maker
|
||||
not to install or run properly. If you have any problems during
|
||||
installation or execution, please resolve the problems and try to
|
||||
install Window Maker again.])
|
||||
echo
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "You appear to have a system packaged by Red Hat, but I could"
|
||||
echo "not find any Red-Hat-specific problems that I know about."
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
@@ -196,10 +457,7 @@ case "$lt_target" in
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
|
||||
AC_LANG_RESTORE])
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
@@ -456,31 +714,35 @@ esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library, adds --enable-ltdl-convenience to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
# the libltdl convenience library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-convenience to the
|
||||
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
||||
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
||||
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
||||
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
||||
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
||||
# flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library, and adds --enable-ltdl-install to
|
||||
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
|
||||
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
|
||||
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
|
||||
# '${top_builddir}/' (note the single quotes!) if your package is not
|
||||
# flat, and, if you're not using automake, define top_builddir as
|
||||
# appropriate in the Makefiles.
|
||||
# the libltdl installable library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-install to the configure
|
||||
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
||||
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
||||
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
||||
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
||||
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
||||
# not flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
@@ -493,8 +755,8 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
@@ -514,3 +776,26 @@ AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user