Permalink
Browse files

use autotools for build and install

  • Loading branch information...
radiumce committed Aug 23, 2012
1 parent 7eefb84 commit ba1b5b93693fe1b975cc29497d61444fcbb510ea
Showing with 61 additions and 30 deletions.
  1. +0 −9 HowTo
  2. +11 −0 Makefile.am
  3. +0 −4 README.md
  4. +27 −0 configure.ac
  5. BIN native/linux/.DS_Store
  6. +0 −7 native/linux/README
  7. +8 −8 native/linux/readline_drv.c
  8. +14 −0 src/Makefile.am
  9. +1 −2 src/essh.erl
View
9 HowTo
@@ -1,9 +0,0 @@
RUN:
erl -noinput -pa $ESSH_HOME/ebin -run essh start $LD_LIBRARY_PATH $PATH_TO_SERVER_LST_FILE
SERVER_LST_FILE's Format:
#------------
server-1
server-2
server-3
#------------
View
@@ -0,0 +1,11 @@
SUBDIRS = src
libdir = $(prefix)/erlyssh/lib
lib_LTLIBRARIES = libreadlinedrv.la
libreadlinedrv_la_SOURCES = $(top_srcdir)/native/linux/readline_drv.c
INCLUDES = -I $(ERLANG_ROOT_DIR)/usr/include
libreadlinedrv_la_LIBADD = -lreadline -lhistory
bin_PROGRAMS = essh
essh:
echo "#!/bin/sh\n" > essh
echo "erl -noinput -pa $(prefix)/erlyssh/ebin -run essh start $(libdir) \$${ESSH_LIST_HOME}/\$$* " >>essh
View
@@ -1,4 +0,0 @@
erlyssh
=======
A Parallel SSH Execution Tool
View
@@ -0,0 +1,27 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([readline_drv], [0.1], [radiumce@gmail.com])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_LIBTOOL
AC_CONFIG_SRCDIR([native/linux/readline_drv.c])
AC_ERLANG_NEED_ERLC
AC_ERLANG_SUBST_ROOT_DIR
AC_ERLANG_SUBST_LIB_DIR
# Checks for programs.
AC_PROG_CC
CFLAGS="$CFLAGS -L/opt/local/lib -L/usr/lib -L/usr/local/lib -I/opt/local/include/readline -I/opt/include -I/usr/local/include"
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([getcwd isascii select strdup strerror strrchr])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
View
Binary file not shown.
View
@@ -1,7 +0,0 @@
denpendency:
libreadline.so.5.2
libhistory.so.5.2
--------------------------
compiled under 64bit debian
readline_drv.so
@@ -10,19 +10,19 @@ typedef struct {
static char *line_read = (char*)NULL;
static char *prompt = "essh>: ";
static ErlDrvData readline_drv_start(ErlDrvPort port, char *buff){
static ErlDrvData libreadlinedrv_start(ErlDrvPort port, char *buff){
readline_data* d = (readline_data*)driver_alloc(sizeof(readline_data));
d->port = port;
return (ErlDrvData)d;
}
static void readline_drv_stop(ErlDrvData handle)
static void libreadlinedrv_stop(ErlDrvData handle)
{
driver_free((char*)handle);
}
static void readline_drv_output(ErlDrvData handle, char *buff, int bufflen)
static void libreadlinedrv_output(ErlDrvData handle, char *buff, int bufflen)
{
readline_data* d = (readline_data*)handle;
@@ -42,19 +42,19 @@ static void readline_drv_output(ErlDrvData handle, char *buff, int bufflen)
ErlDrvEntry readline_driver_entry = {
NULL, /* F_PTR init, N/A */
readline_drv_start, /* L_PTR start, called when port is opened */
readline_drv_stop, /* F_PTR stop, called when port is closed */
readline_drv_output, /* F_PTR output, called when erlang has sent */
libreadlinedrv_start, /* L_PTR start, called when port is opened */
libreadlinedrv_stop, /* F_PTR stop, called when port is closed */
libreadlinedrv_output, /* F_PTR output, called when erlang has sent */
NULL, /* F_PTR ready_input, called when input descriptor ready */
NULL, /* F_PTR ready_output, called when output descriptor ready */
"readline_drv", /* char *driver_name, the argument to open_port */
"libreadlinedrv", /* char *driver_name, the argument to open_port */
NULL, /* F_PTR finish, called when unloaded */
NULL, /* F_PTR control, port_command callback */
NULL, /* F_PTR timeout, reserved */
NULL /* F_PTR outputv, reserved */
};
DRIVER_INIT(readline_drv) /* must match name in driver_entry */
DRIVER_INIT(libreadlinedrv) /* must match name in driver_entry */
{
return &readline_driver_entry;
}
View
@@ -0,0 +1,14 @@
#erlsrcdir = $(prefix)/src
#erlsrc_DATA = essh.erl \
# essh_agent.erl \
# essh_scheduler.erl
erlbeamdir = $(prefix)/erlyssh/ebin
erlbeam_DATA = essh.beam \
essh_agent.beam \
essh_scheduler.beam
CLEANFILES = $(erlbeam_DATA)
SUFFIXES = .erl .beam
.erl.beam:
$(ERLC) $(ERLCFLAGS) -b beam $<
View
@@ -25,12 +25,11 @@
%% External functions
%% ====================================================================
%%
%% TODO: Add description of start/function_arity
%%
start(StartParas) ->
[SharedPath, FilePath | Command] = StartParas,
StartCommand = get_start_command(Command, ""),
SharedLib = "readline_drv",
SharedLib = "libreadlinedrv",
%io:format("starting essh server~n"),
essh_scheduler:start(),
gen_server:start_link({local,?MODULE}, ?MODULE, [SharedPath, SharedLib, FilePath, StartCommand], []).

0 comments on commit ba1b5b9

Please sign in to comment.