[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

4.0.4: Solaris, Tru64 UNIX patches



1. configure.in
   Better pthread check. It is possible to test for pthread functions
   even if <pthread.h> renames them. By #including <pthread.h>, we
   can do this. We have a similar patch for beecrypt/configure.in.
2. configure.in
   Allow $libdb3 to be overridden with:
     libdb3=[val] ./configure
   Might this be useful?
3. Makefile.am
   rpmio/Makefile.am
   LIBS = -lrt -lpthread is icky! librt isn't available on
   Solaris 2.5.1, 2.6, HP-UX 10.20, Tru64 UNIX 4.0D, AIX 4.3.2. It
   should be added only if available. Anyway, I can understand
   why beecrypt/ needs -lrt but do you need -lrt anywhere else?
   Isn't -lrt only for the aio_xxx() functions?

   As to -lpthread, it is available everywhere except for HP-UX
   10.20 (they use CMA threads with the DCE addon package). We
   hacked beecrypt/entropy.c and beecrypt/mtprng.c to remove
   all calls to pthread_xxx(). Does RPMs use of beecrypt really
   need these two source files? If so, it will be impossible to
   get RPM working on HP-UX 10.20 (maybe pth?). Do you even
   want our hacked entropy.c and mtprng.c? Basically we just
   made any function with pthread_xxx() a stub function.
4. Makefile.am
   tools/Makefile.am
   Need dependency on $(top_builddir)/beecrypt/libbeecrypt.la if
   building with --disable-shared --enable-static. Shouldn't
   hurt if shared libraries are being built.
5. Makefile.am
   Making $(myLDADD) a dependency for $(PROGRAMS) causes a
   problem on Tru64 UNIX. Because the iconv library is available
   in /usr/shlib/libiconv.so, -liconv gets added to $(myLDADD).
   Unfortunately, make then tries to build -liconv because it's
   a dependency for $(PROGRAMS). Works fine being removed here.
6. rpmio/Makefile.am
   Use $(MAKE) instead of make.
7. rpmdb/Makefile.am
   Quite output of $(shell) because if internal DB is not built,
   then will generate an error because db3lobjs won't exist.
8. rpmdb/Makefile.am
   Loop:
     for lo in $(DB3LOBJS); do
   won't work on Solaris /bin/sh if $(DB3LOBJS) is empty. So,
   we work around it with:
     for lo in ""$(DB3LOBJS); do
       [ -z "$$lo" ] && continue; \

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- configure.in.orig	Sun May 12 14:24:56 2002
+++ configure.in	Mon May 13 18:27:37 2002
@@ -366,21 +311,31 @@
 dnl will fail.
 AC_CHECK_LIB(port, writev)
 
+dnl
+dnl Test for pthreads but test a bit different than normal. We
+dnl don't AC_CHECK_FUNC(pthread_create) because, on Solaris, the
+dnl C library includes a pthread interface which is not thread-safe.
+dnl For that reason we always add -lpthread if we find a pthread
+dnl library. Also we can't depend on any specific call existing
+dnl (pthread_create, for example), as it may be #defined away in
+dnl an include file -- Tru64 (nee OSF/1) has this problem. So,
+dnl we #include <pthread.h> to get the OS definition and link
+dnl to make sure the symbol resolves.
+dnl
 libthread=""
-AC_CHECK_LIB(pthread, pthread_mutex_trylock, [libthread="-lpthread"], [
-  dnl OSF 5.0 has the the symbols prefixed with __ in libpthread.
-  AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [libthread="-lpthread"])
-])
-
-if test "x$libthread" = "x"; then
-	# Try in libthread too.
-	AC_CHECK_LIB(thread, mutex_lock, [libthread="-lthread"])
-fi
+AC_MSG_CHECKING([for pthread_create in -lpthread by including <pthread.h>])
+savedLIBS=$LIBS
+LIBS="$LIBS -lpthread"
+AC_TRY_LINK([#include <pthread.h>], [(void)pthread_create(0,0,0,0);], [
+    AC_MSG_RESULT(yes)
+    libthread="-lpthread"], [
+    AC_MSG_RESULT(no)
+    AC_CHECK_LIB(thread, mutex_lock, [libthread="-lthread"])])
+LIBS=$savedLIBS
 
 WITH_DB_SUBDIR=
 WITH_INTERNAL_DB=0
 DBLIBSRCS=""
-libdb3=""
 libdb3a=""
 
 dnl
@@ -395,16 +350,23 @@
 AC_CHECK_HEADERS(db3/db.h)
 
 dnl Check for Berkeley db3 API.
-AC_CHECK_FUNC(db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"],
-  AC_CHECK_LIB(db-3.2, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.2"],
-    AC_CHECK_LIB(db-3.1, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.1"],
-      AC_CHECK_LIB(db-3.0, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.0"],
-        AC_CHECK_LIB(db, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb"],
-        ,$libthread)
-      ,$libthread)
-    ,$libthread)
-  ,$libthread)
-)
+AC_CACHE_VAL([libdb3],[
+  AC_CHECK_FUNC(db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"],
+    AC_CHECK_LIB(db-3.2, db_create,
+    [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.2"],
+      AC_CHECK_LIB(db-3.1, db_create,
+      [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.1"],
+        AC_CHECK_LIB(db-3.0, db_create,
+        [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.0"],
+          AC_CHECK_LIB(db, db_create,
+          [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb"], ,
+          $libthread),
+        $libthread),
+      $libthread),
+    $libthread))])
+if test X"$libdb3" != "X" -a X"$DBLIBSRCS" = "X"; then
+    DBLIBSRCS="$DBLIBSRCS db3.c"
+fi
 
 if test X"$DBLIBSRCS" = X; then
     AC_MSG_ERROR([sorry rpm requires libdb-3.x.a (from the Berkeley db package)]) 
--- Makefile.am.orig	Sun May 12 18:44:45 2002
+++ Makefile.am	Mon May 13 12:24:28 2002
@@ -21,8 +21,6 @@
 	@WITH_ZLIB_INCLUDE@ \
 	@INCPATH@
 
-LIBS = -lrt -lpthread
-
 myLDFLAGS = @LDFLAGS_STATIC@
 
 # XXX libtool can/should generate dependent libs.
@@ -34,6 +32,7 @@
 	$(top_builddir)/rpmdb/librpmdb.la \
 	$(top_builddir)/rpmio/librpmio.la \
 	$(top_builddir)/popt/libpopt.la \
+	$(top_builddir)/beecrypt/libbeecrypt.la \
 	@WITH_ZLIB_LIB@ \
 	@INTLLIBS@ @LIBMISC@
 
@@ -99,7 +98,7 @@
 rpm2cpio_LDFLAGS =	$(myLDFLAGS)
 rpm2cpio_LDADD =	$(myLDADD) @LIBMISC@
 
-$(PROGRAMS): 		$(myLDADD) @WITH_APIDOCS_TARGET@
+$(PROGRAMS): 		@WITH_APIDOCS_TARGET@
 
 .PHONY:	lclint
 lclint:
--- rpmio/Makefile.am.orig	Sun May 12 14:33:54 2002
+++ rpmio/Makefile.am	Mon May 13 12:36:04 2002
@@ -21,7 +21,7 @@
 	ugid.h
 noinst_HEADERS = rpmio_internal.h rpmpgp.h
 
-LIBS +=	@WITH_ZLIB_LIB@ -lrt -lpthread
+LIBS +=	@WITH_ZLIB_LIB@
 
 BEECRYPTLOBJS = $(shell cat $(top_builddir)/beecrypt/listobjs)
 
@@ -39,7 +39,7 @@
 	mv .librpmio.la librpmio.la
 
 $(top_builddir)/beecrypt/listobjs:
-	make -C $(top_builddir)/beecrypt listobjs
+	$(MAKE) -C $(top_builddir)/beecrypt listobjs
 
 .created: $(top_builddir)/beecrypt/listobjs
 	for lo in $(BEECRYPTLOBJS); do \
--- rpmdb/Makefile.am.orig	Sun May 12 16:31:25 2002
+++ rpmdb/Makefile.am	Mon May 13 15:29:17 2002
@@ -25,7 +25,7 @@
 mylibs = -lrpm -lrpmio -lpopt @LIBS@ @INTLLIBS@ @LIBMISC@
 LIBS =
 
-DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs)
+DB3LOBJS = $(shell cat $(top_builddir)/$(WITH_DB_SUBDIR)/db3lobjs 2>/dev/null)
 
 lib_LTLIBRARIES = librpmdb.la
 librpmdb_la_SOURCES = $(DBLIBSRCS) \
@@ -44,7 +44,8 @@
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 .created:
-	for lo in $(DB3LOBJS); do \
+	for lo in ""$(DB3LOBJS); do \
+	  [ -z "$$lo" ] && continue; \
 	  [ -f $$lo ] || $(LN_S) $(top_builddir)/$(WITH_DB_SUBDIR)/$$lo $$lo ; \
 	done
 	touch $@
--- tools/Makefile.am.orig	Sun May 12 18:34:40 2002
+++ tools/Makefile.am	Sun May 12 21:02:16 2002
@@ -26,6 +26,7 @@
 	$(top_builddir)/rpmdb/librpmdb.la \
 	$(top_builddir)/rpmio/librpmio.la \
 	$(top_builddir)/popt/libpopt.la \
+	$(top_builddir)/beecrypt/libbeecrypt.la \
 	@WITH_ZLIB_LIB@ \
 	@INTLLIBS@
 
@@ -44,11 +45,8 @@
 
 javadeps_SOURCES =	javadeps.c
 
-$(PROGRAMS): $(myLDADD)
-
 gnash.o: gnash.c
 	$(COMPILE) -o $@ -c gnash.c
 
 gnash: gnash.o
 	$(LINK) -all-static -o $@ gnash.o $(LDADD)
-





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []