[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r864 - in gnunet-gtk: . m4 src
From: |
durner |
Subject: |
[GNUnet-SVN] r864 - in gnunet-gtk: . m4 src |
Date: |
Sat, 4 Jun 2005 06:31:57 -0700 (PDT) |
Author: durner
Date: 2005-06-04 06:31:49 -0700 (Sat, 04 Jun 2005)
New Revision: 864
Added:
gnunet-gtk/m4/ac_define_dir.m4
Modified:
gnunet-gtk/configure.ac
gnunet-gtk/src/Makefile.am
gnunet-gtk/src/about.c
gnunet-gtk/src/daemon.c
gnunet-gtk/src/main.c
gnunet-gtk/src/plibc.h
gnunet-gtk/src/search.c
gnunet-gtk/src/upload.c
Log:
- don't specify GLADE_FILE through the cmd line (-> MinGW oddity)
- fix loading .glade-file under MinGW
- update pre-plibc code
- new plibc.h
- real test for plibc
Modified: gnunet-gtk/configure.ac
===================================================================
--- gnunet-gtk/configure.ac 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/configure.ac 2005-06-04 13:31:49 UTC (rev 864)
@@ -110,7 +110,7 @@
AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
AC_CHECK_LIB(intl, gettext)
- LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32 -lplibc"
+ LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32"
CFLAGS="-mms-bitfields $CFLAGS"
build_target="mingw"
;;
@@ -125,6 +125,9 @@
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(m, log)
+# check for POSIX emulation under Windows
+AC_CHECK_LIB(plibc, plibc_conv_to_win_path)
+
# Checks for standard typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
@@ -167,6 +170,8 @@
fi
AC_CHECK_HEADERS([GNUnet/gnunet_ecrs_lib.h GNUnet/gnunet_fsui_lib.h
GNUnet/gnunet_stats_lib.h GNUnet/gnunet_getoption_lib.h],,
AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core
headers]))
+AC_CHECK_LIB(gnunetutil,LOG,,
+ AC_MSG_ERROR([gnunet-gtk requires GNUnet-Util]))
AC_CHECK_LIB(gnunetecrs,ECRS_createMetaData,,
AC_MSG_ERROR([gnunet-gtk requires ECRS]))
AC_CHECK_LIB(gnunetfsui,FSUI_start,,
@@ -229,6 +234,12 @@
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
+# We define the paths here, because MinGW/GCC expands paths
+# passed through the command line ("-DDATADIR=..."). This would
+# lead to hard-coded paths ("C:\mingw\mingw\bin...") that do
+# not contain the actual GNUnet installation. GNUnet usually lives in
+# "C:\Program Files\GNU\GNUnet\bin".
+AC_DEFINE_DIR([DATADIR], [datadir/gnunet-gtk], [The directory for installing
read-only architecture-independent data])
AC_OUTPUT([
Makefile
Added: gnunet-gtk/m4/ac_define_dir.m4
===================================================================
--- gnunet-gtk/m4/ac_define_dir.m4 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/m4/ac_define_dir.m4 2005-06-04 13:31:49 UTC (rev 864)
@@ -0,0 +1,35 @@
+dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+dnl
+dnl This macro _AC_DEFINEs VARNAME to the expansion of the DIR
+dnl variable, taking care of fixing up ${prefix} and such.
+dnl
+dnl VARNAME is offered as both a C preprocessor symbol, and an output
+dnl variable.
+dnl
+dnl Note that the 3 argument form is only supported with autoconf 2.13
+dnl and later (i.e. only where _AC_DEFINE supports 3 arguments).
+dnl
+dnl Examples:
+dnl
+dnl AC_DEFINE_DIR(DATADIR, datadir)
+dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
+dnl
+dnl @category Misc
+dnl @author Stepan Kasal <address@hidden>
+dnl @author Andreas Schwab <address@hidden>
+dnl @author Guido Draheim <address@hidden>
+dnl @author Alexandre Oliva
+dnl @version 2005-01-17
+dnl @license AllPermissive
+
+AC_DEFUN([AC_DEFINE_DIR], [
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"[$]$2\""
+ AC_SUBST($1, "$ac_define_dir")
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+])
Modified: gnunet-gtk/src/Makefile.am
===================================================================
--- gnunet-gtk/src/Makefile.am 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/Makefile.am 2005-06-04 13:31:49 UTC (rev 864)
@@ -5,9 +5,6 @@
bin_PROGRAMS = gnunet-gtk
-AM_CFLAGS = \
- -DGLADE_FILE="\"$(DESTDIR)$(pkgdatadir)/gnunet-gtk.glade\""
-
gnunet_gtk_SOURCES = \
about.c \
daemon.c daemon.h \
Modified: gnunet-gtk/src/about.c
===================================================================
--- gnunet-gtk/src/about.c 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/about.c 2005-06-04 13:31:49 UTC (rev 864)
@@ -28,6 +28,8 @@
#include "config.h"
#include "main.h"
+extern char *gladeFile;
+
/**
* This displays an about window
*/
@@ -37,7 +39,7 @@
GladeXML * axml;
axml
- = glade_xml_new(GLADE_FILE,
+ = glade_xml_new(gladeFile,
"aboutDialog",
NULL);
ad
Modified: gnunet-gtk/src/daemon.c
===================================================================
--- gnunet-gtk/src/daemon.c 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/daemon.c 2005-06-04 13:31:49 UTC (rev 864)
@@ -171,8 +171,8 @@
char szCall[_MAX_PATH + 1], szWd[_MAX_PATH + 1], szCWd[_MAX_PATH + 1];
char *args[1];
- conv_to_win_path("/bin/gnunetd.exe", szCall);
- conv_to_win_path("/bin", szWd);
+ plibc_conv_to_win_path("/bin/gnunetd.exe", szCall);
+ plibc_conv_to_win_path("/bin", szWd);
_getcwd(szCWd, _MAX_PATH);
chdir(szWd);
Modified: gnunet-gtk/src/main.c
===================================================================
--- gnunet-gtk/src/main.c 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/main.c 2005-06-04 13:31:49 UTC (rev 864)
@@ -97,6 +97,7 @@
}
GladeXML * mainXML;
+char *gladeFile = NULL;
int main(int argc,
char *argv[]) {
@@ -110,9 +111,17 @@
startCron();
gtkInitSaveCalls();
/* load the interface */
- mainXML = glade_xml_new(GLADE_FILE,
+#ifdef MINGW
+ gladeFile = MALLOC(_MAX_PATH + 1);
+ plibc_conv_to_win_path(DATADIR"/gnunet-gtk.glade", gladeFile);
+#else
+ gladeFile = STRDUP(DATADIR"/gnunet-gtk.glade");
+#endif
+
+ mainXML = glade_xml_new(gladeFile,
"mainWindow",
NULL);
+
/* connect the signals in the interface */
setCustomLogProc(&addLogEntry);
glade_xml_signal_autoconnect(mainXML);
@@ -134,6 +143,10 @@
gtkDoneSaveCalls();
UNREF(mainXML);
doneUtil();
+
+#ifdef MINGW
+ FREE(gladeFile);
+#endif
return 0;
}
Modified: gnunet-gtk/src/plibc.h
===================================================================
--- gnunet-gtk/src/plibc.h 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/plibc.h 2005-06-04 13:31:49 UTC (rev 864)
@@ -22,7 +22,7 @@
* @brief PlibC header
* @attention This file is usually not installed under Unix,
* so ship it with your application
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
*/
#ifndef _PLIBC_H_
@@ -48,6 +48,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
+#include <errno.h>
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
@@ -111,18 +112,21 @@
#define EUNATCH 42 /* Protocol driver not attached */
#define ENOCSI 43 /* No CSI structure available */
#define EL2HLT 44 /* Level 2 halted */
-#undef EDEADLK
-#define EDEADLK 45 /* Deadlock condition */
-#undef ENOLCK
-#define ENOLCK 46 /* No record locks available */
+#ifndef EDEADLK
+ #define EDEADLK 45 /* Deadlock condition */
+#endif
+#ifndef ENOLCK
+ #define ENOLCK 46 /* No record locks available */
+#endif
#define EBADE 50 /* Invalid exchange */
#define EBADR 51 /* Invalid request descriptor */
#define EXFULL 52 /* Exchange full */
#define ENOANO 53 /* No anode */
#define EBADRQC 54 /* Invalid request code */
#define EBADSLT 55 /* Invalid slot */
-#undef EDEADLOCK
-#define EDEADLOCK 56 /* File locking deadlock error */
+#ifndef EDEADLOCK
+ #define EDEADLOCK 56 /* File locking deadlock error */
+#endif
#define EBFONT 57 /* Bad font file fmt */
#define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data (for no delay io) */
@@ -148,13 +152,16 @@
#define ELIBSCN 85 /* .lib section in a.out corrupted */
#define ELIBMAX 86 /* Attempting to link in too many libs */
#define ELIBEXEC 87 /* Attempting to exec a shared library */
-#undef ENOSYS
-#define ENOSYS 88 /* Function not implemented */
+#ifndef ENOSYS
+ #define ENOSYS 88 /* Function not implemented */
+#endif
#define ENMFILE 89 /* No more files */
-#undef ENOTEMPTY
-#define ENOTEMPTY 90 /* Directory not empty */
-#undef ENAMETOOLONG
-#define ENAMETOOLONG 91 /* File or path name too long */
+#ifndef ENOTEMPTY
+ #define ENOTEMPTY 90 /* Directory not empty */
+#endif
+#ifndef ENAMETOOLONG
+ #define ENAMETOOLONG 91 /* File or path name too long */
+#endif
#define ELOOP 92 /* Too many symbolic links */
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
@@ -170,8 +177,9 @@
#define ECONNABORTED 113 /* Connection aborted */
#define ENETUNREACH 114 /* Network is unreachable */
#define ENETDOWN 115 /* Network interface is not configured */
-#undef ETIMEDOUT
-#define ETIMEDOUT 116 /* Connection timed out */
+#ifndef ETIMEDOUT
+ #define ETIMEDOUT 116 /* Connection timed out */
+#endif
#define EHOSTDOWN 117 /* Host is down */
#define EHOSTUNREACH 118 /* Host is unreachable */
#define EINPROGRESS 119 /* Connection already in progress */
@@ -189,8 +197,9 @@
#define EUSERS 131 /* Too many users */
#define EDQUOT 132 /* Disk quota exceeded */
#define ESTALE 133 /* Unknown error */
-#undef ENOTSUP
-#define ENOTSUP 134 /* Not supported */
+#ifndef ENOTSUP
+ #define ENOTSUP 134 /* Not supported */
+#endif
#define ENOMEDIUM 135 /* No medium (in tape drive) */
#define ENOSHARE 136 /* No such host or network path */
#define ECASECLASH 137 /* Filename exists with different case */
@@ -338,7 +347,7 @@
char *ctime(const time_t *clock);
char *ctime_r(const time_t *clock, char *buf);
int plibc_init(char *pszOrg, char *pszApp);
-void plibc_shutdown(void);
+void plibc_shutdown();
int plibc_conv_to_win_path_ex(const char *pszUnix, char *pszWindows, int
derefLinks);
void _SetErrnoFromWinError(long lWinError, char *pszCaller, int iLine);
void SetErrnoFromWinsockError(long lWinError);
@@ -412,7 +421,7 @@
struct hostent *_win_gethostbyaddr(const char *addr, int len, int type);
struct hostent *_win_gethostbyname(const char *name);
char *_win_strerror(int errnum);
-int IsWinNT(void);
+int IsWinNT();
#if !HAVE_STRNDUP
char *strndup (const char *s, size_t n);
Modified: gnunet-gtk/src/search.c
===================================================================
--- gnunet-gtk/src/search.c 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/search.c 2005-06-04 13:31:49 UTC (rev 864)
@@ -43,6 +43,8 @@
static GtkListStore * summary;
+extern char *gladeFile;
+
/**
* Recursively free the (internal) model data fields
* (uri and meta) from the search tree model.
@@ -278,7 +280,7 @@
GladeXML * searchXML;
searchXML
- = glade_xml_new(GLADE_FILE,
+ = glade_xml_new(gladeFile,
"searchResultsFrame",
NULL);
glade_xml_signal_autoconnect(searchXML);
Modified: gnunet-gtk/src/upload.c
===================================================================
--- gnunet-gtk/src/upload.c 2005-06-04 08:23:29 UTC (rev 863)
+++ gnunet-gtk/src/upload.c 2005-06-04 13:31:49 UTC (rev 864)
@@ -31,6 +31,7 @@
static GtkTreeStore * summary;
+extern char *gladeFile;
/**
* XML tree for the meta-data dialog of upload.
@@ -400,7 +401,7 @@
filename = gtk_entry_get_text(GTK_ENTRY(entry));
metaXML
- = glade_xml_new(GLADE_FILE,
+ = glade_xml_new(gladeFile,
"metaDataDialog",
NULL);
glade_xml_signal_autoconnect(metaXML);
@@ -658,7 +659,7 @@
GtkTreeIter iter;
uploadXML
- = glade_xml_new(GLADE_FILE,
+ = glade_xml_new(gladeFile,
"uploadfilechooserdialog",
NULL);
glade_xml_signal_autoconnect(uploadXML);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r864 - in gnunet-gtk: . m4 src,
durner <=