Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/ChangeLog,v
retrieving revision 1.106
diff -c -r1.106 ChangeLog
*** ChangeLog	16 Jul 2003 08:28:26 -0000	1.106
--- ChangeLog	20 Jul 2003 14:53:38 -0000
***************
*** 1,3 ****
--- 1,17 ----
+ 2003-07-20  Fredrik Jönsson  <fjo@nada.kth.se
+ 
+ 	Changes to at least compile, not necessary work on Solaris.
+ 	* configure.in: check for statvfs. Check for mkdtemp. Add -lsocket
+ 	to mapping-daemons.
+ 	* mkdtemp.c, mkdtemp.h: Added to provide for fallback for missing. 
+ 	mkdtemp on Solaris. These are stolen from gettext.
+ 	* Makefile.am: conditionally compile mkdtemp.c if needed.
+ 	* mapping-daemon: conditionally include mkdtemp.h, add casts
+ 	to sockaddr to remove compiletime warning.
+ 	* make-iso.c: Conditionally use statvfs and provided mkdtemp.
+ 	* mapping-method.c: add casts to sockaddr to remove compile time
+ 	warning.
+ 	
  2003-07-14  Dafydd Harries  <daf@parnassus.ath.cx>
  
  	* configure.in: Added "cy" (Welsh) to ALL_LINGUAS.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/Makefile.am,v
retrieving revision 1.14
diff -c -r1.14 Makefile.am
*** Makefile.am	7 Jul 2003 19:58:58 -0000	1.14
--- Makefile.am	20 Jul 2003 14:53:38 -0000
***************
*** 76,81 ****
--- 76,82 ----
  	cdspin4.png cdspin5.png cdspin6.png \
  	cdspin7.png cdspin8.png 
  
+ if MKDTEMP_MISSING
  nautilus_cd_burner_SOURCES = \
  	nautilus-cd-burner.c \
  	nautilus-cd-burner.h \
***************
*** 86,103 ****
--- 87,128 ----
  	cd-recorder.c	\
  	cd-recorder.h	\
  	$(BACONFILES)	\
+ 	mkdtemp.c	\
  	$(NULL)
+ else
+ 	nautilus-cd-burner.c \
+ 	nautilus-cd-burner.h \
+ 	make-iso.c	\
+ 	make-iso.h	\
+ 	cdrecorder-marshal.list	\
+ 	$(MARSHALFILES)	\
+ 	cd-recorder.c	\
+ 	cd-recorder.h	\
+ 	$(BACONFILES)	\
+ 	$(NULL)
+ endif
+ 
  nautilus_cd_burner_LDADD = $(GUI_LIBS)
  
  
  ### Mapping daemon
  
+ if MKDTEMP_MISSING
+ mapping_daemon_SOURCES = \
+ 	mapping-daemon.c \
+ 	mapping-daemon.h \
+ 	mapping-protocol.h \
+ 	mapping-protocol.c \
+ 	mkdtemp.c	\
+ 	$(NULL)
+ else
  mapping_daemon_SOURCES = \
  	mapping-daemon.c \
  	mapping-daemon.h \
  	mapping-protocol.h \
  	mapping-protocol.c \
  	$(NULL)
+ endif
  
  mapping_daemon_LDADD = $(DAEMON_LIBS)
  
Index: configure.in
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/configure.in,v
retrieving revision 1.48
diff -c -r1.48 configure.in
*** configure.in	16 Jul 2003 08:28:26 -0000	1.48
--- configure.in	20 Jul 2003 14:53:38 -0000
***************
*** 17,28 ****
--- 17,42 ----
  EEL_REQUIRED=2.0.0
  
  AC_CHECK_LIB(cam, cam_open_spec_device)
+ 
+ AC_CHECK_HEADERS(sys/statvfs.h)
+ AC_CHECK_FUNCS(statvfs)
+ 
+ mkdtemp_missing=false
+ AC_CHECK_FUNC(mkdtemp, 
+     [AC_DEFINE([HAVE_MKDTEMP], 1, [Have GlibC function to make temp dirs])],
+     mkdtemp_missing=true)
+ AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
  	
  PKG_CHECK_MODULES(MAPPING, gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED gnome-vfs-module-2.0 >= $GNOME_VFS_REQUIRED)
  AC_SUBST(MAPPING_CFLAGS)
  AC_SUBST(MAPPING_LIBS)
+ 
+       
  	
  PKG_CHECK_MODULES(DAEMON, glib-2.0 >= $GLIB_REQUIRED)
+ AC_CHECK_LIB(socket, bind, 
+     DAEMON_LIBS="$DAEMON_LIBS -lsocket",
+     :)
  AC_SUBST(DAEMON_CFLAGS)
  AC_SUBST(DAEMON_LIBS)
  	
Index: make-iso.c
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/make-iso.c,v
retrieving revision 1.20
diff -c -r1.20 make-iso.c
*** make-iso.c	27 May 2003 08:07:06 -0000	1.20
--- make-iso.c	20 Jul 2003 14:53:38 -0000
***************
*** 21,26 ****
--- 21,27 ----
    
     Authors: Alexander Larsson <alexl@redhat.com>
  */
+ 
  #ifdef __FreeBSD__
  #include <sys/param.h>
  #include <sys/mount.h>
***************
*** 29,34 ****
--- 30,38 ----
  #endif /* __FreeBSD__ */
  #include <sys/types.h>
  #include <sys/stat.h>
+ #ifdef HAVE_STATVFS_H
+ #include <sys/statvfs.h>
+ #endif
  #include <time.h>
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 41,46 ****
--- 45,54 ----
  
  #include "nautilus-cd-burner.h"
  
+ #ifndef HAVE_MKDTEMP
+ #include "mkdtemp.h"
+ #endif
+ 
  static void
  write_all (int fd, char *buf, int len)
  {
***************
*** 475,481 ****
--- 483,493 ----
  	char *dirname;
  	int exit_status, res;
  	unsigned long iso_size;
+ #ifdef HAVE_STATVFS
+ 	struct statvfs statfs_buf;
+ #else
  	struct statfs statfs_buf;
+ #endif
  	GtkWidget *dialog;
  
  	dirname = g_strdup_printf ("iso-%s.XXXXXX", g_get_user_name ());
***************
*** 552,558 ****
--- 564,574 ----
  	g_free (stdout_data);
  
  	dirname = g_path_get_dirname (filename);
+ #ifdef HAVE_STATVFS
+ 	res = statvfs (dirname, &statfs_buf);
+ #else
  	res = statfs (dirname, &statfs_buf);
+ #endif
  	g_free (dirname);
  	if (res == -1) {
  		g_warning ("Cannot get free space at %s\n", dirname);
Index: mapping-daemon.c
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/mapping-daemon.c,v
retrieving revision 1.6
diff -c -r1.6 mapping-daemon.c
*** mapping-daemon.c	27 Jun 2003 14:50:35 -0000	1.6
--- mapping-daemon.c	20 Jul 2003 14:53:38 -0000
***************
*** 35,40 ****
--- 35,44 ----
  #include <glib/glist.h>
  #include <libgnomevfs/gnome-vfs.h>
  
+ #ifndef HAVE_MKDTEMP
+ #include "mkdtemp.h"
+ #endif
+ 
  #include "mapping-daemon.h"
  #include "mapping-protocol.h"
  
***************
*** 871,877 ****
  	sin.sun_family = AF_UNIX;
  	g_snprintf (sin.sun_path, sizeof(sin.sun_path), "%s/mapping-%s", g_get_tmp_dir (), g_get_user_name ());
  	unlink (sin.sun_path);
! 	if (bind (master_socket, &sin, sizeof(sin)) == -1) {
                  perror ("Failed to bind master socket");
                  exit(1);
          }
--- 875,881 ----
  	sin.sun_family = AF_UNIX;
  	g_snprintf (sin.sun_path, sizeof(sin.sun_path), "%s/mapping-%s", g_get_tmp_dir (), g_get_user_name ());
  	unlink (sin.sun_path);
! 	if (bind (master_socket, (const struct sockaddr *)&sin, sizeof(sin)) == -1) {
                  perror ("Failed to bind master socket");
                  exit(1);
          }
Index: mapping-method.c
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/mapping-method.c,v
retrieving revision 1.5
diff -c -r1.5 mapping-method.c
*** mapping-method.c	28 May 2003 14:06:30 -0000	1.5
--- mapping-method.c	20 Jul 2003 14:53:39 -0000
***************
*** 947,956 ****
                  return NULL;
          }
  	
!         if (connect (daemon_fd, &sin, sizeof(sin)) == -1) {
  		if (errno == ECONNREFUSED || errno == ENOENT) {
  			if (launch_daemon ()) {
! 				if (connect (daemon_fd, &sin, sizeof(sin)) == -1) {
  					perror("mapping method init - connect2");
  					return NULL;
  				}
--- 947,956 ----
                  return NULL;
          }
  	
!         if (connect (daemon_fd, (const struct sockaddr *) &sin, sizeof(sin)) == -1) {
  		if (errno == ECONNREFUSED || errno == ENOENT) {
  			if (launch_daemon ()) {
! 				if (connect (daemon_fd,  (const struct sockaddr *) &sin, sizeof(sin)) == -1) {
  					perror("mapping method init - connect2");
  					return NULL;
  				}
