diff --git a/Makefile.am b/Makefile.am index 51b15ed8..9cf3fe46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,10 @@ endif CFLAGS += -Wno-unused-parameter -Wno-unused-variable CFLAGS += -Ilibssh/include/ -Imsgpack/src +if IS_DEVENV +CFLAGS += -DDEVENV +endif + # Set flags for gcc. gcc4 whines abouts silly stuff so it needs slightly # different flags. if IS_GCC diff --git a/configure.ac b/configure.ac index 013cd655..5be42271 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,13 @@ AC_CHECK_HEADERS( ] ) +AC_ARG_ENABLE( + devenv, + AC_HELP_STRING(--enable-devenv, "dev env (localhost, port 2200, no auth checks)"), + found_devenv=$enable_devenv +) +AM_CONDITIONAL(IS_DEVENV, test "x$found_devenv" = xyes) + # Is this a debug build? #found_debug=yes AC_ARG_ENABLE( diff --git a/tmate.h b/tmate.h index d95c8efa..ed3f847b 100644 --- a/tmate.h +++ b/tmate.h @@ -57,8 +57,13 @@ extern void tmate_decoder_commit(struct tmate_decoder *decoder, size_t len); /* tmate-ssh-client.c */ +#ifdef DEVENV +#define TMATE_HOST "localhost" +#define TMATE_PORT 2200 +#else #define TMATE_HOST "tmate.io" #define TMATE_PORT 22 +#endif typedef struct ssh_session_struct* ssh_session; typedef struct ssh_channel_struct* ssh_channel;