]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use the non deprecated method of getting ruby config
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 24 Nov 2012 17:29:02 +0000 (17:29 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 24 Nov 2012 17:29:02 +0000 (17:29 +0000)
src/modules/rlm_ruby/configure
src/modules/rlm_ruby/configure.in
src/modules/rlm_ruby/m4/ax_ruby_devel.m4

index b583a8b0ae8330267df6a3d55788c395fe8d9c35..4a1d213ce3e00dfe984153d8814b76e2de06032a 100755 (executable)
@@ -590,10 +590,11 @@ targetname
 ruby_headers
 ruby_cflags
 ruby_ldflags
+RUBY_EXTRA_LDFLAGS
 RUBY_EXTRA_LIBS
 RUBY_SITE_PKG
 RUBY_LDFLAGS
-RUBY_CPPFLAGS
+RUBY_CFLAGS
 AWK
 RUBY_VERSION
 GREP
@@ -2011,7 +2012,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # DESCRIPTION
 #
 #   This macro checks for Ruby and tries to get the include path to
-#   'ruby.h'. It provides the $(RUBY_CPPFLAGS) and $(RUBY_LDFLAGS) output
+#   'ruby.h'. It provides the $(RUBY_CFLAGS) and $(RUBY_LDFLAGS) output
 #   variables. It also exports $(RUBY_EXTRA_LIBS) for embedding Ruby in your
 #   code.
 #
@@ -3394,15 +3395,15 @@ $ac_distutils_result" "$LINENO" 5
     #
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ruby include path" >&5
 $as_echo_n "checking for Ruby include path... " >&6; }
-    if test -z "$RUBY_CPPFLAGS"; then
-        ruby_path=`$RUBY -rmkmf -e 'print Config::CONFIG["archdir"]'`
+    if test -z "$RUBY_CFLAGS"; then
+        ruby_path=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(archdir))'`
         if test -n "${ruby_path}"; then
                 ruby_path="-I$ruby_path"
         fi
-        RUBY_CPPFLAGS=$ruby_path
+        RUBY_CFLAGS=$ruby_path
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_CPPFLAGS" >&5
-$as_echo "$RUBY_CPPFLAGS" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_CFLAGS" >&5
+$as_echo "$RUBY_CFLAGS" >&6; }
 
 
     #
@@ -3411,7 +3412,7 @@ $as_echo "$RUBY_CPPFLAGS" >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ruby library path" >&5
 $as_echo_n "checking for Ruby library path... " >&6; }
     if test -z "$RUBY_LDFLAGS"; then
-        RUBY_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG["LIBRUBYARG_SHARED"]'`
+        RUBY_LDFLAGS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))'`
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_LDFLAGS" >&5
 $as_echo "$RUBY_LDFLAGS" >&6; }
@@ -3423,7 +3424,7 @@ $as_echo "$RUBY_LDFLAGS" >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ruby site-packages path" >&5
 $as_echo_n "checking for Ruby site-packages path... " >&6; }
     if test -z "$RUBY_SITE_PKG"; then
-        RUBY_SITE_PKG=`$RUBY -rmkmf -e 'print Config::CONFIG["sitearchdir"]'`
+        RUBY_SITE_PKG=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(sitearchdir))'`
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_SITE_PKG" >&5
 $as_echo "$RUBY_SITE_PKG" >&6; }
@@ -3435,7 +3436,7 @@ $as_echo "$RUBY_SITE_PKG" >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking ruby extra libraries" >&5
 $as_echo_n "checking ruby extra libraries... " >&6; }
     if test -z "$RUBY_EXTRA_LIBS"; then
-       RUBY_EXTRA_LIBS=`$RUBY -rmkmf -e 'print Config::CONFIG["SOLIBS"]'`
+       RUBY_EXTRA_LIBS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(SOLIBS))'`
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_EXTRA_LIBS" >&5
 $as_echo "$RUBY_EXTRA_LIBS" >&6; }
@@ -3445,12 +3446,14 @@ $as_echo "$RUBY_EXTRA_LIBS" >&6; }
     # linking flags needed when embedding
     # (is it even needed for Ruby?)
     #
-    # AC_MSG_CHECKING(ruby extra linking flags)
-    # if test -z "$RUBY_EXTRA_LDFLAGS"; then
-    # RUBY_EXTRA_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG[["LINKFORSHARED"]]'`
-    # fi
-    # AC_MSG_RESULT([$RUBY_EXTRA_LDFLAGS])
-    # AC_SUBST(RUBY_EXTRA_LDFLAGS)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking ruby extra linking flags" >&5
+$as_echo_n "checking ruby extra linking flags... " >&6; }
+    if test -z "$RUBY_EXTRA_LDFLAGS"; then
+      RUBY_EXTRA_LDFLAGS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(LINKFORSHARED))'`
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY_EXTRA_LDFLAGS" >&5
+$as_echo "$RUBY_EXTRA_LDFLAGS" >&6; }
+
 
     # this flags breaks ruby.h, and is sometimes defined by KDE m4 macros
     CFLAGS="`echo "$CFLAGS" | sed -e 's/-std=iso9899:1990//g;'`"
@@ -3468,8 +3471,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
     # save current global flags
     ac_save_LIBS="$LIBS"
     LIBS="$ac_save_LIBS $RUBY_LDFLAGS"
-    ac_save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$ac_save_CPPFLAGS $RUBY_CPPFLAGS"
+    ac_save_CFLAGS="$CFLAGS"
+    CFLAGS="$ac_save_CFLAGS $RUBY_CFLAGS"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ruby.h>
@@ -3513,7 +3516,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
     # turn back to default flags
-    CPPFLAGS="$ac_save_CPPFLAGS"
+    CFLAGS="$ac_save_CFLAGS"
     LIBS="$ac_save_LIBS"
 
     #
@@ -3522,145 +3525,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
        if test x$RUBY_VERSION != x""; then
-               ruby_cflags+="$RUBY_CPPFLAGS"
+               ruby_cflags+="$RUBY_CFLAGS"
                ruby_ldflags+="$RUBY_LDFLAGS"
                ruby_ldflags+="$RUBY_EXTRA_LIBS"
-
-               old_CFLAGS="$CFLAGS"
-               CFLAGS="$ruby_cflags"
-
-
-
-ac_safe=`echo "ruby.h" | sed 'y%./+-%__pm%'`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby.h" >&5
-$as_echo_n "checking for ruby.h... " >&6; }
-
-old_CFLAGS="$CFLAGS"
-smart_include=
-smart_include_dir=
-
-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.  */
-
-                   #include <ruby.h>
-int
-main ()
-{
- int a = 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  smart_include="-I$try"
-else
-  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 "x$smart_include" = "x"; then
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-                 #include <ruby.h>
-int
-main ()
-{
- int a = 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  smart_include=" "
-else
-  smart_include=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test "x$smart_include" = "x"; then
-
-
-if test "x$LOCATE" != "x"; then
-        DIRS=
-  file=ruby.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
-
-    dir=`${DIRNAME} $x 2>/dev/null`
-                exclude=`echo ${dir} | ${GREP} /home`
-    if test "x$exclude" != "x"; then
-      continue
-    fi
-
-                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
-    if test "x$already" = "x"; then
-      DIRS="$DIRS $dir"
-    fi
-  done
-fi
-
-eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
-
-
-  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 <ruby.h>
-int
-main ()
-{
- int a = 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  smart_include="-I$try"
-else
-  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 "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
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-               if test "x$ac_cv_header_ruby_h" != "xyes"; then
-                       fail="$fail ruby.h"
-                       targetname=
-               fi
-
-               CFLAGS="$old_CFLAGS"
        else
                fail="ruby"
                targetname=
index 11603aaae213d4c0274fbc00b682003e9a8cd9a4..c07ddb98cf103f8eee24d9c4c9d0f8ecd2919e12 100644 (file)
@@ -21,20 +21,9 @@ if test x$with_[]modname != xno; then
        AX_RUBY_DEVEL([1.8])
        
        if test x$RUBY_VERSION != x""; then
-               ruby_cflags+="$RUBY_CPPFLAGS"
+               ruby_cflags+="$RUBY_CFLAGS"
                ruby_ldflags+="$RUBY_LDFLAGS"
                ruby_ldflags+="$RUBY_EXTRA_LIBS"
-               
-               old_CFLAGS="$CFLAGS"
-               CFLAGS="$ruby_cflags"
-               
-               FR_SMART_CHECK_INCLUDE(ruby.h)
-               if test "x$ac_cv_header_ruby_h" != "xyes"; then
-                       fail="$fail ruby.h"
-                       targetname=
-               fi
-               
-               CFLAGS="$old_CFLAGS"
        else
                fail="ruby"
                targetname=
index d2d7a49ff8cf243c7e22a0ac85a0d9a30db62e36..67ad3e13fc02798beb8aca8291bf62aa9bacd9a7 100644 (file)
@@ -9,7 +9,7 @@
 # DESCRIPTION
 #
 #   This macro checks for Ruby and tries to get the include path to
-#   'ruby.h'. It provides the $(RUBY_CPPFLAGS) and $(RUBY_LDFLAGS) output
+#   'ruby.h'. It provides the $(RUBY_CFLAGS) and $(RUBY_LDFLAGS) output
 #   variables. It also exports $(RUBY_EXTRA_LIBS) for embedding Ruby in your
 #   code.
 #
@@ -73,22 +73,22 @@ $ac_distutils_result])
     # Check for Ruby include path
     #
     AC_MSG_CHECKING([for Ruby include path])
-    if test -z "$RUBY_CPPFLAGS"; then
-        ruby_path=`$RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]]'`
+    if test -z "$RUBY_CFLAGS"; then
+        ruby_path=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(archdir))'`
         if test -n "${ruby_path}"; then
                 ruby_path="-I$ruby_path"
         fi
-        RUBY_CPPFLAGS=$ruby_path
+        RUBY_CFLAGS=$ruby_path
     fi
-    AC_MSG_RESULT([$RUBY_CPPFLAGS])
-    AC_SUBST([RUBY_CPPFLAGS])
+    AC_MSG_RESULT([$RUBY_CFLAGS])
+    AC_SUBST([RUBY_CFLAGS])
 
     #
     # Check for Ruby library path
     #
     AC_MSG_CHECKING([for Ruby library path])
     if test -z "$RUBY_LDFLAGS"; then
-        RUBY_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG[["LIBRUBYARG_SHARED"]]'`
+        RUBY_LDFLAGS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))'`
     fi
     AC_MSG_RESULT([$RUBY_LDFLAGS])
     AC_SUBST([RUBY_LDFLAGS])
@@ -98,7 +98,7 @@ $ac_distutils_result])
     #
     AC_MSG_CHECKING([for Ruby site-packages path])
     if test -z "$RUBY_SITE_PKG"; then
-        RUBY_SITE_PKG=`$RUBY -rmkmf -e 'print Config::CONFIG[["sitearchdir"]]'`
+        RUBY_SITE_PKG=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(sitearchdir))'`
     fi
     AC_MSG_RESULT([$RUBY_SITE_PKG])
     AC_SUBST([RUBY_SITE_PKG])
@@ -108,7 +108,7 @@ $ac_distutils_result])
     #
     AC_MSG_CHECKING(ruby extra libraries)
     if test -z "$RUBY_EXTRA_LIBS"; then
-       RUBY_EXTRA_LIBS=`$RUBY -rmkmf -e 'print Config::CONFIG[["SOLIBS"]]'`
+       RUBY_EXTRA_LIBS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(SOLIBS))'`
     fi
     AC_MSG_RESULT([$RUBY_EXTRA_LIBS])
     AC_SUBST(RUBY_EXTRA_LIBS)
@@ -117,12 +117,12 @@ $ac_distutils_result])
     # linking flags needed when embedding
     # (is it even needed for Ruby?)
     #
-    AC_MSG_CHECKING(ruby extra linking flags)
-    if test -z "$RUBY_EXTRA_LDFLAGS"; then
-    # RUBY_EXTRA_LDFLAGS=`$RUBY -rmkmf -e 'print Config::CONFIG[["LINKFORSHARED"]]'`
-    fi
-    AC_MSG_RESULT([$RUBY_EXTRA_LDFLAGS])
-    AC_SUBST(RUBY_EXTRA_LDFLAGS)
+    AC_MSG_CHECKING(ruby extra linking flags)
+    if test -z "$RUBY_EXTRA_LDFLAGS"; then
+      RUBY_EXTRA_LDFLAGS=`$RUBY -rmkmf -e 'print RbConfig::CONFIG.fetch(%q(LINKFORSHARED))'`
+    fi
+    AC_MSG_RESULT([$RUBY_EXTRA_LDFLAGS])
+    AC_SUBST(RUBY_EXTRA_LDFLAGS)
 
     # this flags breaks ruby.h, and is sometimes defined by KDE m4 macros
     CFLAGS="`echo "$CFLAGS" | sed -e 's/-std=iso9899:1990//g;'`"
@@ -134,8 +134,8 @@ $ac_distutils_result])
     # save current global flags
     ac_save_LIBS="$LIBS"
     LIBS="$ac_save_LIBS $RUBY_LDFLAGS"
-    ac_save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$ac_save_CPPFLAGS $RUBY_CPPFLAGS"
+    ac_save_CFLAGS="$CFLAGS"
+    CFLAGS="$ac_save_CFLAGS $RUBY_CFLAGS"
     AC_LINK_IFELSE(
                [AC_LANG_PROGRAM([#include <ruby.h>],[ruby_init()])],
                [rubyexists=yes],
@@ -159,7 +159,7 @@ $ac_distutils_result])
     fi
     AC_LANG_POP
     # turn back to default flags
-    CPPFLAGS="$ac_save_CPPFLAGS"
+    CFLAGS="$ac_save_CFLAGS"
     LIBS="$ac_save_LIBS"
 
     #