1# Avoid default CXXFLAGS of "-g -O2"
2AC_DEFUN([SC_SET_CXXFLAGS],
3[if test "$CXXFLAGS" = ""; then
4  CXXFLAGS="-O3 -g"
5fi
6])
7
8# Process this file with autoconf to produce a configure script.
9AC_INIT(SharpConstruct, 0.11, nicholasbishop@gmail.com, sharpconstruct)
10AC_CONFIG_AUX_DIR([config])
11AM_INIT_AUTOMAKE
12
13AM_CONFIG_HEADER([config/config.h])
14AC_SUBST(VERSION)
15
16# RANT:
17# The ******* who created autoconf set the CXXFLAGS variable to
18# include -g -O2. I'm sure there's a good reason for this, and maybe an
19# easy way to work around it, but from where I'm standing, it looks like
20# a really dumb thing to do. I mean, "AC_PROG_CXX" sure sounds like it
21# ought to be finding the _compiler_, not setting optimization flags.
22SC_SET_CXXFLAGS
23
24AC_PROG_CXX
25
26# Small library for prefix-independence
27AM_BINRELOC
28
29# Check for posix_memalign
30AC_CHECK_FUNCS(posix_memalign)
31
32# Check for gtk+
33PKG_CHECK_MODULES(gtk, gtk+-2.0 >= 2.8.0)
34
35# Check for libglademm
36PKG_CHECK_MODULES(libglademm, libglademm-2.4 >= 2.6.0)
37AC_SUBST([libglademm_CFLAGS])
38AC_SUBST([libglademm_LIBS])
39
40# Check for gtkglextmm
41PKG_CHECK_MODULES(gtkglextmm, gtkglextmm-1.2 >= 1.0.0)
42AC_SUBST([gtkglextmm_CFLAGS])
43AC_SUBST([gtkglextmm_LIBS])
44
45# Check for (optional) rendering library
46#AC_CHECK_HEADERS([aqsis/ri.h],
47#[AC_CHECK_LIB(ri2rib, RiBegin)])
48
49# Check for libXpm
50# Not sure how to do this other than to check for all of X.
51# Which hopefully has xpm.
52AC_PATH_XTRA
53
54AC_OUTPUT(
55	Makefile
56	src/Makefile
57	doc/Makefile
58	include/Makefile
59	share/Makefile
60	share/sharpconstruct/Makefile
61	share/sharpconstruct/brushes/Makefile
62	share/sharpconstruct/interface/Makefile)
63