From 666eb6a771f78fc48263d8551be4bf7e1848d709 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 22 Jun 2002 16:59:12 +0000 Subject: [PATCH] Made lib/contrib stuff compilation conditional. --- CHANGES | 3 +++ TODO | 2 -- configure.in.pre | 13 ++++++++++--- includes/silcincludes.h | 4 ++-- lib/contrib/Makefile.am | 23 +++++++++++++++++++---- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 0c3c2330..8885307a 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,9 @@ Sat Jun 22 17:06:58 EEST 2002 Pekka Riikonen 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 * All CMODE_CHANGE and CUMODE_CHANGE notifys are now sent back diff --git a/TODO b/TODO index 8df5432a..6748473e 100644 --- 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). diff --git a/configure.in.pre b/configure.in.pre index 34dad651..6e9d7c58 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -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 # diff --git a/includes/silcincludes.h b/includes/silcincludes.h index ca741639..a098bca6 100644 --- a/includes/silcincludes.h +++ b/includes/silcincludes.h @@ -180,7 +180,7 @@ extern "C" { #endif #ifndef HAVE_REGEX_H -#include "../lib/contrib/regex.h" +#include "regex.h" #else #include #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 */ diff --git a/lib/contrib/Makefile.am b/lib/contrib/Makefile.am index 78f02843..0c3ec06d 100644 --- a/lib/contrib/Makefile.am +++ b/lib/contrib/Makefile.am @@ -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 -- 2.24.0