diff --git a/configure.ac b/configure.ac index dfeb6e1..2fedfc1 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,7 @@ AC_PROG_YACC case "$(uname -s)" in Linux | *BSD) LIBS="$LIBS -lutil -lcrypt" + AC_DEFINE(NOSTREAMS, 1, [Use SVR4 streams support in ttyrec.]) ;; esac @@ -29,10 +30,11 @@ AC_ARG_ENABLE(enable-virus, [AC_SUBST(EDITOR, virus.c)], [AC_SUBST(EDITOR, ee.c)]) AC_ARG_WITH(config-file, -[AS_HELP_STRING([--with-config-file=PATH], [Define the path to the default configuration file.])] -[configfile=$withval], [configfile=/etc/dgamelaunch.conf]) +[AS_HELP_STRING([--with-config-file=PATH], [Define the path to the default configuration file.])], +[configfile=$withval], [configfile="/etc/dgamelaunch.conf"]) AC_DEFINE_UNQUOTED(DEFCONFIG, "$configfile", [Path to the default config file.]) +AC_CHECK_FUNCS(openpty) AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/dgamelaunch.c b/dgamelaunch.c index 435c1d0..68b3cfa 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -129,7 +129,7 @@ mysetenv (const char* name, const char* value, int overwrite) void ttyrec_getpty () { -#ifdef USE_OPENPTY +#ifdef HAVE_OPENPTY if (openpty (&master, &slave, NULL, NULL, NULL) == -1) graceful_exit (62); #else diff --git a/dgamelaunch.h b/dgamelaunch.h index 17e5378..72dbeca 100644 --- a/dgamelaunch.h +++ b/dgamelaunch.h @@ -7,12 +7,6 @@ #include #include -/* Default - should work everywhere */ -#if defined(__linux__) || defined(BSD) -# define USE_OPENPTY -# define NOSTREAMS -#endif - #ifndef ARRAY_SIZE # define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #endif