Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From: Helmut Grohne <helmut@subdivi.de> |
| 2 | Subject: fix cross compilation |
| 3 | |
| 4 | The OH_SET_SIZES macro relies on the usual autoconf sizeof cache variables |
| 5 | during cross compilation, but it never ensure that they are initialized. |
| 6 | |
| 7 | pkg-config must be called with $ac_tool_prefix and PKG_PROG_PKG_CONFIG takes |
| 8 | care of that. Setting PKG_CONFIG_PATH breaks the pkg-config-cross-wrapper. |
| 9 | Don't do that. |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | |
| 14 | Index: openhpi-3.8.0/acinclude.m4 |
| 15 | =================================================================== |
| 16 | --- openhpi-3.8.0.orig/acinclude.m4 |
| 17 | +++ openhpi-3.8.0/acinclude.m4 |
| 18 | @@ -22,30 +22,39 @@ AC_DEFUN([OH_SET_SIZES], |
| 19 | |
| 20 | if test "x$cross_compiling" != "xno"; then |
| 21 | if test "x$OH_SIZEOF_UCHAR" = x; then |
| 22 | + AC_CHECK_SIZEOF([unsigned char]) |
| 23 | OH_SIZEOF_UCHAR=$ac_cv_sizeof_uchar |
| 24 | fi |
| 25 | if test "x$OH_SIZEOF_USHORT" = x; then |
| 26 | + AC_CHECK_SIZEOF([unsigned short]) |
| 27 | OH_SIZEOF_USHORT=$ac_cv_sizeof_ushort |
| 28 | fi |
| 29 | if test "x$OH_SIZEOF_UINT" = x; then |
| 30 | + AC_CHECK_SIZEOF([unsigned int]) |
| 31 | OH_SIZEOF_UINT=$ac_cv_sizeof_uint |
| 32 | fi |
| 33 | if test "x$OH_SIZEOF_CHAR" = x; then |
| 34 | + AC_CHECK_SIZEOF([char]) |
| 35 | OH_SIZEOF_CHAR=$ac_cv_sizeof_char |
| 36 | fi |
| 37 | if test "x$OH_SIZEOF_SHORT" = x; then |
| 38 | + AC_CHECK_SIZEOF([short]) |
| 39 | OH_SIZEOF_SHORT=$ac_cv_sizeof_short |
| 40 | fi |
| 41 | if test "x$OH_SIZEOF_INT" = x; then |
| 42 | + AC_CHECK_SIZEOF([int]) |
| 43 | OH_SIZEOF_INT=$ac_cv_sizeof_int |
| 44 | fi |
| 45 | if test "x$OH_SIZEOF_LLONG" = x; then |
| 46 | + AC_CHECK_SIZEOF([long long]) |
| 47 | OH_SIZEOF_LLONG=$ac_cv_sizeof_longlong |
| 48 | fi |
| 49 | if test "x$OH_SIZEOF_FLOAT" = x; then |
| 50 | + AC_CHECK_SIZEOF([float]) |
| 51 | OH_SIZEOF_FLOAT=$ac_cv_sizeof_float |
| 52 | fi |
| 53 | if test "x$OH_SIZEOF_DOUBLE" = x; then |
| 54 | + AC_CHECK_SIZEOF([double]) |
| 55 | OH_SIZEOF_DOUBLE=$ac_cv_sizeof_double |
| 56 | fi |
| 57 | else |
| 58 | Index: openhpi-3.8.0/configure.ac |
| 59 | =================================================================== |
| 60 | --- openhpi-3.8.0.orig/configure.ac |
| 61 | +++ openhpi-3.8.0/configure.ac |
| 62 | @@ -87,9 +87,9 @@ have_rtas_lib=no |
| 63 | |
| 64 | dnl Check for GLIB |
| 65 | |
| 66 | -AC_CHECK_PROG([found_pkg_config],[pkg-config],[yes]) |
| 67 | +PKG_PROG_PKG_CONFIG |
| 68 | |
| 69 | -if test "x$found_pkg_config" != "xyes"; then |
| 70 | +if test "x$PKG_CONFIG" = "x"; then |
| 71 | OH_CHECK_FAIL(pkg-config,pkg-config) |
| 72 | fi |
| 73 | PKG_CFG_SETPATH |
| 74 | @@ -105,7 +105,7 @@ GLIB=glib-2.0 |
| 75 | GTHREAD=gthread-2.0 |
| 76 | GMODULE=gmodule-2.0 |
| 77 | |
| 78 | -if pkg-config --atleast-version $GLIB_REQUIRED_VERSION $GLIB; then |
| 79 | +if $PKG_CONFIG --atleast-version $GLIB_REQUIRED_VERSION $GLIB; then |
| 80 | : |
| 81 | else |
| 82 | AC_MSG_ERROR([ |
| 83 | @@ -268,12 +268,12 @@ dnl |
| 84 | dnl We really need to make ipmi enablement be contigent on OpenIPMI |
| 85 | dnl |
| 86 | |
| 87 | -if PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --atleast-version 1.4.20 OpenIPMI; then |
| 88 | +if $PKG_CONFIG --atleast-version 1.4.20 OpenIPMI; then |
| 89 | have_openipmi=yes |
| 90 | AC_CHECK_LIB([OpenIPMI], [ipmi_smi_setup_con], [have_openipmi=yes]) |
| 91 | - OPENIPMI_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --cflags OpenIPMI` |
| 92 | + OPENIPMI_CFLAGS=`$PKG_CONFIG --cflags OpenIPMI` |
| 93 | AC_SUBST(OPENIPMI_CFLAGS) |
| 94 | - OPENIPMI_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig pkg-config --libs OpenIPMI` |
| 95 | + OPENIPMI_LIBS=`$PKG_CONFIG --libs OpenIPMI` |
| 96 | AC_SUBST(OPENIPMI_LIBS) |
| 97 | fi |
| 98 | |