[libtool] autogen時AM_PATH_GLIB_2_0錯誤的處理

錯誤提示: macro 'AM_PATH_GLIB_2_0' not found in library


說明對應的定義沒有找到,


而對應包已安裝

#rpm -qa|grep glib2
glib2-devel-2.22.5-6.1.el6.x86_64
glib2-2.22.5-6.1.el6.x86_64


說明定義文件.m4沒包含在autoconf的路徑中,查看autogen:

#cat autogen
#! /bin/sh


# cd to the directory we're run from
cd `dirname $0`


# if you change this, please also change it in the root Makefile.am
includes="-I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive"


# clean up
rm -f aclocal.m4
rm -rf autom4te*.cache
rm -f configure


die() {
    echo x"${@}" | sed 's/^x//'
    exit 1
}


echo "See DEVELOPING for instructions on updating:"
echo " * gettext macros"
echo " * gnulib"
echo " * libtool files"


echo "..creating file lists"
(   cd config
    for m4dir in amanda gettext-macros gnulib macro-archive; do
        echo "## this file is automatically generated by autogen" > "$m4dir/file-list"
        for f in $m4dir/*.m4; do echo "EXTRA_DIST += $f" >> "$m4dir/file-list"; done
    done


    echo "## this file is automatically generated by autogen" > "automake/file-list"
    for f in automake/*.am; do echo "EXTRA_DIST += $f" >> "automake/file-list"; done
)


echo "..aclocal"
aclocal $includes || die "aclocal failed"


echo "...aclocal patches"
# See http://bugzilla.gnome.org/show_bug.cgi?id=418778
#
# The Glib developers are a bit over-eager in their version requirements, requiring
# an unnecessarily high verison of pkg-config at configure time, when they really
# only need it at autogen time.  This patch resets the version number in the file
# just generated by aclocal to the version we've been requiring all along.
sed --in-place -e  \
     's/PKG_PROG_PKG_CONFIG(\[0\.16\])/PKG_PROG_PKG_CONFIG([0.7])/g' \
     aclocal.m4


echo "..autoconf"
autoconf || die "autoconf failed"


echo "..autoheader"
autoheader || die "autoheader failed"
touch config/config.h.in


echo "..automake"
automake --force --copy --warnings=none || die "automake failed"


解決方法,找到.m4文件,加入環境變量

#rpm -ql glib2-devel |grep m4
/usr/share/aclocal/glib-2.0.m4
/usr/share/aclocal/glib-gettext.m4


export ACLOCAL_PATH=/usr/share/aclocal

重編譯。


[root@dev /root/rpmbuild/BUILD/amanda-2.6.1p2]
#./autogen
See DEVELOPING for instructions on updating:
 * gettext macros
 * gnulib
 * libtool files
..creating file lists
..aclocal
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
config/amanda/libs.m4:120: warning: macro 'AM_PATH_GLIB_2_0' not found in library
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1998: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2019: AC_CACHE_CHECK is expanded from...
config/libtool.m4:640: AC_LIBTOOL_LINKER_OPTION is expanded from...
config/libtool.m4:2559: _LT_AC_LANG_C_CONFIG is expanded from...
config/libtool.m4:2558: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
config/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from...
config/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from...
config/libtool.m4:25: AC_PROG_LIBTOOL is expanded from...
config/libtool.m4:6132: AM_PROG_LIBTOOL is expanded from...
configure.in:183: the top level
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:595: AC_LIBTOOL_COMPILER_OPTION is expanded from...
config/libtool.m4:4695: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:2671: _LT_AC_LANG_CXX_CONFIG is expanded from...
config/libtool.m4:2670: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
config/libtool.m4:1709: _LT_AC_TAGCONFIG is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:3785: _LT_AC_LANG_F77_CONFIG is expanded from...
config/libtool.m4:3784: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:3891: _LT_AC_LANG_GCJ_CONFIG is expanded from...
config/libtool.m4:3890: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
...aclocal patches
..autoconf
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1998: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2019: AC_CACHE_CHECK is expanded from...
config/libtool.m4:640: AC_LIBTOOL_LINKER_OPTION is expanded from...
config/libtool.m4:2559: _LT_AC_LANG_C_CONFIG is expanded from...
config/libtool.m4:2558: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
config/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from...
config/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from...
config/libtool.m4:25: AC_PROG_LIBTOOL is expanded from...
config/libtool.m4:6132: AM_PROG_LIBTOOL is expanded from...
configure.in:183: the top level
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:595: AC_LIBTOOL_COMPILER_OPTION is expanded from...
config/libtool.m4:4695: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:2671: _LT_AC_LANG_CXX_CONFIG is expanded from...
config/libtool.m4:2670: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
config/libtool.m4:1709: _LT_AC_TAGCONFIG is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:3785: _LT_AC_LANG_F77_CONFIG is expanded from...
config/libtool.m4:3784: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
configure.in:183: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached
config/libtool.m4:3891: _LT_AC_LANG_GCJ_CONFIG is expanded from...
config/libtool.m4:3890: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
configure:39615: error: possibly undefined macro: AM_PATH_GLIB_2_0
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:39616: error: possibly undefined macro: AC_MSG_ERROR
autoconf failed


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章