Made lib/contrib stuff compilation conditional.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 22 Jun 2002 16:59:12 +0000 (16:59 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 22 Jun 2002 16:59:12 +0000 (16:59 +0000)
CHANGES
TODO
configure.in.pre
includes/silcincludes.h
lib/contrib/Makefile.am

diff --git a/CHANGES b/CHANGES
index 0c3c23308365aa9ef2876879104898a5eaac4750..8885307aec58f219ceb349a77459cda8a66f2c0f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -16,6 +16,9 @@ Sat Jun 22 17:06:58 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
          reason of the disconnection and optional disconnection
          message.  Affected file lib/silcclient/silcclient.h.
 
+       * Made the compilation of lib/contrib/ stuff conditional.
+         Affected files configure.in.pre, lib/contrib/Makefile.am.
+
 Sat Jun 22 12:49:21 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * All CMODE_CHANGE and CUMODE_CHANGE notifys are now sent back
diff --git a/TODO b/TODO
index 8df5432ae9fa159cb1079e3eb063507cd906a076..6748473e9cb70694fde6aef779484e508351baa4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -45,8 +45,6 @@ TODO/bugs In SILC Server
 TODO/bugs In SILC Libraries
 ===========================
 
- o Remove ../lib/contrib/ from includes and use relative path instead.
-
  o WIN32 silc_net_create_connection_async does not work the same way
    than on Unix.  Do it with threads on WIN32.  The function works but
    is not actually async currently (Fix this to 0.9.x).
index 34dad65186a4ce62d9608cc22204873a3da7ae60..6e9d7c5858ae38f8c1262913696aa34863bce803 100644 (file)
@@ -72,7 +72,7 @@ AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h)
 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
-AC_CHECK_HEADERS(ncurses.h signal.h ctype.h regex.h utime.h iconv.h)
+AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h iconv.h)
 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
 
 # Data type checking
@@ -110,8 +110,7 @@ if test x$ac_socket_found = x0; then
 fi
 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
 AC_CHECK_FUNCS(select listen bind shutdown close connect)
-AC_CHECK_FUNCS(fcntl setsockopt)
-AC_CHECK_FUNCS(getopt_long time)
+AC_CHECK_FUNCS(fcntl setsockopt time)
 AC_CHECK_FUNCS(chmod stat fstat getenv putenv strerror ctime gettimeofday)
 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
 AC_CHECK_FUNCS(setgroups initgroups)
@@ -134,6 +133,14 @@ AC_CHECK_HEADERS(dlfcn.h,
     AC_MSG_RESULT(no SIM support found)),
   AC_MSG_RESULT(no SIM support found))
 
+#
+# lib/contrib conditionals
+#
+AC_CHECK_HEADER(regex.h, have_regex=1, have_regex=0)
+AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
+AC_CHECK_FUNC(getopt_long, have_getopt_long=1, have_getopt_long=0)
+AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
+
 #
 # Installation
 #
index ca7416396a59a42e59ad0892142ca67a49579ee2..a098bca6a108cbedc57bdf746a6af961bcbaced6 100644 (file)
@@ -180,7 +180,7 @@ extern "C" {
 #endif
 
 #ifndef HAVE_REGEX_H
-#include "../lib/contrib/regex.h"
+#include "regex.h"
 #else
 #include <regex.h>
 #endif
@@ -216,7 +216,7 @@ extern "C" {
 #endif                         /* !SILC_WIN32 */
 
 #ifndef HAVE_GETOPT_LONG
-#include "../lib/contrib/getopt.h"
+#include "getopt.h"
 #endif
 
 /* Include generic SILC type definitions */
index 78f02843efde0666653762b9c9bffa722fd6c04d..0c3ec06d8b83037cce2a357da4562bfcc5b74d14 100644 (file)
@@ -20,15 +20,30 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 noinst_LIBRARIES = libcontrib.a
 
+if HAVE_GETOPT_LONG
+GETOPT =
+else
+GETOPT = getopt.c getopt1.c
+endif
+
+if HAVE_REGEX
+REGEX =
+else
+REGEX = regex.c
+endif
+
 if SILC_WIN32
 libcontrib_a_SOURCES =
 else
 libcontrib_a_SOURCES = \
-       getopt.c \
-       getopt1.c \
-       regex.c
+       $(GETOPT) \
+       $(REGEX)
+endif
+
+if SILC_DIST_TOOLKIT
+include_HEADERS = getopt.h regex.h
 endif
 
-EXTRA_DIST = *.h
+EXTRA_DIST = *.c *.h
 
 include $(top_srcdir)/Makefile.defines.in