[unixODBC-dev] cross compiling 2.3.0

Bill Segall bill at segall.net
Thu Apr 14 22:03:13 BST 2011


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

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.

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!

Thanks, it's working well for me.

Bill.


More information about the unixODBC-dev mailing list