compile sysinfo.c only if sysinfo fct exist (does not exist on freebsd)
[psensor.git] / configure.ac
index dd68666..12d201e 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.64])
-AC_INIT([psensor], [0.6.2.13],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor])
+AC_INIT([psensor], [0.6.2.15],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor])
 
 AM_INIT_AUTOMAKE([-Wall -Werror gnu])
 
@@ -18,7 +18,7 @@ AC_PROG_RANLIB
 
 # Checks for header files.
 AC_PATH_X
-AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h getopt.h])
+AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h getopt.h sys/sysinfo.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_SIZE_T
@@ -29,6 +29,12 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([gettimeofday memmove socket strdup strtol])
 
+SYSINFO_FCT=
+AC_CHECK_FUNC(sysinfo,
+             [SYSINFO_FCT='1' AC_DEFINE([HAVE_SYSINFO_FCT],[1],[Use sysinfo])],
+              [AC_MSG_WARN("sysinfo function not present")])
+AM_CONDITIONAL(SYSINFO_FCT, test -n "$SYSINFO_FCT")
+
 AM_GNU_GETTEXT_VERSION([0.16])
 AM_GNU_GETTEXT([external])
 
@@ -63,7 +69,7 @@ AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
 if test "$GTK_LIBS" == ""; then
-   PKG_CHECK_MODULES(GTK, gtk+-2.0 )
+   PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
    AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
    AC_SUBST(GTK_CFLAGS)
    AC_SUBST(GTK_LIBS)
@@ -175,7 +181,7 @@ AC_ARG_WITH(libatiadl,
 [  --with-libatiadl[=DIR]   use libatiadlxx in DIR],[
                   ATIADL_DIR=${withval}
                   CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
-                  LIBS="$LIBS -L/usr/lib/fglrx"
+                  LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
                  ]
 )
 
@@ -184,7 +190,7 @@ AC_CHECK_HEADERS(adl_defines.h,
                [
                        AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
                        LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
-                       LIBATIADL_LIBS="-L/usr/lib/fglrx -latiadlxx"
+                       LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
                ]))
 
 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
@@ -226,10 +232,7 @@ AC_CONFIG_FILES([
  Makefile
  src/Makefile
  src/glade/Makefile
- src/plib/Makefile
  src/lib/Makefile
- src/unity/Makefile
- src/libpsensor_json/Makefile
  src/server/Makefile
  icons/hicolor/scalable/Makefile
  icons/hicolor/14x14/Makefile