From: Ezra Peisach Date: Mon, 18 Jun 2001 18:25:22 +0000 (+0000) Subject: * acconfig.h: Add HAVE_REGCOMP X-Git-Tag: krb5-1.3-alpha1~1402 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35a7cdb867f1b4377092055be6dd51cf88ca1a68;p=krb5.git * acconfig.h: Add HAVE_REGCOMP * aclocal.m4 (KRB5_AC_NEED_LIBGEN): Determins if libgen is really needed to be linked with executables by determining if regcomp() is missing or non-functionl and then if compile/step will be used. (KRB5_AC_REGEX_FUNCS): Rewritten to require KRB5_AC_NEED_LIBGEN. (KRB5_BUILD_PROGRAM): Use KRB5_AC_NEED_LIBGEN instead of testing for compile in libgen. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13365 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index 0325cd679..2211db0e1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-06-18 Ezra Peisach + + * acconfig.h: Add HAVE_REGCOMP. + + * aclocal.m4 (KRB5_AC_NEED_LIBGEN): Determins if libgen is really + needed to be linked with executables by determining if regcomp() + is missing or non-functionl and then if compile/step will be used. + (KRB5_AC_REGEX_FUNCS): Rewritten to require KRB5_AC_NEED_LIBGEN. + (KRB5_BUILD_PROGRAM): Use KRB5_AC_NEED_LIBGEN instead of testing + for compile in libgen. + 2001-06-11 Ezra Peisach * aclocal.m4 (KRB5_NEED_PROTO): Determines if the OS provides a diff --git a/src/acconfig.h b/src/acconfig.h index 263d00adb..74e4b6644 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -18,6 +18,7 @@ #undef HAVE_STDARG_H #undef HAVE_VARARGS_H +#undef HAVE_REGCOMP /* Define if struct sockaddr and friends (sockaddr_in etc) have the sa_len field. */ diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 95a08a5d2..8ee10e4ec 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -655,15 +655,15 @@ fi dnl stdarg test failure ])dnl dnl -dnl KRB5_AC_REGEX_FUNCS --- check for different regular expression -dnl support functions +dnl KRB5_AC_NEED_LIBGEN --- check if libgen needs to be linked in for +dnl compile/step dnl -AC_DEFUN(KRB5_AC_REGEX_FUNCS,[ -AC_CHECK_FUNCS(re_comp re_exec regexec) +dnl +AC_DEFUN(KRB5_AC_NEED_LIBGEN,[ +AC_REQUIRE([AC_PROG_CC]) dnl dnl regcomp is present but non-functional on Solaris 2.4 dnl -AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING(for working regcomp) AC_CACHE_VAL(ac_cv_func_regcomp,[ AC_TRY_RUN([ @@ -671,23 +671,33 @@ AC_TRY_RUN([ #include regex_t x; regmatch_t m; int main() { return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0); } -], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no)]) +], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no, AC_ERROR([Cannot test regcomp when cross compiling]))]) AC_MSG_RESULT($ac_cv_func_regcomp) test $ac_cv_func_regcomp = yes && AC_DEFINE(HAVE_REGCOMP) dnl -dnl Check for the compile and step functions +dnl Check for the compile and step functions - only if regcomp is not available dnl -save_LIBS="$LIBS" -LIBS=-lgen +if test $ac_cv_func_regcomp = no; then + save_LIBS="$LIBS" + LIBS=-lgen dnl this will fail if there's no compile/step in -lgen, or if there's dnl no -lgen. This is fine. -AC_CHECK_FUNCS(compile step) -LIBS="$save_LIBS" + AC_CHECK_FUNCS(compile step) + LIBS="$save_LIBS" dnl dnl Set GEN_LIB if necessary dnl -AC_CHECK_LIB(gen, compile, GEN_LIB=-lgen, GEN_LIB=) -AC_SUBST(GEN_LIB) + AC_CHECK_LIB(gen, compile, GEN_LIB=-lgen, GEN_LIB=) + AC_SUBST(GEN_LIB) +fi +]) +dnl +dnl KRB5_AC_REGEX_FUNCS --- check for different regular expression +dnl support functions +dnl +AC_DEFUN(KRB5_AC_REGEX_FUNCS,[ +AC_CHECK_FUNCS(re_comp re_exec regexec) +AC_REQUIRE([KRB5_AC_NEED_LIBGEN]) ])dnl dnl dnl AC_KRB5_TCL_FIND_CONFIG (uses tcl_dir) @@ -986,8 +996,7 @@ dnl Set variables to build a program. AC_DEFUN(KRB5_BUILD_PROGRAM, [AC_REQUIRE([KRB5_LIB_AUX]) -AC_CHECK_LIB(gen, compile, GEN_LIB=-lgen, GEN_LIB=) -AC_SUBST(GEN_LIB) +AC_REQUIRE([KRB5_AC_NEED_LIBGEN]) AC_SUBST(CC_LINK) AC_SUBST(DEPLIBEXT)])