From ce3d6fcba4587feb5555a9b85c6fdeaa0b74553f Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 14 Aug 2006 04:45:46 +0000 Subject: adding autotool stuff git-svn-id: http://svn.irssi.org/repos/irssi-python@4313 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/Makefile | 35 ----------------------------------- src/Makefile.am | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/objects/Makefile | 28 ---------------------------- src/objects/Makefile.am | 26 ++++++++++++++++++++++++++ src/pyloader.c | 7 +++++-- 5 files changed, 78 insertions(+), 65 deletions(-) delete mode 100644 src/Makefile create mode 100644 src/Makefile.am delete mode 100644 src/objects/Makefile create mode 100644 src/objects/Makefile.am (limited to 'src') diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 123e0ed..0000000 --- a/src/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -CC = gcc - -PYTHON = /usr/include/python2.4 -IRSSI = /home/chrisd/irssi-0.8.10 - -CFLAGS = -fpic -ggdb -Wall -I$(PYTHON) -I$(IRSSI) -I$(IRSSI)/src \ --I$(IRSSI)/src/fe-common/core -I$(IRSSI)/src/core -I$(IRSSI)/src/fe-text \ --I$(IRSSI)/src/irc -I$(IRSSI)/src/irc/core -I$(IRSSI)/src/irc/dcc \ --I$(IRSSI)/src/irc/notifylist -I.. -I. -Iobjects \ -`pkg-config glib-2.0 --cflags` - -LDFLAGS = -fpic /usr/lib/libpython2.4.so - -OBJ = pycore.o pyutils.o pymodule.o pyloader.o pysignals.o pysource.o \ -pythemes.o pystatusbar.o pyconstants.o - -pyirssi: pyobjects.a $(OBJ) - $(CC) -shared -o libirssi_python.so $(OBJ) objects/pyobjects.a $(LDFLAGS) - -pyobjects.a: - cd objects/ && make - -%.o: %.c - $(CC) -c $< $(CFLAGS) - -signalmap: - awk -f sig2code.awk ~/irssi-0.8.10/docs/signals.txt > pysigmap.h - -constants: - awk -f constants.awk constants.txt > pyconstants.c - -clean: - rm -f *.o *.so - cd objects/ && make clean - diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..5a28039 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,47 @@ +moduledir = $(libdir)/irssi/modules +wrappersdir = $(datadir)/irssi/scripts +module_LTLIBRARIES = libirssi_python.la + +libirssi_python_la_DEPENDENCIES = objects/libobjects.la +libirssi_python_la_LIBADD = $(PYTHON_LDFLAGS) objects/libobjects.la +libirssi_python_la_LDFLAGS = -avoid-version + +INCLUDES = $(IRSSI_PYTHON_INCLUDES) \ + -I$(top_srcdir)/src/objects \ + -DSCRIPTDIR=\""$(datadir)/irssi/scripts"\" + +libirssi_python_la_SOURCES = \ + pycore.c \ + pyutils.c \ + pymodule.c \ + pyloader.c \ + pysignals.c\ + pysource.c \ + pythemes.c \ + pystatusbar.c \ + pyconstants.c + +noinst_HEADERS = \ + pyconstants.h \ + pycore.h \ + pyirssi.h \ + pyirssi_irc.h \ + pyloader.h \ + pymodule.h \ + pysigmap.h \ + pysignals.h \ + pysource.h \ + pystatusbar.h \ + pythemes.h \ + pyutils.h + +wrappers_DATA = irssi.py irssi_startup.py +EXTRA_DIST = $(wrappers_DATA) + +SUBDIRS = objects + +signalmap: + awk -f sig2code.awk $(IRSSI_DIST)/docs/signals.txt > pysigmap.h + +constants: + awk -f constants.awk constants.txt > pyconstants.c diff --git a/src/objects/Makefile b/src/objects/Makefile deleted file mode 100644 index 6cc56fb..0000000 --- a/src/objects/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -CC = gcc - -PYTHON = /usr/include/python2.4 -IRSSI = /home/chrisd/irssi-0.8.10 -CFLAGS = -fpic -ggdb -Wall -I$(PYTHON) -I$(IRSSI) -I$(IRSSI)/src \ --I$(IRSSI)/src/fe-common/core -I$(IRSSI)/src/core -I$(IRSSI)/src/fe-text \ --I$(IRSSI)/src/irc -I$(IRSSI)/src/irc/core -I$(IRSSI)/src/irc/dcc \ --I$(IRSSI)/src/irc/notifylist -I.. \ -`pkg-config glib-2.0 --cflags` - -OBJ = pyscript-object.o base-objects.o window-item-object.o channel-object.o \ -query-object.o server-object.o connect-object.o irc-server-object.o \ -irc-connect-object.o irc-channel-object.o ban-object.o nick-object.o \ -chatnet-object.o reconnect-object.o window-object.o textdest-object.o \ -rawlog-object.o log-object.o logitem-object.o ignore-object.o \ -dcc-object.o dcc-chat-object.o dcc-get-object.o dcc-send-object.o \ -netsplit-object.o netsplit-server-object.o netsplit-channel-object.o \ -notifylist-object.o process-object.o command-object.o theme-object.o \ -statusbar-item-object.o main-window-object.o factory.o - -pyobjects.a: $(OBJ) - ar r pyobjects.a $(OBJ) - -%.o: %.c - $(CC) -c $< $(CFLAGS) - -clean: - rm -f *.o *.so *.a diff --git a/src/objects/Makefile.am b/src/objects/Makefile.am new file mode 100644 index 0000000..4164e8f --- /dev/null +++ b/src/objects/Makefile.am @@ -0,0 +1,26 @@ +noinst_LTLIBRARIES = libobjects.la + +INCLUDES = $(IRSSI_PYTHON_INCLUDES) \ + -I$(top_srcdir)/src + +libobjects_la_SOURCES = \ + pyscript-object.c base-objects.c window-item-object.c channel-object.c \ + query-object.c server-object.c connect-object.c irc-server-object.c \ + irc-connect-object.c irc-channel-object.c ban-object.c nick-object.c \ + chatnet-object.c reconnect-object.c window-object.c textdest-object.c \ + rawlog-object.c log-object.c logitem-object.c ignore-object.c \ + dcc-object.c dcc-chat-object.c dcc-get-object.c dcc-send-object.c \ + netsplit-object.c netsplit-server-object.c netsplit-channel-object.c \ + notifylist-object.c process-object.c command-object.c theme-object.c \ + statusbar-item-object.c main-window-object.c factory.c + +noinst_HEADERS = \ + ban-object.h base-objects.h channel-object.h chatnet-object.h \ + command-object.h connect-object.h dcc-chat-object.h dcc-get-object.h \ + dcc-object.h dcc-send-object.h factory.h ignore-object.h \ + irc-channel-object.h irc-connect-object.h irc-server-object.h logitem-object.h \ + log-object.h main-window-object.h netsplit-channel-object.h netsplit-object.h \ + netsplit-server-object.h nick-object.h notifylist-object.h process-object.h \ + pyscript-object.h query-object.h rawlog-object.h reconnect-object.h \ + server-object.h statusbar-item-object.h textdest-object.h theme-object.h \ + window-item-object.h window-object.h diff --git a/src/pyloader.c b/src/pyloader.c index a087827..9c878a4 100644 --- a/src/pyloader.c +++ b/src/pyloader.c @@ -321,11 +321,14 @@ int pyloader_init(void) return 0; /* XXX: load autorun scripts here */ - /* Add script location to the load path (add more paths later) */ + /* Add script location to the load path */ pyhome = g_strdup_printf("%s/scripts", get_irssi_dir()); pyloader_add_script_path(pyhome); g_free(pyhome); - + + /* typically /usr/local/share/irssi/scripts */ + pyloader_add_script_path(SCRIPTDIR); + return 1; } -- cgit