1 dnl Process this file with autoconf to produce a configure script.
3 dnl Auto* initialization
5 AC_INIT([run], [1.3.4], [cygwin@cygwin.com])
6 AC_CONFIG_SRCDIR(src/run.c)
7 AC_CONFIG_AUX_DIR([build-aux])
8 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE([1.12 silent-rules tar-ustar dist-xz no-dist-gzip])
10 AM_CONFIG_HEADER([config.h])
15 AC_CHECK_TOOL([RC],[windres], [])
16 if test "x$RC" = "x" ; then
17 AC_MSG_ERROR([No windows resource compiler found. Cannot build.])
20 VERSION_MAJOR=`echo $VERSION | cut -f1 -d.`
21 VERSION_MINOR=`echo $VERSION | cut -f2 -d.`
22 VERSION_PATCH=`echo $VERSION | cut -f3 -d.`
24 AC_SUBST(VERSION_MAJOR)
25 AC_SUBST(VERSION_MINOR)
26 AC_SUBST(VERSION_PATCH)
33 [operation is completely silent (default)]),
34 [cx_enable_silent=$enableval],
35 [cx_enable_silent=yes])
36 if test x"$cx_enable_silent" = xyes ; then
37 AC_DEFINE([SILENT],1,[Define this for completely silent operation])
44 [allow use of MSWin popup windows for messages (default)]),
45 [cx_enable_gui=$enableval],
47 if test x"$cx_enable_gui" = xyes ; then
48 AC_DEFINE([ENABLE_GUI],1,[Define this to 1 to allow MSWin popup windows])
50 AC_DEFINE([ENABLE_GUI],0)
57 [allow use of TTY console for messages (default)]),
58 [cx_enable_tty=$enableval],
60 if test x"$cx_enable_tty" = xyes ; then
61 AC_DEFINE([ENABLE_TTY],1,[Define this to 1 to allow TTY console messages])
63 AC_DEFINE([ENABLE_TTY],0)
70 [turn on debugging messages]),
71 [cx_enable_debug=$enableval],
73 if test x"$cx_enable_debug" = xyes ; then
74 AC_DEFINE([ENABLE_DEBUG],1,[Define this enable debugging messages])
77 if test x"$cx_enable_tty" != xyes ; then
78 if test x"$cx_enable_gui" != xyes ; then
79 AC_MSG_ERROR([At least one of --enable-gui and --enable-tty must be "yes"])
83 # Checks for programs.
89 # checks for header files
90 AC_CHECK_HEADERS([float.h locale.h malloc.h stdlib.h string.h assert.h pwd.h unistd.h])
91 AC_CHECK_HEADERS([getopt.h sys/cygwin.h windows.h])
93 # Checks for typedefs, structures, and compiler characteristics.
98 # Checks for library functions.
99 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
104 AC_CHECK_FUNCS([getcwd memset putenv setenv setlocale strcasecmp strchr strcspn strdup strerror strrchr strtol])
105 AC_CHECK_FUNC([getopt_long], [], [replace_getopt=yes])
106 AM_CONDITIONAL([REPLACE_GETOPT], [test "$replace_getopt" = yes])
107 if test "$replace_getopt" = yes; then
108 AC_DEFINE([REPLACE_GETOPT], 1,
109 [Define if you must use the replacement getopt_long implementation])
112 # Use cygwin_conv_path as a proxy for cygwin-1.7
113 AC_CHECK_DECLS([cygwin_conv_path],[],[
115 *cygwin* ) AC_MSG_ERROR([At least cygwin-1.7 is required]) ;;
117 [[#include <sys/cygwin.h>]])
119 dnl should only exist on windows, I hope
120 AC_CHECK_STDCALL_FUNC([OpenClipboard],[void *])
121 if test x"$ac_cv_func_OpenClipboard" = xyes ; then
122 AC_DEFINE([HAVE_OPENCLIPBOARD], 1,
123 [Define if you have the __stdcall__ OpenClipboard function])
126 RUN_FUNC_SPAWNV_ARGTYPE3
127 RUN_FUNC__SPAWNV_ARGTYPE3
128 AC_DEFINE([ORIGINAL_RUN], [], [Build utility routines for run.exe, not run2.exe])
132 # define ENABLE_GUI 1
135 # define ENABLE_TTY 1
137 #if (ENABLE_TTY == 0) && (ENABLE_GUI == 0)
138 # error At least one of ENABLE_GUI and ENABLE_TTY must be 1
142 AC_CONFIG_FILES([Makefile