diff options
-rw-r--r-- | config/ac-macros/misc.m4 | 29 | ||||
-rw-r--r-- | configure.in | 10 |
2 files changed, 30 insertions, 9 deletions
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 index e3413048cf7..6f93f38f119 100644 --- a/config/ac-macros/misc.m4 +++ b/config/ac-macros/misc.m4 @@ -737,3 +737,32 @@ then fi AC_SUBST(CXX_VERSION) ]) + +AC_DEFUN([MYSQL_PROG_AR], [ +AC_REQUIRE([MYSQL_CHECK_CXX_VERSION]) +case $CXX_VERSION in + MIPSpro*) + AR=$CXX + ARFLAGS="-ar -o" + ;; + *Forte*) + AR=$CXX + ARFLAGS="-xar -o" + ;; + *) + if test -z "$AR" + then + AC_CHECK_PROG([AR], [ar], [ar]) + fi + if test -z "$AR" + then + AC_MSG_ERROR([You need ar to build the library]) + fi + if test -z "$ARFLAGS" + then + ARFLAGS="cru" + fi +esac +AC_SUBST(AR) +AC_SUBST(ARFLAGS) +]) diff --git a/configure.in b/configure.in index bed47ce279f..ae26a0c44df 100644 --- a/configure.in +++ b/configure.in @@ -354,15 +354,7 @@ then [1], [Defined by configure. Use explicit template instantiation.]) fi -case $CXX_VERSION in - MIPSpro*) - AR=$CXX - ARFLAGS="-ar -o" - ;; - *Forte*) - AR=$CXX - ARFLAGS="-xar -o" -esac +MYSQL_PROG_AR # Avoid bug in fcntl on some versions of linux AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os") |