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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
|
dnl Process this file with autoconf to produce a configure script.
dnl
dnl ./configure script for GOM (Gom is nOt yet another Mixer)
dnl (c) Copyright Stephan Suerken 1996, 1997
dnl
AC_INIT(gom.c)
dnl AC_PREREQ(2.10)
dnl
dnl automake 1.2 / autoconf 2.12 bug (?!) fix: occurs with make distcheck
dnl
dnl AUTOMAKE=automake
dnl AC_SUBST(AUTOMAKE)
dnl
dnl DISTRIBUTION
dnl
PACKAGE=gom
VERSION=0.29.10
DATE="1997 Sep 23"
dnl
dnl END DISTRIBUTION
dnl
dnl package, version: required for makefile
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
dnl version, date: required by gom
AC_DEFINE_UNQUOTED(GOM_VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(GOM_DATE, "$DATE")
AC_PROG_INSTALL
AC_ARG_PROGRAM
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
dnl GOM-LOCAL-BUILD-OPTIONS
gom_echo_prefix="GOM LOCAL:"
gom_t_gomii_warnings="none"
gom_x_gomii_warnings="none"
AC_ARG_ENABLE(t-gomii,
--enable-t-gomii Force enabling/disabling of terminal gomii [[yes]],
[
GOM_ENABLE_T_GOMII=$enableval
echo "$gom_echo_prefix User-enforced: GOM_ENABLE_T_GOMII=$GOM_ENABLE_T_GOMII"
],
[
GOM_ENABLE_T_GOMII=yes
])
AC_ARG_ENABLE(x-gomii,
--enable-x-gomii Force enabling/disabling of x gomii [[yes]],
[
GOM_ENABLE_X_GOMII=$enableval
echo "$gom_echo_prefix User-enforced: GOM_ENABLE_X_GOMII=$GOM_ENABLE_X_GOMII"
],
[
GOM_ENABLE_X_GOMII=yes
])
dnl CHECKS FOR LIBRARIES.
if [[ "$GOM_ENABLE_T_GOMII" = "yes" ]]; then
AC_CHECK_LIB(ncurses, main,
[
LIBS="$LIBS -lncurses"
],
[
GOM_ENABLE_T_GOMII=no
echo "$gom_echo_prefix Autodisabling: GOM_ENABLE_T_GOMII=$GOM_ENABLE_T_GOMII"
])
fi
dnl This may still link to existing, but unneeded x libs in some conditions
dnl I.e.: GOM_ENABLE_X_GOMII" = "yes", libX11 exist, xview libs don't exist:
dnl -> gom will still be linked to libX11 (well...)
if [[ "$GOM_ENABLE_X_GOMII" = "yes" ]]; then
AC_CHECK_LIB(X11, main,
[
LIBS="$LIBS -lX11"
],
[
GOM_ENABLE_X_GOMII=no
echo "$gom_echo_prefix Autodisabling: GOM_ENABLE_X_GOMII=$GOM_ENABLE_X_GOMII"
])
fi
if [[ "$GOM_ENABLE_X_GOMII" = "yes" ]]; then
AC_CHECK_LIB(olgx, main,
[
LIBS="$LIBS -lolgx"
],
[
GOM_ENABLE_X_GOMII=no
echo "$gom_echo_prefix Autodisabling: GOM_ENABLE_X_GOMII=$GOM_ENABLE_X_GOMII"
])
fi
if [[ "$GOM_ENABLE_X_GOMII" = "yes" ]]; then
AC_CHECK_LIB(xview, main,
[
LIBS="$LIBS -lxview"
],
[
GOM_ENABLE_X_GOMII=no
echo "$gom_echo_prefix Autodisabling: GOM_ENABLE_X_GOMII=$GOM_ENABLE_X_GOMII"
])
fi
dnl CHECKS FOR HEADER FILES
dnl ANSI C?
AC_HEADER_STDC
dnl others?
AC_CHECK_HEADERS(unistd.h getopt.h fcntl.h sys/ioctl.h sys/soundcard.h)
if [[ "$GOM_ENABLE_T_GOMII" = "yes" ]]; then
AC_CHECK_HEADERS(ncurses.h curses.h)
if [[ "$ac_cv_header_ncurses_h" = "no" ]] && [[ "$ac_cv_header_curses_h" = "no" ]]; then
gom_t_gomii_warnings="-lncurses exists, but neither curses.h nor ncurses.h"
fi
fi
if [[ "$GOM_ENABLE_X_GOMII" = "yes" ]]; then
AC_CHECK_HEADERS(xview/frame.h xview/panel.h)
if [[ "$ac_cv_header_xview_frame_h" = "no" ]] || [[ "$ac_cv_header_xview_panel_h" = "no" ]]; then
gom_x_gomii_warnings="xview libs exist, but xview/frame.h or xview/panel.h is missing"
fi
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(snprintf vsnprintf)
dnl AC_FUNC_VPRINTF
dnl AC_CHECK_FUNCS(strerror)
dnl map enable options to defines
if [[ "$GOM_ENABLE_X_GOMII" = "yes" ]]; then
AC_DEFINE(GOM_ENABLE_X_GOMII)
fi
if [[ "$GOM_ENABLE_T_GOMII" = "yes" ]]; then
AC_DEFINE(GOM_ENABLE_T_GOMII)
fi
if [[ "$GOM_ENABLE_T_GOMII" = "yes" ]]; then
AC_DEFINE(GOM_ENABLE_T_GOMII)
fi
dnl Create link to correct sound device driver (currently only OSS)
ln -sfv $srcdir/gom_driver_oss.c $srcdir/gom_driver.c
ln -sfv $srcdir/gom_driver_oss.h $srcdir/gom_driver.h
AC_OUTPUT(Makefile)
cat <<EOF
Notes on gom's GNU autoconf "./configure" script:"
The command line interface is always compiled in. All gomiis are on
by default. These defaults can be changed using --[[en|dis]]able-*
(see "./configure --help"). The defaults are auto-deselected by
"./configure" if the needed libraries can't be found.
Remember that you need to do "make clean" if you reconfigure, but
have successfully compiled before with other options (else make won't
recompile); if you change your system's configuration, you might need
to run "make distclean" first, then rerun "./configure".
KNOWN BUGS: Essential warnings are produced, but they are not
complete (i.e. gom might still fail to compile even without
warnings). Gom basically is designed compile on a POSIX.1 system with
a C library conforming to ANSI C. GNU extensions are welcome, and used
if appropriate. At the moment, I knowingly use the GNU extensions
[v]snprintf _without_ patch for non-gnu systems. Maybe I still
unknowingly use some other GNU extensions.
EOF
echo "I have computed the following:"
echo ""
echo " ----------------------------------------------------"
echo " Built-in terminal gomii: $GOM_ENABLE_T_GOMII (Warnings: $gom_t_gomii_warnings)"
echo " Built-in x gomii : $GOM_ENABLE_X_GOMII (Warnings: $gom_x_gomii_warnings)"
echo -n " Overall warnings : "
if [[ "$ac_cv_header_stdc" != "yes" ]]; then
echo -n "No ANSI C headers. "
fi
if [[ "$ac_cv_header_unistd_h" != "yes" ]]; then
echo -n "Not a POSIX.1 system. "
fi
if [[ "$ac_cv_func_snprintf" != "yes" ]]; then
echo -n "GNU extension snprintf not found. "
fi
if [[ "$ac_cv_func_vsnprintf" != "yes" ]]; then
echo -n "GNU extension vsnprintf not found. "
fi
if [[ "$ac_cv_header_sys_soundcard_h" != "yes" ]]; then
echo -n "No sound card header file. "
fi
echo -n "No (more) warnings."
echo ""
echo " ----------------------------------------------------"
echo ""
echo "Now type \"make\" to compile with these options."
|