A few weeks ago I started studying COBOL with GnuCOBOL, and I'm quite excited. I extend a big thank to everybody here. To take it with me while on the way, I choosed the Android version, available already in Termux. By now, almost everything went fine, but one of my programs failed with indexed files. Indexed files on gnucobol for Termux were originally provided with vbisam, and empty .dat and .idx files were created with open optional. By the advice of @sf-mensch, I could change the driver to --with-db,...
ok success! indexed files may be used on android with termux. i touched the configure.ac to be more permissive in the case of cross compilation. there is a little cleanup to do tomorrow and i'll see how to publish it. it would also be nice to consider my configure.ac. doesn't seem harmful. next is gixpp. i'd also try to package libdb-6.0.19 that is more permissibly licensed.
status: i'm appending #define WITH_DB 1 to config.h config.h is being included in cobc/cobc.c however, it definitely ignores this definition. on the other hand, AC_DEFINES is setting WITH_DB=1 for most makefiles, bar cobc/Makefile. i will inquire further.
i'm touching configure.ac alittle to implement more positive assumptions in the cross compiling condition of ac_run_ifelse. macros from db.h can easily be evaluated while crosscompiling, by creating a file like: include <db.h></db.h> DB_VERSION_MAJOR.DB_VERSION_MINOR and running cc -E filename | tail -n 1 highlight by sourceforge.
i set the arguments to configure, but the indexed files code is disabled in the compiler. i'll try something less than orthodox: setting the relevant variables after all checks that presently remove them.
ok, thanks a lot for your help. i'm currently trying to package libdb-6.0.19, last version not agpl. it may be important to distribute binary programs written in gc, no that i have any by now.
maybe there is a libcob4 or libdb way to display the full path of the file to open. this should be important, as status 91 is related to file permissions. https://ibmmainframes.com/about17687.html
it's probably a problem with configure of gc32 that probably misidentifies db-18.* but after further reading, since 6.0.21, db became agpl, thus limiting linked products too. so, i'll take your previous advice to pack an older version and provide it as an alternative. you've mentioned db-6.0.19. however, it seems debian is embracing db-5.3.28. what would you suggest?
i could also download the logs. the build environment cannot run programs it builds, because the linker of android being hardcoded in the programs.
can you see this, simon? it contains a cat of config.log i purposely added. https://github.com/alexbodn/termux-packages/actions/runs/10027228388/job/27712596439
the log is huge but maybe all the build output may be copied from gh.
** thats how configure is being invoked ** configure --disable-dependency-tracking --prefix=/data/data/com.termux/files/usr --libdir=/data/data/com.termux/files/usr/lib --sbindir=/data/data/com.termux/files/usr/bin --disable-rpath --disable-rpath-hack --host=aarch64-linux-android --with-db --with-json=json-c --disable-nls --enable-shared --enable-static --libexecdir=/data/data/com.termux/files/usr/libexec host_alias=aarch64-linux-android CC=aarch64-linux-android-clang CFLAGS= -fstack-protector-strong...
configure seems to tackle with bdb configure: Checks for Berkeley DB ... checking db.h usability... yes checking db.h presence... yes checking for db.h... yes configure: WARNING: cannot run test program while cross-compiling configure: db.h reports version "cross" configure: WARNING: Matching BDB version (>=4.1) assumed checking for db_version in -ldb... yes
status of building: by now i could build gnucobol-3.2 for android. the only thing i had to disable altogether is help2man invokation of cobc --help, because the linker in the binary is not present in the building environment, which is only cross compiling. i'll recheck this later with the staticly build cobc. funnily, the indexed files support is disabled in cobcrun -info, and i'll have to look where it happens. next report in a short time.
the various opinions expressed on 'optional', ilustrate it's some newer syntactic sugar. my experience weights nothing, but it seems to me it worked properly as far as i tried it. file status of opening an unexistent file is 05, while for opening an existent one was 00. more finegrained control on the file conditions.
pardon my deep ignorance, whad do you mean by declaratives?
ok, i began exploring the termux package builder in order to switch to version 3.2 and find things to patch, as at least some xml includes are missing in this release too. now i see the previous package had even a patch related to a hardcoded '/tmp' string, things that for sure will not work in termux. however, termux does set $TMPDIR correctly. hope for good news later today.
i have a feeling it's about temporary files.
indeed i do suspect the system is prependinding some directory i cant't write to. i did also try to give a hard coded path to the file name. about the write permission, it should allegedly be the same location of the program i've just saved and compiled. with some libdb or libcob4 insight i could see what is the true path to the file is and why is it that.
maybe there is a libcob4 or libdb way to display the full path of the file to open. this should be important, as status 91 is related to file permissions.
thank you vincent. i tried your code with the same 91 filestatus. @sf-mensch has also suggested to try i-o, and output on failure. your solution works perfectly on linux, as mine does, but both fail on termux. i have to mention, the optional select attribute did the good job on linux before i tried your solution. please note that successfuly opening an inexistent file with optional gave status 05, so simon suggested to test for fs(1,1) = zero.
A few weeks ago I started studying COBOL with GnuCOBOL, and I'm quite excited. I extend a big thank to everybody here. To take it with me while on the way, I choosed the Android version, available already in Termux. By now, almost everything went fine, but one of my programs failed with indexed files. Indexed files on gnucobol for Termux were originally provided with vbisam, and empty .dat and .idx files were created with open optional. By the advice of @sf-mensch, I could change the driver to --with-db,...
CSV is almost excel.
minor fixes to the cppdb test.