From: Hugo Villeneuve Date: Sat, 25 May 2013 23:21:11 +0000 (-0400) Subject: Fixed configure errors when SSL and libsndfile are not present on the system X-Git-Tag: v1.0.0~10 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=5e685b907d89e5d2d8dbeb2e80ece0edccd1c852;p=dockapps%2Fwmnotify.git Fixed configure errors when SSL and libsndfile are not present on the system --- diff --git a/configure.ac b/configure.ac index 1773570..35b441a 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,8 @@ dnl Checking if the NEWS file has been updated to reflect the current version. AM_INIT_AUTOMAKE(check-news) dnl Testing the C compiler. -AC_PROG_CC +dnl AC_PROG_CC +AM_PROG_CC_C_O AC_LANG_C dnl Checking for header files. @@ -27,9 +28,7 @@ dnl Basic CFLAGS values CFLAGS="${CFLAGS} -Wall" dnl Checking for POSIX threads library. -ACX_PTHREAD(CC="${PTHREAD_CC}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" dnl - LIBS="${PTHREAD_LIBS} ${LIBS}", dnl - echo "Can't find POSIX threads library"; exit 1 ) +ACX_PTHREAD(CC="${PTHREAD_CC}", , echo "Can't find POSIX threads library"; exit 1 ) dnl Trying to locate the X window system's includes and libraries, and sets the dnl variables x_includes and x_libraries to their locations. Also adds the @@ -58,12 +57,12 @@ AC_ARG_ENABLE(libsndfile, [ --enable-libsndfile Enable libsndfile support for audible notification (default=yes)], [ac_cv_enable_libsndfile=$enableval], [ac_cv_enable_libsndfile=yes]) AC_MSG_CHECKING([whether to use libsndfile]) -if test $ac_cv_enable_libsndfile = yes; then +if test x$ac_cv_enable_libsndfile = xyes; then AC_MSG_RESULT(yes) - PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2,dnl - AC_DEFINE([HAVE_SNDFILE],1,[Set to 1 to enable libsndfile support.])dnl - CFLAGS="${CFLAGS} ${SNDFILE_CFLAGS}"dnl - LIBS="${LIBS} ${SNDFILE_LIBS}", ac_cv_enable_libsndfile=no) + PKG_CHECK_MODULES([SNDFILE], sndfile >= 1.0.2, :, ac_cv_enable_libsndfile=no) + if test x$ac_cv_enable_libsndfile = xyes; then + AC_DEFINE([HAVE_SNDFILE],1,[Set to 1 to enable libsndfile support.]) + fi else AC_MSG_RESULT(no) fi @@ -73,16 +72,19 @@ AC_ARG_ENABLE(ssl, [ --enable-ssl Enable SSL support using OpenSSL (default=yes)], [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes]) AC_MSG_CHECKING([whether to use OpenSSL]) -if test $ac_cv_enable_ssl = yes; then +if test x$ac_cv_enable_ssl = xyes; then AC_MSG_RESULT(yes) - PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.6,dnl - AC_DEFINE([HAVE_SSL],1,[Set to 1 to enable OpenSSL support.])dnl - CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"dnl - LIBS="${LIBS} ${OPENSSL_LIBS}", ac_cv_enable_ssl=no) + PKG_CHECK_MODULES([OPENSSL], openssl >= 0.9.6, :, ac_cv_enable_ssl=no) + if test x$ac_cv_enable_ssl = xyes; then + AC_DEFINE([HAVE_SSL],1,[Set to 1 to enable OpenSSL support.]) + fi else AC_MSG_RESULT(no) fi +CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS} ${SNDFILE_CFLAGS} ${OPENSSL_CFLAGS}" +LIBS="${PTHREAD_LIBS} ${SNDFILE_LIBS} ${OPENSSL_LIBS} ${LIBS}" + AC_SUBST(CFLAGS) AC_SUBST(LIBS) AC_SUBST(ac_aux_dir)