[unixODBC-dev] cross compiling 2.3.0

Nick Gorham nick at lurcher.org
Fri Apr 15 09:48:23 BST 2011


On 14/04/2011 22:03, Bill Segall wrote:
> Nick,
>
> With 2.3.1-pre the generated unixodbc_conf.h seems to be on the right
> track. It would be good if the defined values could be put in a guard
> to avoid possible redefinition so that we have our defines in a block
> like:
>
> #ifndef SIZEOF_LONG_INT
> #define SIZEOF_LONG_INT 8
> #endif

Yep, that can be done, its like that in the main config.h
> This can really help when using multiple third party packages.
> Ideally, that would be UNIXODBC_SIZEOF_LONG_INT to avoid name
> pollution as well. Internally here we tend to have our configure
> generate _config.h and then have a Makefile.am rule to create config.h
> from _config.h such as:
>
> input=$(top_builddir)/include/LIBNAME/_config.h
> output=$(top_builddir)/include/LIBNAME/config.h
> config.h: _config.h
>          sed -e 's/#define /#define LIBNAME_/' \
>              -e 's/#undef /#undef LIBNAME_/' \
>              -e 's/LIBNAME_LIBNAME_/LIBNAME_/'<  $(input)>  $(output)
>
> and having the top level configure.ac have:
> AC_CONFIG_HEADER([include/LIBNAME/_config.h])
>
> Of course doing this would require quite a lot of code changes in
> existing code so it's not easy to retrofit.
I will think on that, I would have though given the names and the #ifdef 
that any collisions would be benign anyway
> A second issue was that I needed to configure separately in the
> libtltdl sub-directory - I suspect you're missing a
> AC_CONFIG_SUBDIRS([libltdl]) in configure.ac. Speaking of, it would be
> generous if you added configure.ac to the dist via EXTRA_DIST so
> others can fix little issues - you may even get patches!
Hmm, that should work, at least it does for me. Can you send the output 
from running configure. It may be deciding to use yoru system libltdl 
instead of the built in one.

-- 
Nick


More information about the unixODBC-dev mailing list