aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macros/ChangeLog9
-rw-r--r--macros/Makefile.am2
-rw-r--r--macros/aclocal-include.m410
-rw-r--r--macros/gnome-x-checks.m459
-rw-r--r--macros/gnome.m47
5 files changed, 87 insertions, 0 deletions
diff --git a/macros/ChangeLog b/macros/ChangeLog
new file mode 100644
index 0000000000..a56b3147c3
--- /dev/null
+++ b/macros/ChangeLog
@@ -0,0 +1,9 @@
+1998-02-10 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4: New file. Moved AC_CHECK_GNOME from `configure.in' to
+ here, and renamed macro to GNOME_CHECK_GNOME.
+ * gnome-x-checks.m4: Likewise, move and renaming AC_GNOME_X_CHECKS
+ to GNOME_X_CHECKS.
+
+ * aclocal-include.m4: New file. Defines AM_ACLOCAL_INCLUDE macro
+ to provide extra search directories to `aclocal'.
diff --git a/macros/Makefile.am b/macros/Makefile.am
new file mode 100644
index 0000000000..d2969a8305
--- /dev/null
+++ b/macros/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST=aclocal-include.m4 \
+ gnome.m4 gnome-x-checks.m4
diff --git a/macros/aclocal-include.m4 b/macros/aclocal-include.m4
new file mode 100644
index 0000000000..c58c767db4
--- /dev/null
+++ b/macros/aclocal-include.m4
@@ -0,0 +1,10 @@
+# aclocal-include.m4
+#
+# This macro adds the name macrodir to the set of directories
+# that `aclocal' searches for macros.
+
+# serial 1
+
+dnl AM_ACLOCAL_INCLUDE(macrodir)
+AC_DEFUN([AM_ACLOCAL_INCLUDE],
+[ACLOCAL="$ACLOCAL -I $1"])
diff --git a/macros/gnome-x-checks.m4 b/macros/gnome-x-checks.m4
new file mode 100644
index 0000000000..4ffe519fe9
--- /dev/null
+++ b/macros/gnome-x-checks.m4
@@ -0,0 +1,59 @@
+AC_DEFUN([GNOME_X_CHECKS],
+[
+ AC_PATH_X
+ AC_PATH_XTRA
+
+ saved_cflags="$CFLAGS"
+ saved_ldflags="$LDFLAGS"
+
+ CFLAGS="$X_CFLAGS"
+ LDFLAGS="$X_LDFLAGS $X_LIBS"
+
+ dnl Checks for libraries.
+ AC_CHECK_LIB(X11, XOpenDisplay,
+ x_libs="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS",
+ [AC_MSG_ERROR(No X11 installed)],
+ $X_EXTRA_LIBS)
+ AC_SUBST(x_libs)
+
+ LDFLAGS="$saved_ldflags $X_LDFLAGS $X_LIBS $x_libs"
+
+ AC_CHECK_LIB(Xext, XShmAttach,
+ x_libs="$x_libs -lXext", ,
+ $x_libs)
+
+ gnome_cv_passdown_x_libs="$x_libs"
+ gnome_cv_passdown_X_LIBS="$X_LIBS"
+ gnome_cv_passdown_X_CFLAGS="$X_CFLAGS"
+
+ LDFLAGS="$saved_ldflags $X_LDFLAGS $X_LIBS"
+
+ dnl Assume that if we have -lSM then we also have -lICE.
+ AC_CHECK_LIB(SM, SmcSaveYourselfDone,
+ [AC_DEFINE(HAVE_LIBSM)
+ x_libs="$x_libs -lSM -lICE"], ,
+ $x_libs -lICE)
+ AM_CONDITIONAL(ENABLE_GSM,
+ test "x$ac_cv_lib_SM_SmcSaveYourselfDone" = "xyes")
+
+ AC_CHECK_LIB(gtk, gdk_pixmap_unref,
+ GTK_LIBS="-lgtk -lgdk -lglib -lm",
+ [AC_MSG_ERROR(Can not find a Gtk 0.99.1, probably you have an older version?)],
+ -lgdk -lglib $x_libs -lm)
+ AC_SUBST(GTK_LIBS)
+
+ gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
+
+ XPM_LIBS=""
+ AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
+ AC_SUBST(XPM_LIBS)
+
+ PTHREAD_LIB=""
+ AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
+ [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r")])
+ AC_SUBST(PTHREAD_LIB)
+
+ CFLAGS="$saved_cflags $X_CFLAGS"
+ LDFLAGS="$saved_ldflags"
+ AC_PROVIDE([GNOME_X_CHECKS])
+])
diff --git a/macros/gnome.m4 b/macros/gnome.m4
new file mode 100644
index 0000000000..08e2943280
--- /dev/null
+++ b/macros/gnome.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([GNOME_CHECK_GNOME],
+[
+ AC_REQUIRE([GNOME_X_CHECKS])
+ AC_CHECK_LIB(gnome, gnome_init, [GNOME_LIBS="-lgnome -lgnomeui"],[
+ AC_MSG_ERROR(Gnome libraries not found)],[
+ "$GTK_LIBS $x_libs"])
+])