From 0a62c6379e1c276bf649bd267dd24c776f894ad5 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Sat, 8 Jan 2005 09:57:44 +0000 Subject: [PATCH] - fix: FreeBSD - libgnugetopt is optional library --- configure.in | 4 +++- src/siproxd.c | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 46ff04a..ba61a0d 100644 --- a/configure.in +++ b/configure.in @@ -30,6 +30,7 @@ dnl (there seems to be a bug somewhere) dnl 18-Aug-2004 tries fli4l-uclibc -> fli4l-21-uclibc, fli4l-22-uclibc dnl 2.1.x has no pthread support, link -static dnl 2.2.x has (maybe) pthread support +dnl 08-Jan-2005 tries FreeBSD: check for libgnugetopt before using it dnl dnl @@ -127,7 +128,8 @@ case "$target" in AC_DEFINE(_BSD,,[building on BSD platform]) AC_DEFINE(_FREEBSD,,[building on FreeBSD platform]) CPPFLAGS="$CPPFLAGS -I/usr/local/include/" - LIBS="$LIBS -L/usr/local/lib/ -lgnugetopt" + LIBS="$LIBS -L/usr/local/lib/" + AC_CHECK_LIB(gnugetopt,getopt_long,[LIBS="$LIBS -lgnugetopt"]) ;; *-*-openbsd*) AC_MSG_RESULT(OpenBSD) diff --git a/src/siproxd.c b/src/siproxd.c index aefb9d2..0da5cc6 100644 --- a/src/siproxd.c +++ b/src/siproxd.c @@ -48,13 +48,20 @@ FILE *siproxd_passwordfile; /* -h help option text */ static const char str_helpmsg[] = -PACKAGE "-" VERSION "-" BUILDSTR " (c) 2002-2004 Thomas Ries\n" +PACKAGE "-" VERSION "-" BUILDSTR " (c) 2002-2005 Thomas Ries\n" "\nUsage: siproxd [options]\n\n" "options:\n" -" --help (-h) help\n" -" --debug (-d) set debug-pattern\n" -" --config (-c) use the specified config file\n" -" --pid-file (-p) create pid file \n" +#ifdef HAVE_GETOPT_LONG +" -h, --help help\n" +" -d, --debug set debug-pattern\n" +" -c, --config use the specified config file\n" +" -p, --pid-file create pid file \n" +#else +" -h help\n" +" -d set debug-pattern\n" +" -c use the specified config file\n" +" -p create pid file \n" +#endif "";