#5 port to hpux
Opened 15 years ago by laubster. Modified 7 years ago

I just spent some effort getting mlocate 0.20 to run on hpux 11.11, and wanted to gauge interest in incorporating any changes back into the mlocate code base. (I'm not trying to pressure folks, as I understand support for multiple platforms is not trivial.) :-)

Here's a short summary of what I ran across:

  • I haven't root access on this box, so in Makefile.in I changed the groupname from "mlocate" to "dba". (This seems like a great candidate for being a parameter.)

  • in strerror.c, I needed to move #include <limits.h> a little higher so it always gets included, so that CHAR_BIT would be #defined.

  • printf doesn't recognize %ju, so I changed those occurrences to %u, and cast their corresponding parameters to uint.

  • strtoumax didn't exist, so I changed it to strtoul.

  • _PATH_MOUNTED wasn't #defined, so I put in code to #define it to MOUNTED (if it's not already set)

  • sed handles only text files, so where the testsuite tests -0, I changed "sed" to "perl -p -e".

  • make test was failing miserably; turned out the invocations of "pwd" were returning /home/jdl/... even though /export/home/jdl/... was the value stored in the index. (My home dir is automounted.) I haven't put a lot of thought into this solution yet; as a quick workaround I just explicitly chdired to my homedir's true name.

I am by no means an automake expert, but I'd be happy to give a shot at having it perform (when necessary) some of the tweaks I made. However, I don't want to spend the time if no one is interested, so let me know. No matter what the case, thanks for a fine piece of software. :-)


for review only: changes I had to make under hpux 11.11
mlocate-0.20-port_to_hpux.diff

Replying to [comment:1 mitr]:

Replying to [ticket:5 laubster]:

  • sed handles only text files, so where the testsuite tests -0, I changed "sed" to "perl -p -e".
    OK.

  • make test was failing miserably; turned out the invocations of "pwd" were returning /home/jdl/... even though /export/home/jdl/... was the value stored in the index. (My home dir is automounted.) I haven't put a lot of thought into this solution yet; as a quick workaround I just explicitly chdired to my homedir's true name.
    Perhaps using (pwd -P) instead of (pwd) could help, if it is supported on hpux.
    In both cases, please edit the source .at files instead of the generated testsuite script.

Apologies for the out of order comments. There was a git commit id in the first comment that was causing the hg plugin to malfunction, so I deleted it directly from the database. I've pasted the contents of that comment below (minus the git commit ID):

I just spent some effort getting mlocate 0.20 to run on hpux 11.11, and wanted to gauge interest in incorporating any changes back into the mlocate code base. (I'm not trying to pressure folks, as I understand support for multiple platforms is not trivial.) :-)
The more platforms supported, the better - but the port should not at all affect correctness on Linux, and should affect maintainability as little as possible.

The preferred mechanism is gnulib, in particular commit <removed because of problems with hg plugin> in git://git.savannah.gnu.org/gnulib.git, the last GPLv2 version. Learning to use gnulib might take a bit more time, but I believe the result is better than local patches that need explanations about portability issues to avoid "fixing" them to the old form.

  • I haven't root access on this box, so in Makefile.in I changed the groupname from "mlocate" to "dba". (This seems like a great candidate for being a parameter.)
    groupname is a make variable, so it is already a parameter: use (make groupname=dba) and (make install groupname=dba).

  • in strerror.c, I needed to move #include <limits.h> a little higher so it always gets included, so that CHAR_BIT would be #defined.
    OK. (This is fixed in recent gnulib, but that's GPLv3.)

  • printf doesn't recognize %ju, so I changed those occurrences to %u, and cast their corresponding parameters to uint.
    That might truncate data. Instead, please set up gnulib to use the appropriate printf* module if the system printf does not support the necessary specifiers. (Use gnulib-import.)

  • strtoumax didn't exist, so I changed it to strtoul.
    Again, please use the strtoumax module in gnulib.

  • _PATH_MOUNTED wasn't #defined, so I put in code to #define it to MOUNTED (if it's not already set)
    OK.

  • sed handles only text files, so where the testsuite tests -0, I changed "sed" to "perl -p -e".
    OK.

  • make test was failing miserably; turned out the invocations of "pwd" were returning /home/jdl/... even though /export/home/jdl/... was the value stored in the index. (My home dir is automounted.) I haven't put a lot of thought into this solution yet; as a quick workaround I just explicitly chdired to my homedir's true name.
    Perhaps using (pwd -P) instead of (pwd) could help, if it is supported on hpux.

No matter what the case, thanks for a fine piece of software. :-)
Thanks (:

Login to comment on this ticket.

Metadata