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 210 211 212 213
|
dnl ---------------------------------------------------------------------------
dnl Process this file with autoconf to produce a configure script.
dnl $Id$
dnl ---------------------------------------------------------------------------
AC_INIT(src/main.c)
GNP_MAJOR_VERSION=1
GNP_MINOR_VERSION=0
GNP_MICRO_VERSION=2
GNP_VERSION=$GNP_MAJOR_VERSION.$GNP_MINOR_VERSION.$GNP_MICRO_VERSION
dnl ---------------------------------------------------------------------------
dnl for automake:
dnl ---------------------------------------------------------------------------
AUTOMAKE_OPTIONS=no-dependencies
VERSION=$GNP_VERSION
PACKAGE=gnotepad+
dnl ---------------------------------------------------------------------------
dnl Initialize automake now
dnl ---------------------------------------------------------------------------
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_SUBST(GNP_VERSION)
AC_PREFIX_DEFAULT(/usr/local)
dnl ---------------------------------------------------------------------------
dnl checks for needed compilers
dnl ---------------------------------------------------------------------------
dnl CFLAGS=""
dnl if test x${CFLAGS+set} = xset ; then
dnl :
dnl else
dnl CFLAGS="-O2 -g"
dnl fi
AC_PROG_CC
dnl AC_PROG_CXX
dnl AC_PROG_RANLIB
dnl ---------------------------------------------------------------------------
dnl clean compiles
dnl ---------------------------------------------------------------------------
compiler_warnings=yes
AC_ARG_ENABLE(
warnings,
[ --disable-warnings turn OFF gcc compiler warnings (not recommended)],
[if test $enableval = no; then
compiler_warnings=no
fi]
)
dnl ---------------------------------------------------------------------------
dnl ansi warnings
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(
ansi,
[ --enable-ansi turn ON gcc strict ansi checking [default=no]],
,
enable_ansi=no)
if test "$ac_cv_prog_CC" = gcc -o "$ac_cv_prog_CC" = g++; then
if test $compiler_warnings = yes; then
if echo "$CFLAGS" | grep "\-Wall" > /dev/null 2> /dev/null; then
CFLAGS="$CFLAGS"
else
CFLAGS="$CFLAGS -Wall"
wall_flag=yes
fi
if echo "$CFLAGS" | grep "\-Wmissing-prototypes" > /dev/null 2> /dev/null; then
CFLAGS="$CFLAGS"
else
CFLAGS="$CFLAGS -Wmissing-prototypes"
missing_proto_flag=yes
fi
if test "$wall_flag" = yes -a "$missing_proto_flag" = yes; then
echo "updating CFLAGS with extra '-Wall -Wmissing-prototypes' options"
else
if test "$wall_flag" = yes; then
echo "updating CFLAGS with extra '-Wall' option"
else
if test "$missing_proto_flag" = yes; then
echo "updating CFLAGS with extra '-Wmissing-prototypes' option"
fi
fi
fi
fi
if test "$enable_ansi" = yes; then
if echo "$CFLAGS" | grep "\-ansi" > /dev/null 2> /dev/null; then
CFLAGS="$CFLAGS"
else
CFLAGS="$CFLAGS -ansi"
ansi_flag=yes
fi
if echo "$CFLAGS" | grep "\-pedantic" > /dev/null 2> /dev/null; then
CFLAGS="$CFLAGS"
else
CFLAGS="$CFLAGS -pedantic"
pedantic_flag=yes
fi
if test "$ansi_flag" = yes -a "$pedantic_flag" = yes; then
echo "updating CFLAGS with extra '-ansi -pedantic' options"
else
if test "$ansi_flag" = yes; then
echo "updating CFLAGS with extra '-ansi' option"
else
if test "$pedantic_flag" = yes; then
echo "updating CFLAGS with extra '-pedantic' option"
fi
fi
fi
fi
fi
dnl ---------------------------------------------------------------------------
dnl now some other stuff
dnl AC_CANONICAL_HOST ... needs config.guess
dnl ---------------------------------------------------------------------------
AM_CONFIG_HEADER(config.h)
AM_SANITY_CHECK
dnl AC_PROG_LN_S
dnl ---------------------------------------------------------------------------
dnl check for GTK
dnl ---------------------------------------------------------------------------
AM_PATH_GTK(1.0.5,
[LIBS="$LIBS $GTK_LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"],
AC_MSG_ERROR(Cannot find GTK+: Is gtk-config in executable path?))
dnl ---------------------------------------------------------------------------
dnl checks for correctly defined types
dnl ---------------------------------------------------------------------------
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
dnl ---------------------------------------------------------------------------
dnl checks for header files & functions
dnl ---------------------------------------------------------------------------
dnl AC_CHECK_HEADERS(sys/mman.h)
dnl AC_CHECK_FUNCS(mlockall)
dnl AC_CHECK_FUNCS(putenv)
dnl ---------------------------------------------------------------------------
dnl enable runtime debugging code
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(
debug,
[ --enable-debug use runtime debugging code [default=no]],
echo "enabling runtime debugging code",
enable_debug=no
)
dnl only works with GNU make
dnl AM_CONDITIONAL(DEBUGMODE, test x$enable_debug != xno)
AC_DEFINE(GNP_DEBUG)
dnl ---------------------------------------------------------------------------
dnl use flock for file locking
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(
flock,
[ --enable-flock use flock() to lock files],
[if test $enableval = yes; then
AC_DEFINE(USE_FLOCK)
fi]
)
dnl ---------------------------------------------------------------------------
dnl use fcntl for file locking (default)
dnl ---------------------------------------------------------------------------
use_fcntl=yes
AC_ARG_ENABLE(
fcntl,
[ --disable-fcntl do NOT use fcntl() to lock files ],
[if test $enableval = no; then use_fcntl=no; fi]
)
if test $use_fcntl = yes; then
AC_DEFINE(USE_FCNTL)
fi
dnl ---------------------------------------------------------------------------
dnl project/ide code
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(
project,
[ --enable-project use experimental project/ide features [default=no]],
echo "enabling experimental project/ide features",
want_project=no
)
if test x$want_project != xno; then
AC_DEFINE(WANT_PROJECT)
fi
dnl ---------------------------------------------------------------------------
dnl Makefiles to create:
dnl ---------------------------------------------------------------------------
AC_OUTPUT(Makefile src/Makefile)
|