aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--configure.in96
-rw-r--r--include/config.h6
-rw-r--r--include/config.h.in6
-rw-r--r--include/defs.h19
-rw-r--r--include/defs.h.in19
-rw-r--r--lib/ppsocket.cc2
-rw-r--r--lib/rfsv32.cc5
-rw-r--r--plpnfsd/Makefile.am3
-rw-r--r--plpnfsd/main.cc4
10 files changed, 151 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am
index 2aae5db..9e61ea8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
#
# $Id$
#
-SUBDIRS = lib nfsd
+SUBDIRS = lib ncpd nfsd plpftp
EXTRA_DIST = COPYING README TODO INSTALL
AUTOMAKE_OPTIONS = foreign
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..257f86c
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,96 @@
+AC_REVISION($ Revision: 0.1 $)dnl revision of this configure.in script
+
+AC_INIT(acinclude.m4)
+AM_CONFIG_HEADER(include/config.h)
+AM_INIT_AUTOMAKE(plpnfsd, 0.1)
+
+dnl Enable Mainatiner stuff
+AM_MAINTAINER_MODE
+
+dnl checks for programs
+AC_PROG_MAKE_SET
+AC_CHECK_COMPILERS
+AC_PROG_RANLIB
+
+CFLAGS="-O"
+test "$GCC" = yes && CFLAGS="-O2 -Wall"
+AC_PATH_PROG(CC_PATH, $CC)
+test "$CC_PATH" = /opt/SUNWspro/bin/cc && CFLAGS="-xO2 -v"
+
+dnl checking for aix
+AC_MSG_CHECKING(for AIX)
+if test "`uname -s 2>/dev/null`" = AIX ; then
+ AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(bsd, hostname)
+ EXTRA_OBJS=mount_aix.o
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST(EXTRA_OBJS)
+
+dnl checks for libraries
+
+dnl readline and history for plpftp
+AC_CHECK_LIB(readline, readline)
+AC_CHECK_LIB(history, add_history)
+
+dnl these three are for solaris
+AC_CHECK_LIB(socket, socket)
+AC_CHECK_LIB(nsl, gethostbyname)
+ac_save_LDFLAGS=$LDFLAGS; LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
+AC_CHECK_LIB(rpcsoc, svcudp_create,,LDFLAGS=$ac_save_LDFLAGS)
+
+dnl checks for mount table
+AC_MSG_CHECKING(for mount table)
+AC_FIND_FILE(/etc/mnttab /etc/mtab, MTAB)
+AC_MSG_RESULT($MTAB)
+test "$MTAB" = "NO" && CFLAGS="${CFLAGS} -DDONT_UPDATE_MTAB";
+AC_SUBST(MTAB)
+
+dnl checks for header files
+AC_CHECK_HEADERS(sys/ioctl.h sys/errno.h sys/ttold.h stdlib.h)
+
+dnl special options for customization
+
+AC_ARG_WITH(serial,
+ [ --with-serial=DEV override default serial line ],
+ [ DDEV="$withval"
+ AC_MSG_RESULT(Overriding serial line: $DDEV)
+ ],
+ [ AC_MSG_CHECKING(for default serial line)
+ AC_FIND_CDEV(/dev/tty0p0 /dev/tty00 /dev/ttyS0 /dev/term/a /dev/ttyfa /dev/ttya /dev/tty0 /dev/ttyf1 /dev/cuaa1, DDEV)
+ AC_MSG_RESULT($DDEV)
+ test "$DDEV" = "NO" && AC_MSG_ERROR(NO serial lines. Use --with-serial.)
+ ]
+)
+AC_SUBST(DDEV)
+
+AC_ARG_WITH(speed,
+ [ --with-speed=SPEED override default serial speed [115200]],
+ [ DSPEED="$withval"
+ AC_MSG_RESULT(Overriding serial speed: $DSPEED) ],
+ [ DSPEED=115200
+ AC_MSG_RESULT(Using default serial speed: $DSPEED)
+ ]
+)
+AC_SUBST(DSPEED)
+
+AC_ARG_WITH(port,
+ [ --with-port=PORT override default port [7501]],
+ [ DPORT="$withval"
+ AC_MSG_RESULT(Overriding port: $DPORT) ],
+ [ DPORT=7501
+ AC_MSG_RESULT(Using default port: $DPORT)
+ ]
+)
+AC_SUBST(DPORT)
+
+AC_OUTPUT(
+ Makefile
+ lib/Makefile
+ ncpd/Makefile
+ plpftp/Makefile
+ nfsd/Makefile
+ include/config.h
+ include/defs.h
+)
diff --git a/include/config.h b/include/config.h
index a2ced96..92e9916 100644
--- a/include/config.h
+++ b/include/config.h
@@ -20,9 +20,15 @@
/* Define if you have the bsd library (-lbsd). */
/* #undef HAVE_LIBBSD */
+/* Define if you have the history library (-lhistory). */
+#define HAVE_LIBHISTORY 1
+
/* Define if you have the nsl library (-lnsl). */
#define HAVE_LIBNSL 1
+/* Define if you have the readline library (-lreadline). */
+#define HAVE_LIBREADLINE 1
+
/* Define if you have the rpcsoc library (-lrpcsoc). */
/* #undef HAVE_LIBRPCSOC */
diff --git a/include/config.h.in b/include/config.h.in
index 5fc2ffd..4932d0a 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -19,9 +19,15 @@
/* Define if you have the bsd library (-lbsd). */
#undef HAVE_LIBBSD
+/* Define if you have the history library (-lhistory). */
+#undef HAVE_LIBHISTORY
+
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
+/* Define if you have the readline library (-lreadline). */
+#undef HAVE_LIBREADLINE
+
/* Define if you have the rpcsoc library (-lrpcsoc). */
#undef HAVE_LIBRPCSOC
diff --git a/include/defs.h b/include/defs.h
index 8733d37..506bfa3 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -1,6 +1,9 @@
#ifndef _defs_h_
#define _defs_h_
+/*
+ * NFS related stuff
+ */
#define MTAB_PATH "/etc/mtab"
#ifdef linux
# define MTAB_TMP "/etc/mtab~"
@@ -8,8 +11,6 @@
# define MTAB_TMP "/etc/mtab.p3nfsd"
#endif
-#define DDEV "/dev/ttyS0"
-
#ifdef _IBMR2
# define DONT_UPDATE_MTAB /* The mount table is obtained from the kernel (!?) */
#endif
@@ -29,5 +30,19 @@
#define NO_WRITE_SELECT
#endif
+/*
+ * defaults for ncpd
+ */
+#define DDEV "/dev/ttyS0"
+#define DSPEED 115200
+#define DPORT 7501
+
+/* Debugging */
+
+#define PACKET_LAYER_DIAGNOSTICS false
+#define LINK_LAYER_DIAGNOSTICS false
+// #define SOCKET_DIAGNOSTICS
+
#include "config.h"
#endif
+
diff --git a/include/defs.h.in b/include/defs.h.in
index 9ee654e..221f142 100644
--- a/include/defs.h.in
+++ b/include/defs.h.in
@@ -1,6 +1,9 @@
#ifndef _defs_h_
#define _defs_h_
+/*
+ * NFS related stuff
+ */
#define MTAB_PATH "@MTAB@"
#ifdef linux
# define MTAB_TMP "@MTAB@~"
@@ -8,8 +11,6 @@
# define MTAB_TMP "@MTAB@.p3nfsd"
#endif
-#define DDEV "@DDEV@"
-
#ifdef _IBMR2
# define DONT_UPDATE_MTAB /* The mount table is obtained from the kernel (!?) */
#endif
@@ -29,5 +30,19 @@
#define NO_WRITE_SELECT
#endif
+/*
+ * defaults for ncpd
+ */
+#define DDEV "@DDEV@"
+#define DSPEED @DSPEED@
+#define DPORT @DPORT@
+
+/* Debugging */
+
+#define PACKET_LAYER_DIAGNOSTICS false
+#define LINK_LAYER_DIAGNOSTICS false
+// #define SOCKET_DIAGNOSTICS
+
#include "config.h"
#endif
+
diff --git a/lib/ppsocket.cc b/lib/ppsocket.cc
index 1caa027..6babcc7 100644
--- a/lib/ppsocket.cc
+++ b/lib/ppsocket.cc
@@ -31,7 +31,7 @@
#include <sys/types.h>
#include <netinet/in.h>
-#include "../defaults.h"
+#include "defs.h"
#include "bool.h"
#include "bufferstore.h"
#include "ppsocket.h"
diff --git a/lib/rfsv32.cc b/lib/rfsv32.cc
index b6105c5..945a18e 100644
--- a/lib/rfsv32.cc
+++ b/lib/rfsv32.cc
@@ -26,14 +26,15 @@
#include <time.h>
#include <string.h>
-#include "bool.h"
+#include "defs.h"
#include "bool.h"
#include "rfsv32.h"
#include "bufferstore.h"
#include "ppsocket.h"
-#include "../defaults.h"
#include "bufferarray.h"
+#define RFSV_SENDLEN 230
+
rfsv32::rfsv32(ppsocket * _skt) : serNum(0)
{
skt = _skt;
diff --git a/plpnfsd/Makefile.am b/plpnfsd/Makefile.am
index 83e0b78..8f870da 100644
--- a/plpnfsd/Makefile.am
+++ b/plpnfsd/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES=-I../lib
-LIBS=../lib/libutils.a
+
+LIBS = -L../lib -lutils
sbin_PROGRAMS = plpnfsd
diff --git a/plpnfsd/main.cc b/plpnfsd/main.cc
index c20b24d..ac8d10d 100644
--- a/plpnfsd/main.cc
+++ b/plpnfsd/main.cc
@@ -24,8 +24,8 @@
#include <stdlib.h>
#include <stdio.h>
+#include "defs.h"
#include "bool.h"
-#include "../defaults.h"
#include "rfsv32.h"
#include "bufferstore.h"
#include "bufferarray.h"
@@ -223,7 +223,7 @@ void rfsv_startup()
}
skt = new ppsocket();
skt->startup();
- res = skt->connect(NULL, DEFAULT_SOCKET);
+ res = skt->connect(NULL, DPORT);
a = new rfsv32(skt);
}