0

I have a program which makes use of boost_regex. The library boost_regex has an undefined symbol named differently with respect to the version of boost I am using. For instance, when I use boost version 1.49, libboost_regex.so contains an undefined symbol called u_tolower_49. This symbol can be found within libicuuc.so.

Obviously, if an user who doesn’t have icu compiles my program, the link stage will fail because that symbol is missing. So I decided to add it to configure.ac so that the configuration stage fails before starting the compilation.

configure.ac

...
AC_SEARCH_LIBS([u_tolower_49],[icuuc], , AC_MSG_ERROR([Unable to find icuuc, make sure ICU is installed.]))
...

Now my problem is that when the user’s version of boost is 48, the symbol is no longer named u_tolower_49 but u_tolower_48.

How can I tweak configure.ac to make sure that the configuration fails regardless of the version of boost the user has?

qdii
  • 12,505
  • 10
  • 59
  • 116

1 Answers1

1

Nest the checks:

AC_SEARCH_LIBS([u_tolower_49],[icuuc],[],[
    AC_SEARCH_LIBS([u_tolower_48],[icuuc],[],[
        AC_MSG_ERROR([Unable to find icuuc, make sure ICU is installed.])
    ])
])
William Pursell
  • 204,365
  • 48
  • 270
  • 300
  • +1 for the idea, but hm, there is also boost 50, boost 51, and so,on – qdii Oct 01 '12 at 21:04
  • 1
    @qdii That is an issue to take up with boost! If they change symbol names to break the api, there is (probably) a reason for doing so. You could ease the pain by using an `m4_foreach` loop, but any solution will be hackish. – William Pursell Oct 01 '12 at 21:11