]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix HP-UX compile issues (STR #1446)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 27 Feb 2006 20:57:07 +0000 (20:57 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 27 Feb 2006 20:57:07 +0000 (20:57 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@5194 7a7537e8-13f0-0310-91df-b6672ffda945

Makedefs.in
backend/parallel.c
backend/serial.c
config-scripts/cups-threads.m4
cups/testfile.c
scheduler/auth.c
scheduler/cups-deviced.c
scheduler/log.c

index 726b8b2a1c6ce415161d332e15c186031a4fc994..384bd6f554dcd9a6ba4ac219f4ec02712e2418ab 100644 (file)
@@ -104,11 +104,11 @@ INSTALLSTATIC     =       @INSTALLSTATIC@
 ARFLAGS                =       @ARFLAGS@
 BACKLIBS       =       @BACKLIBS@
 CFLAGS         =       -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ \
-                       @LARGEFILE@ $(OPTIONS)
+                       @LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
 COMMONLIBS     =       @LIBS@
 CUPSDLIBS      =       @CUPSDLIBS@
 CXXFLAGS       =       -I.. $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CXXFLAGS@ \
-                       @LARGEFILE@ $(OPTIONS)
+                       @LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
 CXXLIBS                =       @CXXLIBS@
 DSOFLAGS       =       @DSOFLAGS@
 DSOLIBS                =       @DSOLIBS@ $(COMMONLIBS)
index 932775519a7f3510186d10dcea824be696f4b9ee..db332f0f4376e47de20a8170a2d8e9929c538c64 100644 (file)
 #include <errno.h>
 #include <cups/string.h>
 #include <signal.h>
-#include <sys/select.h>
 #include "ieee1284.c"
 
+#ifdef __hpux
+#  include <sys/time.h>
+#else
+#  include <sys/select.h>
+#endif /* __hpux */
+
 #ifdef WIN32
 #  include <io.h>
 #else
index 18bfde7bc91dbaa95b37e2c289eb3b2169855e76..6d0a641e68bcbee063bedaaf878804cd6bcf6829 100644 (file)
 #  include <unistd.h>
 #  include <fcntl.h>
 #  include <termios.h>
-#  include <sys/select.h>
+#  ifdef __hpux
+#    include <sys/time.h>
+#  else
+#    include <sys/select.h>
+#  endif /* __hpux */
 #  ifdef HAVE_SYS_IOCTL_H
 #    include <sys/ioctl.h>
 #  endif /* HAVE_SYS_IOCTL_H */
index 788ce838ce9e1cfe9ecd251004f3350d666d5ebd..639eb741437fbb74f04b6f947371a3c2e44aa49a 100644 (file)
@@ -25,26 +25,32 @@ dnl
 AC_ARG_ENABLE(threads, [  --enable-threads        enable multi-threading support])
 
 have_pthread=no
+PTHREAD_FLAGS=""
 
 if test "x$enable_threads" != xno; then
        AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
-       AC_CHECK_LIB(pthread, pthread_create)
 
-       if test "x$ac_cv_lib_pthread_pthread_create" = xyes -a x$ac_cv_header_pthread_h = xyes; then
-               have_pthread=yes
-       else
-               dnl *BSD uses -pthread option...
-               AC_MSG_CHECKING([for pthread_create using -pthread])
-               SAVELIBS="$LIBS"
-               LIBS="-pthread $LIBS"
-               AC_TRY_LINK([#include <pthread.h>],
-                       [pthread_create(0, 0, 0, 0);],
-                       have_pthread=yes,
-                       LIBS="$SAVELIBS")
-               AC_MSG_RESULT([$have_pthread])
+       if test x$ac_cv_header_pthread_h = xyes; then
+               dnl Check various threading options for the platforms we support
+               for flag in -lpthreads -lpthread -pthread; do
+                       AC_MSG_CHECKING([for pthread_create using $flag])
+                       SAVELIBS="$LIBS"
+                       LIBS="$flag $LIBS"
+                       AC_TRY_LINK([#include <pthread.h>],
+                               [pthread_create(0, 0, 0, 0);],
+                               have_pthread=yes,
+                               LIBS="$SAVELIBS")
+                       AC_MSG_RESULT([$have_pthread])
+
+                       if test $have_pthread = yes; then
+                               PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
+                               break
+                       fi
+               done
        fi
 fi
 
+AC_SUBST(PTHREAD_FLAGS)
 
 dnl
 dnl End of "$Id$".
index a3680c6e360fca200b72464ddbaaa723e23f89a7..a110d2723cef4eb9493de9560d70ba311e4b6f05 100644 (file)
@@ -39,7 +39,9 @@
 #include "string.h"
 #include "file.h"
 #include "debug.h"
-#include <zlib.h>
+#ifdef HAVE_LIBZ
+#  include <zlib.h>
+#endif /* HAVE_LIBZ */
 
 
 /*
index 39a4321421624f7699d949bd0dd9ac632d7dd93b..99239be35dfbe969093b38f6011d23e72b1b2df7 100644 (file)
@@ -116,7 +116,7 @@ typedef struct cupsd_authdata_s             /**** Authentication data ****/
  */
 
 #if defined(__hpux) && defined(HAVE_LIBPAM)
-static cupsd_authdata_t        *auth_datat;    /* Current client being authenticated */
+static cupsd_authdata_t        *auth_data    /* Current client being authenticated */
 #endif /* __hpux && HAVE_LIBPAM */
 
 
index dfb4389ccaa554bfbcf66892c70e91993f1fecdb..0a2886bd50777c941d011ebbae67bfb06eb0ccac 100644 (file)
 #include <cups/array.h>
 #include <cups/dir.h>
 
+#ifdef __hpux
+#  define seteuid(uid) setresuid(-1, (uid), -1)
+#endif /* __hpux */
+
 
 /*
  * Device information structure...
index 45fb54616a0dcce80ee68ca6226a1578038ef9de..85235ac7dcae10f07288dc7e830c8d3f6046e9ad 100644 (file)
 
 #include "cupsd.h"
 #include <stdarg.h>
-
-#ifdef HAVE_VSYSLOG
-#  include <syslog.h>
-#endif /* HAVE_VSYSLOG */
+#include <syslog.h>
 
 
 /*