I posted instructions for CentOS 5. FrobTADS 2.0 was released last month and I have an update for CentOS 7. The latest FrobTADS can be found on github: Releases · realnc/frobtads · GitHub
After you untar the files, doc/INSTALL
is pretty clear. But I had to use cmake3
in place of cmake
, install a new gcc, and fix a build error. This article describes installation of gcc 6 or 7: https://linuxize.com/post/how-to-install-gcc-compiler-on-centos-7/ , but I installed 8:
$ sudo yum install centos-release-scl
$ sudo yum install devtoolset-8
$ scl enable devtoolset-8 bash
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
NB: This enables gcc 8.3.1 for (only) the bash session in which you issued the scl enable
command.
YMMV, but I needed to install cmake3, ncurses, and curl and I cast my net broadly:
sudo cmake cmake3
sudo yum install ncurses ncurses-devel ncurses-libs ncurses-static ncurses-base ncurses-term
sudo yum install libcurl libcurl-devel curl
Then I could build the source:
$ ls
frobtads-2.0/ frobtads-2.0.tar.gz
$ cd frobtads-2.0
$ mkdir build
$ cd build
$ cmake3 ..
$ vi ../doc/INSTALL
$ cmake3 --build .
At this point, I got errors about frobtads-2.0/tads2/ostzposix.c:
/home/amead/projects/tads/source/frobtads-2.0/tads2/ostzposix.c: In function ‘os_get_timezone_info’:
/home/amead/projects/tads/source/frobtads-2.0/tads2/ostzposix.c:298:31: error: ‘const struct tm’ has no member named ‘tm_gmtoff’
info->dst_ofs = tm->tm_gmtoff;
^
/home/amead/projects/tads/source/frobtads-2.0/tads2/ostzposix.c:299:67: error: ‘const struct tm’ has no member named ‘tm_zone’
safe_strcpy(info->dst_abbr, sizeof(info->dst_abbr), tm->tm_zone);
A little googling suggested an answer: 'struct tm' has no member named 'tm_gmtoff'
Edit ../tads2/ostzposix.c
to add the lines #if defined (HAVE_STRUCT_TM_GMTOFF)
and # endif
as shown below.
/* Get timezone information. This can be used as a fallback if the a
* zoneinfo key isn't available, or if the caller doesn't use zoneinfo
* data.
*/
int
os_get_timezone_info( struct os_tzinfo_t *info )
{
/* try parsing environment variable TZ as a POSIX timezone string */
const char *tz = getenv("TZ");
if (tz != 0 && oss_parse_posix_tz(info, tz, strlen(tz), TRUE))
return TRUE;
/* fall back on localtime() - that'll at least give us the current
* timezone name and GMT offset in most cases
*/
time_t timer = time(0);
const struct tm *tm = localtime(&timer);
#if defined (HAVE_STRUCT_TM_GMTOFF)
if (tm != 0)
{
memset(info, 0, sizeof(*info));
info->is_dst = tm->tm_isdst;
if (tm->tm_isdst)
{
info->dst_ofs = tm->tm_gmtoff;
safe_strcpy(info->dst_abbr, sizeof(info->dst_abbr), tm->tm_zone);
}
else
{
info->std_ofs = tm->tm_gmtoff;
safe_strcpy(info->std_abbr, sizeof(info->std_abbr), tm->tm_zone);
}
return TRUE;
}
# endif
/* no information is available */
return FALSE;
}
Then you should be able to build and install:
$ vi ../doc/INSTALL
$ cmake3 --build .
$ cmake3 --build . --target install
The INSTALL describes how to modify the installation directory, I preferred to install the files manually so I could preserve the previous versions (tadsrc
is new) and choose the installation directory:
$ sudo cp -p /usr/local/bin/tadsc /usr/local/bin/old_tadsc
$ sudo cp tadsc /usr/local/bin/
$ sudo cp -p /usr/local/bin/frob /usr/local/bin/old_frob
$ sudo cp frob /usr/local/bin/
$ sudo cp -p /usr/local/bin/t3make /usr/local/bin/old_t3make
$ sudo cp t3make /usr/local/bin/
$ sudo cp tadsrsc /usr/local/bin/