OSSP CVS Repository

ossp - Check-in [1059]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1059
Date: 2001-Oct-02 20:37:19 (local)
2001-Oct-02 18:37:19 (UTC)
User:rse
Branch:
Comment: Upgrade ad-hoc build environment to standard OSSP build environment.
Tickets:
Inspections:
Files:
ossp-pkg/sa/.cvsignore      1.1 -> 1.2     6 inserted, 0 deleted
ossp-pkg/sa/Makefile.in      1.1 -> 1.2     91 inserted, 29 deleted
ossp-pkg/sa/autogen.sh      1.1 -> 1.2     9 inserted, 9 deleted
ossp-pkg/sa/configure.ac      1.1 -> 1.2     38 inserted, 12 deleted
ossp-pkg/sa/sa_test.c      added-> 1.1
ossp-pkg/sa/test.c      1.1->removed

ossp-pkg/sa/.cvsignore 1.1 -> 1.2

--- .cvsignore   2001/10/02 13:36:08     1.1
+++ .cvsignore   2001/10/02 18:37:19     1.2
@@ -1,4 +1,10 @@
+config.guess
+config.sub
+ltmain.sh
+libtool.m4
+shtool
 configure
 config.h.in
 Makefile
 config.h
+sa_test


ossp-pkg/sa/Makefile.in 1.1 -> 1.2

--- Makefile.in  2001/10/02 13:27:44     1.1
+++ Makefile.in  2001/10/02 18:37:19     1.2
@@ -1,44 +1,106 @@
+##
+##  SA - OSSP Socket Abstraction Library
+##  Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
+##  Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
+##
+##  This file is part of OSSP SA, a socket abstraction library which
+##  can be found at http://www.ossp.org/pkg/sa/.
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  Makefile.in: make(1) build procedure
+##
+
+@SET_MAKE@
+
+DESTDIR     =
+prefix      = @prefix@
+exec_prefix = @exec_prefix@
+bindir      = @bindir@
+libdir      = @libdir@
+includedir  = @includedir@
+mandir      = @mandir@
+
+CC          = @CC@
+CPPFLAGS    = @CPPFLAGS@
+CFLAGS      = @DEFS@ @CFLAGS@
+LDFLAGS     = @LDFLAGS@
+LIBS        = @LIBS@
+RM          = rm -f
+SHTOOL      = ./shtool
+LIBTOOL     = ./libtool
+
+LIB_NAME    = libsa.la
+LIB_OBJS    = sa.lo
 
-CC      = @CC@
-CFLAGS  = @CFLAGS@ @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS    = @LIBS@
-AR      = @AR@
-RANLIB  = @RANLIB@
-RM      = rm -f
+TST_NAME    = sa_test
+TST_OBJS    = sa_test.o
 
-PRG_NAME = test
-PRG_OBJS = test.o
+.SUFFIXES:
+.SUFFIXES: .c .o .lo
 
-LIB_NAME = libsa.a
-LIB_OBJS = sa.o
-
-all: $(LIB_NAME)
+all: $(LIB_NAME) $(TST_NAME)
 
 .c.o:
-        $(CC) $(CFLAGS) -c $<
+        @$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+
+.c.lo:
+        @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 $(LIB_NAME): $(LIB_OBJS)
-        $(AR) rc $(LIB_NAME) $(LIB_OBJS)
-        $(RANLIB) $(LIB_NAME)
+        @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l txt -d libtool VERSION`
 
-$(PRG_NAME): $(PRG_OBJS) $(LIB_NAME)
-        $(CC) $(LDFLAGS) -o $(PRG_NAME) $(PRG_OBJS) $(LIB_NAME) $(LIBS)
+$(TST_NAME): $(TST_OBJS)
+        @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(TST_NAME) $(TST_OBJS) $(LIB_NAME) $(LIBS)
 
-check: $(PRG_NAME)
-        ./$(PRG_NAME)
+check: $(TST_NAME)
+        @$(LIBTOOL) --mode=execute ./$(TST_NAME)
 
-clean: 
-        $(RM) $(LIB_NAME) $(LIB_OBJS)
-        $(RM) $(PRG_NAME) $(PRG_OBJS)
+install:
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)
+        @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libsa.la $(DESTDIR)$(libdir)/
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)
+        $(SHTOOL) install -c -m 644 sa.h $(DESTDIR)$(includedir)/
+
+clean:
+        -$(RM) $(LIB_NAME) $(LIB_OBJS)
+        -$(RM) $(TST_NAME) $(TST_OBJS)
+        -$(RM) -r .libs >/dev/null 2>&1
+        -$(RM) *.o *.lo
 
 distclean: clean
-        $(RM) config.cache config.log config.status
-        $(RM) config.h
-        $(RM) Makefile
+        -$(RM) config.log config.status config.cache
+        -$(RM) Makefile config.h
+        -$(RM) libtool
 
 realclean: distclean
-        $(RM) config.h.in configure
-
-install:
+        -$(RM) configure config.h.in
+        -$(RM) shtool
+        -$(RM) ltmain.sh libtool.m4 config.guess config.sub
+
+version:
+        $(SHTOOL) version -l txt -e VERSION
+
+dist: distclean
+        @$(SHTOOL) fixperm -v .; \
+        V=`$(SHTOOL) version -l txt -d short VERSION`; \
+        $(SHTOOL) tarball -o sa-$${V}.tar.gz -d sa-$${V} -u ossp -g ossp \
+                          -e 'CVS,\.cvsignore,\.[ao],^\.,autogen.sh' -c 'gzip --best' .
 


ossp-pkg/sa/autogen.sh 1.1 -> 1.2

--- autogen.sh   2001/10/02 13:27:44     1.1
+++ autogen.sh   2001/10/02 18:37:19     1.2
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 #   generator tools version sanity check
-#    "libtoolize --version 4 1.4.2 1.4*"
-#    "shtoolize  -v        3 1.5.4 1.5.*"
 for spec in \
-    "autoconf   --version 4 2.52  2.5*"
+    "autoconf   --version 4 2.52  2.5*" \
+    "libtoolize --version 4 1.4.2 1.4*" \
+    "shtoolize  -v        3 1.5.4 1.5.*"
 do
     set -- $spec
     t="$1"
@@ -31,10 +31,10 @@
 done
 
 #   GNU Libtool generation
-# echo "GNU Libtool $libtoolize_version -> ltmain.sh, libtool.m4, config.guess, config.sub"
-# libtoolize --force --copy >/dev/null 2>&1
-# cp `libtoolize --force --copy --dry-run | grep "add the contents of" |\
-#     sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4
+echo "GNU Libtool $libtoolize_version -> ltmain.sh, libtool.m4, config.guess, config.sub"
+libtoolize --force --copy >/dev/null 2>&1
+cp `libtoolize --force --copy --dry-run | grep "add the contents of" |\
+    sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4
 
 #   GNU Autoconf generation
 echo "GNU Autoconf $autoconf_version -> configure, config.h.in"
@@ -42,6 +42,6 @@
 autoheader
 
 #   GNU Shtool generation
-# echo "GNU Shtool $shtoolize_version -> shtool"
-# shtoolize -q all
+echo "GNU Shtool $shtoolize_version -> shtool"
+shtoolize -q all
 


ossp-pkg/sa/configure.ac 1.1 -> 1.2

--- configure.ac 2001/10/02 13:27:44     1.1
+++ configure.ac 2001/10/02 18:37:19     1.2
@@ -1,26 +1,52 @@
 dnl ##
-dnl ##  Autoconf specification for SA library
+dnl ##  SA - OSSP Socket Abstraction Library
+dnl ##  Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
+dnl ##  Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
+dnl ##
+dnl ##  This file is part of OSSP SA, a socket abstraction library which
+dnl ##  can be found at http://www.ossp.org/pkg/sa/.
+dnl ##
+dnl ##  Permission to use, copy, modify, and distribute this software for
+dnl ##  any purpose with or without fee is hereby granted, provided that
+dnl ##  the above copyright notice and this permission notice appear in all
+dnl ##  copies.
+dnl ##
+dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl ##  SUCH DAMAGE.
+dnl ##
+dnl ##  configure.ac: GNU Autoconf source script
 dnl ##
 
-AC_PREREQ(2.52)dnl
+AC_PREREQ(2.52)
 AC_REVISION(1.0)
+AC_INIT(sa.h)
 
-AC_INIT(README)
-AC_PREFIX_DEFAULT(/usr/local)
-AC_CONFIG_HEADER(config.h)
+AC_DIVERT_PUSH(NOTICE)
+V=`./shtool version -l txt -d long VERSION`
+./shtool echo -e "Configuring %BOSSP SA%b, Version %B${V}%b"
+AC_DIVERT_POP()
 
 AC_SET_MAKE
 AC_PROG_CC
-AC_PROG_CPP
-AC_CHECK_PROG(AR, ar, ar)
-AC_PROG_RANLIB
-
 AC_CHECK_DEBUGGING
 
+sinclude(libtool.m4)
+AC_PROG_LIBTOOL
+
 sinclude(sa.ac)
 AC_CHECK_SA
 
-AC_OUTPUT(dnl
-Makefile dnl
-)dnl
+AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
 


ossp-pkg/sa/sa_test.c -> 1.1

*** /dev/null    Mon Sep 28 08:19:46 2020
--- -    Mon Sep 28 08:19:49 2020
***************
*** 0 ****
--- 1,80 ----
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <time.h>
+ #include <syslog.h>
+ #include <sys/utsname.h>
+ 
+ #include "sa.h"
+ 
+ /* see RFC3164 */
+ 
+ static void die(char *fmt, ...)
+ {
+     va_list ap;
+ 
+     va_start(ap, fmt);
+     fprintf(stderr, "test:ERROR: ");
+     vfprintf(stderr, fmt, ap);
+     fprintf(stderr, "\n");
+     va_end(ap);
+     exit(1);
+ }
+ 
+ int main(int argc, char *argv[]) 
+ {
+     sa_addr_t *ra;
+     sa_addr_t *la;
+     sa_t *sa;
+     char caBuf[1024];
+     int nBuf;
+     char caTime[15+1];
+     time_t now;
+     struct tm *tm;
+     char caHost;
+     struct utsname uts;
+     char *cp;
+     char caTag[32+1];
+     char *cpHost;
+     int n;
+ 
+     if (sa_u2a(&ra, "udp://%s:514", argv[1]) != SA_OK)
+         die("sa_u2a ra");
+     if (sa_u2a(&la, "udp://0.0.0.0:0") != SA_OK)
+         die("sa_u2a la");
+     if (sa_create(&sa) != SA_OK)
+         die("sa_create");
+     if (sa_bind(sa, la) != SA_OK)
+         die("sa_bind");
+ 
+     /* RFC3164: The BSD syslog Protocol; C. Lonvick; August 2001. */
+ 
+     now = time(NULL);
+     tm = localtime(&now);
+     strftime(caTime, sizeof(caTime), "%b %e %H:%M:%S", tm);
+ 
+     if (uname(&uts) == 0) {
+         cpHost = strdup(uts.nodename);
+         if ((cp = strchr(cpHost, '.')) != NULL)
+             *cp = '\0';
+     }
+     else
+         cpHost = strdup("0.0.0.0"); /* FIXME */
+ 
+     strcpy(caTag, "progname[12]: ");
+     if (strlen(caTag) > 32)
+         caTag[32] = '\0';
+ 
+     sprintf(caBuf, "<%d>%s %s %s%s", LOG_MAIL|LOG_EMERG, caTime, cpHost, caTag, argv[2]);
+     fprintf(stderr, "%s\n", caBuf);
+     nBuf = strlen(caBuf);
+     if (sa_writeto(sa, caBuf, nBuf, &n, ra) != SA_OK)
+         die("sa_writeto");
+     if (sa_destroy(sa) != SA_OK)
+         die("sa_destroy");
+     free(ra);
+     free(la);
+     return 0;
+ }
+ 


ossp-pkg/sa/test.c 1.1 -> 1.2


CVSTrac 2.0.1