diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-05 22:19:37 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-05 22:19:37 +0300 |
commit | 1a5850f8ccb916e3bc3c4504f528b25a0c422c86 (patch) | |
tree | d110fbaecf7e5a1217384a159038aecda054e4db | |
parent | 05826b51ec41ae091756087bc734931c071e9221 (diff) | |
download | videoteco-fork-1a5850f8ccb916e3bc3c4504f528b25a0c422c86.tar.gz |
automatically use the current date when building with Autotools
* It's actually the time of running ./configure that will be used.
* On OpenWatcom, it does not seem to be possible to set variables
based on external processes, so you will still have to update
AUTO_DATE in teco.h when releasing for DOS.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | tecbuf.c | 4 | ||||
-rw-r--r-- | teco.h | 53 |
3 files changed, 33 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac index ff6117e..2f4d334 100644 --- a/configure.ac +++ b/configure.ac @@ -77,5 +77,7 @@ AC_CHECK_MEMBERS([struct termios.c_cflag, struct termios.c_ospeed, struct termio #endif ]) +AC_DEFINE_UNQUOTED([AUTO_DATE], ["`date '+$Date: %Y/%m/%d %T $'`"], [Configuration time]) + AC_CONFIG_FILES([Makefile doc/Doxyfile]) AC_OUTPUT @@ -34,7 +34,7 @@ struct buff_header *buff_create( char *name, char internal_flag ); #include "teco.h" #include "tecparse.h" -char rcs_date[] = AUTO_DATE; +static const char rcs_date[] = AUTO_DATE; /* * Global Storage is defined here for lack of a better place. @@ -1075,7 +1075,7 @@ register struct buff_header *hbp; char tmp_buffer[LINE_BUFFER_SIZE],padd_buffer[LINE_BUFFER_SIZE]; register int i; int count; -register char *cp; +register const char *cp; int max_length; PREAMBLE(); @@ -41,38 +41,22 @@ #define BLOCKED 2 #define INVALIDATE 3 -#define VMAJOR 7 -#define VMINOR 0 -#define AUTO_DATE "$Date: 2007/12/10 22:13:07 $" - /* - * Immediately start insertion after the first escape in FS. + * There is redundancy with PACKAGE_VERSION, but this + * is preferred, as it will work with the OpenWatcom build system as well. */ -#define INTERACTIVE_FS - -/** - * We define unix except for the really different operating systems, like - * vms. It lets us write our own version of functions which simply do not - * exist outside of unix. - */ -#if !defined(VMS) && !defined(MSDOS) -#define UNIX -#define JOB_CONTROL -#endif +#define VMAJOR 7 +#define VMINOR 0 /* * Include Files From GNU Autoconf/Autoheader - * - * FIXME: The Autoconf build system does not pass down -DHAVE_CONFIG_H. - * This should be fixed by rewriting it as the original sources - * are missing. */ -//#ifdef HAVE_CONFIG_H -#ifndef __WATCOMC__ +#ifdef HAVE_CONFIG_H + #include "config.h" -#endif -#ifdef MSDOS +#elif defined(MSDOS) + #define __WATCOM_LFN__ #define STDC_HEADERS 1 #define HAVE_STDIO_H 1 @@ -95,8 +79,29 @@ #define HAVE_SBRK 1 #define HAVE_STRCHR 1 #define TERMCAP 1 + #endif /* MSDOS */ +#ifndef AUTO_DATE +/* should be passed in from the build system */ +#define AUTO_DATE "$Date: 2007/12/10 22:13:07 $" +#endif + +/* + * Immediately start insertion after the first escape in FS. + */ +#define INTERACTIVE_FS + +/** + * We define unix except for the really different operating systems, like + * vms. It lets us write our own version of functions which simply do not + * exist outside of unix. + */ +#if !defined(VMS) && !defined(MSDOS) +#define UNIX +#define JOB_CONTROL +#endif + #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif |