From 5e47d03ed37b87da72f4c1f8fca7a5efff6b0bb3 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 29 Oct 2010 12:10:16 +0100 Subject: [PATCH] Add libroken as its own library Include libroken as a library in its own right, so that the whole of the code can benefit from it. This change purely adds libroken for the Unix build system. It doesn't replace those pieces of libroken in hcrypto or util, or enable it for Windows. There is also the option of using a system-install libroken, if one is found at configure time. *) If --with-libroken=yes, or is not supplied than a system library will be used if suitable. Otherwise, we'll use the internal libroken *) If --with-libroken=/path/to/installation then the libroken at that path will be used. If there is no libroken there, or it is not suitable, an error will be returned *) If --with-libroken=internal then the internal libroken is used, regardless of what is present on the system. We deliberately do not provide installed headers for the internal libroken. If other applications wish to make use of libroken, then they should use the Heimdal one, rather than piggybacking on ours. Change-Id: Iff01e1e17090404cc8e4783108ae8a8784170918 Reviewed-on: http://gerrit.openafs.org/3191 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- Makefile.in | 13 ++-- acinclude.m4 | 69 ++++++++++++++++++-- configure.ac | 1 + src/cf/c-attribute.m4 | 27 ++++++++ src/cf/roken.m4 | 70 ++++++++++++++++++++ src/config/Makefile.config.in | 9 ++- src/crypto/hcrypto/Makefile.in | 31 ++++++++- src/crypto/hcrypto/roken.h | 4 ++ src/roken/.gitignore | 2 + src/roken/Makefile.in | 143 +++++++++++++++++++++++++++++++++++++++++ src/roken/config.h | 38 +++++++++++ src/roken/librokenafs.map | 33 ++++++++++ 12 files changed, 426 insertions(+), 14 deletions(-) create mode 100644 src/cf/c-attribute.m4 create mode 100644 src/cf/roken.m4 create mode 100644 src/roken/.gitignore create mode 100644 src/roken/Makefile.in create mode 100644 src/roken/config.h create mode 100644 src/roken/librokenafs.map diff --git a/Makefile.in b/Makefile.in index f09ec3a..7722436 100644 --- a/Makefile.in +++ b/Makefile.in @@ -148,7 +148,7 @@ config: prelude procmgmt: config +${COMPILE_PART1} procmgmt ${COMPILE_PART2} -util: procmgmt des lwp_depinstall rx_depinstall +util: $(DIR_roken) procmgmt des lwp_depinstall rx_depinstall +${COMPILE_PART1} util ${COMPILE_PART2} audit: util rx rxkad fsint @@ -165,12 +165,15 @@ cmd: comerr ${COMPILE_PART1} cmd ${COMPILE_PART2} ;; \ esac -hcrypto: config +hcrypto: config $(DIR_roken) +${COMPILE_PART1} crypto/hcrypto ${COMPILE_PART2} lwp: util lwp_depinstall +${COMPILE_PART1} lwp ${COMPILE_PART2} +roken: config + +${COMPILE_PART1} roken ${COMPILE_PART2} + rxgen: config +${COMPILE_PART1} rxgen ${COMPILE_PART2} @@ -656,7 +659,7 @@ finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs dviced dvolser \ venus update xstat afsmonitor rxdebug libafsrpc hcrypto \ libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \ - platform kopenafs authtools + platform kopenafs authtools $(DIR_roken) +${COMPILE_PART1} finale ${COMPILE_PART2} finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \ @@ -664,7 +667,7 @@ finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth lo dviced dvolser \ venus update xstat afsmonitor rxdebug libafsrpc hcrypto \ libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \ - platform kopenafs authtools + platform kopenafs authtools $(DIR_roken) +${COMPILE_PART1} finale ${COMPILE_PART2} check test: finale @@ -779,6 +782,7 @@ clean2: -${COMPILE_PART1} libuafs ${COMPILE_CLEAN} -${COMPILE_PART1} tests ${COMPILE_CLEAN} -${COMPILE_PART1} crypto/hcrypto ${COMPILE_CLEAN} + -${COMPILE_PART1} roken ${COMPILE_CLEAN} -(cd src/libafs; /bin/rm -rf afs afsint config rx) -(cd src/libuafs; /bin/rm -rf afs afsint config rx des) -/bin/rm -rf ${TOP_INCDIR} ${TOP_LIBDIR} ${TOP_JLIBDIR} @@ -878,6 +882,7 @@ distclean: clean src/procmgmt/test/Makefile \ src/ptserver/Makefile \ src/tptserver/Makefile \ + src/roken/Makefile \ src/rx/Makefile \ src/rx/bulk.example/Makefile \ src/rx/bulktest/Makefile \ diff --git a/acinclude.m4 b/acinclude.m4 index 70b27fd..7d5d0bf 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1206,12 +1206,13 @@ dnl checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT -AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h grp.h) +AC_CHECK_HEADERS(stdlib.h stdint.h string.h unistd.h fcntl.h sys/time.h sys/file.h grp.h) AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h) AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h sys/pag.h) AC_CHECK_HEADERS(windows.h direct.h sys/ipc.h sys/resource.h sys/un.h) AC_CHECK_HEADERS(security/pam_modules.h ucontext.h regex.h sys/statvfs.h sys/statfs.h sys/bitypes.h) +AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h errno.h time.h syslog.h) AC_CHECK_HEADERS(linux/errqueue.h,,,[#include ]) AC_CHECK_HEADERS(et/com_err.h) @@ -1254,7 +1255,6 @@ AC_SUBST(BUILD_LOGIN) AC_CHECK_FUNCS([ \ arc4random \ - daemon \ flock \ fseeko64 \ ftello64 \ @@ -1281,19 +1281,48 @@ AC_CHECK_FUNCS([ \ snprintf \ strcasestr \ strerror \ - strlcat \ - strlcpy \ timegm \ vsnprintf \ vsyslog \ ]) +OPENAFS_ROKEN() +OPENAFS_C_ATTRIBUTE() + +dnl Functions that Heimdal's libroken provides, but that we +dnl haven't found a need for yet, and so haven't imported +AC_CHECK_FUNCS([ \ + chown \ + fchown \ + getdtablesize \ + gethostname \ + gettimeofday \ + localtime_r \ + lstat \ + inet_aton \ + inet_ntop \ + inet_pton \ + readv \ + strdup \ + strftime \ + strndup \ + strsep \ +]) + dnl Functions that we're going to try and get from libroken AC_REPLACE_FUNCS([ \ + daemon \ + ecalloc \ + emalloc \ + erealloc \ err \ errx \ + getopt \ getprogname \ + strcasecmp \ + strlcat \ + strnlen \ strlcpy \ verr \ verrx \ @@ -1308,9 +1337,18 @@ AC_CHECK_HEADERS([ \ err.h \ ]) +AC_CHECK_DECLS([h_errno], [], [], [ +#include +#ifdef HAVE_NETDB_H +#include +#endif +]) + +AC_HEADER_TIME + ROKEN_HEADERS= AS_IF([test "$ac_cv_header_err_h" != "yes" ], - [ROKEN_HEADERS="$ROKEN_HEADERS err.h"], + [ROKEN_HEADERS="$ROKEN_HEADERS \$(TOP_INCDIR)/err.h"], []) AC_SUBST(ROKEN_HEADERS) @@ -1362,6 +1400,27 @@ AC_CHECK_TYPE([socklen_t],[], [#include #include ]) AC_CHECK_TYPES(off64_t) +AC_CHECK_TYPES([ssize_t], [], [], [#include ]) +AC_CHECK_TYPES([struct winsize], [], [], [ +#include +#include ]) +AC_CHECK_TYPES([sa_family_t, socklen_t, struct sockaddr, + struct sockaddr_storage], + [], [], [ +#include +#include +]) +AC_CHECK_TYPES([sa_family_t], [], [], [ +#include +#include +]) +AC_CHECK_TYPES([struct addrinfo], [], [], [ +#include +#ifdef HAVE_NETDB_H +#include +#endif +]) + AC_SIZEOF_TYPE(long) AC_HEADER_PAM_CONST diff --git a/configure.ac b/configure.ac index 136ee59..ddc14c1 100644 --- a/configure.ac +++ b/configure.ac @@ -194,6 +194,7 @@ src/procmgmt/Makefile \ src/procmgmt/test/Makefile \ src/ptserver/Makefile \ src/tptserver/Makefile \ +src/roken/Makefile \ src/rx/Makefile \ src/rx/bulk.example/Makefile \ src/rx/bulktest/Makefile \ diff --git a/src/cf/c-attribute.m4 b/src/cf/c-attribute.m4 new file mode 100644 index 0000000..c179d90 --- /dev/null +++ b/src/cf/c-attribute.m4 @@ -0,0 +1,27 @@ +dnl +dnl $Id$ +dnl + +dnl +dnl Test for __attribute__ +dnl + +AC_DEFUN([OPENAFS_C_ATTRIBUTE], [ +AC_MSG_CHECKING(for __attribute__) +AC_CACHE_VAL(ac_cv___attribute__, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include +static void foo(void) __attribute__ ((noreturn)); + +static void +foo(void) +{ + exit(1); +} +]])], +[ac_cv___attribute__=yes], +[ac_cv___attribute__=no])]) +if test "$ac_cv___attribute__" = "yes"; then + AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) +fi +AC_MSG_RESULT($ac_cv___attribute__) +]) diff --git a/src/cf/roken.m4 b/src/cf/roken.m4 new file mode 100644 index 0000000..67f261f --- /dev/null +++ b/src/cf/roken.m4 @@ -0,0 +1,70 @@ + +AC_DEFUN([_OPENAFS_ROKEN_INTERNAL], [ + DIR_roken=roken + CPPFLAGS_roken= + LDFLAGS_roken="-L\$(TOP_LIBDIR)" + LIB_roken=-lrokenafs +]) + +dnl _OPENAFS_ROKEN_CHECK($path, +dnl $action-if-found, +dnl $action-if-not-found) +dnl Find a roken library at $path. +dnl +dnl If $path is not specified, +dnl try to find one in the standard locations on the system. +dnl +dnl If we fail, and $path was given, then error out. Otherwise, +dnl fall back to the internal roken implementation +AC_DEFUN([_OPENAFS_ROKEN_CHECK], [ + roken_path=$1 + + save_CPPFLAGS=$CPPFLAGS + save_LDFLAGS=$LDFLAGS + save_LIBS=$LIBS + AS_IF([test x"$roken_path" != x], + [CPPFLAGS="-I$roken_path/include $CPPFLAGS" + LDFLAGS="-L$roken_path/lib $LDFLAGS"]) + + dnl Need to be careful what we check for here, as libroken contains + dnl different symbols on different platforms. + AC_CHECK_LIB([roken], [ct_memcmp], [found_foundlib=true]) + AC_CHECK_HEADER([roken], [roken_foundheader=true]) + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + + AS_IF([test x"$roken_foundlib" = xtrue && test x"roken_foundheader" = xtrue], + [AS_IF([test x"$roken_path" != x], + [CPPFLAGS_roken = "-I$roken_path/include" + LDFLAGS_roken="-I$roken_path/lib" + LIB_roken="-lroken"]) + $2], + [$3]) +]) + +AC_DEFUN([OPENAFS_ROKEN], [ + roken_root= + AC_SUBST(LIB_roken) + AC_SUBST(CPPFLAGS_roken) + AC_SUBST(LDFLAGS_roken) + AC_SUBST(DIR_roken) + + AC_ARG_WITH([roken], + [AS_HELP_STRING([--with-roken=DIR], + [Location of the roken library, or 'internal'])], + [AS_IF([test x"$withval" = xno], + [AC_ERROR("OpenAFS requires roken to build")], + [AS_IF([test x"$withval" != xyes], + [roken_root="$withval"]) + ]) + ]) + + AS_IF([test x"$roken_root" = xinteral], + [_OPENAFS_ROKEN_INTERNAL()], + [AS_IF([test x"$roken_root" = x], + [_OPENAFS_ROKEN_CHECK([], [], [_OPENAFS_ROKEN_INTERNAL()])], + [_OPENAFS_ROKEN_CHECK($roken_root, + [AC_MSG_ERROR([Cannot find roken at that location])]) + ]) + ]) +]) diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 2016b8b..890fa57 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -36,6 +36,7 @@ AFSD_LIBS = @AFSD_LIBS@ AFSD_LDFLAGS = @AFSD_LDFLAGS@ CC = @CC@ CPP = @CPP@ +CPPFLAGS_roken = @CPPFLAGS_roken@ CCOBJ = @CCOBJ@ CCXPG2 = @CCXPG2@ CFLAGS = @CFLAGS@ @@ -43,15 +44,18 @@ CP = @CP@ DARWIN_INFOFILE=@DARWIN_INFOFILE@ DBG = @DBG@ DEST = @DEST@ +DIR_roken = @DIR_roken@ FSINCLUDES = @FSINCLUDES@ INCLUDE_LIBINTL = @INCLUDE_libintl@ KERN_DBG = @KERN_DBG@ KERN_OPTMZ = @KERN_OPTMZ@ LD = @LD@ +LDFLAGS_roken = @LDFLAGS_roken@ LEX = @LEX@ LIB_AFSDB = @LIB_AFSDB@ LIB_crypt = @LIB_crypt@ LIB_hcrypto = @LIB_hcrypto@ +LIB_roken = @LIB_roken@ LIBS = @LIBS@ LIB_LIBINTL = @LIB_libintl@ LINUX_KERNEL_PATH = @LINUX_KERNEL_PATH@ @@ -135,9 +139,10 @@ SHELL = /bin/sh COMMON_INCL=$(MODULE_INCLUDE) -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \ -I${srcdir} -I. -COMMON_CFLAGS=$(CFLAGS) ${DBG} ${OPTMZ} ${COMMON_INCL} ${INCLUDE_LIBINTL} +COMMON_CFLAGS=$(CFLAGS) ${DBG} ${OPTMZ} ${COMMON_INCL} ${INCLUDE_LIBINTL} \ + $(CPPFLAGS_libroken) -COMMON_LDFLAGS=$(LDFLAGS) $(DBG) $(OPTMZ) +COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_roken) $(DBG) $(OPTMZ) # LWP Flags LWP_CFLAGS=$(COMMON_CFLAGS) $(MODULE_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) diff --git a/src/crypto/hcrypto/Makefile.in b/src/crypto/hcrypto/Makefile.in index 88ab927..c5483e2 100644 --- a/src/crypto/hcrypto/Makefile.in +++ b/src/crypto/hcrypto/Makefile.in @@ -33,7 +33,7 @@ HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \ UPSTREAM= ${TOP_SRCDIR}/external/heimdal -MODULE_INCLUDE=-I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto +MODULE_INCLUDE=-I${srcdir} -I${TOP_INCDIR}/hcrypto -I$(UPSTREAM)/hcrypto SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR} @@ -272,8 +272,18 @@ net_write.o: ${UPSTREAM}/roken/net_write.c # out into a new libroken top level target, which allows the use of an # existing libroken, if one is available. -strlcpy.o: ${UPSTREAM}/roken/strlcpy.c - $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c + +daemon.o: ${UPSTREAM}/roken/daemon.c + $(AFS_CCRULE) $(UPSTREAM)/roken/daemon.c + +ecalloc.o: ${UPSTREAM}/roken/ecalloc.c + $(AFS_CCRULE) $(UPSTREAM)/roken/ecalloc.c + +emalloc.o: ${UPSTREAM}/roken/emalloc.c + $(AFS_CCRULE) $(UPSTREAM)/roken/emalloc.c + +erealloc.o: ${UPSTREAM}/roken/erealloc.c + $(AFS_CCRULE) $(UPSTREAM)/roken/erealloc.c err.h: ${UPSTREAM}/roken/err.hin cp $? $@ @@ -284,9 +294,24 @@ err.o: ${UPSTREAM}/roken/err.c errx.o: ${UPSTREAM}/roken/errx.c $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c +getopt.o: ${UPSTREAM}/roken/getopt.c + $(AFS_CCRULE) $(UPSTREAM)/roken/getopt.c + getprogname.o: ${UPSTREAM}/roken/getprogname.c $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c +socket.o: ${UPSTREAM}/roken/socket.c + $(AFS_CCRULE) $(UPSTREAM)/roken/socket.c + +strlcat.o: ${UPSTREAM}/roken/strlcat.c + $(AFS_CCRULE) $(UPSTREAM)/roken/strlcat.c + +strlcpy.o: ${UPSTREAM}/roken/strlcpy.c + $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c + +strnlen.o: ${UPSTREAM}/roken/strnlen.c + $(AFS_CCRULE) $(UPSTREAM)/roken/strnlen.c + verr.o: ${UPSTREAM}/roken/verr.c $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c diff --git a/src/crypto/hcrypto/roken.h b/src/crypto/hcrypto/roken.h index ed218c1..dfdf4ec 100644 --- a/src/crypto/hcrypto/roken.h +++ b/src/crypto/hcrypto/roken.h @@ -95,4 +95,8 @@ ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL getprogname(void); #endif +#ifndef _PATH_DEVNULL +#define _PATH_DEVNULL "/dev/null" +#endif + #endif /* OPENAFS_ROKEN_H */ diff --git a/src/roken/.gitignore b/src/roken/.gitignore new file mode 100644 index 0000000..86c95ca --- /dev/null +++ b/src/roken/.gitignore @@ -0,0 +1,2 @@ +/librokenafs.exp +/err.h diff --git a/src/roken/Makefile.in b/src/roken/Makefile.in new file mode 100644 index 0000000..55c96c7 --- /dev/null +++ b/src/roken/Makefile.in @@ -0,0 +1,143 @@ +# A roken library for AFS + +LIBMAJOR=1 +LIBMINOR=1 + +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config +include @TOP_OBJDIR@/src/config/Makefile.shared + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +HEADERS = ${TOP_INCDIR}/roken.h \ + ${TOP_INCDIR}/roken-common.h + +UPSTREAM = $(TOP_SRCDIR)/external/heimdal/roken + +SHLIBOBJ = librokenafs.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR} + +all: $(ROKEN_HEADERS) $(HEADERS) \ + $(TOP_LIBDIR)/$(SHLIBOBJ) \ + $(TOP_LIBDIR)/librokenafs.a + +install: librokenafs.a $(SHLIBOBJ) + $(TOP_OBJDIR)/src/config/shlib-install -d $(DESTDIR)$(libdir) \ + -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR) + $(INSTALL_DATA) librokenafs.a $(DESTDIR)$(libdir)/librokenafs.a + +dest: librokenafs.a $(SHLIBOBJ) + $(TOP_OBJDIR)/src/config/shlib-install -d $(DEST)/lib \ + -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR) + $(INSTALL_DATA) librokenafs.a $(DEST)/lib/librokenafs.a + +clean: + $(RM) -f $(OBJECTS) $(SHLIBOBJ) librokenafs.a librokenafs.exp + +OBJECTS = $(ROKEN_LIBOBJS) \ + cloexec.o ct.o hex.o issuid.o net_read.o net_write.o socket.o \ + warnerr.o + +$(TOP_LIBDIR)/$(SHLIBOBJ): $(SHLIBOBJ) + $(TOP_OBJDIR)/src/config/shlib-install -d $(TOP_LIBDIR) \ + -l librokenafs -M $(LIBMAJOR) -m $(LIBMINOR) + +$(SHLIBOBJ): $(OBJECTS) librokenafs.map + $(TOP_OBJDIR)/src/config/shlib-build -i -d $(srcdir) -l librokenafs \ + -M $(LIBMAJOR) -m $(LIBMINOR) -- \ + $(OBJECTS) $(MT_LIBS) + +$(TOP_LIBDIR)/librokenafs.a: librokenafs.a + $(INSTALL_DATA) $? $@ + +librokenafs.a: $(OBJECTS) + $(RM) -f $@ + $(AR) crv $@ $(OBJECTS) + $(RANLIB) $@ + +$(TOP_INCDIR)/err.h: ${UPSTREAM}/err.hin + cp $? $@ + +$(TOP_INCDIR)/roken.h: $(UPSTREAM)/roken.h.in + $(INSTALL_DATA) $? $@ + +$(TOP_INCDIR)/roken-common.h: $(UPSTREAM)/roken-common.h + $(INSTALL_DATA) $? $@ + +err.h: ${UPSTREAM}/err.hin + cp $? $@ + +cloexec.o: ${UPSTREAM}/cloexec.c + $(AFS_CCRULE) $(UPSTREAM)/cloexec.c + +ct.o: ${UPSTREAM}/ct.c + $(AFS_CCRULE) $(UPSTREAM)/ct.c + +daemon.o: ${UPSTREAM}/daemon.c + $(AFS_CCRULE) $(UPSTREAM)/daemon.c + +ecalloc.o: ${UPSTREAM}/ecalloc.c + $(AFS_CCRULE) $(UPSTREAM)/ecalloc.c + +emalloc.o: ${UPSTREAM}/emalloc.c + $(AFS_CCRULE) $(UPSTREAM)/emalloc.c + +erealloc.o: ${UPSTREAM}/erealloc.c + $(AFS_CCRULE) $(UPSTREAM)/erealloc.c + +err.o: ${UPSTREAM}/err.c err.h + $(AFS_CCRULE) $(UPSTREAM)/err.c + +errx.o: ${UPSTREAM}/errx.c err.h + $(AFS_CCRULE) $(UPSTREAM)/errx.c + +getopt.o: ${UPSTREAM}/getopt.c + $(AFS_CCRULE) $(UPSTREAM)/getopt.c + +getprogname.o: ${UPSTREAM}/getprogname.c + $(AFS_CCRULE) $(UPSTREAM)/getprogname.c + +hex.o: ${UPSTREAM}/hex.c + $(AFS_CCRULE) $(UPSTREAM)/hex.c + +issuid.o: ${UPSTREAM}/issuid.c + $(AFS_CCRULE) $(UPSTREAM)/issuid.c + +net_read.o: ${UPSTREAM}/net_read.c + $(AFS_CCRULE) $(UPSTREAM)/net_read.c + +net_write.o: ${UPSTREAM}/net_write.c + $(AFS_CCRULE) $(UPSTREAM)/net_write.c + +socket.o: ${UPSTREAM}/socket.c + $(AFS_CCRULE) $(UPSTREAM)/socket.c + +strlcat.o: ${UPSTREAM}/strlcat.c + $(AFS_CCRULE) $(UPSTREAM)/strlcat.c + +strlcpy.o: ${UPSTREAM}/strlcpy.c + $(AFS_CCRULE) $(UPSTREAM)/strlcpy.c + +strnlen.o: ${UPSTREAM}/strnlen.c + $(AFS_CCRULE) $(UPSTREAM)/strnlen.c + +verr.o: ${UPSTREAM}/verr.c err.h + $(AFS_CCRULE) $(UPSTREAM)/verr.c + +verrx.o: ${UPSTREAM}/verrx.c err.h + $(AFS_CCRULE) $(UPSTREAM)/verrx.c + +vwarn.o: ${UPSTREAM}/vwarn.c err.h + $(AFS_CCRULE) $(UPSTREAM)/vwarn.c + +vwarnx.o: ${UPSTREAM}/vwarnx.c err.h + $(AFS_CCRULE) $(UPSTREAM)/vwarnx.c + +warn.o: ${UPSTREAM}/warn.c err.h + $(AFS_CCRULE) $(UPSTREAM)/warn.c + +warnerr.o: ${UPSTREAM}/warnerr.c err.h + $(AFS_CCRULE) $(UPSTREAM)/warnerr.c + +warnx.o: ${UPSTREAM}/warnx.c err.h + $(AFS_CCRULE) $(UPSTREAM)/warnx.c diff --git a/src/roken/config.h b/src/roken/config.h new file mode 100644 index 0000000..80b0640 --- /dev/null +++ b/src/roken/config.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 Your File System Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS 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 AUTHOR 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. + */ + +#include +#include + +#if defined(AFS_NT40_ENV) +# define inline __inline +#elif defined(AFS_HPUX_ENV) || defined(AFS_USR_HPUX_ENV) +# define inline +#elif defined(AFS_AIX_ENV) || defined(AFS_USR_AIX_ENV) +# define inline +#elif defined(AFS_SGI_ENV) || defined(AFS_USR_SGI_ENV) +# define inline +#elif defined(AFS_NBSD_ENV) +# define inline __inline __attribute__((always_inline)) +#endif diff --git a/src/roken/librokenafs.map b/src/roken/librokenafs.map new file mode 100644 index 0000000..11bca46 --- /dev/null +++ b/src/roken/librokenafs.map @@ -0,0 +1,33 @@ +{ + global: + ct_memcmp; + daemon; + err; + errx; + getopt; + getprogname; + issuid; + net_read; + net_write; + rk_cloexec; + rk_cloexec_file; + rk_ecalloc; + rk_emalloc; + rk_erealloc; + rk_hex_encode; + rk_print_version; + rk_socket; + rk_strcasecmp; + rk_strlcat; + rk_strnlen; + rk_strlcpy; + strcasecmp; + verr; + verrx; + vwarn; + vwarnx; + warn; + warnx; + local: + *; +}; -- 1.9.4