here comes the big header include rewrite
[monky] / configure.ac.in
index f4f2f4f..d7ed523 100644 (file)
@@ -1,8 +1,6 @@
-dnl $Id$
-
 dnl major, minor and micro version macros.
 m4_define([conky_version_major], [1])
-m4_define([conky_version_minor], [5])
+m4_define([conky_version_minor], [6])
 m4_define([conky_version_micro], [2])
 m4_define([conky_version_tag], [pre]) dnl [] for releases
 m4_define([conky_version_revision],[_pre@REVISION@])
@@ -16,6 +14,7 @@ AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net])
 
 AM_INIT_AUTOMAKE(conky, conky_version())
 AM_CONFIG_HEADER(src/config.h)
+AC_CONFIG_MACRO_DIR([m4])
 
 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
 dnl libtool must be deleted with make distclean to see this fix.
@@ -23,6 +22,8 @@ if test x"$CFLAGS" = x""; then
   AC_SUBST(CFLAGS, [ ])
 fi
 
+AC_DEFINE([_GNU_SOURCE], [], [Define for GNU source and extensions])
+
 dnl
 dnl Tools
 dnl
@@ -90,6 +91,20 @@ AC_SUBST(BUILD_ARCH)
 
 
 dnl
+dnl BUILD_CONFIG_OUTPUT option
+dnl
+
+AC_ARG_ENABLE([config_output],
+              AC_HELP_STRING([--disable-config-output], [disable if you do not want conky to output a default config (with -C) @<:@default=yes@:>@]),
+              [want_config_output="$enableval"], [want_config_output=yes])
+
+AM_CONDITIONAL(BUILD_CONFIG_OUTPUT, test x$want_config_output = xyes)
+if test x$want_config_output = xyes; then
+  AC_DEFINE(CONFIG_OUTPUT, 1, [Define if you want conky to output a default config (with -C)])
+  AC_CHECK_FUNCS(fopencookie, AM_CONDITIONAL(BUILD_FOR_FOPENCOOKIE, true))
+fi
+
+dnl
 dnl OWN_WINDOW option
 dnl
 
@@ -174,6 +189,20 @@ if test x$want_hddtemp = xyes; then
 fi
 
 dnl
+dnl Math
+dnl
+
+AC_ARG_ENABLE([math],
+              AC_HELP_STRING([--disable-math], [disable if you do not want math support @<:@default=yes@:>@]),
+              [want_math="$enableval"], [want_math=yes])
+
+AM_CONDITIONAL(BUILD_MATH, test x$want_math = xyes)
+if test x$want_math = xyes; then
+  LIBS="$LIBS -lm"
+  AC_DEFINE(MATH, 1, [Define if you want math support])
+fi
+
+dnl
 dnl MPD
 dnl
 
@@ -187,6 +216,19 @@ if test x$want_mpd = xyes; then
 fi
 
 dnl
+dnl MOC
+dnl
+
+AC_ARG_ENABLE([moc],
+              AC_HELP_STRING([--disable-moc], [disable if you do not want MOC support @<:@default=yes@:>@]),
+              [want_moc="$enableval"], [want_moc=yes])
+
+AM_CONDITIONAL(BUILD_MOC, test x$want_moc = xyes)
+if test x$want_moc = xyes; then
+  AC_DEFINE(MOC, 1, [Define if you want MOC support])
+fi
+
+dnl
 dnl XMMS2
 dnl
 
@@ -203,6 +245,27 @@ if test x$want_xmms2 = xyes; then
 fi
 
 dnl
+dnl EVE Skill Monitor
+dnl
+
+AC_ARG_ENABLE([eve],
+              AC_HELP_STRING([--enable-eve], [Eve-Online skill monitor @<:@default=no@:>@]),
+              [want_eve="$enableval"], [want_eve=no])
+
+AM_CONDITIONAL(BUILD_EVE, test x$want_eve = xyes)
+if test x$want_eve = xyes; then
+       PKG_CHECK_MODULES([libxml2], libxml-2.0)
+       PKG_CHECK_MODULES([libcurl], libcurl)
+       CFLAGS="$CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
+       LIBS="$LIBS $libxml2_LIBS $libcurl_LIBS"
+       AC_DEFINE(EVE, 1, [Define if you want Eve-Online Skill monitor support])
+       AC_DEFINE(EVEURL_TRAINING, "http://api.eve-online.com/char/SkillInTraining.xml.aspx", [Eve training URL])
+       AC_DEFINE(EVEURL_SKILLTREE, "http://api.eve-online.com/eve/Skilltree.xml.aspx", [Eve skilltree URL])
+       AC_DEFINE(MY_ENCODING, "ISO-8859-1", [Textencoding to use])
+       AC_DEFINE(EVE_OUTPUT_FORMAT, "%s %d in %s", [Eve output format])
+fi
+
+dnl
 dnl RSS
 dnl
 
@@ -240,7 +303,7 @@ dnl
 AC_ARG_ENABLE([wlan],
              AC_HELP_STRING([--enable-wlan], [enable if you want wireless support @<:@default=no@:>@]),
              [want_wlan="$enableval"], [want_wlan=no])
-#
+
 AM_CONDITIONAL(BUILD_WLAN, test x$want_wlan = xyes)
 if test x$want_wlan = xyes; then
   AC_CHECK_HEADERS([iwlib.h], [], AC_MSG_ERROR([iwlib.h header not found]))
@@ -249,6 +312,24 @@ if test x$want_wlan = xyes; then
 fi
 
 dnl
+dnl NVIDIA libXNVCtrl support
+dnl
+
+AC_ARG_ENABLE([nvidia],
+               AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
+               [want_nvidia="$enableval"], [want_nvidia=no])
+AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
+if test x$want_nvidia = xyes; then
+       AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
+dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
+dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
+dnl ## am I Stupid ??
+dnl ## it won't find the lib for some reason!?
+       LIBS="$LIBS -lXNVCtrl"
+               AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
+fi
+
+dnl
 dnl IMLIB2
 dnl
 
@@ -280,6 +361,7 @@ if test x"$want_portmon" = xyes; then
       AC_MSG_NOTICE([port monitors not supported on $uname... disabling])
       want_portmon=no
   else
+        AC_CHECK_FUNCS([getnameinfo], [], AC_MSG_ERROR([getnameinfo function not found]))
         AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
            [PORT_MONITORS_MISSING=yes])
         if test x"$PORT_MONITORS_MISSING" = xyes; then
@@ -464,13 +546,21 @@ AC_CHECK_HEADERS([sys/mount.h], [], [],
       #endif
       ])
 
-AC_DEFINE([_GNU_SOURCE], [], [Define for GNU source and extensions])
+dnl
+dnl Some defines
+dnl
+
+AC_DEFINE(DEFAULTNETDEV, "eth0", [Default networkdevice])
+AC_DEFINE(CONFIG_FILE, "$HOME/.conkyrc", [Configfile of the user])
+AC_DEFINE(MAX_SPECIALS_DEFAULT, 512, [Default maximum number of special things, e.g. fonts, offsets, aligns, etc.])
+AC_DEFINE(MAX_USER_TEXT_DEFAULT, 16384, [Default maximum size of config TEXT buffer, i.e. below TEXT line.])
+AC_DEFINE(DEFAULT_TEXT_BUFFER_SIZE, 256, [Default size used for temporary, static text buffers])
 
 dnl
 dnl Some functions
 dnl
 
-AC_CHECK_FUNCS([calloc malloc free popen sysinfo getloadavg memrchr strndup])
+AC_CHECK_FUNCS([calloc malloc free popen sysinfo getloadavg memrchr strndup gethostbyname_r])
 AC_SEARCH_LIBS(clock_gettime, [rt],
                [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])],
                [AC_CHECK_FUNCS([gettimeofday], [], [AC_MSG_ERROR([gettimeofday() not available!])])], [])
@@ -550,6 +640,8 @@ case `$LD -O1 -v 2>&1 </dev/null` in
   ;;
 esac
 
+dnl Solve multiple definitions (only necessary when gnulib is used)
+dnl LDFLAGS="$LDFLAGS -Xlinker -zmuldefs"
 
 dnl
 dnl Da.
@@ -566,8 +658,8 @@ AC_ARG_ENABLE([debug],
               [want_debug="$enableval"], [want_debug=no])
 
 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
-  CFLAGS="$CFLAGS -g3 -Werror"
-  AC_DEFINE([DEBUG], [], [Define for debugging])
+  CFLAGS="$CFLAGS -g3"
+  AC_DEFINE([DEBUG], 1, [Define for debugging])
 fi
 
 dnl
@@ -580,10 +672,10 @@ AC_ARG_ENABLE([testing],
 
 if test "x$want_testing" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
   if test "x$want_debug" = "xyes"; then
-    CFLAGS="$CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic"
+    CFLAGS="$CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
     AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
   else
-    CFLAGS="$CFLAGS -g3 -Werror -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic"
+    CFLAGS="$CFLAGS -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
     AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
   fi
 fi
@@ -616,12 +708,17 @@ $PACKAGE $VERSION configured successfully:
   Audacious:        $want_audacious
   BMPx:             $want_bmpx
   MPD:              $want_mpd
+  MOC:              $want_moc
   XMMS2:            $want_xmms2
 
  * General:
+  math:             $want_math
   hddtemp:          $want_hddtemp
   portmon:          $want_portmon
   RSS:              $want_rss
   wireless:         $want_wlan
   SMAPI:            $want_smapi
+  nvidia:           $want_nvidia
+  eve-online:       $want_eve
+  config-output:    $want_config_output
 EOF