add g-wrap patch and discussion of it in INSTALL instructions.
[gwave-svn.git] / configure.ac
blob4c9fc6867ff88d9b4eee433ba21b5df000b6b633
1 dnl Process this file with autoconf to produce a configure script.
2 dnl ## Initialize autoconf ##
4 AC_INIT(src/gwave.c)
5 AM_INIT_AUTOMAKE(gwave2, 20090211)
6 AM_MAINTAINER_MODE
7 AM_CONFIG_HEADER(config.h)
9 dnl Use ANSI mode
10 AM_PROG_CC_STDC
12 dnl ## Checks for programs ##
13 AC_PROG_CC
14 AC_PROG_RANLIB
15 AC_PROG_LN_S
16 AC_PATH_PROGS(PERL, perl perl5, no)
17 AC_SUBST(PERL)
19 # this tries to find GNU graph only, not traditional berkeley/sysv graph,
20 # so we do the right thing on solaris, where an unusable one is in /usr/bin
21 # and the graph we want is usually in /usr/local/bin or some such.
22 AC_ARG_WITH(graph, [full pathname to GNU graph for postscript plotting])
23 dnl AC_MSG_RESULT(with_graph is $with_graph)
24 if test "$with_graph" != no; then
25         if test "$with_graph" != yes && test ! -z "$with_graph" ; then
26                 AC_DEFINE_UNQUOTED(PROG_GRAPH, "$with_graph", [If present, the pathname of graph, from GNU plotutils.])
27         else
28                 AC_PROG_GREPSTDOUT(GRAPH, graph --version, GNU, $ac_dir/$ac_word)
29                 AC_DEFINE_UNQUOTED(PROG_GRAPH, "$GRAPH", [If present, the pathname of graph, from GNU plotutils.])
30         fi
33 dnl do we need libtool? 
34 dnl even though we aren't building shared libraries, it seemed to help on HP-UX
35 dnl AM_PROG_LIBTOOL
37 dnl Checks for typedefs, structures, and compiler characteristics.
38 AC_C_CONST
40 dnl Checks for library functions.
41 AC_FUNC_MEMCMP
43 dnl check for posix regular expression routines
44 AC_CHECK_HEADER([regex.h], [AC_CHECK_FUNC([regcomp], [AC_DEFINE(HAVE_POSIX_REGEXP,1,[defined if we have POSIX regular expression routines])])])
46 AC_CHECK_HEADERS([sys/types.h])
48 dnl check for GTK+
49 AM_PATH_GTK_2_0(2.8.0, AC_DEFINE(HAVE_GTK2,1,defined if we have a new enough GTK2), AC_MSG_ERROR(Can not find GTK+ 2.8.0 or later on this system))
51 dnl check for gtk/glib features
52 AC_CHECK_LIB(c, g_slice_set_config, AC_DEFINE(HAVE_G_SLICE_SET_CONFIG,1,[Define this if your version of glib2 has the slice allocator and g_slice_set_config]),,[$GTK_LIBS])
55 dnl check for readline library
56 AC_CHECK_LIB(termcap, tgoto, [
57         AC_CHECK_LIB(readline, readline, [
58         READLINE_LIB="-lreadline -ltermcap"
59         AC_DEFINE(HAVE_READLINE,1,[Define this if you have the readline library])
60         AC_CHECK_LIB(readline, add_history, AC_DEFINE(HAVE_HISTORY,1,[Define this if your readline also has add_history]),,"-ltermcap"
62         ], READLINE_LIB="", "-ltermcap")  
63 ], AC_CHECK_LIB(ncurses, tgoto, [
64         AC_CHECK_LIB(readline, readline, [
65                 READLINE_LIB="-lreadline -lncurses"
66                 AC_DEFINE(HAVE_READLINE,1,[Define this if you have the readline library])
67                 AC_CHECK_LIB(readline, add_history, AC_DEFINE(HAVE_HISTORY,1,[Define this if your readline also has add_history]),,"-l
68 ncurses")
69         ], READLINE_LIB="", "-lncurses")
70 ], READLINE_LIB=""))
72 AC_SUBST(READLINE_LIB)
75 dnl check for guile
76 GUILE_FLAGS
78 dnl checks for guile version-specific features, if any
81 dnl check for guile-gnome-platform
83 GUILE_MODULE_REQUIRED(gnome-2)
84 dnl GUILE_MODULE_REQUIRED(gnome gtk)
86 PKG_CHECK_MODULES(GUILE_GNOME, guile-gnome-gtk-2, ,AC_MSG_ERROR(Can not find Guile-gnome-platform))
88 dnl remind myself how to check for somthing I know exists
89 dnl GUILE_MODULE_EXPORTS(foo_widget_show, (gnome-0)(gnome gtk),gtk-widget-show)
90 dnl if test "$foo_widget_show" = yes; then
91 dnl  AC_DEFINE(FOO_WIDGET_SHOW,1,"Defined if guile-gnome module (gnome gtk) already contains gtk-widget-show")
92 dnl fi
94 GUILE_MODULE_EXPORTS(have_guile_gtk_menu_popup,(gnome-2)(gnome gtk),gtk-menu-popup)
95 if test "$have_guile_gtk_menu_popup" = yes; then
96  AC_DEFINE(HAVE_GUILE_GTK_MENU_POPUP,1,"Defined if guile-gnome module (gnome gtk) already contains gtk-menu-popup")
100 dnl doesn't work if prefix isn't specified.
101 dnl AC_DEFINE_UNQUOTED(DATADIR,"${datadir}",Installation prefix for finding necessary guile code)
103 AC_OUTPUT(Makefile \
104 src/Makefile spicefile/Makefile scheme/Makefile \
105 src/app/Makefile \
106 remote/Makefile \
107 utilities/Makefile \
108 utilities/gwave-doc-snarf \
109 utilities/doc-split \
110 utilities/sweepsplit \
111 gwave.spec  \
112 scheme/gwave-config.scm)