summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>1999-10-03 14:37:29 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>1999-10-03 14:37:29 +0000
commit9ccee0a31b6ee025e65502570579ecb5c6336d5f (patch)
treeef0558ef1565048dfe0dd47549eb2a09d79c3aa0
parent69546b19de9a9abc3bf098c1c743c51d74d75d19 (diff)
downloadirssi-9ccee0a31b6ee025e65502570579ecb5c6336d5f.zip
Command line argument handling works.
-c server [-p port] : connects to server at startup -n : don't autoconnect to any servers git-svn-id: http://svn.irssi.org/repos/irssi/trunk@33 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--acconfig.h19
-rw-r--r--configure.in44
-rw-r--r--src/common.h38
3 files changed, 59 insertions, 42 deletions
diff --git a/acconfig.h b/acconfig.h
index e90d0d05..3ff17f52 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,17 +1,22 @@
-#undef HAVE_GTK
-#undef HAVE_GNOME
-#undef HAVE_GNOME_PANEL
#undef SYSCONFDIR
#undef PLUGINSDIR
#undef PERLSCRIPTDIR
-#undef GTK_10
-#undef HAVE_SOCKS_H
+
+#undef HAVE_GTK
#undef HAVE_IMLIB
-#undef MEM_DEBUG
-#undef HAVE_IPV6
+#undef HAVE_GNOME
+#undef HAVE_GNOME_PANEL
+
#undef GTK_HEBREW
#undef GTK_HEBREW_RC
+#undef MEM_DEBUG
+#undef HAVE_IPV6
+
+#undef HAVE_POPT_H
+#undef HAVE_POPT_GNOME_H
+#undef HAVE_SOCKS_H
+
#undef HAVE_NCURSES_USE_DEFAULT_COLORS
#undef HAVE_CURSES_IDCOK
diff --git a/configure.in b/configure.in
index 7cf531e9..603b53fe 100644
--- a/configure.in
+++ b/configure.in
@@ -183,6 +183,38 @@ AC_DEFINE_UNQUOTED(SYSCONFDIR, "$prefix/etc")
AC_DEFINE_UNQUOTED(PLUGINSDIR, "$prefix/lib/irssi/plugins")
dnl **
+dnl ** check for popt.h
+dnl **
+if test "x$popt_dir" = "x"; then
+ AC_CHECK_HEADER(popt.h, [
+ AC_DEFINE(HAVE_POPT_H)
+ LIBS="-lpopt"
+ ])
+else
+ poptlib=-L$popt_dir/lib
+ CFLAGS="$CFLAGS -I$popt_dir/include"
+ LIBS="$LIBS $poptlib -lpopt"
+ if test -f $popt_dir/include/popt.h; then
+ AC_DEFINE(HAVE_POPT_H)
+ else
+ if test -f $popt_dir/include/popt-gnome.h; then
+ AC_DEFINE(HAVE_POPT_GNOME_H)
+ fi
+ fi
+fi
+
+AC_CHECK_LIB(popt, poptGetContext, [
+ POPT_LIBS="$poptlib -lpopt"
+], [
+ AC_CHECK_LIB(gnomesupport, poptGetContext, [
+ POPT_LIBS="$poptlib $GNOME_LIBDIR -lgnomesupport"
+ ], [
+ AC_ERROR(["libpropt or libgnomesupport not found"])
+ ], $LIBS $poptlib $GNOME_LIBDIR -lgnomesupport)
+], $LIBS $poptlib -lpopt)
+
+
+dnl **
dnl ** check for libPropList
dnl **
@@ -237,8 +269,11 @@ if test "x$want_gnome" = "xyes"; then
AC_DEFINE(HAVE_GTK)
AC_DEFINE(HAVE_GNOME)
AC_DEFINE(HAVE_IMLIB)
+ AC_DEFINE(HAVE_POPT_GNOME_H)
GNOME_SUPPORT_CHECKS
- GUI_CFLAGS="$GNOME_INCLUDEDIR"
+
+ dnl ** needed for including popt-gnome.h
+ CFLAGS="$CFLAGS $GNOME_INCLUDEDIR"
dnl **
dnl ** check for gnome panel applet library
@@ -260,13 +295,9 @@ else
want_gnome_panel="no"
AC_DEFINE(HAVE_GTK)
AM_PATH_GTK(1.2.0)
- GUI_CFLAGS="$GTK_CFLAGS"
+ GUI_CFLAGS="$GTK_CFLAGS $POPT_LIBS"
GUI_LIBS="$GTK_LIBS"
- if test "x$gtk_config_minor_version" = "x0"; then
- AC_DEFINE(GTK_10)
- fi
-
if test "x$want_imlib" = "xyes"; then
AM_PATH_GDK_IMLIB(, [define_imlib=true])
if test x$define_imlib = xtrue; then
@@ -281,6 +312,7 @@ if test "x$GUI_LIBS" != "x"; then
GUI_LIBS="$GUI_LIBS $HEBREW_LIBS"
fi
+AC_SUBST(POPT_LIBS)
AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_CFLAGS)
AM_CONDITIONAL(BUILD_GNOMEUI, test "x$GUI_LIBS" != "x")
diff --git a/src/common.h b/src/common.h
index d78a5562..7dfa2094 100644
--- a/src/common.h
+++ b/src/common.h
@@ -26,6 +26,14 @@
#include <sys/wait.h>
#include <sys/utsname.h>
+#ifdef HAVE_POPT_H
+#include <popt.h>
+#else
+# ifdef HAVE_POPT_GNOME_H
+# include <popt-gnome.h>
+# endif
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -60,6 +68,7 @@ typedef struct
}
IPADDR;
+#include "irc-base/memdebug.h"
#include "lib-config/irssi-config.h"
#include "common-setup.h"
@@ -82,33 +91,4 @@ void gui_input_remove(gint tag);
guint gui_timeout_add(guint32 interval, GUITimeoutFunction function, gpointer data);
void gui_timeout_remove(gint tag);
-#ifdef MEM_DEBUG
-
-void ig_mem_profile(void);
-
-void ig_set_data(gchar *data);
-
-gpointer ig_malloc(gint size, gchar *file, gint line);
-gpointer ig_malloc0(gint size, gchar *file, gint line);
-gpointer ig_realloc(gpointer mem, gulong size, gchar *file, gint line);
-gchar *ig_strdup(const char *str, gchar *file, gint line);
-gchar *ig_strconcat(const char *str, ...);
-gchar *ig_strdup_printf(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
-void ig_free(gpointer p);
-GString *ig_string_new(gchar *str);
-void ig_string_free(GString *str, gboolean freeit);
-
-#define g_malloc(a) ig_malloc(a, __FILE__, __LINE__)
-#define g_malloc0(a) ig_malloc0(a, __FILE__, __LINE__)
-#define g_realloc(a,b) ig_realloc(a, b, __FILE__, __LINE__)
-#define g_strdup(a) ig_strdup(a, __FILE__, __LINE__)
-#define g_strconcat ig_strconcat
-#define g_strdup_printf ig_strdup_printf
-#define g_strdup_vprintf ig_strdup_vprintf
-#define g_free ig_free
-#define g_string_new ig_string_new
-#define g_string_free ig_string_free
-
-#endif
-
#endif