[Xfce4-commits] <thunarx-python:master> Improved the build scripts a little

Adam Plumb noreply at xfce.org
Thu May 27 18:10:41 CEST 2010


Updating branch refs/heads/master
         to cbc0041f04a13e9786204b9f98d43e1d7a00f3a4 (commit)
       from 151b583a75786ee84c9e3d8a7d040b57cf556e13 (commit)

commit cbc0041f04a13e9786204b9f98d43e1d7a00f3a4
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Thu Sep 17 21:03:05 2009 -0400

    Improved the build scripts a little

 configure.ac    |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/Makefile.am |   44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..fc6b3f2
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,60 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+AC_INIT(thunarx-python, 0.0.1)
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([src/thunarx-python.h])
+AC_CONFIG_HEADER([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Check for Python
+AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])
+
+# Check for programs
+PKG_CHECK_MODULES([THUNARX], [thunarx-1 >= 0.4.0])
+PKG_CHECK_PACKAGE([GTK], [gtk+-2.0 >= 2.6.0])
+PKG_CHECK_PACKAGE([GLIB], [glib-2.0 >= 2.6.0])
+PKG_CHECK_PACKAGE([GOBJECT], [gobject-2.0 >= 2.6.0])
+PKG_CHECK_PACKAGE([PYGTK], [pygtk-2.0 >= 2.8.0]
+
+PACKAGE_CFLAGS="-g -Wall $THUNARX_CFLAGS $APR_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GOBJECT_CFLAGS"
+PACKAGE_LIBS="-g $THUNARX_LIBS $APR_LIBS $GTK_LIBS $GLIB_LIBS $GOBJECT_LIBS"
+PACKAGE_LDFLAGS="$THUNARX_LDFLAGS $APR_LDFLAGS $GTK_LDFLAGS $GLIB_LDFLAGS $GOBJECT_LDFLAGS"
+PACKAGE_CPPFLAGS="$THUNARX_CPPFLAGS $APR_CPPFLAGS $GTK_CPPFLAGS $GLIB_CPPFLAGS $GOBJECT_CPPFLAGS"
+
+# Make dependency CFLAGS and LIBS available
+AC_SUBST(PACKAGE_CFLAGS)
+AC_SUBST(PACKAGE_LIBS)
+AC_SUBST(PACKAGE_LDFLAGS)
+AC_SUBST(PACKAGE_CPPFLAGS)
+
+AC_MSG_CHECKING(for pygtk defs)
+PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
+AC_SUBST(PYGTK_DEFSDIR)
+AC_MSG_RESULT($PYGTK_DEFSDIR)
+
+AC_MSG_CHECKING(for pygtk codegen)
+PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
+AC_SUBST(PYGTK_CODEGEN)
+AC_MSG_RESULT($PYGTK_CODEGEN)
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+
+# Checks for library functions.
+AC_CHECK_FUNCS([setenv])
+
+AC_CONFIG_FILES([
+Makefile
+src/Makefile
+])
+AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..d45f29b
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,44 @@
+thunar_extensiondir=$(libdir)/thunarx-1
+
+thunar_extension_LTLIBRARIES = thunarx-python.la
+
+thunarx_python_la_SOURCES = \
+    thunarx_python-object.c                 \
+    thunarx_python-object.h                 \
+    thunarx_python.c                        \
+    thunarx_python.h
+
+thunarx_python_la_LIBADD = \
+    $(PACKAGE_LIBS)         \
+    $(PYTHON_LIBS)
+ 
+thunarx_python_la_LDFLAGS = \
+    -module -pthread
+    $(PACKAGE_LDFLAGS)
+ 
+thunarx_python_la_CPPFLAGS = \
+    $(PACKAGE_CPPFLAGS)
+ 
+thunarx_python_la_CFLAGS = \
+    $(PACKAGE_CFLAGS)
+ 
+pyexec_LTLIBRARIES = thunarx.la
+pyexecdir = $(libdir)/thunarx-1/thunarx-python
+
+thunarx_la_LIBADD = $(PACKAGE_LIBS)
+thunarx_la_SOURCES = thunarxmodule.c
+nodist_thunarx_la_SOURCES = thunarx.c
+thunarx.c: thunarx.defs thunarx.override
+CLEANFILES = thunarx.c
+EXTRA_DIST = thunarx.override thunarx.defs
+
+.defs.c:
+	(cd $(srcdir)\
+         && $(PYGTK_CODEGEN) \
+	    --register $(PYGTK_DEFSDIR)/pango-types.defs \
+            --register $(PYGTK_DEFSDIR)/gdk-types.defs \
+            --register $(PYGTK_DEFSDIR)/gtk-types.defs \
+            --override $*.override \
+            --prefix py$* $*.defs) > gen-$*.c \
+        && cp gen-$*.c $*.c \
+        && rm -f gen-$*.c



More information about the Xfce4-commits mailing list