summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2000-09-28 22:58:40 +0000
committerjbj <devnull@localhost>2000-09-28 22:58:40 +0000
commit88579dc7a79ab1e26fc38301683d0dc7ce29382a (patch)
treef705bcdc0068577bf26b109cc4f7fb68d73a16d9
parent4893fba6f059d6eae5a209b9883a452bd0cb3e22 (diff)
downloadlibrpm-tizen-88579dc7a79ab1e26fc38301683d0dc7ce29382a.tar.gz
librpm-tizen-88579dc7a79ab1e26fc38301683d0dc7ce29382a.tar.bz2
librpm-tizen-88579dc7a79ab1e26fc38301683d0dc7ce29382a.zip
- handle possible db3 dependency on -lpthread more gracefully.
CVS patchset: 4181 CVS date: 2000/09/28 22:58:40
-rw-r--r--CHANGES3
-rw-r--r--configure.in27
-rw-r--r--perl/Makefile.PL2
3 files changed, 26 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 1777249ec..72afefe71 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@
- collect and display rpm build error messages at end of build.
- don't trim leading ./ in rpmCleanPath() (#14961).
- order packages using tsort, clipping PreReq:'s in dependency loops.
+ - fix: avoid calling getpass twice as side effect of xstrdup macro
+ (katzj@linuxpower.org) (#17672).
+ - handle possible db3 dependency on -lpthread more gracefully.
3.0.6 -> 4.0
- use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db.
diff --git a/configure.in b/configure.in
index fee3f98ae..16ce916c8 100644
--- a/configure.in
+++ b/configure.in
@@ -299,17 +299,23 @@ dnl for this macro (not LIBS=...), otherwise the check for dbopen
dnl will fail.
AC_CHECK_LIB(port, writev)
+libpthread=""
+AC_CHECK_LIB(pthread, pthread_mutex_trylock,[libpthread="-lpthread"])
+
DBLIBOBJS=""
libdb3=""
libdb2=""
libdb1=""
-PTHREAD=""
dnl Check for Berkeley db3 API.
AC_CHECK_FUNC(db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"],
- AC_CHECK_LIB(db-3.1, db_create, [LIBS="$LIBS $PTHREAD"; DBLIBOBJS="$DBLIBOBJS db3.c" ; libdb3="-ldb-3.1"],
- AC_CHECK_LIB(db-3.0, db_create, [LIBS="$LIBS $PTHREAD"; DBLIBOBJS="$DBLIBOBJS db3.c"; libdb3="-ldb-3.0"],
- AC_CHECK_LIB(db, db_create, [LIBS="$LIBS $PTHREAD"; DBLIBOBJS="$DBLIBOBJS db3.c"; libdb3="-ldb"],,$PTHREAD)))
+ AC_CHECK_LIB(db-3.1, db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"; libdb3="-ldb-3.1"],
+ AC_CHECK_LIB(db-3.0, db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"; libdb3="-ldb-3.0"],
+ AC_CHECK_LIB(db, db_create, [DBLIBOBJS="$DBLIBOBJS db3.c"; libdb3="-ldb"],
+ ,$libpthread)
+ ,$libpthread)
+ ,$libpthread)
)
+
dnl Check for Berkeley db2 API.
dnl AC_CHECK_FUNC(db_open, [DBLIBOBJS="$DBLIBOBJS db2.c"],
dnl AC_CHECK_LIB(db, db_open, [LIBS="$LIBS"; DBLIBOBJS="$DBLIBOBJS db2.c" ; libdb2="-ldb"])
@@ -322,12 +328,23 @@ dnl )
dnl Check for Berkeley db1 API in glibc.
AC_CHECK_FUNC(dbopen, [DBLIBOBJS="$DBLIBOBJS db3.c"],
AC_CHECK_LIB(db1, dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c falloc.c" ; libdb1="-ldb1"],
- AC_CHECK_LIB(db, dbopen, [LIBS="$LIBS $PTHREAD"; DBLIBOBJS="$DBLIBOBJS db1.c falloc.c" ; libdb1="-ldb"],,)))
+ AC_CHECK_LIB(db, dbopen, [DBLIBOBJS="$DBLIBOBJS db1.c falloc.c" ; libdb1="-ldb"])
+ )
+)
if test X"$DBLIBOBJS" = X; then
AC_MSG_ERROR([sorry rpm requires libdb-3.x.a or libdb1.a (from the Berkeley db package)])
fi
+if test -n "$libdb3" -a -n "$libpthread" ; then
+ AC_MSG_CHECKING(whether $libdb3 needs $libpthread)
+ saveLIBS="$LIBS"
+ LIBS="$LIBS $libdb3"
+ AC_TRY_LINK_FUNC(db_create, AC_MSG_RESULT(no),
+ [libdb3="$libdb3 $libpthread"; AC_MSG_RESULT(yes)])
+ LIBS="$saveLIBS"
+fi
+
AC_SUBST(DBLIBOBJS)
AC_SUBST(libdb3)
AC_SUBST(libdb2)
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index aec2361ce..f62ecfe58 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -8,7 +8,7 @@ WriteMakefile(
'OBJECT' => 'rpm.o constant.o',
'VERSION_FROM' => 'rpm.pm', # finds $VERSION
'MAKEFILE'=> 'PMakefile',
- 'LIBS' => [' -L/usr/local/lib -lz -lbz2'], # e.g., '-lm'
+ 'LIBS' => [' -L/usr/local/lib -lz -lbz2'], # e.g., '-lm'
'CCFLAGS' => '-g -O2 -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts',
'OPTIMIZE'=> '-g',
'DEFINE' => '-Dbool=char -DHAS_BOOL',