Index: ossp-pkg/rc/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/rc/Makefile.in,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/rc/Makefile.in,v' 2>/dev/null --- Makefile.in 2002/02/05 14:11:52 1.6 +++ Makefile.in 2002/02/05 17:29:17 1.7 @@ -48,9 +48,12 @@ RM = rm -f RMDIR = rmdir SHTOOL = ./shtool +LIBTOOL = ./libtool POD2MAN = pod2man TRUE = true +PROG_NAME = rc + TARGET = $(TARGET_PROGS) $(TARGET_MANS) TARGET_PROGS = rc TARGET_MANS = rc.1 rc-sample.5 @@ -61,9 +64,11 @@ SUBDIRS = @SUBDIR_EX@ @SUBDIR_VAR@ @SUBDIR_STR@ @SUBDIR_POPT@ .SUFFIXES: -.SUFFIXES: .c .cc .cpp .o +.SUFFIXES: .c .cc .cpp .o .lo .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $< +.c.lo: + $(LIBTOOL) --mode=compile --quiet $(CC) -c $(CPPFLAGS) $(CFLAGS) $< all: _SUBDIRS_all $(TARGET) @@ -86,18 +91,18 @@ echo "<=== $(_SUBDIRS_DP)$$subdir"; \ done -$(TARGET_PROGS): Makefile $(OBJS) - $(CC) $(LDFLAGS) -o $(TARGET_PROGS) $(OBJS) $(LIBS) - -$(OBJS): Makefile - # Build pcre regex library rc_pcre.lo: rc_pcre.tab rc_pcre.c rc_pcre.tab: rc_pcre.c - $(CC) $(CFLAGS) -DRC_PCRE_TAB $(LDFLAGS) -o rc_pcre.gen rc_pcre.c $(LIBS) +# $(CC) $(CFLAGS) -DRC_PCRE_TAB $(LDFLAGS) -o rc_pcre.gen rc_pcre.c $(LIBS) + $(CC) $(CFLAGS) -DRC_PCRE_TAB $(LDFLAGS) -o rc_pcre.gen rc_pcre.c ./rc_pcre.gen >rc_pcre.tab $(RM) rc_pcre.gen +$(PROG_NAME): $(OBJS) +# $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o $(PROG_NAME) $(OBJS) $(LIBS) + $(CC) $(LDFLAGS) -o $(PROG_NAME) $(OBJS) $(LIBS) + rc.1: rc.pod VS=`$(SHTOOL) version -lc -dshort rc_version.c`; \ VL=`$(SHTOOL) version -lc -dlong rc_version.c`; \ @@ -126,8 +131,12 @@ distclean: clean $(RM) config.log config.status config.cache $(RM) Makefile rc_config.h rc_pcre.tab + $(RM) config.log config.status config.cache + $(RM) Makefile rc_config.h + $(RM) libtool realclean: distclean + $(RM) ltmain.sh libtool.m4 config.guess config.sub $(RM) configure rc_config.h.in $(RM) shtool Index: ossp-pkg/rc/configure.in RCS File: /v/ossp/cvs/ossp-pkg/rc/configure.in,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/rc/configure.in,v' 2>/dev/null --- configure.in 2002/02/04 22:35:20 1.8 +++ configure.in 2002/02/05 17:29:17 1.9 @@ -34,7 +34,7 @@ dnl Announce the product and version AC_DIVERT_PUSH(NOTICE) -V=`./shtool version -lc -dlong version.c` +V=`./shtool version -lc -dlong rc_version.c` ./shtool echo -e "Configuring %BOSSP rc%b, Version %B${V}%b" echo "Copyright (c) 2001-2002 The OSSP Project " echo "Copyright (c) 2001-2002 Cable & Wireless Deutschland " @@ -52,6 +52,9 @@ AC_HEADER_STDC AC_PROG_INSTALL +sinclude(libtool.m4) +AC_PROG_LIBTOOL + dnl Check other requirements AC_SET_MAKE AC_PROG_CC Index: ossp-pkg/rc/devtool.conf RCS File: /v/ossp/cvs/ossp-pkg/rc/devtool.conf,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/rc/devtool.conf,v' 2>/dev/null --- devtool.conf 2002/02/05 14:11:52 1.6 +++ devtool.conf 2002/02/05 17:29:17 1.7 @@ -4,6 +4,7 @@ %autogen @autogen shtool 1.5.4 "1.5.*" all + @autogen libtool 1.4.2 "1.4*" @autogen autoconf 2.52 "2.5.*" echo "===> rc_ex (devtool autogen)" @@ -21,6 +22,7 @@ %autoclean @autoclean shtool + @autoclean libtool @autoclean autoconf echo "===> rc_ex (devtool autoclean)" @@ -36,11 +38,14 @@ %configure ./configure \ --cache-file=config.cache \ + --enable-maintainer \ + --disable-shared \ --prefix=/tmp/rc \ + --enable-debug "$@" %version - ./shtool version -l txt -n "OSSP rc" -p "rc_" -e VERSION + ./shtool version -l c -n "OSSP rc" -p "rc_" -e rc_version.c %dist make distclean >/dev/null 2>&1 Index: ossp-pkg/rc/rc.c RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.c,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/rc/rc.c,v' 2>/dev/null --- rc.c 2002/02/04 22:35:20 1.5 +++ rc.c 2002/02/05 17:29:17 1.6 @@ -63,15 +63,15 @@ [ ...]", szProgname); }*/ -int main(int argc, char *argv[]) { - char cOpt; /* For argument parsing */ - int iBufpos = 0; /* For tracking options */ - char *szCLIBuf; - char szFuncfile; /* Rc.func file name and location */ - int nIter; +int main(int argc, char *argv[]) +{ + char cOpt = 0; /* For argument parsing */ + int iBufpos = 0; /* For tracking options */ + char *szCLIBuf = NULL; + char *szFuncfile = NULL; /* Rc.func file name and location */ + int nIter = 0; char pcBuf[BUFSIZ+1]; - popt_context optCon; /* Context for parsing options */ - rc_return_t nRet; + popt_context optCon; /* Context for parsing options */ struct popt_option optionsTable[] = { /* Long options with short keys but no arguments */ @@ -161,7 +161,7 @@ fprintf(stderr, "%s: %s\n", popt_badoption(optCon, POPT_BADOPTION_NOALIAS), popt_strerror(cOpt)); - die(nRet); + die(RC_ERR_INT); } /* Print out options, szCLIBuf chosen */ Index: ossp-pkg/rc/rc.h RCS File: /v/ossp/cvs/ossp-pkg/rc/rc.h,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/rc/rc.h,v' 2>/dev/null --- rc.h 2002/02/04 22:35:20 1.5 +++ rc.h 2002/02/05 17:29:17 1.6 @@ -43,6 +43,9 @@ #define TRUE (!FALSE) #endif +#include "popt.h" + + /* RC return codes */ typedef enum { RC_OK, /* Success */ @@ -52,9 +55,13 @@ RC_ERR_SYS, /* System error (see errno) */ RC_ERR_IO, /* Input/output error */ RC_ERR_FMT, /* Formatting error */ - RC_ERR_INT, /* Internal error */ + RC_ERR_INT /* Internal error */ } rc_return_t; +/* Function prototypes */ +static void die(rc_return_t); +void usage(popt_context, rc_return_t, char *); + /*rc_result_t rc_Err (void); rc_result_t rc_Warn (void); rc_result_t rc_PathAppend (int bExists, char **pszPaths);