1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT([starplot],[0.95.5],[starplot@starplot.org])
AC_PREREQ(2.61) dnl required version of autoconf to rebuild
AM_INIT_AUTOMAKE(1.9) dnl required version of automake to rebuild
AC_USE_SYSTEM_EXTENSIONS dnl put this here to shut up some gettext.m4 warnings
AM_GNU_GETTEXT
AM_GNU_GETTEXT_VERSION(0.16.1)
AM_MAINTAINER_MODE
dnl Local program options.
dnl Make sure we're in the right directory.
AC_CONFIG_SRCDIR(src/gui/starplot.h)
dnl Create a config.h file.
AC_CONFIG_HEADER(config.h)
dnl Create appropriate variables.
AC_CONFIG_LIBOBJ_DIR(lib)
AC_SUBST(VERSION)
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_CANONICAL_HOST
AC_SUBST([exampledir], ['$(docdir)/examples'])
AC_SUBST([HTML_IMAGES], [`cd "$srcdir"/doc && echo html/images/*`])
AC_SUBST([HTML_PARFILES], [`cd "$srcdir"/doc && echo html/parfiles/*`])
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROG(has_pkg_config, pkg-config, yes, no)
if test "x$has_pkg_config" = "xno" ; then
AC_MSG_FAILURE([cannot find pkg-config program!])
fi
AC_ARG_WITH(webbrowser,
[ --with-webbrowser=PROGRAM Web browser to use for viewing help docs])
if test "x$with_webbrowser" != "x" ; then
AC_PATH_PROG(browserpath, "$with_webbrowser")
else
# Use /usr/bin/open for default browser on Mac OS X
if "$srcdir"/config.guess | grep -q apple-darwin ; then
AC_PATH_PROG(browserpath, open)
fi
fi
if test "x$browserpath" != "x" ; then
AC_DEFINE_UNQUOTED(BROWSER, "$browserpath",
[Path of WWW browser])
fi
dnl Checks for libraries.
LIBS="-lm"
save_libs="$LIBS"
AM_PATH_GTK_2_0(2.0.0, , AC_MSG_FAILURE([cannot find GTK+ 2.x library!]))
LIBS="$GTK_LIBS $LIBS"
dnl Checks for header files.
AC_LANG(C)
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(stdarg.h stdio.h stdlib.h locale.h sys/types.h unistd.h \
string.h, [],
[AC_MSG_FAILURE([cannot find required system header!])])
AC_LANG(C++)
AC_CHECK_HEADERS(string, [],
[AC_MSG_FAILURE([cannot find C++ STL string header!])])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_LANG(C)
AC_C_VOLATILE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
dnl Test for ostringstream
AC_LANG([C++])
AC_CHECK_TYPE([std::ostringstream],
[AC_DEFINE([HAVE_STD__OSTRINGSTREAM], 1,
[Define to 1 if you have the class std::ostringstream.])],
[AC_CHECK_TYPE([std::ostrstream],
[AC_DEFINE([HAVE_STD__OSTRSTREAM], 1,
[Define to 1 if you have std::ostrstream \
but not std::ostringstream.]) \
dnl AC_LIBOBJ provides no way to specify that the replacement file is not
dnl a .c file, so we can't use AC_LIBOBJ here, and also have to add
dnl ostringstream.cc explicitly in lib/Makefile.am
dnl AC_LIBOBJ([ostringstream])],
[AC_MSG_FAILURE([cannot find ostringstream or ostrstream!])],
[#include <strstream.h>])],
[#include <sstream>]
)
dnl Checks for library functions.
dnl AC_LANG(C) so I don't have to use the std:: namespace in these tests
AC_LANG(C)
AC_FUNC_FORK
if test "x$ac_cv_func_fork_works" = xno ; then
AC_MSG_FAILURE([cannot find working fork function!])
fi
AC_FUNC_VPRINTF
if test "x$ac_cv_func_vprintf" = xno ; then
AC_MSG_FAILURE([cannot find working vprintf function!])
fi
AC_CHECK_FUNCS(vsprintf execvp strcmp log exp atan, [],
[AC_MSG_FAILURE([cannot find $ac_func function!])])
AC_CHECK_FUNCS(bind_textdomain_codeset, [],
[AC_MSG_WARN([cannot find $ac_func - you may need to use a UTF-8 locale.])])
AC_CHECK_FUNCS(gtk_expander_new, [], [])
AC_FUNC_STRTOD
if test "x$ac_cv_func_strtod" = xyes ; then
AC_DEFINE(HAVE_STRTOD, 1,
[Define to 1 if you have a working strtod function.])
AC_LIBOBJ([strtod])
fi
dnl These ones I can actually write replacement code for...
AC_REPLACE_FUNCS(pow log10 floor sqrt atan2 strtol strlen snprintf vsnprintf)
dnl Local configuration variables.
LIBS="$save_libs"
AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in m4/Makefile
doc/Makefile lib/Makefile src/Makefile])
AC_CONFIG_FILES([src/convert/starpkg])
AC_OUTPUT
|