--- /dev/null
+#!/bin/bash
+
+set -x
+
+mkdir -p config
+
+# Create an aclocal file with macros for libtool.
+touch aclocal.m4
+
+if [ -e /usr/local/share/aclocal/libtool.m4 ]
+then
+ cat /usr/local/share/aclocal/libtool.m4 >> aclocal.m4
+fi
+
+if [ -e /usr/share/aclocal/libtool.m4 ]
+then
+ cat /usr/share/aclocal/libtool.m4 >> aclocal.m4
+fi
+
+libtoolize --copy
+aclocal
+autoheader
+automake --gnu --add-missing
+autoconf
+
+cp -r config config.new
+rm -rf config
+mv config.new config
--- /dev/null
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT(InterAspect, 0.9.0)
+AC_CONFIG_SRCDIR([src/aop-main.c])
+# Note that we do not generate a config.h because GCC already uses a
+# config.h that plugins must include.
+#AC_CONFIG_HEADER([config.h])
+AC_CONFIG_AUX_DIR(config)
+
+m4_include(m4/ax_gcc_plugin.m4)
+
+AM_INIT_AUTOMAKE
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+# Get the plugin includes directory.
+AX_GCC_PLUGIN
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+
+AC_OUTPUT
--- /dev/null
+# SYNOPSIS
+#
+# AX_GCC_PLUGIN
+#
+# DESCRIPTION
+#
+# This macro locates the headers necessary to compile a GCC plug-in.
+#
+# If the --with-gcc-includes option is set to a directory, the macro
+# checks for the tree.def header in that directory. Otherwise, it
+# looks for the include directory belonging to the actual build
+# compiler (speified with CC).
+#
+# AX_GCC_PLUGIN() fails with an error if it cannot find tree.def.
+#
+# This macro calls:
+#
+# AC_SUBST(gcc_includes)
+#
+# LICENSE
+#
+# Copyright (c) 2009 Stony Brook University
+#
+# Copying and distribution of this file, with or without
+# modification, are permitted in any medium without royalty provided
+# the copyright notice and this notice are preserved.
+
+AC_DEFUN([AX_GCC_PLUGIN],
+[
+ AC_ARG_WITH(
+ [gcc_includes],
+ AC_HELP_STRING([--with-gcc-includes], [Full path to directory with gcc plug-in header files. By default configure will ask GCC for this directory.]),
+ [gcc_includes=$withval],
+ [gcc_includes=`"$CC" -print-file-name=plugin`/include])
+
+ # Don't let the user specify --with-gcc-includes=no or --without-gcc-includes.
+ # That's bogus.
+ AS_IF(
+ [test "x$gcc_includes" == xno],
+ AC_MSG_FAILURE([Plug-ins cannot compile without a plug-in includes directory.]))
+
+ # If you ask a pre-plug-in GCC for the plug-in includes directory,
+ # it just returns "plugin"
+ AS_IF(
+ [test "x$gcc_includes" == xplugin/include],
+ AC_MSG_FAILURE([Bad plugin directory. It looks like you are not using a plug-in-capable GCC.]))
+
+ # Make sure the path looks like an absolute path.
+ case "$gcc_includes" in
+ /*) ;;
+ ~*) ;;
+ *)
+ gcc_includes==`pwd`/$gcc_includes
+ ;;
+ esac
+
+ # Final check. Did we actually find a directory with plug-in header files?
+ AS_IF(
+ [test "x$gcc_includes" == x -o ! -f "$gcc_includes/tree.def"],
+ AC_MSG_FAILURE([Cannot find plug-in headers in $gcc_includes]))
+
+ AC_MSG_NOTICE([Using GCC headers at $gcc_includes])
+ AC_SUBST([gcc_includes], [$gcc_includes])
+])