dockapps/wmhdplop/configure.ac
Doug Torrance 7ab8a56465 wmhdplop: Modernize autotools.
In particular, fix the following errors and warnings:

 configure.ac:2: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are
 deprecated.  For more info, see:
 configure.ac:2: http://www.gnu.org/software/automake/manual/automake.html
 #Modernize-AM_005fINIT_005fAUTOMAKE-invocation

 Makefile.am:21: error: linker flags such as '-shared' belong in
 'gkhdplop_so_LDFLAGS'

 ./configure: line 2910: syntax error near unexpected token `build_old_libs,'
 ./configure: line 2910: `    _LT_DECL(build_old_libs, enable_static, 0,'

 ./configure: line 2908: syntax error near unexpected token
 `build_libtool_libs,'
 ./configure: line 2908: `    _LT_DECL(build_libtool_libs, enable_shared, 0,

https://sources.debian.net/src/wmhdplop/0.9.9-5/debian/patches/
  modernize_autotools.patch/
2016-11-24 15:43:12 +00:00

101 lines
2.7 KiB
Plaintext

AC_INIT(wmhdplop, 0.9.9)
AC_CONFIG_SRCDIR(wmhdplop.c)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_SUBST(VERSION)
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_CANONICAL_HOST
AC_PROG_INSTALL
AC_PROG_CC
AC_HEADER_STDC
AC_DEFINE(ENABLE_HDDTEMP_QUERY,[],[enable queries to hddtemp])
AC_DEFINE(_GNU_SOURCE,[],[uses GNU extensions])
if test x$GCC = xyes; then
CFLAGS="-O3 -fomit-frame-pointer -ffast-math -Wall -W";
fi
dnl check for X
AC_PATH_X
AC_PATH_XTRA
if test x$no_x = xyes; then
echo "You need to supply the path to the X headers and libraries with --x-includes=dir and --x-libraries=dir";
exit 1;
fi;
LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 -lXext ${LIBS} ${X_EXTRA_LIBS}"
CFLAGS="$CFLAGS $X_CFLAGS"
dnl Checks for library functions.
AC_CHECK_HEADERS(linux/hdreg.h)
AC_CHECK_PROG([IMLIB2_CONFIG_IN_PATH],[imlib2-config],[yes],[no])
if test "x$IMLIB2_CONFIG_IN_PATH" = "xno"; then
AC_ERROR([imlib2-config not found in PATH.. You need to install Imlib2 (and its developpement package)])
fi
IMLIB2_CFLAGS=$(imlib2-config --cflags)
IMLIB2_LIBS=$(imlib2-config --libs)
AC_SUBST(IMLIB2_CFLAGS)
AC_SUBST(IMLIB2_LIBS)
YELLOW="\\033\\1331;33m"
RESET="\\033\\1330m"
dnl Checks for the gkrellm plugin
build_gkhdplop="yes"
AC_ARG_ENABLE(gkrellm,
[ --enable-gkrellm build the gkrellm plugin (requires gtk2 and gkrellm developpement files) (Default is yes)
--disable-gkrellm do not build the gkrellm plugin],
[ if test "x$enableval" = "xno" ; then
build_gkhdplop="no"
echo you disabled the gkhdplop gkrellm plugin
fi
], [build_gkhdplop="yes"])
GKHDPLOP=""
if test "x$build_gkhdplop" = "xno"; then
echo gkhdplop disabled...
else
echo building with GKHDPLOP, checking for gtk2..
pkg_modules="gtk+-2.0 >= 2.0.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
GTK2_CFLAGS=$PACKAGE_CFLAGS;
GTK2_LIBS=$PACKAGE_LIBS;
AC_SUBST(GTK2_CFLAGS)
AC_SUBST(GTK2_LIBS)
SAVECPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CFLAGS $GTK2_CFLAGS"
AC_CHECK_HEADERS([gkrellm2/gkrellm.h], [ok=1], [ok=0])
if test "x$ok" = "x0"; then
echo -e "${YELLOW}gkrellm2/gkrellm.h header not found or unusable${RESET}... cannot build gkhdplop.so"
build_gkhdplop="no"
else
GKHDPLOP="gkhdplop.so"
fi
CPPFLAGS="$SAVECPPFLAGS"
fi
AC_SUBST(GKHDPLOP)
AC_OUTPUT(Makefile)
echo "- - - - - - - - - - - - - - - -"
echo -e "${YELLOW}wmhdplop will be built${RESET}"
if test "x$build_gkhdplop" = "xno"; then
echo -e "${YELLOW}gkhdplop.so will NOT be built${RESET}"
else
echo -e "${YELLOW}gkhdplop.so will be built${RESET}"
echo "Check that the plugin is working properly before installing it with:"
echo " gkrellm -p ./gkhdplop.so"
echo "and then install the gkrellm plugin with:"
echo " mv ./gkhdplop.so ~/.gkrellm2/plugins"
fi