configure and makefile updates
[monky] / configure.in
index 49f7a70..214a99e 100644 (file)
@@ -1,7 +1,15 @@
-AC_INIT(conky.c)
+AC_INIT([Conky],[1.3],[brenden1@users.sourceforge.net])
 
 AM_INIT_AUTOMAKE(conky, 1.3)
-AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER(src/config.h)
+AC_PROG_LIBTOOL
+
+
+AC_CONFIG_FILES(
+       Makefile
+       doc/Makefile
+       src/Makefile
+       )
 
 uname=`uname`
 
@@ -57,23 +65,6 @@ if test $dah != "no"; then
 fi
 
 dnl
-dnl DOUBLE_BUFFER option
-dnl
-
-dah=yes
-AC_ARG_ENABLE(double_buffer,
-[  --enable-double-buffer  enable if you want to support flicker-free operation [default=yes]],
-  [dah="$enableval"])
-
-if test $dah != "no"; then
-  AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
-  AC_CHECK_HEADERS([X11/extensions/Xdbe.h], [AC_DEFINE([HAVE_XDBE], 1, [Xdbe])], [XDBE_MISSING=yes])
-  if test "x$XDBE_MISSING" = xyes; then
-      AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension])
-  fi
-fi
-
-dnl
 dnl PROC_UPTIME option
 dnl
 
@@ -106,7 +97,7 @@ dnl
 
 want_mpd=no
 AC_ARG_ENABLE(mpd,
-[  --enable-mpd           enable if you want MPD support [default=no]],
+[  --enable-mpd            enable if you want MPD support [default=no]],
   [want_mpd="$enableval"])
 
 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd == xyes)
@@ -120,7 +111,7 @@ dnl
 
 want_cairo=no
 AC_ARG_ENABLE(cairo,
-[  --enable-cairo           enable if you want Cairo support [default=no]],
+[  --enable-cairo          enable if you want Cairo support [default=no]],
   [want_cairo="$enableval"])
 
 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo == xyes)
@@ -143,25 +134,6 @@ if test "$want_cairo" = "yes"; then
   fi
 fi
 
-dnl metar
-dnl
-
-want_metar=no
-AC_ARG_ENABLE(metar,
-[  --enable-metar       enable if you want metar stats (weather information) [default=no]],
-  [want_metar="$enableval"])
-
-AM_CONDITIONAL(BUILD_METAR, test x$want_metar == xyes)
-if test x$want_metar == xyes; then
-AC_CHECK_HEADERS([metar.h], [], [METAR_MISSING=yes])
-    if test "x$METAR_MISSING" = xyes; then
-      AC_MSG_ERROR([something went wrong when checking for mdsplib, you're probably missing headers or it's not installed])
-  fi
-  AC_DEFINE(METAR, 1, [Define if you want metar stats (weather information)])
-fi
-dnl
-
-
 
 dnl
 dnl MLDonkey
@@ -187,52 +159,44 @@ dnl
 dnl X
 dnl
 
+dah=yes
+AC_ARG_ENABLE(double_buffer,
+[  --enable-double-buffer  enable if you want to support flicker-free operation [default=yes]],
+  [dah="$enableval"])
+
 want_x11=yes
 AC_ARG_ENABLE(x11,
-[  --enable-x11       enable if you want X11 support [default=yes]],
-  [want_x11="$enableval"])
+[  --enable-x11            enable if you want X11 support [default=yes]],
+ [want_x11="$enableval"])
 
 
-AM_CONDITIONAL(BUILD_X11, test x$want_x11 == xyes)
+AM_CONDITIONAL(BUILD_X11, test x$want_x11)
 if test x$want_x11 == xyes; then
-AC_PATH_X
-AC_CHECK_HEADERS([X11/Xlib.h], [], [X11_MISSING=yes])
-AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
-AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
-   X11_LIBS="$X11_LIBS -lXext"
-   AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
- ], [], [[-L$x_libraries $X11_LIBS]])
-    if test "x$X11_MISSING" = xyes; then
-      AC_MSG_ERROR([something went wrong when checking for X11, you're probably missing headers or it's not installed, either re-run configure with --disable-x11, or fix this])
-  fi
-  AC_DEFINE(X11, 1, [Define if you want to use X11])
-  AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
-fi
-dnl AC_PATH_X if test $have_x != "yes"; then
-dnl   echo "Sorry, X is very much needed"
-dnl   exit 1
-dnl fi
-dnl AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
-
-AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
-AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
-   X11_LIBS="$X11_LIBS -lXext"
-   AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
- ], [], [[-L$x_libraries $X11_LIBS]])
-
-if test "$x_libraries" != ""; then
-  LDFLAGS="$LDFLAGS -L$x_libraries"
+       AC_PATH_X
+       AC_PATH_XTRA
+       CFLAGS="$CFLAGS $X_CFLAGS"
+       LIBS="$LIBS $X_LIBS $X11_LIBS"
+       LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
+       if test "x$X_DISPLAY_MISSING" = xyes; then
+               AC_MSG_ERROR([something went wrong when checking for X11, you're probably missing headers or it's not installed, either re-run configure with --disable-x11, or fix this])
+       fi
+       AC_DEFINE(X11, 1, [Define if you want to use X11])
+       AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
+       if test $dah != "no"; then
+               AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
+               AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
+                    [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
+       fi
 fi
+AM_CONDITIONAL(HAVE_X11, test x$want_x11)
+
 
-if test "$x_includes" != ""; then
-  CFLAGS="$CFLAGS -Wall -I$x_includes"
-fi
 
 dnl
 dnl Xft
 dnl
 
-if test "$want_xft" = "yes"; then
+if test x$want_xft && test x$want_x11; then
   AC_PATH_PROG(XFTCONFIG, xft-config)
   if test x$XFTCONFIG != x; then
     dnl TODO: needs more checks
@@ -278,14 +242,19 @@ dnl Some random headers
 dnl
 
 
-AC_CHECK_HEADERS([signal.h unistd.h X11/Xlib.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h])
+AC_CHECK_HEADERS([signal.h unistd.h X11/Xlib.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
 AC_CHECK_HEADERS([sys/statfs.h sys/param.h sys/mount.h])
 dnl For cairo
 
 dnl
-dnl Check help2man
+dnl Check doc stuff
 dnl
 
+AC_PATH_PROG(DB2X_XSLPROC, db2x_xsltproc)
+AC_PATH_PROG(DB2X_MANXML, db2x_manxml)
+AC_PATH_PROG(XSLPROC, xsltproc)
+AM_CONDITIONAL(HAVE_DOCSTUFF, test $DB2X_XSLPROC -a $DB2X_MANXML -a $XSLPROC)
+
 dnl
 dnl Check sysinfo()
 dnl
@@ -361,4 +330,4 @@ AC_SUBST(CFLAGS)
 AC_SUBST(X11_LIBS)
 AC_SUBST(XFT_LIBS)
 
-AC_OUTPUT(Makefile)
+AC_OUTPUT