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 206 207 208 209
|
dnl $Id: $
dnl PURPOSE: configure clips package for unix systems.
dnl AUTHOR: Javier Fernandez-Sanguino Pen~a <jfs@debian.org>
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision: $)
AC_INIT(configure.in)
VERSION_MAJOR="6"
VERSION_MINOR="30"
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}"
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION)
HAVE_GENERIC=0
HAVE_UNIX_V=0
HAVE_UNIX_7=0
WANT_EMACS_EDITOR=0
WANT_WINDOW_INTERFACE=0
AC_SUBST(HAVE_GENERIC)
AC_SUBST(HAVE_UNIX_V)
AC_SUBST(HAVE_UNIX_7)
AC_SUBST(WANT_EMACS_EDITOR)
AC_SUBST(WANT_WINDOW_INTERFACE)
dnl Create config files
AC_CONFIG_HEADER(clips_config.h)
dnl Checks for editor support (like emacs)
AC_ARG_ENABLE(emeditor,
[ --enable-emeditor build internal (like emacs) editor])
if test "$enable_emeditor" = yes; then
WANT_EMACS_EDITOR=1
AC_CHECK_LIB(termcap, main)
fi
dnl Checks for X support (xclips)
AC_ARG_ENABLE(xclips,
[ --enable-xclips build xclips instead clips])
if test "$enable_xclips" = yes; then
WANT_WINDOW_INTERFACE=1
fi
dnl ----------------------------
dnl Checks for programs.
dnl
AC_PATH_PROGS(SH, sh)
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PROG_INSTALL
AC_CHECK_PROGS(MKINSTALLDIRS,mkinstalldirs,no)
if test $MKINSTALLDIRS = no; then
AC_MSG_WARN(You need 'mkinstalldirs' utility to build binary distributions.)
fi
AC_CHECK_PROG(HAVE_AUTOCONF, autoconf, yes)
dnl ----------------------------
dnl Checks for libraries.
dnl
AC_CHECK_LIB(m,main)
dnl This is a litle strange. It must place next line before call
dnl AC_PATH_X macro (AC_PATH_aunAC_PATH_os 5.5.1) ?;-\ to avoid further
dnl configure problems
AC_CHECK_HEADERS( stdio.h )
if (test "${WANT_WINDOW_INTERFACE}" = 1); then
dnl Checks for X-files.
AC_CHECK_LIB(socket,socket)
AC_PATH_X
AC_SUBST(x_libraries)
LDFLAGS="$LDFLAGS ${x_libraries:+-L$x_libraries}"
dnl WARNING: library search ORDER is very important !!!!
AC_CHECK_LIB(X11,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(Xext,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(ICE,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(SM,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(Xt,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(Xmu,main,,,${x_libraries:+-L$x_libraries})
AC_CHECK_LIB(Xaw3d, main,,
AC_CHECK_LIB(Xaw, main,,,
${x_libraries:+-L$x_libraries}),
${x_libraries:+-L$x_libraries})
fi
dnl ----------------------------
dnl Checks for header files.
dnl
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS( fcntl.h limits.h malloc.h sgtty.h strings.h )
dnl ----------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
dnl AC_TYPE_SIZE_T
AC_STRUCT_TM
dnl ----------------------------
dnl Checks for library functions.
dnl
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(ftime getwd)
dnl ----------------------------
dnl Check for system characteristics.
dnl
AC_MSG_CHECKING([system version])
system=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_RESULT([unknown (can't find uname command)])
system=unknown
else
# Special check for weird MP-RAS system (uname returns weird
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
system=MP-RAS-`awk '{print $3}' /etc/.relid`
fi
if test "`uname -s`" = "AIX" ; then
system=AIX-`uname -v`.`uname -r`
fi
AC_MSG_RESULT($system)
fi
case $system in
BSD/OS-2.1*|BSD/OS-3*)
HAVE_UNIX_V=1
;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
HAVE_UNIX_V=1
;;
Linux*)
HAVE_UNIX_V=1
;;
NetBSD-*|FreeBSD-*|OpenBSD-*)
HAVE_UNIX_V=1
;;
SunOS-4*)
HAVE_UNIX_7=1
AC_DEFINE(SOLARIS)
;;
UNIX_SV*)
HAVE_UNIX_V=1
;;
*)
HAVE_GENERIC=1
;;
esac
#
# Debido al uso indiscriminado de globales y su utilizacin como
# arrays en funciones como "getwd", el no forzar -fno-common
# es motivo de una gran inestabilidad, sobre todo en ciertas funciones
# definidas en "xmenu_file.c".
#
CFLAGS="$CFLAGS -fno-common"
dnl Checks for statically linked clips
AC_ARG_ENABLE(static-clips,
[ --enable-static-clips build statically linked clips])
if test "$enable_static_clips" = yes; then
WANT_STATIC_CLIPS=yes
AC_SUBST(WANT_STATIC_CLIPS)
fi
dnl Checks for debug
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging ])
if test "$enable_debug" = yes; then
AC_DEFINE(DEBUG)
CFLAGS="$CFLAGS -g -Wall"
CXXFLAGS="$CXXFLAGS -g -Wall"
AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
fi
dnl Checks for no compiler optimization
AC_ARG_ENABLE(nooptimize,
[ --enable-nooptimize enable don't optimize])
if test "$enable_nooptimize" = yes; then
CFLAGS="$CFLAGS -O0"
CXXFLAGS="$CXXFLAGS -O0"
fi
if test `expr "$CFLAGS" : ".*-g"` -eq 0 ; then
CFLAGS="$CFLAGS -fomit-frame-pointer"
fi
AC_OUTPUT([
Makefile
],
echo timestamp > .stamp-h.in)
|