Re: Patch for server-name and server-file

Jörg Sommer <[email protected]>
Newsgroups gmane.network.slrn.user
Message-ID <[email protected]>
Hallo,

Thomas Wiegner <[email protected]> wrote:
> the old slrn had the following options in the configure script:
>
> #v+
>  --with-server-name=HOST Hostname of a default NNTP server
>  --with-server-file=FILE File containing the hostname of an NNTP server
> #v-
>
> The code to handle this is still in the sources, but these option
> seem somehow gone lost in the configure script. 
>
> The attached patch enables these two options again in the configure
> script.

Here's a patch with the configure.ac modifications. John, you should run
autoconf with -Wall. With version do you use?

diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 91933ab..70f758d 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -86,6 +86,27 @@ AC_SUBST(SLRNPULL)
 AC_SUBST(SLRNPULL_ROOT_DIR)
 AC_SUBST(MAN_SLRNPULL)
 
+AC_ARG_WITH(server-name,
+    AS_HELP_STRING([--with-server-name=HOST],
+                   [Hostname of a default NNTP server]),
+    [if test "x$withval" != "xno"; then
+      if test "x$withval" = xyes; then
+        AC_MSG_ERROR([you must pass the hostname of the server to the option --with-server-name])
+      fi
+      AC_DEFINE_UNQUOTED([NNTPSERVER_NAME], "$withval")
+     fi
+    ])
+AC_ARG_WITH(server-file,
+    AS_HELP_STRING([--with-server-file=FILE],
+                   [File containing the hostname of an NNTP server]),
+    [if test "x$withval" != "xno"; then
+      if test "x$withval" = xyes; then
+        AC_MSG_ERROR([you must pass the name of the file to the option --with-server-file])
+      fi
+      AC_DEFINE_UNQUOTED([NNTPSERVER_FILE], "$withval")
+     fi
+    ])
+
 CF_COMPILE_OPTION(nntp,
     [  --disable-nntp          Disable NNTP support],
     [SLRN_HAS_NNTP_SUPPORT], 1)
diff --git a/configure b/configure
index cebf57d..3192dd3 100755
--- a/configure
+++ b/configure
@@ -1346,6 +1346,8 @@ Optional Packages:
   --with-slrnlib=DIR       Place for the slrn library files
   --with-localedir=DIR    Where to put locale files
   --with-slrnpull=[DIR]        Build slrnpull and use DIR as the slrnpull root
+  --with-server-name=HOST Hostname of a default NNTP server
+  --with-server-file=FILE File containing the hostname of an NNTP server
   --with-uu=DIR      Use DIR/lib and DIR/include for uu
   --with-uulib=DIR   uu library in DIR
   --with-uuinc=DIR   uu include files in DIR
@@ -4582,6 +4584,41 @@ SLRN_HAS_PULL_SUPPORT=$optionvalue
 
 
 
+# Check whether --with-server-name was given.
+if test "${with_server_name+set}" = set; then
+  withval=$with_server_name; if test "x$withval" != "xno"; then
+      if test "x$withval" = xyes; then
+        { { echo "$as_me:$LINENO: error: you must pass the hostname of the server to the option --with-server-name" >&5
+echo "$as_me: error: you must pass the hostname of the server to the option --with-server-name" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      cat >>confdefs.h <<_ACEOF
+#define NNTPSERVER_NAME "$withval"
+_ACEOF
+
+     fi
+
+fi
+
+
+# Check whether --with-server-file was given.
+if test "${with_server_file+set}" = set; then
+  withval=$with_server_file; if test "x$withval" != "xno"; then
+      if test "x$withval" = xyes; then
+        { { echo "$as_me:$LINENO: error: you must pass the name of the file to the option --with-server-file" >&5
+echo "$as_me: error: you must pass the name of the file to the option --with-server-file" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      cat >>confdefs.h <<_ACEOF
+#define NNTPSERVER_FILE "$withval"
+_ACEOF
+
+     fi
+
+fi
+
+
+
  optionvalue=1
  # Check whether --enable-nntp was given.
 if test "${enable_nntp+set}" = set; then
diff --git a/src/config.hin b/src/config.hin
index c809fed..e715e15 100644
--- a/src/config.hin
+++ b/src/config.hin
@@ -218,4 +218,7 @@ typedef long NNTP_Artnum_Type;
 # define NNTP_STR_TO_ARTNUM atoi
 #endif
 
+#undef NNTPSERVER_NAME
+#undef NNTPSERVER_FILE
+
 #endif /* SLRN_CONFIG_H */

Schöne Grüße, Jörg.
-- 
Niveau sieht nur von unten aus wie Arroganz.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.