All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0 of 3] Another round of fixes for autoconf
@ 2012-02-22 16:40 Roger Pau Monne
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 16:40 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

Add checks for curses library, bin86, bcc and iasl. Also fix 
python-dev check.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1 of 3] imported patch add_ncurses_autoconf
  2012-02-22 16:40 [PATCH 0 of 3] Another round of fixes for autoconf Roger Pau Monne
@ 2012-02-22 16:40 ` Roger Pau Monne
  2012-02-22 16:46   ` [PATCH] autoconf: add check for curses library Roger Pau Monne
                     ` (2 more replies)
  2012-02-22 16:40 ` [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl Roger Pau Monne
  2012-02-22 16:40 ` [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib Roger Pau Monne
  2 siblings, 3 replies; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 16:40 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329928648 -3600
# Node ID 6e86cecd06046b53373b3cbe756d6a9981ff73d3
# Parent  caf03354472676522f7407a80ad5bec3963a90a9
imported patch add_ncurses_autoconf

diff -r caf033544726 -r 6e86cecd0604 tools/configure
--- a/tools/configure	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure	Wed Feb 22 17:37:28 2012 +0100
@@ -3907,6 +3907,8 @@ case $host_os in *\ *) host_os=`echo "$h
 # PKG_CHECK_MODULES
 
 
+
+
 # Enable/disable options
 # Check whether --enable-xsm was given.
 if test "${enable_xsm+set}" = set; then :
@@ -6380,6 +6382,118 @@ if test "$libuuid" != "y"; then :
 fi
 
 
+ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_curses_h" = x""yes; then :
+  cursesh="y"
+else
+  cursesh="n"
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+  ncursesh="y"
+else
+  ncursesh="n"
+fi
+
+
+if test "$cursesh" = "n" && test "$ncursesh" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses header" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
+$as_echo_n "checking for clear in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $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 clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_curses_clear=yes
+else
+  ac_cv_lib_curses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
+$as_echo "$ac_cv_lib_curses_clear" >&6; }
+if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+  curses="y"
+else
+  curses="n"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
+$as_echo_n "checking for clear in -lncurses... " >&6; }
+if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $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 clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ncurses_clear=yes
+else
+  ac_cv_lib_ncurses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
+$as_echo "$ac_cv_lib_ncurses_clear" >&6; }
+if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+  ncurses="y"
+else
+  ncurses="n"
+fi
+
+if test "$curses" = "n" && test "$ncurses" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses library" "$LINENO" 5
+
+fi
+
+
 
 
 
diff -r caf033544726 -r 6e86cecd0604 tools/configure.ac
--- a/tools/configure.ac	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure.ac	Wed Feb 22 17:37:28 2012 +0100
@@ -33,6 +33,7 @@ m4_include([m4/default_lib.m4])
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
+m4_include([m4/curses.m4])
 
 # Enable/disable options
 AX_ARG_ENABLE_AND_EXPORT([xsm],
@@ -102,6 +103,7 @@ AS_IF([test "x$pythontools" = "xy"], [
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 AX_CHECK_UUID
+AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, glib-2.0)
 
 # Check library path

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl
  2012-02-22 16:40 [PATCH 0 of 3] Another round of fixes for autoconf Roger Pau Monne
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
@ 2012-02-22 16:40 ` Roger Pau Monne
  2012-03-02 20:55   ` Julian Pidancet
  2012-03-12 11:00   ` Ian Jackson
  2012-02-22 16:40 ` [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib Roger Pau Monne
  2 siblings, 2 replies; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 16:40 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329928670 -3600
# Node ID 04c74f6b97ad74ecd3226be5a4c7478859a74aec
# Parent  6e86cecd06046b53373b3cbe756d6a9981ff73d3
autoconf: check for as86, ld86, bcc and iasl

Check for this tools, and set the proper paths on config/Tool.mk.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r 6e86cecd0604 -r 04c74f6b97ad config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Feb 22 17:37:28 2012 +0100
+++ b/config/Tools.mk.in	Wed Feb 22 17:37:50 2012 +0100
@@ -15,6 +15,10 @@ CURL_CONFIG         := @CURL@
 XML2_CONFIG         := @XML@
 BASH                := @BASH@
 XGETTTEXT           := @XGETTEXT@
+AS86                := @AS86@
+LD86                := @LD86@
+BCC                 := @BCC@
+IASL                := @IASL@
 
 # Extra folder for libs/includes
 PREPEND_INCLUDES    := @PREPEND_INCLUDES@
diff -r 6e86cecd0604 -r 04c74f6b97ad tools/configure
--- a/tools/configure	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure	Wed Feb 22 17:37:50 2012 +0100
@@ -631,6 +631,10 @@ INSTALL_PROGRAM
 SET_MAKE
 LN_S
 SED
+IASL
+BCC
+LD86
+AS86
 XGETTEXT
 BASH
 XML
@@ -744,6 +748,10 @@ CURL
 XML
 BASH
 XGETTEXT
+AS86
+LD86
+BCC
+IASL
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
@@ -1398,6 +1406,10 @@ Some influential environment variables:
   XML         Path to xml2-config tool
   BASH        Path to bash shell
   XGETTEXT    Path to xgetttext tool
+  AS86        Path to as86 tool
+  LD86        Path to ld86 tool
+  BCC         Path to bcc tool
+  IASL        Path to iasl tool
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
               directories to add to pkg-config's search path
@@ -4154,6 +4166,10 @@ LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPE
 
 
 
+
+
+
+
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
@@ -6321,6 +6337,186 @@ if test x"${XGETTEXT}" == x"no"
 then
     as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5
 fi
+# Extract the first word of "as86", so it can be a program name with args.
+set dummy as86; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_AS86+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $AS86 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AS86="$AS86" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_AS86="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_AS86" && ac_cv_path_AS86="no"
+  ;;
+esac
+fi
+AS86=$ac_cv_path_AS86
+if test -n "$AS86"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS86" >&5
+$as_echo "$AS86" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${AS86}" == x"no"
+then
+    as_fn_error $? "Unable to find as86, please install as86" "$LINENO" 5
+fi
+# Extract the first word of "ld86", so it can be a program name with args.
+set dummy ld86; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LD86+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $LD86 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LD86="$LD86" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_LD86="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_LD86" && ac_cv_path_LD86="no"
+  ;;
+esac
+fi
+LD86=$ac_cv_path_LD86
+if test -n "$LD86"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD86" >&5
+$as_echo "$LD86" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${LD86}" == x"no"
+then
+    as_fn_error $? "Unable to find ld86, please install ld86" "$LINENO" 5
+fi
+# Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BCC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $BCC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BCC="$BCC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_BCC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_BCC" && ac_cv_path_BCC="no"
+  ;;
+esac
+fi
+BCC=$ac_cv_path_BCC
+if test -n "$BCC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BCC" >&5
+$as_echo "$BCC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${BCC}" == x"no"
+then
+    as_fn_error $? "Unable to find bcc, please install bcc" "$LINENO" 5
+fi
+# Extract the first word of "iasl", so it can be a program name with args.
+set dummy iasl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_IASL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $IASL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_IASL="$IASL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_IASL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_IASL" && ac_cv_path_IASL="no"
+  ;;
+esac
+fi
+IASL=$ac_cv_path_IASL
+if test -n "$IASL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IASL" >&5
+$as_echo "$IASL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${IASL}" == x"no"
+then
+    as_fn_error $? "Unable to find iasl, please install iasl" "$LINENO" 5
+fi
 
 ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
 if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
diff -r 6e86cecd0604 -r 04c74f6b97ad tools/configure.ac
--- a/tools/configure.ac	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure.ac	Wed Feb 22 17:37:50 2012 +0100
@@ -68,6 +68,10 @@ AC_ARG_VAR([CURL], [Path to curl-config 
 AC_ARG_VAR([XML], [Path to xml2-config tool])
 AC_ARG_VAR([BASH], [Path to bash shell])
 AC_ARG_VAR([XGETTEXT], [Path to xgetttext tool])
+AC_ARG_VAR([AS86], [Path to as86 tool])
+AC_ARG_VAR([LD86], [Path to ld86 tool])
+AC_ARG_VAR([BCC], [Path to bcc tool])
+AC_ARG_VAR([IASL], [Path to iasl tool])
 
 # Checks for programs.
 AC_PROG_SED
@@ -102,6 +106,10 @@ AS_IF([test "x$pythontools" = "xy"], [
     AX_CHECK_PYTHON_DEVEL()
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
+AX_PATH_PROG_OR_FAIL([AS86], [as86])
+AX_PATH_PROG_OR_FAIL([LD86], [ld86])
+AX_PATH_PROG_OR_FAIL([BCC], [bcc])
+AX_PATH_PROG_OR_FAIL([IASL], [iasl])
 AX_CHECK_UUID
 AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, glib-2.0)

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib
  2012-02-22 16:40 [PATCH 0 of 3] Another round of fixes for autoconf Roger Pau Monne
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
  2012-02-22 16:40 ` [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl Roger Pau Monne
@ 2012-02-22 16:40 ` Roger Pau Monne
  2012-03-12 10:56   ` Ian Jackson
  2 siblings, 1 reply; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 16:40 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329928675 -3600
# Node ID d27037d4c8ef217effb9d063db3bb620ba3762aa
# Parent  04c74f6b97ad74ecd3226be5a4c7478859a74aec
autoconf: check for Python.h header and -lpython lib

Check that the usually called python-dev package is present.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r 04c74f6b97ad -r d27037d4c8ef tools/configure
--- a/tools/configure	Wed Feb 22 17:37:50 2012 +0100
+++ b/tools/configure	Wed Feb 22 17:37:55 2012 +0100
@@ -6270,26 +6270,77 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
-$as_echo_n "checking for python devel... " >&6; }
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Python devel package not found" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
+
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    if test ${flag:0:2} = "-L"; then :
+
+        LDFLAGS="$LDLFAGS $flag"
+
+fi
+    if test ${flag:0:8} = "-lpython"; then :
+
+        python_lib=${flag:2}
+
+fi
+done
+ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = x""yes; then :
+
+else
+  as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
+fi
+
+
+as_ac_Lib=`$as_echo "ac_cv_lib_$python_lib''_main" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$python_lib" >&5
+$as_echo_n "checking for main in -l$python_lib... " >&6; }
+if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$python_lib  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_LIB$python_lib" | $as_tr_cpp` 1
+_ACEOF
+
+  LIBS="-l$python_lib $LIBS"
+
+else
+  as_fn_error $? "Unable to find a suitable python development library" "$LINENO" 5
+fi
+
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+
 
 fi
 # Extract the first word of "xgettext", so it can be a program name with args.
diff -r 04c74f6b97ad -r d27037d4c8ef tools/m4/python_devel.m4
--- a/tools/m4/python_devel.m4	Wed Feb 22 17:37:50 2012 +0100
+++ b/tools/m4/python_devel.m4	Wed Feb 22 17:37:55 2012 +0100
@@ -1,18 +1,20 @@
-AC_DEFUN([AX_CHECK_PYTHON_DEVEL],
-[AC_MSG_CHECKING([for python devel])
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Python devel package not found])
-else
-    AC_MSG_RESULT([yes])
-fi])
+AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    AS_IF([test ${flag:0:2} = "-L"], [
+        LDFLAGS="$LDLFAGS $flag"
+    ])
+    AS_IF([test ${flag:0:8} = "-lpython"], [
+        python_lib=${flag:2}
+    ])
+done
+AC_CHECK_HEADER([Python.h], [],
+    [AC_MSG_ERROR([Unable to find Python development headers])],)
+AC_CHECK_LIB($python_lib, main, [],
+    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+])

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] autoconf: add check for curses library
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
@ 2012-02-22 16:46   ` Roger Pau Monne
  2012-03-02 12:21   ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monné
  2012-03-12 10:52   ` Ian Jackson
  2 siblings, 0 replies; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 16:46 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329929131 -3600
# Node ID a6af2a82f9de757b529465c3941363507264272e
# Parent  caf03354472676522f7407a80ad5bec3963a90a9
autoconf: add check for curses library

Check for a curses compatible library (curses or ncurses basically).
One of those is needed to compile Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r caf033544726 -r a6af2a82f9de tools/configure
--- a/tools/configure	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure	Wed Feb 22 17:45:31 2012 +0100
@@ -3907,6 +3907,8 @@ case $host_os in *\ *) host_os=`echo "$h
 # PKG_CHECK_MODULES
 
 
+
+
 # Enable/disable options
 # Check whether --enable-xsm was given.
 if test "${enable_xsm+set}" = set; then :
@@ -6380,6 +6382,118 @@ if test "$libuuid" != "y"; then :
 fi
 
 
+ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_curses_h" = x""yes; then :
+  cursesh="y"
+else
+  cursesh="n"
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+  ncursesh="y"
+else
+  ncursesh="n"
+fi
+
+
+if test "$cursesh" = "n" && test "$ncursesh" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses header" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
+$as_echo_n "checking for clear in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $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 clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_curses_clear=yes
+else
+  ac_cv_lib_curses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
+$as_echo "$ac_cv_lib_curses_clear" >&6; }
+if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+  curses="y"
+else
+  curses="n"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
+$as_echo_n "checking for clear in -lncurses... " >&6; }
+if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $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 clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ncurses_clear=yes
+else
+  ac_cv_lib_ncurses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
+$as_echo "$ac_cv_lib_ncurses_clear" >&6; }
+if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+  ncurses="y"
+else
+  ncurses="n"
+fi
+
+if test "$curses" = "n" && test "$ncurses" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses library" "$LINENO" 5
+
+fi
+
+
 
 
 
diff -r caf033544726 -r a6af2a82f9de tools/configure.ac
--- a/tools/configure.ac	Wed Feb 22 17:37:28 2012 +0100
+++ b/tools/configure.ac	Wed Feb 22 17:45:31 2012 +0100
@@ -33,6 +33,7 @@ m4_include([m4/default_lib.m4])
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
+m4_include([m4/curses.m4])
 
 # Enable/disable options
 AX_ARG_ENABLE_AND_EXPORT([xsm],
@@ -102,6 +103,7 @@ AS_IF([test "x$pythontools" = "xy"], [
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 AX_CHECK_UUID
+AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, glib-2.0)
 
 # Check library path

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-12 10:56   ` Ian Jackson
@ 2012-02-22 23:30     ` Roger Pau Monne
  2012-03-12 12:16       ` Ian Jackson
  2012-03-14 14:08       ` Ian Jackson
  0 siblings, 2 replies; 23+ messages in thread
From: Roger Pau Monne @ 2012-02-22 23:30 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329953110 -3600
# Node ID 56c370dc64c17a770dd3cb04b81f9c27dab54d4b
# Parent  f8c0e7ac5a9510a54a48ada6aca5636b9017cdee
autoconf: check for Python.h header and -lpython* lib

Check that the usually called python-dev package is present.

Changes since v1:

 * Use "case" instead of ${flag...} = ....

 * Add comment explaining why we drop -l* flags from python-config.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r f8c0e7ac5a95 -r 56c370dc64c1 tools/configure
--- a/tools/configure	Wed Feb 22 23:58:14 2012 +0100
+++ b/tools/configure	Thu Feb 23 00:25:10 2012 +0100
@@ -6271,26 +6271,88 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
-$as_echo_n "checking for python devel... " >&6; }
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Python devel package not found" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
+
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&5
+$as_echo "$as_me: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&2;}
+        ;;
+    esac
+done
+ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = x""yes; then :
+
+else
+  as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
+fi
+
+
+as_ac_Lib=`$as_echo "ac_cv_lib_$python_lib''_PyArg_ParseTuple" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -l$python_lib" >&5
+$as_echo_n "checking for PyArg_ParseTuple in -l$python_lib... " >&6; }
+if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$python_lib  $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 PyArg_ParseTuple ();
+int
+main ()
+{
+return PyArg_ParseTuple ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_LIB$python_lib" | $as_tr_cpp` 1
+_ACEOF
+
+  LIBS="-l$python_lib $LIBS"
+
+else
+  as_fn_error $? "Unable to find a suitable python development library" "$LINENO" 5
+fi
+
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+
 
 fi
 # Extract the first word of "xgettext", so it can be a program name with args.
diff -r f8c0e7ac5a95 -r 56c370dc64c1 tools/m4/python_devel.m4
--- a/tools/m4/python_devel.m4	Wed Feb 22 23:58:14 2012 +0100
+++ b/tools/m4/python_devel.m4	Thu Feb 23 00:25:10 2012 +0100
@@ -1,18 +1,28 @@
-AC_DEFUN([AX_CHECK_PYTHON_DEVEL],
-[AC_MSG_CHECKING([for python devel])
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Python devel package not found])
-else
-    AC_MSG_RESULT([yes])
-fi])
+AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: $flag])
+        ;;
+    esac
+done
+AC_CHECK_HEADER([Python.h], [],
+    [AC_MSG_ERROR([Unable to find Python development headers])],)
+AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
+    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+])

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1 of 3] imported patch add_ncurses_autoconf
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
  2012-02-22 16:46   ` [PATCH] autoconf: add check for curses library Roger Pau Monne
@ 2012-03-02 12:21   ` Roger Pau Monné
  2012-03-12 10:52   ` Ian Jackson
  2 siblings, 0 replies; 23+ messages in thread
From: Roger Pau Monné @ 2012-03-02 12:21 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.jackson, ian.campbell

2012/2/22 Roger Pau Monne <roger.pau@entel.upc.edu>:
> # HG changeset patch
> # User Roger Pau Monne <roger.pau@entel.upc.edu>
> # Date 1329928648 -3600
> # Node ID 6e86cecd06046b53373b3cbe756d6a9981ff73d3
> # Parent  caf03354472676522f7407a80ad5bec3963a90a9
> imported patch add_ncurses_autoconf

Forget about this patch, I have to resend it.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl
  2012-02-22 16:40 ` [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl Roger Pau Monne
@ 2012-03-02 20:55   ` Julian Pidancet
  2012-03-12 11:00   ` Ian Jackson
  1 sibling, 0 replies; 23+ messages in thread
From: Julian Pidancet @ 2012-03-02 20:55 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: ian.campbell, xen-devel

On 02/22/12 16:40, Roger Pau Monne wrote:
> # HG changeset patch
> # User Roger Pau Monne <roger.pau@entel.upc.edu>
> # Date 1329928670 -3600
> # Node ID 04c74f6b97ad74ecd3226be5a4c7478859a74aec
> # Parent  6e86cecd06046b53373b3cbe756d6a9981ff73d3
> autoconf: check for as86, ld86, bcc and iasl
> 
> Check for this tools, and set the proper paths on config/Tool.mk.
> 
> Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
> 

I've recently submitted patches to enable/disable building of
rombios/vgabios in hvmloader through options in Config.mk:

CONFIG_ROMBIOS ?= y
CONFIG_SEABIOS ?= y

If rombios is disabled, then we shouldn't depend on bcc any longer.

Is it possible to introduce an option in the configure script to
set the above variables and not require bcc/as86/ld86 if not building
rombios support in hvmloader ?

-- 
Julian

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1 of 3] imported patch add_ncurses_autoconf
  2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
  2012-02-22 16:46   ` [PATCH] autoconf: add check for curses library Roger Pau Monne
  2012-03-02 12:21   ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monné
@ 2012-03-12 10:52   ` Ian Jackson
  2012-03-12 11:37     ` Roger Pau Monné
  2 siblings, 1 reply; 23+ messages in thread
From: Ian Jackson @ 2012-03-12 10:52 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel

Roger Pau Monne writes ("[PATCH 1 of 3] imported patch add_ncurses_autoconf"):
> imported patch add_ncurses_autoconf

Did you forget to add curses.m4 ?

Ian.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib
  2012-02-22 16:40 ` [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib Roger Pau Monne
@ 2012-03-12 10:56   ` Ian Jackson
  2012-02-22 23:30     ` [PATCH v2] autoconf: check for Python.h header and -lpython* lib Roger Pau Monne
  0 siblings, 1 reply; 23+ messages in thread
From: Ian Jackson @ 2012-03-12 10:56 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel

Roger Pau Monne writes ("[PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib"):
> +    AS_IF([test ${flag:0:2} = "-L"], [

This syntax, ${flag:0:2}, is not POSIX.  You should use case.  I think
we can safely dispense with the use of AS_IF.

> +        LDFLAGS="$LDLFAGS $flag"
> +    ])
> +    AS_IF([test ${flag:0:8} = "-lpython"], [
> +        python_lib=${flag:2}
> +    ])

I see that you are throwing away all other -l* options.  This deserves
a comment.  You probably also want to barf if you find options which
are not -L or -l.

Ian.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl
  2012-02-22 16:40 ` [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl Roger Pau Monne
  2012-03-02 20:55   ` Julian Pidancet
@ 2012-03-12 11:00   ` Ian Jackson
  2012-04-04 11:14     ` Roger Pau Monné
  1 sibling, 1 reply; 23+ messages in thread
From: Ian Jackson @ 2012-03-12 11:00 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel

Roger Pau Monne writes ("[PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl"):
> autoconf: check for as86, ld86, bcc and iasl
> 
> Check for this tools, and set the proper paths on config/Tool.mk.

This looks plausible.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1 of 3] imported patch add_ncurses_autoconf
  2012-03-12 10:52   ` Ian Jackson
@ 2012-03-12 11:37     ` Roger Pau Monné
  0 siblings, 0 replies; 23+ messages in thread
From: Roger Pau Monné @ 2012-03-12 11:37 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian Campbell, xen-devel

2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> Roger Pau Monne writes ("[PATCH 1 of 3] imported patch add_ncurses_autoconf"):
>> imported patch add_ncurses_autoconf
>
> Did you forget to add curses.m4 ?

Yes, forget about this patch, it is completely wrong.

> Ian.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-02-22 23:30     ` [PATCH v2] autoconf: check for Python.h header and -lpython* lib Roger Pau Monne
@ 2012-03-12 12:16       ` Ian Jackson
  2012-03-12 13:35         ` Roger Pau Monné
  2012-03-14 14:08       ` Ian Jackson
  1 sibling, 1 reply; 23+ messages in thread
From: Ian Jackson @ 2012-03-12 12:16 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and -lpython* lib"):
> autoconf: check for Python.h header and -lpython* lib

Right, this is better.

> +ac_previous_cppflags=$CPPFLAGS
...
> +AC_CHECK_HEADER([Python.h], [],
> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
> +CPPFLAGS=$ac_previous_cppflags
> +LDLFAGS=$ac_previous_ldflags

But AFAICT we go to all this effort to find the right python flags and
then we throw them away.  This is a bit odd.  Shouldn't we be passing
this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?

Ian.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-12 12:16       ` Ian Jackson
@ 2012-03-12 13:35         ` Roger Pau Monné
  2012-03-12 16:33           ` Ian Jackson
  2012-03-20 13:06           ` Jan Beulich
  0 siblings, 2 replies; 23+ messages in thread
From: Roger Pau Monné @ 2012-03-12 13:35 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and -lpython* lib"):
>> autoconf: check for Python.h header and -lpython* lib
>
> Right, this is better.
>
>> +ac_previous_cppflags=$CPPFLAGS
> ...
>> +AC_CHECK_HEADER([Python.h], [],
>> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
>> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
>> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
>> +CPPFLAGS=$ac_previous_cppflags
>> +LDLFAGS=$ac_previous_ldflags
>
> But AFAICT we go to all this effort to find the right python flags and
> then we throw them away.  This is a bit odd.  Shouldn't we be passing
> this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?

This would only be needed to compile Python C modules, but since
python uses it's own standart build script (tools/python/setup.py) and
we already pass to the setup.py script the desired python version to
use, it already fetches the necessary includes/libs using it's own
mechanisms.

> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-12 13:35         ` Roger Pau Monné
@ 2012-03-12 16:33           ` Ian Jackson
  2012-03-20 13:06           ` Jan Beulich
  1 sibling, 0 replies; 23+ messages in thread
From: Ian Jackson @ 2012-03-12 16:33 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib"):
> 2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> > But AFAICT we go to all this effort to find the right python flags and
> > then we throw them away.  This is a bit odd.  Shouldn't we be passing
> > this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?
> 
> This would only be needed to compile Python C modules, but since
> python uses it's own standart build script (tools/python/setup.py) and
> we already pass to the setup.py script the desired python version to
> use, it already fetches the necessary includes/libs using it's own
> mechanisms.

Ah, right.  Well, good then, thanks.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-02-22 23:30     ` [PATCH v2] autoconf: check for Python.h header and -lpython* lib Roger Pau Monne
  2012-03-12 12:16       ` Ian Jackson
@ 2012-03-14 14:08       ` Ian Jackson
  1 sibling, 0 replies; 23+ messages in thread
From: Ian Jackson @ 2012-03-14 14:08 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[Xen-devel] [PATCH v2] autoconf: check for Python.h header and -lpython* lib"):
> autoconf: check for Python.h header and -lpython* lib

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-12 13:35         ` Roger Pau Monné
  2012-03-12 16:33           ` Ian Jackson
@ 2012-03-20 13:06           ` Jan Beulich
  2012-03-20 13:40             ` Jan Beulich
  1 sibling, 1 reply; 23+ messages in thread
From: Jan Beulich @ 2012-03-20 13:06 UTC (permalink / raw)
  To: Roger Pau Monné, Ian Jackson; +Cc: xen-devel

>>> On 12.03.12 at 14:35, Roger Pau Monné<roger.pau@entel.upc.edu> wrote:
> 2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
>> Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and 
> -lpython* lib"):
>>> autoconf: check for Python.h header and -lpython* lib
>>
>> Right, this is better.
>>
>>> +ac_previous_cppflags=$CPPFLAGS
>> ...
>>> +AC_CHECK_HEADER([Python.h], [],
>>> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
>>> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
>>> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
>>> +CPPFLAGS=$ac_previous_cppflags
>>> +LDLFAGS=$ac_previous_ldflags
>>
>> But AFAICT we go to all this effort to find the right python flags and
>> then we throw them away.  This is a bit odd.  Shouldn't we be passing
>> this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?
> 
> This would only be needed to compile Python C modules, but since
> python uses it's own standart build script (tools/python/setup.py) and
> we already pass to the setup.py script the desired python version to
> use, it already fetches the necessary includes/libs using it's own
> mechanisms.

I'm sorry to say that, but this change is pretty incompatible: Not only
does Python not provide any python-config prior to 2.5.x, but
additionally was Ian's point above very valid: Stripping all the other
-l options causes a configure failure for me:

configure:6176: checking for PyArg_ParseTuple in -lpython2.4
configure:6201: gcc -o conftest  -g -O2   -g -O2  -I/usr/include/python2.4 -I/usr/include/python2.4 
-L/usr/lib/python2.4/config conftest.c -lpython2.4   >&5
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_tmpnam':
(.text+0x81e): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_tempnam':
(.text+0x90c): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `complex_abs':
(.text+0x54d): undefined reference to `hypot'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x2418): undefined reference to `hypot'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x242a): undefined reference to `pow'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x243f): undefined reference to `atan2'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x2470): undefined reference to `cos'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x2483): undefined reference to `sin'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x24f6): undefined reference to `exp'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function `_Py_c_pow':
(.text+0x2507): undefined reference to `log'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function `float_rem':
(.text+0x17c8): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function `float_divmod':
(.text+0x25a8): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function `float_pow':
(.text+0x296f): undefined reference to `pow'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function `float_pow':
(.text+0x2a03): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
(.text+0x12e): undefined reference to `dlsym'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
(.text+0x195): undefined reference to `dlopen'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
(.text+0x1c3): undefined reference to `dlsym'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
(.text+0x232): undefined reference to `dlerror'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_release_lock':
(.text+0x49): undefined reference to `sem_post'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_acquire_lock':
(.text+0xc7): undefined reference to `sem_wait'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_acquire_lock':
(.text+0xe2): undefined reference to `sem_trywait'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_free_lock':
(.text+0x1f2): undefined reference to `sem_destroy'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_allocate_lock':
(.text+0x267): undefined reference to `sem_init'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_start_new_thread':
(.text+0x568): undefined reference to `pthread_create'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function `PyThread_start_new_thread':
(.text+0x586): undefined reference to `pthread_detach'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_forkpty':
(.text+0x3189): undefined reference to `forkpty'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function `posix_openpty':
(.text+0x3218): undefined reference to `openpty'
collect2: ld returned 1 exit status

As you can see, all unresolved symbols revolve around symbols from
those other libraries - the symbol looked for (PyArg_ParseTuple) is not
among them.

As this is the second time (out of two tries) that the newly added
configure logic causes problems for me (and hence eats time intended
to be spent elsewhere), I really have to question to quality of all of
this. Am I to expect that going forward I will have to plan several
hours for taking a fresh snapshot, rather than just making my
(usually short) patch queue apply and build?

Jan

>> Ian.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org 
> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-20 13:06           ` Jan Beulich
@ 2012-03-20 13:40             ` Jan Beulich
  2012-03-20 17:02               ` Roger Pau Monné
  0 siblings, 1 reply; 23+ messages in thread
From: Jan Beulich @ 2012-03-20 13:40 UTC (permalink / raw)
  To: roger.pau, Ian Jackson; +Cc: xen-devel

>>> On 20.03.12 at 14:06, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 12.03.12 at 14:35, Roger Pau Monné<roger.pau@entel.upc.edu> wrote:
>> 2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
>>> Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and 
>> -lpython* lib"):
>>>> autoconf: check for Python.h header and -lpython* lib
>>>
>>> Right, this is better.
>>>
>>>> +ac_previous_cppflags=$CPPFLAGS
>>> ...
>>>> +AC_CHECK_HEADER([Python.h], [],
>>>> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
>>>> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
>>>> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
>>>> +CPPFLAGS=$ac_previous_cppflags
>>>> +LDLFAGS=$ac_previous_ldflags
>>>
>>> But AFAICT we go to all this effort to find the right python flags and
>>> then we throw them away.  This is a bit odd.  Shouldn't we be passing
>>> this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?
>> 
>> This would only be needed to compile Python C modules, but since
>> python uses it's own standart build script (tools/python/setup.py) and
>> we already pass to the setup.py script the desired python version to
>> use, it already fetches the necessary includes/libs using it's own
>> mechanisms.
> 
> I'm sorry to say that, but this change is pretty incompatible: Not only
> does Python not provide any python-config prior to 2.5.x, but
> additionally was Ian's point above very valid: Stripping all the other
> -l options causes a configure failure for me:
> 
> configure:6176: checking for PyArg_ParseTuple in -lpython2.4
> configure:6201: gcc -o conftest  -g -O2   -g -O2  -I/usr/include/python2.4 
> -I/usr/include/python2.4 
> -L/usr/lib/python2.4/config conftest.c -lpython2.4   >&5
> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
> `posix_tmpnam':
> (.text+0x81e): warning: the use of `tmpnam_r' is dangerous, better use 
> `mkstemp'
> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
> `posix_tempnam':
> (.text+0x90c): warning: the use of `tempnam' is dangerous, better use 
> `mkstemp'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `complex_abs':
> (.text+0x54d): undefined reference to `hypot'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x2418): undefined reference to `hypot'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x242a): undefined reference to `pow'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x243f): undefined reference to `atan2'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x2470): undefined reference to `cos'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x2483): undefined reference to `sin'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x24f6): undefined reference to `exp'
> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
> `_Py_c_pow':
> (.text+0x2507): undefined reference to `log'
> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
> `float_rem':
> (.text+0x17c8): undefined reference to `fmod'
> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
> `float_divmod':
> (.text+0x25a8): undefined reference to `fmod'
> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
> `float_pow':
> (.text+0x296f): undefined reference to `pow'
> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
> `float_pow':
> (.text+0x2a03): undefined reference to `fmod'
> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
> `_PyImport_GetDynLoadFunc':
> (.text+0x12e): undefined reference to `dlsym'
> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
> `_PyImport_GetDynLoadFunc':
> (.text+0x195): undefined reference to `dlopen'
> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
> `_PyImport_GetDynLoadFunc':
> (.text+0x1c3): undefined reference to `dlsym'
> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
> `_PyImport_GetDynLoadFunc':
> (.text+0x232): undefined reference to `dlerror'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_release_lock':
> (.text+0x49): undefined reference to `sem_post'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_acquire_lock':
> (.text+0xc7): undefined reference to `sem_wait'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_acquire_lock':
> (.text+0xe2): undefined reference to `sem_trywait'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_free_lock':
> (.text+0x1f2): undefined reference to `sem_destroy'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_allocate_lock':
> (.text+0x267): undefined reference to `sem_init'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_start_new_thread':
> (.text+0x568): undefined reference to `pthread_create'
> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
> `PyThread_start_new_thread':
> (.text+0x586): undefined reference to `pthread_detach'
> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
> `posix_forkpty':
> (.text+0x3189): undefined reference to `forkpty'
> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
> `posix_openpty':
> (.text+0x3218): undefined reference to `openpty'
> collect2: ld returned 1 exit status
> 
> As you can see, all unresolved symbols revolve around symbols from
> those other libraries - the symbol looked for (PyArg_ParseTuple) is not
> among them.

A sketched out partial fix for this might be

--- a/tools/m4/python_devel.m4
+++ b/tools/m4/python_devel.m4
@@ -2,17 +2,18 @@ AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
 ac_previous_cppflags=$CPPFLAGS
 CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
 ac_previous_ldflags=$LDFLAGS
+python_other_libs=
 for flag in `$PYTHON-config --ldflags`
 do
     case $flag in
     -L*)
-        LDFLAGS="$LDLFAGS $flag"
+        LDFLAGS="$LDFLAGS $flag"
         ;;
     -lpython*)
         python_lib=`echo $flag | sed 's/^-l//'`
         ;;
     -l*)
-        # Ignore other libraries, we are only interested in testing python-dev
+        python_other_libs="$python_other_libs $flag"
         ;;
     *)
         AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: $flag])
@@ -22,7 +23,8 @@ done
 AC_CHECK_HEADER([Python.h], [],
     [AC_MSG_ERROR([Unable to find Python development headers])],)
 AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
-    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+    [AC_MSG_ERROR([Unable to find a suitable python development library])],
+    [$python_other_libs])
 CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 ])

I didn't really re-generate tools/configure though (not sure what
autoconf version would be required, and surely this wouldn't match
the ones I have around), so can't claim this is syntactically correct.
For my purposes I instead patched tools/configure manually.

Partial because it doesn't address the lack of python-config on pre-2.5
Python (we require >= 2.3).

I also wonder whether the -lpython* case shouldn't be cumulative in
case there's more than one matching option.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-20 13:40             ` Jan Beulich
@ 2012-03-20 17:02               ` Roger Pau Monné
  2012-03-20 17:10                 ` Jan Beulich
  0 siblings, 1 reply; 23+ messages in thread
From: Roger Pau Monné @ 2012-03-20 17:02 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Ian Jackson, xen-devel

2012/3/20 Jan Beulich <JBeulich@suse.com>:
>>>> On 20.03.12 at 14:06, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>>> On 12.03.12 at 14:35, Roger Pau Monné<roger.pau@entel.upc.edu> wrote:
>>> 2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
>>>> Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and
>>> -lpython* lib"):
>>>>> autoconf: check for Python.h header and -lpython* lib
>>>>
>>>> Right, this is better.
>>>>
>>>>> +ac_previous_cppflags=$CPPFLAGS
>>>> ...
>>>>> +AC_CHECK_HEADER([Python.h], [],
>>>>> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
>>>>> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
>>>>> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
>>>>> +CPPFLAGS=$ac_previous_cppflags
>>>>> +LDLFAGS=$ac_previous_ldflags
>>>>
>>>> But AFAICT we go to all this effort to find the right python flags and
>>>> then we throw them away.  This is a bit odd.  Shouldn't we be passing
>>>> this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?
>>>
>>> This would only be needed to compile Python C modules, but since
>>> python uses it's own standart build script (tools/python/setup.py) and
>>> we already pass to the setup.py script the desired python version to
>>> use, it already fetches the necessary includes/libs using it's own
>>> mechanisms.
>>
>> I'm sorry to say that, but this change is pretty incompatible: Not only
>> does Python not provide any python-config prior to 2.5.x, but
>> additionally was Ian's point above very valid: Stripping all the other
>> -l options causes a configure failure for me:
>>
>> configure:6176: checking for PyArg_ParseTuple in -lpython2.4
>> configure:6201: gcc -o conftest  -g -O2   -g -O2  -I/usr/include/python2.4
>> -I/usr/include/python2.4
>> -L/usr/lib/python2.4/config conftest.c -lpython2.4   >&5
>> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
>> `posix_tmpnam':
>> (.text+0x81e): warning: the use of `tmpnam_r' is dangerous, better use
>> `mkstemp'
>> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
>> `posix_tempnam':
>> (.text+0x90c): warning: the use of `tempnam' is dangerous, better use
>> `mkstemp'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `complex_abs':
>> (.text+0x54d): undefined reference to `hypot'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x2418): undefined reference to `hypot'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x242a): undefined reference to `pow'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x243f): undefined reference to `atan2'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x2470): undefined reference to `cos'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x2483): undefined reference to `sin'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x24f6): undefined reference to `exp'
>> /usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function
>> `_Py_c_pow':
>> (.text+0x2507): undefined reference to `log'
>> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function
>> `float_rem':
>> (.text+0x17c8): undefined reference to `fmod'
>> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function
>> `float_divmod':
>> (.text+0x25a8): undefined reference to `fmod'
>> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function
>> `float_pow':
>> (.text+0x296f): undefined reference to `pow'
>> /usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function
>> `float_pow':
>> (.text+0x2a03): undefined reference to `fmod'
>> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function
>> `_PyImport_GetDynLoadFunc':
>> (.text+0x12e): undefined reference to `dlsym'
>> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function
>> `_PyImport_GetDynLoadFunc':
>> (.text+0x195): undefined reference to `dlopen'
>> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function
>> `_PyImport_GetDynLoadFunc':
>> (.text+0x1c3): undefined reference to `dlsym'
>> /usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function
>> `_PyImport_GetDynLoadFunc':
>> (.text+0x232): undefined reference to `dlerror'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_release_lock':
>> (.text+0x49): undefined reference to `sem_post'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_acquire_lock':
>> (.text+0xc7): undefined reference to `sem_wait'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_acquire_lock':
>> (.text+0xe2): undefined reference to `sem_trywait'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_free_lock':
>> (.text+0x1f2): undefined reference to `sem_destroy'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_allocate_lock':
>> (.text+0x267): undefined reference to `sem_init'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_start_new_thread':
>> (.text+0x568): undefined reference to `pthread_create'
>> /usr/lib/python2.4/config/libpython2.4.a(thread.o): In function
>> `PyThread_start_new_thread':
>> (.text+0x586): undefined reference to `pthread_detach'
>> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
>> `posix_forkpty':
>> (.text+0x3189): undefined reference to `forkpty'
>> /usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
>> `posix_openpty':
>> (.text+0x3218): undefined reference to `openpty'
>> collect2: ld returned 1 exit status
>>
>> As you can see, all unresolved symbols revolve around symbols from
>> those other libraries - the symbol looked for (PyArg_ParseTuple) is not
>> among them.
>
> A sketched out partial fix for this might be

I've already posted something arround this lines a few days ago:

http://lists.xen.org/archives/html/xen-devel/2012-03/msg01350.html

What I didn't know was that python-config was only available starting
from 2.5, which is a real pain in the ass, I will probably have to
drop the python-config stuff and move to distutils to perform this
checks. Sorry for the trouble this is causing you (Jan), it's
impossible for me to test on all systems/python versions that are
*supported*, and I tend to run this on pretty new systems.

>
> --- a/tools/m4/python_devel.m4
> +++ b/tools/m4/python_devel.m4
> @@ -2,17 +2,18 @@ AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
>  ac_previous_cppflags=$CPPFLAGS
>  CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
>  ac_previous_ldflags=$LDFLAGS
> +python_other_libs=
>  for flag in `$PYTHON-config --ldflags`
>  do
>     case $flag in
>     -L*)
> -        LDFLAGS="$LDLFAGS $flag"
> +        LDFLAGS="$LDFLAGS $flag"
>         ;;
>     -lpython*)
>         python_lib=`echo $flag | sed 's/^-l//'`
>         ;;
>     -l*)
> -        # Ignore other libraries, we are only interested in testing python-dev
> +        python_other_libs="$python_other_libs $flag"
>         ;;
>     *)
>         AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: $flag])
> @@ -22,7 +23,8 @@ done
>  AC_CHECK_HEADER([Python.h], [],
>     [AC_MSG_ERROR([Unable to find Python development headers])],)
>  AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
> -    [AC_MSG_ERROR([Unable to find a suitable python development library])])
> +    [AC_MSG_ERROR([Unable to find a suitable python development library])],
> +    [$python_other_libs])
>  CPPFLAGS=$ac_previous_cppflags
>  LDLFAGS=$ac_previous_ldflags
>  ])
>
> I didn't really re-generate tools/configure though (not sure what
> autoconf version would be required, and surely this wouldn't match
> the ones I have around), so can't claim this is syntactically correct.
> For my purposes I instead patched tools/configure manually.
>
> Partial because it doesn't address the lack of python-config on pre-2.5
> Python (we require >= 2.3).
>
> I also wonder whether the -lpython* case shouldn't be cumulative in
> case there's more than one matching option.

I don't think python-config will output more than one -lpython*, I
have systems with more than one python version, and I have
python(version)-config for each one of them, but plain python-config
just outputs a single version to link to.

> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-20 17:02               ` Roger Pau Monné
@ 2012-03-20 17:10                 ` Jan Beulich
  2012-03-21 11:08                   ` Ian Jackson
  0 siblings, 1 reply; 23+ messages in thread
From: Jan Beulich @ 2012-03-20 17:10 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: Ian Jackson, xen-devel

>>> On 20.03.12 at 18:02, Roger Pau Monné<roger.pau@entel.upc.edu> wrote:
> 2012/3/20 Jan Beulich <JBeulich@suse.com>:
>> I also wonder whether the -lpython* case shouldn't be cumulative in
>> case there's more than one matching option.
> 
> I don't think python-config will output more than one -lpython*, I
> have systems with more than one python version, and I have
> python(version)-config for each one of them, but plain python-config
> just outputs a single version to link to.

That is what you observe currently. But my point is that the purpose
of python-config is to abstract away e.g. a future library split.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] autoconf: check for Python.h header and -lpython* lib
  2012-03-20 17:10                 ` Jan Beulich
@ 2012-03-21 11:08                   ` Ian Jackson
  0 siblings, 0 replies; 23+ messages in thread
From: Ian Jackson @ 2012-03-21 11:08 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

Jan Beulich writes ("Re: [Xen-devel] [PATCH v2] autoconf: check for Python.h header and -lpython* lib"):
> That is what you observe currently. But my point is that the purpose
> of python-config is to abstract away e.g. a future library split.

There is not going to be any future library split because Python 2.7
is going to be the last 2.x.

If and when we support Python 3 we'll have an entirely separate pile
of machinery for it.

Ian.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl
  2012-03-12 11:00   ` Ian Jackson
@ 2012-04-04 11:14     ` Roger Pau Monné
  2012-04-04 15:15       ` Ian Jackson
  0 siblings, 1 reply; 23+ messages in thread
From: Roger Pau Monné @ 2012-04-04 11:14 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian Campbell, xen-devel

2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> Roger Pau Monne writes ("[PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl"):
>> autoconf: check for as86, ld86, bcc and iasl
>>
>> Check for this tools, and set the proper paths on config/Tool.mk.
>
> This looks plausible.
>
> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

Could this be applied before the 4.2 freeze?

Thanks, Roger.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl
  2012-04-04 11:14     ` Roger Pau Monné
@ 2012-04-04 15:15       ` Ian Jackson
  0 siblings, 0 replies; 23+ messages in thread
From: Ian Jackson @ 2012-04-04 15:15 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: Ian Campbell, xen-devel

Roger Pau Monné writes ("Re: [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl"):
> 2012/3/12 Ian Jackson <Ian.Jackson@eu.citrix.com>:
> > Roger Pau Monne writes ("[PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl"):
> >> autoconf: check for as86, ld86, bcc and iasl
> >>
> >> Check for this tools, and set the proper paths on config/Tool.mk.
> >
> > This looks plausible.
> >
> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> Could this be applied before the 4.2 freeze?

Yes, I have applied it now.  I had acked it, but at that time it
seemed that you were going to repost the series because of other
things in it, and I didn't apply it on its own.  But in fact it looks
fine by itself.

Ian.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-04-04 15:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22 16:40 [PATCH 0 of 3] Another round of fixes for autoconf Roger Pau Monne
2012-02-22 16:40 ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monne
2012-02-22 16:46   ` [PATCH] autoconf: add check for curses library Roger Pau Monne
2012-03-02 12:21   ` [PATCH 1 of 3] imported patch add_ncurses_autoconf Roger Pau Monné
2012-03-12 10:52   ` Ian Jackson
2012-03-12 11:37     ` Roger Pau Monné
2012-02-22 16:40 ` [PATCH 2 of 3] autoconf: check for as86, ld86, bcc and iasl Roger Pau Monne
2012-03-02 20:55   ` Julian Pidancet
2012-03-12 11:00   ` Ian Jackson
2012-04-04 11:14     ` Roger Pau Monné
2012-04-04 15:15       ` Ian Jackson
2012-02-22 16:40 ` [PATCH 3 of 3] autoconf: check for Python.h header and -lpython lib Roger Pau Monne
2012-03-12 10:56   ` Ian Jackson
2012-02-22 23:30     ` [PATCH v2] autoconf: check for Python.h header and -lpython* lib Roger Pau Monne
2012-03-12 12:16       ` Ian Jackson
2012-03-12 13:35         ` Roger Pau Monné
2012-03-12 16:33           ` Ian Jackson
2012-03-20 13:06           ` Jan Beulich
2012-03-20 13:40             ` Jan Beulich
2012-03-20 17:02               ` Roger Pau Monné
2012-03-20 17:10                 ` Jan Beulich
2012-03-21 11:08                   ` Ian Jackson
2012-03-14 14:08       ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.