Fixed HTTP-client query-string handling bug.
[doldaconnect.git] / configure.in
index f90ec5f..4d103df 100644 (file)
@@ -1,6 +1,8 @@
-AC_INIT(daemon/main.c)
-AM_INIT_AUTOMAKE([doldaconnect], [0.5])
+AC_INIT([doldaconnect], [1.4])
+AC_CONFIG_SRCDIR(daemon/main.c)
+AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
+AC_USE_SYSTEM_EXTENSIONS
 
 DOLDA_AC_GROUP([Checking build chain])
 
@@ -21,17 +23,15 @@ m4_defun([_LT_AC_LANG_CXX_CONFIG], true)
 m4_defun([_LT_AC_LANG_F77_CONFIG], true)
 AC_PROG_LIBTOOL
 
-DOLDA_AC_GROUP([Checking required libraries])
-
-AC_CHECK_LIB(z, deflate, [:], AC_MSG_ERROR([*** must have zlib]))
-AC_CHECK_LIB(bz2, BZ2_bzWriteOpen, [:], AC_MSG_ERROR([*** must have bzlib]))
-AC_CHECK_LIB(gdbm, gdbm_open, [:], AC_MSG_ERROR([*** must have gdbm]))
-
-extlibs=
 experimental=no
 
 DOLDA_AC_GROUP([Checking optional libraries])
 
+# Standard libraries
+AC_CHECK_LIB(z, deflate, [HAS_LIBZ=yes], [HAS_LIBZ=no])
+AC_CHECK_LIB(bz2, BZ2_bzWriteOpen, [HAS_LIBBZ2=yes], [HAS_LIBBZ2=no])
+AC_CHECK_LIB(gdbm, gdbm_open, [HAS_GDBM=yes], [HAS_GDBM=no])
+
 # PAM check
 pam_msg=no
 AH_TEMPLATE(HAVE_PAM, [define to compile support for PAM authentication])
@@ -57,6 +57,10 @@ DOLDA_PKG([HAS_GTK2], [test "$with_gtk2" = no && HAS_GTK2=no],
 if test "$with_gtk2" = yes -a "$HAS_GTK2" = no; then
        AC_MSG_ERROR([*** cannot find GTK2 on this system])
 fi
+DOLDA_PKG([HAS_GTK2SI], [test "$HAS_GTK2" = no && HAS_GTK2SI=no],
+                       [DOLDA_CHECK_FUNC(gtk_status_icon_new_from_pixbuf, [], [HAS_GTK2SI=no], $GTK2_CFLAGS, $GTK2_LIBS)])
+DOLDA_PKG([HAS_GTK2ASS], [test "$HAS_GTK2" = no && HAS_GTK2ASS=no],
+                        [DOLDA_CHECK_FUNC(gtk_assistant_new, [], [HAS_GTK2ASS=no], $GTK2_CFLAGS, $GTK2_LIBS)])
 
 # libxml2 check
 AC_ARG_WITH(libxml2, [  --with-libxml2          Enable libxml2 support])
@@ -81,6 +85,21 @@ if test "$HAS_LIBNOTIFY" = yes; then
        AC_DEFINE(HAVE_NOTIFY)
 fi
 
+# libattr check
+AH_TEMPLATE(HAVE_XATTR, [define to compile support for extended attributes])
+AC_ARG_WITH(xattr, [  --with-xattr            Enable XATTR support])
+DOLDA_PKG([HAS_XATTR], [test "$with_xattr" = no && HAS_XATTR=no],
+                      [AC_CHECK_LIB(attr, getxattr, [:], [HAS_XATTR=no])],
+                      [DOLDA_CHECK_HEADER(attr/xattr.h, [], [HAS_XATTR=no])],
+                      [XATTR_LIBS=-lattr])
+if test "$with_xattr" = yes -a "$HAS_XATTR" = no; then
+       AC_MSG_ERROR([*** cannot find xattr support on this system])
+fi
+if test "$HAS_XATTR" = yes; then
+       AC_DEFINE(HAVE_XATTR)
+fi
+AC_SUBST(XATTR_LIBS)
+
 # libpanelapplet check
 DOLDA_PKG([HAS_LIBPANELAPPLET], [PKG_CHECK_MODULES(PANELAPPLET, libpanelapplet-2.0, [], [HAS_LIBPANELAPPLET=no])])
 
@@ -91,54 +110,49 @@ DOLDA_PKG([HAS_LIBPURPLE], [PKG_CHECK_MODULES(PURPLE, purple, [], [HAS_LIBPURPLE
                           [DOLDA_CHECK_HEADER(plugin.h, [], [HAS_LIBPURPLE=no], $PURPLE_CFLAGS)])
 
 # Daemon check
-DOLDA_ENABLE(daemon, [  --enable-daemon         Enable the daemon], yes, [])
+DOLDA_ENABLE(daemon, [  --enable-daemon         Enable the daemon], yes,
+                    [HAS_LIBZ HAS_LIBBZ2 HAS_GDBM])
 AM_CONDITIONAL(DAEMON, test "$enable_daemon" = yes)
 
+# ADC check
+DOLDA_ENABLE(fnetadc, [  --enable-fnetadc        Enable ADC code (experimental)], no,
+                 [enable_daemon])
+if test "$enable_fnetadc" = yes; then
+       experimental=yes
+fi
+AM_CONDITIONAL(ADC, test "$enable_fnetadc" = yes)
+
 # Gtk GUI check
 DOLDA_ENABLE(gtk2ui, [  --enable-gtk2ui         Enable the GTK2 user interface], yes,
-                    [HAS_GTK2 HAS_LIBXML])
+                    [HAS_GTK2 HAS_LIBBZ2 HAS_LIBXML])
 AM_CONDITIONAL(CLI_GTK2, test "$enable_gtk2ui" = yes)
 
 # Dolconf check
 DOLDA_ENABLE(dolconf, [  --enable-dolconf        Build the configuration helper], yes,
-                     [HAS_GTK2])
+                     [HAS_GTK2], [HAS_GTK2ASS])
 AM_CONDITIONAL(DOLCONF, test "$enable_dolconf" = yes)
 
 # GUI shell check
 DOLDA_ENABLE(guishell, [  --enable-guishell       Build the GUI shell programs], yes,
-                      [HAS_GTK2])
+                      [HAS_GTK2], [HAS_GTK2SI])
 AM_CONDITIONAL(GUISHELL, test "$enable_guishell" = yes)
 
-# Gtk progress bar check
-AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
-DOLDA_ENABLE(gtk2pbar, [  --enable-gtk2pbar       Enable GTK2 progress bars (experimental)], no,
-                      [HAS_GTK2 enable_gtk2ui])
-if test "$enable_gtk2pbar" = yes; then
-       experimental=yes
-       AC_DEFINE(ENABLE_GTK2PBAR)
-fi
-
 # Gnome applet check
-DOLDA_ENABLE(gnomeapplet, [  --enable-gnomeapplet    Enable GNOME transfer applet (experimental)], no,
+DOLDA_ENABLE(gnomeapplet, [  --enable-gnomeapplet    Enable GNOME transfer applet], no,
                          [HAS_LIBPANELAPPLET])
-if test "$enable_gnomeapplet" = yes; then
-       experimental=yes
-fi
 AM_CONDITIONAL(CLI_GNOMEAPPLET, test "$enable_gnomeapplet" = yes)
 
 # Gaim plugin check
 gaimplugin_msg=
-DOLDA_ENABLE(gaimplugin, [  --enable-gaimplugin     Enable Gaim chat plugin (experimental)], no,
+DOLDA_ENABLE(gaimplugin, [  --enable-gaimplugin     Enable Gaim chat plugin], no,
                         [HAS_LIBGAIM])
 if test "$enable_gaimplugin" = yes; then
-       experimental=yes
        gaimplugin_msg="Gaim $gaimplugin_msg"
 fi
 AM_CONDITIONAL(CLI_GAIM, test "$enable_gaimplugin" = yes)
-DOLDA_ENABLE(pidginplugin, [  --enable-pidginplugin   Enable Pidgin chat plugin (experimental)], no,
+DOLDA_ENABLE(pidginplugin, [  --enable-pidginplugin   Enable Pidgin chat plugin], no,
                           [HAS_LIBPURPLE])
 if test "$enable_pidginplugin" = yes; then
-       experimental=yes
        gaimplugin_msg="Pidgin $gaimplugin_msg"
 fi
 AM_CONDITIONAL(CLI_PIDGIN, test "$enable_pidginplugin" = yes)
@@ -147,12 +161,12 @@ if test -z "$gaimplugin_msg"; then
 fi
 
 # Guile check (XXX: Shouldn't have to be enabled manually)
-guile_msg=no
+enable_guile=no
 if test "$with_guile" = yes; then
        GUILE_FLAGS
-       extlibs="$extlibs guile"
-       guile_msg=yes
+       enable_guile=yes
 fi
+AM_CONDITIONAL(ELIB_GUILE, test "$enable_guile" = yes)
 
 # Check whether to install baseconv
 AC_ARG_ENABLE(baseconv, [  --enable-baseconv       Install the baseconv utility])
@@ -180,7 +194,8 @@ if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
        AC_DEFINE(HAVE_KRB5)
        krb_msg=yes
 fi
-AC_SUBST([KRB5_LIBS KRB5_CFLAGS])
+AC_SUBST(KRB5_LIBS)
+AC_SUBST(KRB5_CFLAGS)
 
 # Linux keyring
 AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
@@ -212,6 +227,8 @@ AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#i
 AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
 AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
                                  LDFLAGS="$LDFLAGS -lresolv" ])
+AC_CHECK_LIB(resolv, __res_query, [ AC_DEFINE(HAVE_RESOLVER)
+                                   LDFLAGS="$LDFLAGS -lresolv" ])
 
 # Unix credentials selector
 AH_TEMPLATE(UNIX_AUTH_STYLE, [undefine for no Unix auth, 1 for Linux style, 2 for BSD style])
@@ -243,7 +260,18 @@ CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
 
 DOLDA_AC_GROUP([Writing output])
 
-AC_SUBST([extlibs])
+AH_TEMPLATE(RELEASEINFO, [define release information reported by various programs (should be left to configure to define)])
+relinfo="relver ${VERSION}\\n"
+relinfo="${relinfo}builddate $(date)\\n"
+if test -d .git && which git-rev-parse >/dev/null 2>&1; then
+       relinfo="${relinfo}source git $(git-rev-parse HEAD)\\n"
+elif test -r source; then
+       relinfo="${relinfo}source $(cat source)\\n"
+else
+       relinfo="${relinfo}source unknown\\n"
+fi
+AC_DEFINE_UNQUOTED([RELEASEINFO], ["$relinfo"])
+
 AC_OUTPUT([
 Makefile
 autopackage/Makefile
@@ -267,6 +295,8 @@ config/Makefile
 config/cmd/Makefile
 config/util/Makefile
 contrib/Makefile
+contrib/doldaconnect.spec
+share/Makefile
 autopackage/doldacond.apspec
 autopackage/dolcon.apspec
 autopackage/dcuilib.apspec
@@ -277,16 +307,16 @@ autopackage/guishell.apspec
 echo
 echo "Dolda Connect has been configured with the following settings:"
 echo
-echo "    Daemon:                  $enable_daemon"
-echo "    PAM support:             $pam_msg"
-echo "    Kerberos 5 support:      $krb_msg"
-echo "    GTK2 user interface:     $enable_gtk2ui"
-echo "    GTK2 progress bars:      $enable_gtk2pbar"
-echo "    Dolconf configurator:    $enable_dolconf"
-echo "    GUI shell:               $enable_guishell"
-echo "    Guile extension library: $guile_msg"
-echo "    GNOME transfer applet:   $enable_gnomeapplet"
-echo "    Gaim chat plugin:        $gaimplugin_msg"
+echo "    Daemon:                     $enable_daemon"
+echo "    PAM support:                $pam_msg"
+echo "    Kerberos 5 support:         $krb_msg"
+echo "    ADC support (unfinished):   $enable_fnetadc"
+echo "    GTK2 user interface:        $enable_gtk2ui"
+echo "    Dolconf configurator:       $enable_dolconf"
+echo "    GUI shell:                  $enable_guishell"
+echo "    Guile extension library:    $enable_guile"
+echo "    GNOME transfer applet:      $enable_gnomeapplet"
+echo "    Gaim chat plugin:           $gaimplugin_msg"
 echo
 
 if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then