From: Arran Cudbard-Bell Date: Mon, 25 Feb 2013 15:52:23 +0000 (-0500) Subject: Fix eap-ikev2 configure script X-Git-Tag: release_3_0_0_beta1~950 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb13c1065c996f0ac655c9ffa7ce7e8b45db57b;p=thirdparty%2Ffreeradius-server.git Fix eap-ikev2 configure script --- diff --git a/src/modules/rlm_eap/types/rlm_eap_ikev2/configure b/src/modules/rlm_eap/types/rlm_eap_ikev2/configure index 6f6d5b7248f..d0b0080f90e 100755 --- a/src/modules/rlm_eap/types/rlm_eap_ikev2/configure +++ b/src/modules/rlm_eap/types/rlm_eap_ikev2/configure @@ -196,8 +196,7 @@ test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -584,50 +583,11 @@ PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="rlm_eap_ikev2.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - ac_subst_vars='LTLIBOBJS LIBOBJS targetname eap_ikev2_ldflags eap_ikev2_cflags -EGREP -GREP -CPP OBJEXT EXEEXT ac_ct_CC @@ -676,8 +636,9 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -with_eap_ikev2_includes -with_eap_ikev2_libraries +with_eap_ikev2_include_dir +with_eap_ikev2_lib_dir +with_eap_ikev2_dir ' ac_precious_vars='build_alias host_alias @@ -686,8 +647,7 @@ CC CFLAGS LDFLAGS LIBS -CPPFLAGS -CPP' +CPPFLAGS' # Initialize some variables set by options. @@ -1294,10 +1254,12 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-eap-ikev2-includes - Diectory to look for EAPIKEv2 include files - --with-eap-ikev2-libraries - Diectory to look for EAPIKEv2 library file + --with-eap-ikev2-include-dir=DIR + Directory where the json-c includes may be found + --with-eap-ikev2-lib-dir=DIR + Directory where the eap-ikev2 libraries may be found + --with-eap-ikev2-dir=DIR + Base directory where eap-ikev2 is installed Some influential environment variables: CC C compiler command @@ -1307,7 +1269,6 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1427,203 +1388,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -2025,9 +1789,58 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x$with_rlm_eap_ikev2 != xno; then - - ## We may need more complex checking here. Assume for now that - ## everyone has it. + eap_ikev2_include_dir= + +# Check whether --with-eap-ikev2-include-dir was given. +if test "${with_eap_ikev2_include_dir+set}" = set; then : + withval=$with_eap_ikev2_include_dir; case "$withval" in + no) + as_fn_error $? "Need eap-ikev2-include-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + eap_ikev2_include_dir="$withval" + ;; + esac +fi + + + eap_ikev2_lib_dir= + +# Check whether --with-eap-ikev2-lib-dir was given. +if test "${with_eap_ikev2_lib_dir+set}" = set; then : + withval=$with_eap_ikev2_lib_dir; case "$withval" in + no) + as_fn_error $? "Need eap-ikev2-lib-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + eap_ikev2_lib_dir="$withval" + ;; + esac +fi + + + +# Check whether --with-eap-ikev2-dir was given. +if test "${with_eap_ikev2_dir+set}" = set; then : + withval=$with_eap_ikev2_dir; case "$withval" in + no) + as_fn_error $? "Need eap-ikev2-dir" "$LINENO" 5 + ;; + yes) + ;; + *) + eap_ikev2_lib_dir="$withval/lib" + eap_ikev2_include_dir="$withval/include" + ;; + esac +fi + + + smart_try_dir="$eap_ikev2_include_dir" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2818,499 +2631,291 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi +ac_safe=`echo "EAPIKEv2/connector.h" | sed 'y%./+-%__pm%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EAPIKEv2/connector.h" >&5 +$as_echo_n "checking for EAPIKEv2/connector.h... " >&6; } - done - ac_cv_prog_CPP=$CPP +old_CFLAGS="$CFLAGS" +smart_include= +smart_include_dir= -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + CFLAGS="$old_CFLAGS -I$try" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + #include +int +main () +{ + int a = 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + smart_include="-I$try" else - # Broken: fails on valid input. -continue + smart_include= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "x$smart_include" != "x"; then + break; + fi + done + CFLAGS="$old_CFLAGS" fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. +if test "x$smart_include" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + + #include +int +main () +{ + int a = 1; + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +if ac_fn_c_try_compile "$LINENO"; then : + smart_include=" " else - # Passes both tests. -ac_preproc_ok=: -break + smart_include= fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test "x$smart_include" = "x"; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +if test "x$LOCATE" != "x"; then + DIRS= + file=EAPIKEv2/connector.h + for x in `${LOCATE} $file 2>/dev/null`; do + base=`echo $x | sed "s%/${file}%%"` + if test "x$x" = "x$base"; then + continue; + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count + dir=`${DIRNAME} $x 2>/dev/null` + exclude=`echo ${dir} | ${GREP} /home` + if test "x$exclude" != "x"; then + continue fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_EGREP_found && break 3 - done - done + already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` + if test "x$already" = "x"; then + DIRS="$DIRS $dir" + fi done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + for try in $smart_include_dir /usr/local/include /opt/include; do + CFLAGS="$old_CFLAGS -I$try" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include + #include int main () { - + int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes + smart_include="-I$try" else - ac_cv_header_stdc=no + smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "x$smart_include" != "x"; then + break; + fi + done + CFLAGS="$old_CFLAGS" +fi -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - +if test "x$smart_include" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + eval "ac_cv_header_$ac_safe=yes" + CFLAGS="$old_CFLAGS $smart_include" + SMART_CFLAGS="$SMART_CFLAGS $smart_include" else - ac_cv_header_stdc=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest* -fi + if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then + fail="$fail EAPIKEv2/connector.h" + fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + smart_try_dir="$eap_ikev2_lib_dir" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* +sm_lib_safe=`echo "eap-ikev2" | sed 'y%./+-%__p_%'` +sm_func_safe=`echo "ikev2_set_log_callback" | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ikev2_set_log_callback in -leap-ikev2" >&5 +$as_echo_n "checking for ikev2_set_log_callback in -leap-ikev2... " >&6; } -fi +old_LIBS="$LIBS" +smart_lib= +smart_lib_dir= -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "x$smart_try_dir" != "x"; then + for try in $smart_try_dir; do + LIBS="-L$try -leap-ikev2 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +extern char ikev2_set_log_callback(); int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + ikev2_set_log_callback() + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no +if ac_fn_c_try_link "$LINENO"; then : + smart_lib="-L$try -leap-ikev2" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$smart_lib" != "x"; then + break; + fi + done + LIBS="$old_LIBS" fi +if test "x$smart_lib" = "x"; then + LIBS="-leap-ikev2 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char ikev2_set_log_callback(); +int +main () +{ + ikev2_set_log_callback() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + smart_lib="-leap-ikev2" fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$old_LIBS" fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$smart_lib" = "x"; then -fi -done +if test "x$LOCATE" != "x"; then + DIRS= + file=libeap-ikev2${libltdl_cv_shlibext} + for x in `${LOCATE} $file 2>/dev/null`; do + base=`echo $x | sed "s%/${file}%%"` + if test "x$x" = "x$base"; then + continue; + fi -for ac_header in malloc.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 -_ACEOF + dir=`${DIRNAME} $x 2>/dev/null` + exclude=`echo ${dir} | ${GREP} /home` + if test "x$exclude" != "x"; then + continue + fi + already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` + if test "x$already" = "x"; then + DIRS="$DIRS $dir" + fi + done fi -done - +eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" -# Check whether --with-eap-ikev2-includes was given. -if test "${with_eap_ikev2_includes+set}" = set; then : - withval=$with_eap_ikev2_includes; eap_ikev2_includes=-I$with_eap_ikev2_includes -fi +if test "x$LOCATE" != "x"; then + DIRS= + file=libeap-ikev2.a + for x in `${LOCATE} $file 2>/dev/null`; do + base=`echo $x | sed "s%/${file}%%"` + if test "x$x" = "x$base"; then + continue; + fi + dir=`${DIRNAME} $x 2>/dev/null` + exclude=`echo ${dir} | ${GREP} /home` + if test "x$exclude" != "x"; then + continue + fi -# Check whether --with-eap-ikev2-libraries was given. -if test "${with_eap_ikev2_libraries+set}" = set; then : - withval=$with_eap_ikev2_libraries; eap_ikev2_libraries=-L$with_eap_ikev2_libraries + already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` + if test "x$already" = "x"; then + DIRS="$DIRS $dir" + fi + done fi +eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" - LDFLAGS="$eap_ikev2_libraries $OPENSSL_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ikev2_set_log_callback in -leap-ikev2" >&5 -$as_echo_n "checking for ikev2_set_log_callback in -leap-ikev2... " >&6; } -if ${ac_cv_lib_eap_ikev2_ikev2_set_log_callback+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-leap-ikev2 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ikev2_set_log_callback (); + for try in $smart_lib_dir /usr/local/lib /opt/lib; do + LIBS="-L$try -leap-ikev2 $old_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char ikev2_set_log_callback(); int main () { -return ikev2_set_log_callback (); + ikev2_set_log_callback() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_eap_ikev2_ikev2_set_log_callback=yes -else - ac_cv_lib_eap_ikev2_ikev2_set_log_callback=no + smart_lib="-L$try -leap-ikev2" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + if test "x$smart_lib" != "x"; then + break; + fi + done + LIBS="$old_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_eap_ikev2_ikev2_set_log_callback" >&5 -$as_echo "$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" >&6; } -if test "x$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBEAP_IKEV2 1 -_ACEOF - - LIBS="-leap-ikev2 $LIBS" +if test "x$smart_lib" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" + LIBS="$smart_lib $old_LIBS" + SMART_LIBS="$smart_lib $SMART_LIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" != "xyes"; then fail="$fail libeap-ikev2" fi - LDFLAGS=$old_LDFLAG - - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$eap_ikev2_includes - ac_fn_c_check_header_mongrel "$LINENO" "EAPIKEv2/connector.h" "ac_cv_header_EAPIKEv2_connector_h" "$ac_includes_default" -if test "x$ac_cv_header_EAPIKEv2_connector_h" = xyes; then : - -fi - - - if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then - fail="$fail EAPIKEv2/connector.h" - fi - CPPFLAGS=$old_CPPFLAGS - - eap_ikev2_cflags="$eap_ikev2_includes" - LDFLAGS="$LDFLAGS $openssl_libraries $eap_ikev2_libraries" - targetname=rlm_eap_ikev2 # keep this! Don't change! else targetname= # keep this! Don't change! @@ -3329,7 +2934,8 @@ $as_echo "$as_me: WARNING: FAILURE: rlm_eap_ikev2 requires: $fail." >&2;}; fi fi - +eap_ikev2_cflags="${SMART_CFLAGS}" +eap_ikev2_ldflags="${OPENSSL_LIBS} ${SMART_LIBS}" diff --git a/src/modules/rlm_eap/types/rlm_eap_ikev2/configure.in b/src/modules/rlm_eap/types/rlm_eap_ikev2/configure.in index ccf83100e39..7176ebb1580 100644 --- a/src/modules/rlm_eap/types/rlm_eap_ikev2/configure.in +++ b/src/modules/rlm_eap/types/rlm_eap_ikev2/configure.in @@ -3,41 +3,72 @@ AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_ikev2]) if test x$with_[]modname != xno; then + dnl extra argument: --with-eap-ikev2-include-dir=DIR + eap_ikev2_include_dir= + AC_ARG_WITH(eap-ikev2-include-dir, + [AS_HELP_STRING([--with-eap-ikev2-include-dir=DIR], + [Directory where the json-c includes may be found])], + [case "$withval" in + no) + AC_MSG_ERROR(Need eap-ikev2-include-dir) + ;; + yes) + ;; + *) + eap_ikev2_include_dir="$withval" + ;; + esac]) - ## We may need more complex checking here. Assume for now that - ## everyone has it. - AC_CHECK_HEADERS(malloc.h) + dnl extra argument: --with-eap-ikev2-lib-dir=DIR + eap_ikev2_lib_dir= + AC_ARG_WITH(eap-ikev2-lib-dir, + [AS_HELP_STRING([--with-eap-ikev2-lib-dir=DIR], + [Directory where the eap-ikev2 libraries may be found])], + [case "$withval" in + no) + AC_MSG_ERROR(Need eap-ikev2-lib-dir) + ;; + yes) + ;; + *) + eap_ikev2_lib_dir="$withval" + ;; + esac]) - AC_ARG_WITH(eap-ikev2-includes, - AS_HELP_STRING([--with-eap-ikev2-includes], - [Diectory to look for EAPIKEv2 include files]), - eap_ikev2_includes=-I$with_eap_ikev2_includes) - + dnl extra argument: --with-eap-ikev2-dir=DIR + AC_ARG_WITH(eap-ikev2-dir, + [AS_HELP_STRING([--with-eap-ikev2-dir=DIR], + [Base directory where eap-ikev2 is installed])], + [case "$withval" in + no) + AC_MSG_ERROR(Need eap-ikev2-dir) + ;; + yes) + ;; + *) + eap_ikev2_lib_dir="$withval/lib" + eap_ikev2_include_dir="$withval/include" + ;; + esac]) - AC_ARG_WITH(eap-ikev2-libraries, - AS_HELP_STRING([--with-eap-ikev2-libraries], - [Diectory to look for EAPIKEv2 library file]), - eap_ikev2_libraries=-L$with_eap_ikev2_libraries) + dnl ############################################################ + dnl # Check for eap-ikev2 includes + dnl ############################################################ + smart_try_dir="$eap_ikev2_include_dir" + FR_SMART_CHECK_INCLUDE([EAPIKEv2/connector.h]) + if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then + fail="$fail EAPIKEv2/connector.h" + fi - LDFLAGS="$eap_ikev2_libraries $OPENSSL_LIBS" - AC_CHECK_LIB([eap-ikev2],[ikev2_set_log_callback]) + dnl ############################################################ + dnl # Check for eap-ikev2 library + dnl ############################################################ + smart_try_dir="$eap_ikev2_lib_dir" + FR_SMART_CHECK_LIB([eap-ikev2],[ikev2_set_log_callback]) if test "x$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" != "xyes"; then fail="$fail libeap-ikev2" fi - LDFLAGS=$old_LDFLAG - - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=$eap_ikev2_includes - AC_CHECK_HEADER(EAPIKEv2/connector.h) - if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then - fail="$fail EAPIKEv2/connector.h" - fi - CPPFLAGS=$old_CPPFLAGS - - eap_ikev2_cflags="$eap_ikev2_includes" - LDFLAGS="$LDFLAGS $openssl_libraries $eap_ikev2_libraries" - targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! @@ -55,7 +86,8 @@ if test x"$fail" != x""; then fi fi - +eap_ikev2_cflags="${SMART_CFLAGS}" +eap_ikev2_ldflags="${OPENSSL_LIBS} ${SMART_LIBS}" AC_SUBST(eap_ikev2_cflags) AC_SUBST(eap_ikev2_ldflags)