diff --git a/.gitignore b/.gitignore index 71e8d86..1c60054 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ -# Files generated by patch(1) +*.a +*.o *.orig *.rej + +Makefile.configure +config.h +config.log +configure.local + +Paths.h +libsj3lib.* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5708eb0 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +.PHONY: all + +include Makefile.configure + +VMAJOR = 2 +VMINOR = 0 +VPATCH = 99 +VERSION := $(VMAJOR).$(VMINOR).$(VPATCH) +LIBVER = 1 + +CFLAGS += -fPIC +CPPFLAGS += -I. -I./include + +SJ3LIB_OBJS = level1.o sj3lib.o string.o + +all: libsj3lib.a libsj3lib.so.$(LIBVER) + +libsj3lib.a: $(SJ3LIB_OBJS) compats.o + $(AR) rs $@ $(SJ3LIB_OBJS) compats.o + +libsj3lib.so.$(LIBVER): $(SJ3LIB_OBJS) compats.o + $(CC) -shared -o $@ $(SJ3LIB_OBJS) compats.o $(LDFLAGS) -Wl,${LINKER_SONAME},$@ $(LDLIBS) + ln -sf $@ `basename $@ .$(LIBVER)` + +Paths.h: Paths.h.in + sed -e "s|@SJ3CONFDIR@|/etc/sj3|" -e "s|@SJ3DICTDIR@|$(SHAREDIR)/sj3/dict|" Paths.h.in > $@ + +$(SJ3LIB_OBJS) compats.o: config.h +$(SJ3LIB_OBJS): Paths.h diff --git a/include/Paths.h.in b/Paths.h.in similarity index 62% rename from include/Paths.h.in rename to Paths.h.in index 8c52cc7..4aa5626 100644 --- a/include/Paths.h.in +++ b/Paths.h.in @@ -25,35 +25,28 @@ * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * from Sony Corporation. - * */ -/* - * $SonyRCSfile: Paths.h.in,v $ - * $SonyRevision: 1.1 $ - * $SonyDate: 1997/01/23 11:20:55 $ - */ +#ifndef SJ3_PATHS_H_ +#define SJ3_PATHS_H_ -/* - * Change ErrotOutFile variable. - * Because suppress a error when sj3serv start up, change to "/dev/stderr". - * This error is "Cannot Open "/dev/console".". - * Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10 - * - * Change ErrotOutFile variable. - * This default value is "/dev/null" in document. - * Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/11 - */ #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) -#define ErrorOutFile "/dev/console" +#define ErrorOutFile "/dev/console" #else -/* #define ErrorOutFile "/dev/stderr" */ /* for test */ -#define ErrorOutFile "/dev/null" +#define ErrorOutFile "/dev/null" #endif -#define SocketName "/tmp/sj3sock" -#define LockFile "/tmp/SJ3SERV.EXIST" +#define SocketName "/tmp/sj3sock" +#define LockFile "/tmp/SJ3SERV.EXIST" -#define MainDictionary "sj3main.dic" -#define UserDictionary "private.dic" -#define StudyFile "study.dat" +#define MainDictionary "sj3main.dic" +#define UserDictionary "private.dic" +#define StudyFile "study.dat" +#define RunCmdFile "@SJ3CONFDIR@/serverrc" +#define DictRootDir "@SJ3DICTDIR@" + +#define DEFRKFILE "@SJ3CONFDIR@/sjrk" +#define DEFRCFILE "@SJ3CONFDIR@/sjrc" +#define DEFKEYFILE "@SJ3CONFDIR@/cvtkey." + +#endif /* SJ3_PATHS_H_ */ diff --git a/sj3lib/level1.c b/level1.c similarity index 100% rename from sj3lib/level1.c rename to level1.c diff --git a/sj3lib/sj.c b/sj3lib.c similarity index 100% rename from sj3lib/sj.c rename to sj3lib.c diff --git a/sj3lib/sj3lib.h b/sj3lib.h similarity index 100% rename from sj3lib/sj3lib.h rename to sj3lib.h diff --git a/sj3lib/string.c b/string.c similarity index 100% rename from sj3lib/string.c rename to string.c