From 6d4a9b90e98a98e5bb28289595558af745dbeed3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 17 Jun 2005 16:29:16 +0000 Subject: [PATCH] * check for expat in configure * some premature command line parsing stuff git-svn-id: file:///home/lennart/svn/public/avahi/trunk@125 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/example.service | 2 +- avahi-daemon/main.c | 26 ++++++++++++++++++++++++++ configure.ac | 9 +++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/avahi-daemon/example.service b/avahi-daemon/example.service index a5f9071..3df961c 100644 --- a/avahi-daemon/example.service +++ b/avahi-daemon/example.service @@ -14,7 +14,7 @@ _telnet._tcp local - ecstasy.local + fuck.local 23 foo=bar waldo=buzz diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index 4a8d44d..d59e9fb 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -49,6 +49,26 @@ static void server_callback(AvahiServer *s, AvahiServerState state, gpointer use } } +static void help(FILE *f, const gchar *argv0) { + fprintf(f, + "%s [options]\n" + " -h --help Show this help\n" + " -D --daemon Daemonize after startup\n" + " -k --kill Kill a running daemon\n" + " -v --version Show version\n", + argv0); +} + +static gint parse_command_line(AvahiServerConfig *config, int argc, char *argv[]) { + + return 0; +} + +static gint load_config_file(AvahiServerConfig *config) { + + return 0; +} + int main(int argc, char *argv[]) { GMainLoop *loop = NULL; gint r = 255; @@ -56,6 +76,12 @@ int main(int argc, char *argv[]) { avahi_server_config_init(&config); + if (load_config_file(&config) < 0) + goto finish; + + if (parse_command_line(&config, argc, argv) < 0) + goto finish; + loop = g_main_loop_new(NULL, FALSE); if (simple_protocol_setup(NULL) < 0) diff --git a/configure.ac b/configure.ac index 1a295d4..c9e2de5 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,15 @@ fi AM_CONDITIONAL(ENABLE_DBUS, test "x$ENABLE_DBUS" = "xyes") +AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) + +if ! $have_expat ; then + AC_MSG_ERROR([*** libexpat not found ***]) +fi + +PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ]) +AC_SUBST(LIBDAEMON_CFLAGS) +AC_SUBST(LIBDAEMON_LIBS) # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then -- 2.39.5