summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Davis <loafier@gmail.com>2006-08-14 04:45:46 +0000
committerChristopher Davis <loafier@gmail.com>2006-08-14 04:45:46 +0000
commitce3d6fcba4587feb5555a9b85c6fdeaa0b74553f (patch)
tree73de668e3b48b475ae1fac6a8317f577ec2c0663 /src
parent3a028090359e5d5d24ccbfc11d9b6ff5681aab4f (diff)
downloadirssi-python-ce3d6fcba4587feb5555a9b85c6fdeaa0b74553f.tar.gz
irssi-python-ce3d6fcba4587feb5555a9b85c6fdeaa0b74553f.tar.xz
irssi-python-ce3d6fcba4587feb5555a9b85c6fdeaa0b74553f.zip
adding autotool stuff
git-svn-id: http://svn.irssi.org/repos/irssi-python@4313 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/Makefile35
-rw-r--r--src/Makefile.am47
-rw-r--r--src/objects/Makefile28
-rw-r--r--src/objects/Makefile.am26
-rw-r--r--src/pyloader.c7
5 files changed, 78 insertions, 65 deletions
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;
}