Apply patches for enhancing portability, from Dan McMahill
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 29 Jan 2010 02:48:00 +0000 (02:48 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 29 Jan 2010 02:48:00 +0000 (02:48 +0000)
commitf42087159ab322eae4a1c7c09082ce60083c8aeb
treece2685cebe78db9c0dd4012a4d2f718a44d4cfca
parent0a8be9ed4d0b4df44a5ee14fd34c989acc232a36
Apply patches for enhancing portability, from Dan McMahill

The following is a list of the patches and a brief description of what
they are supposed to address.  They were needed for building OpenSRF-1.2.0
(the most recent release) on a NetBSD system.

patch-aa -- some systems have dlerror() in libc instead of libdl so use
            AC_SEARCH_LIBS to see if we need an explicit -ldl or not.
            Fail in the same way as the previous code if we can't find
            dlerror() anywhere.

            malloc_stats() is malloc implementation specific so check for
            it and define HAVE_MALLOC_STATS if we do.

patch-ab -- No need to explicitly list -lxml2 -ldl -lmemcache  in LDADD.
            These were automatically filled in via the LIBS variable which
            is filled in via AC_SEARCH_LIBS and AC_CHECK_LIB.  Also this
            way -ldl only shows up if it is actually needed.

patch-ac -- Only conditionally call malloc_stats() if it exists.  On
            systems without malloc_stats(), just print a warning to the
            effect.

patch-ad -- Instead of using -lopensrf for foo_la_LIBADD use
            @top_builddir@/src/libopensrf/libopensrf.la.  This
            is the way to link to the not-yet-installed libtool
            library we just built.

patch-af -- "sed -i" is a GNU sed extension and not portable to Solaris or the
             various BSDs.  Rework the target a little to be more portable.

patch-ag -- Use /bin/sh instead of /bin/bash.  And to make sure this will work
            on non-Linux systems where /bin/sh is *not* bash, make things a little
            more portable.  The biggest is that
              function foo { code here }
            is replaced by the more portable
              foo() {code here}
            syntax.

patch-ah -- Use /bin/sh instead of /bin/bash.  And to make sure this will work
            on non-Linux systems where /bin/sh is *not* bash, make things a little
            more portable.  Of note, "echo -e" is non-portable so instead use
            as "here document" which is more portable and also I think easier to
            edit anyway.  Also address the function syntax and finally "==" is
            a bash extension to "test".  "=" does the same thing and is portable
            to other shells.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Signed-off-by: Dan McMahill <dmcmahill@NetBSD.org>
git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_2@1907 9efc2488-bf62-4759-914b-345cdb29e865
bin/osrf_config.in
bin/osrf_ctl.sh.in
configure.ac
src/Makefile.am
src/c-apps/Makefile.am
src/c-apps/timejson.c
src/libopensrf/Makefile.am