From: Kern Sibbald Date: Thu, 4 Aug 2005 09:02:42 +0000 (+0000) Subject: - Apply patch in bug#397 that improved configure X-Git-Tag: Release-1.38.0~212 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=33de3238000703abe88febe4e60399c63528028c;p=bacula%2Fbacula - Apply patch in bug#397 that improved configure - find readline under /include/readline - no libutil under Solaris - no need for -ldl under Solaris git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2292 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 03cea57ecb..09812a3f42 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -333,6 +333,9 @@ /* Define to 1 if you have the `sun' library (-lsun). */ #undef HAVE_LIBSUN +/* Define to 1 if you have the `util' library (-lutil). */ +#undef HAVE_LIBUTIL + /* Define to 1 if you have the `xnet' library (-lxnet). */ #undef HAVE_LIBXNET diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index b57ad99184..76b01a2294 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -476,15 +476,19 @@ if test x$support_readline = xyes; then case "$with_readline" in no) : ;; yes|*) - if test "$with_readline" != "yes"; then - CONS_INC="-I${with_readline}" - CONS_LDFLAGS="-L$with_readline" - else - with_readline="/usr/include/readline" - fi + if test -f ${with_readline}/readline.h; then + CONS_INC="-I${with_readline}" + CONS_LDFLAGS="-L$with_readline" + elif test -f ${with_readline}/include/readline/readline.h; then + CONS_INC="-I${with_readline}/include/readline" + CONS_LDFLAGS="-L${with_readline}/lib" + with_readline="${with_readline}/include/readline" + else + with_readline="/usr/include/readline" + fi AC_CHECK_HEADER(${with_readline}/readline.h, [ AC_DEFINE(HAVE_READLINE) - CONS_LIBS="-lreadline -ltermcap" + CONS_LIBS="-lreadline -lhistory -ltermcap" got_readline="yes" ], [ echo " " @@ -560,22 +564,22 @@ AC_ARG_WITH(python, for python_root in /usr /usr/local; do if test -f $python_root/include/python2.2/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.2 - PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2" break elif test -f $python_root/include/python2.3/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.3 - PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3" break elif test -f $python_root/include/python2.4/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.4 - PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4" break fi done if test x$PYTHON_INCDIR = x; then if test -f $prefix/include/Python.h; then PYTHON_INCDIR=-I$prefix/include - PYTHON_LIBS="-L$prefix/lib/config -lpython -lutil" + PYTHON_LIBS="-L$prefix/lib/config -lpython" else AC_MSG_RESULT(no) AC_MSG_ERROR(Unable to find Python.h in standard locations) @@ -584,10 +588,13 @@ AC_ARG_WITH(python, else if test -f $withval/Python.h; then PYTHON_INCDIR=-I$withval - PYTHON_LIBS="-L$withval/config -lpython -lutil" + PYTHON_LIBS="-L$withval/config -lpython" elif test -f $withval/include/Python.h; then PYTHON_INCDIR=-I$withval/include - PYTHON_LIBS="-L$withval/lib/config -lpython -lutil" + PYTHON_LIBS="-L$withval/lib/config -lpython" + elif test -f $withval/include/python/Python.h; then + PYTHON_INCDIR=-I$withval/include/python + PYTHON_LIBS="-L$withval/lib/python/config -lpython" else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval) @@ -596,7 +603,12 @@ AC_ARG_WITH(python, AC_DEFINE([HAVE_PYTHON], 1) AC_MSG_RESULT(yes) support_python=yes - + AC_MSG_NOTICE(checking for more Python libs) + saved_LIBS="$LIBS"; LIBS= + AC_SEARCH_LIBS(shm_open, [rt]) + AC_CHECK_LIB(util, openpty) + PYTHON_LIBS="$PYTHON_LIBS $LIBS" + LIBS="$saved_LIBS" else AC_MSG_RESULT(no) fi @@ -709,6 +721,13 @@ AC_SUBST(OPENSSL_LIBS) AC_SUBST(OPENSSL_INC) +# ----------------------------------------------------------- +# Python and OpenSSL are using dlopen +# ----------------------------------------------------------- + +if test "$support_python" = "yes" -o "$support_tls" = "yes"; then + AC_SEARCH_LIBS(dlopen, [dl]) +fi # ------------------------------------------ # Where to place working dir @@ -1558,7 +1577,6 @@ PFILES="platforms/Makefile" PSCMD="ps -e" WIN32= MACOSX= -PYTHON_LIBS_EXTRAS="-ldl" hostname=`uname -n | cut -d '.' -f 1` case "$DISTNAME" in aix) @@ -1632,7 +1650,6 @@ freebsd) platforms/freebsd/bacula-sd \ platforms/freebsd/bacula-dir" largefile_support="yes" - PYTHON_LIBS_EXTRAS= ;; hpux) PSCMD="UNIX95=1 ps -e -o pid,comm" @@ -1785,9 +1802,6 @@ esac AC_SUBST(hostname) LIBS="$PTHREAD_LIB $LIBS" -if test "x$PYTHON_LIBS" != x -a "x$PYTHON_LIBS_EXTRAS" != x; then - PYTHON_LIBS="$PYTHON_LIBS $PYTHON_LIBS_EXTRAS" -fi AC_DEFINE_UNQUOTED(lld, "$lld") AC_DEFINE_UNQUOTED(llu, "$llu") diff --git a/bacula/configure b/bacula/configure index 6cc5f15ccd..7e75afeb87 100755 --- a/bacula/configure +++ b/bacula/configure @@ -5981,12 +5981,16 @@ if test "${with_readline+set}" = set; then case "$with_readline" in no) : ;; yes|*) - if test "$with_readline" != "yes"; then - CONS_INC="-I${with_readline}" - CONS_LDFLAGS="-L$with_readline" - else - with_readline="/usr/include/readline" - fi + if test -f ${with_readline}/readline.h; then + CONS_INC="-I${with_readline}" + CONS_LDFLAGS="-L$with_readline" + elif test -f ${with_readline}/include/readline/readline.h; then + CONS_INC="-I${with_readline}/include/readline" + CONS_LDFLAGS="-L${with_readline}/lib" + with_readline="${with_readline}/include/readline" + else + with_readline="/usr/include/readline" + fi as_ac_Header=`echo "ac_cv_header_${with_readline}/readline.h" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for ${with_readline}/readline.h" >&5 @@ -6130,7 +6134,7 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then #define HAVE_READLINE 1 _ACEOF - CONS_LIBS="-lreadline -ltermcap" + CONS_LIBS="-lreadline -lhistory -ltermcap" got_readline="yes" else @@ -7248,22 +7252,22 @@ if test "${with_python+set}" = set; then for python_root in /usr /usr/local; do if test -f $python_root/include/python2.2/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.2 - PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2" break elif test -f $python_root/include/python2.3/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.3 - PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3" break elif test -f $python_root/include/python2.4/Python.h; then PYTHON_INCDIR=-I$python_root/include/python2.4 - PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4 -lutil" + PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4" break fi done if test x$PYTHON_INCDIR = x; then if test -f $prefix/include/Python.h; then PYTHON_INCDIR=-I$prefix/include - PYTHON_LIBS="-L$prefix/lib/config -lpython -lutil" + PYTHON_LIBS="-L$prefix/lib/config -lpython" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -7275,10 +7279,13 @@ echo "$as_me: error: Unable to find Python.h in standard locations" >&2;} else if test -f $withval/Python.h; then PYTHON_INCDIR=-I$withval - PYTHON_LIBS="-L$withval/config -lpython -lutil" + PYTHON_LIBS="-L$withval/config -lpython" elif test -f $withval/include/Python.h; then PYTHON_INCDIR=-I$withval/include - PYTHON_LIBS="-L$withval/lib/config -lpython -lutil" + PYTHON_LIBS="-L$withval/lib/config -lpython" + elif test -f $withval/include/python/Python.h; then + PYTHON_INCDIR=-I$withval/include/python + PYTHON_LIBS="-L$withval/lib/python/config -lpython" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -7294,7 +7301,211 @@ _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 support_python=yes + { echo "$as_me:$LINENO: checking for more Python libs" >&5 +echo "$as_me: checking for more Python libs" >&6;} + saved_LIBS="$LIBS"; LIBS= + echo "$as_me:$LINENO: checking for library containing shm_open" >&5 +echo $ECHO_N "checking for library containing shm_open... $ECHO_C" >&6 +if test "${ac_cv_search_shm_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_shm_open=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shm_open (); +int +main () +{ +shm_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_shm_open="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_shm_open" = no; then + for ac_lib in rt; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shm_open (); +int +main () +{ +shm_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_shm_open="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_shm_open" >&5 +echo "${ECHO_T}$ac_cv_search_shm_open" >&6 +if test "$ac_cv_search_shm_open" != no; then + test "$ac_cv_search_shm_open" = "none required" || LIBS="$ac_cv_search_shm_open $LIBS" + +fi + + +echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6 +if test "${ac_cv_lib_util_openpty+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lutil $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char openpty (); +int +main () +{ +openpty (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_util_openpty=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_util_openpty=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6 +if test $ac_cv_lib_util_openpty = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUTIL 1 +_ACEOF + + LIBS="-lutil $LIBS" + +fi + + PYTHON_LIBS="$PYTHON_LIBS $LIBS" + LIBS="$saved_LIBS" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -7874,6 +8085,138 @@ echo "${ECHO_T}$support_tls" >&6 +# ----------------------------------------------------------- +# Python and OpenSSL are using dlopen +# ----------------------------------------------------------- + +if test "$support_python" = "yes" -o "$support_tls" = "yes"; then + echo "$as_me:$LINENO: checking for library containing dlopen" >&5 +echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6 +if test "${ac_cv_search_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_dlopen=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_dlopen="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_dlopen" = no; then + for ac_lib in dl; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_dlopen="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5 +echo "${ECHO_T}$ac_cv_search_dlopen" >&6 +if test "$ac_cv_search_dlopen" != no; then + test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS" + +fi + +fi # ------------------------------------------ # Where to place working dir @@ -20942,7 +21285,6 @@ PFILES="platforms/Makefile" PSCMD="ps -e" WIN32= MACOSX= -PYTHON_LIBS_EXTRAS="-ldl" hostname=`uname -n | cut -d '.' -f 1` case "$DISTNAME" in aix) @@ -21016,7 +21358,6 @@ freebsd) platforms/freebsd/bacula-sd \ platforms/freebsd/bacula-dir" largefile_support="yes" - PYTHON_LIBS_EXTRAS= ;; hpux) PSCMD="UNIX95=1 ps -e -o pid,comm" @@ -21175,9 +21516,6 @@ esac LIBS="$PTHREAD_LIB $LIBS" -if test "x$PYTHON_LIBS" != x -a "x$PYTHON_LIBS_EXTRAS" != x; then - PYTHON_LIBS="$PYTHON_LIBS $PYTHON_LIBS_EXTRAS" -fi cat >>confdefs.h <<_ACEOF #define lld "$lld" diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index a047660cf3..470548f099 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -5,6 +5,10 @@ General: Changes to 1.37.34: 04Aug03 +- Apply patch in bug#397 that improved configure + - find readline under $with_readline/include/readline + - no libutil under Solaris + - no need for -ldl under Solaris - Make reservation system single threaded during the search to avoid two threads competing for the same resource.