configure.in 10.8 KB
Newer Older
Stéphane Démurget's avatar
Stéphane Démurget committed
1 2 3
dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta - will be overwritten
dnl If you don't want it to overwrite it,
Naba Kumar's avatar
Naba Kumar committed
4
dnl 	Please disable it in the Anjuta project configuration
Stéphane Démurget's avatar
Stéphane Démurget committed
5 6

AC_INIT(configure.in)
7
AM_INIT_AUTOMAKE(anjuta, 0.1.9-pre)
Stéphane Démurget's avatar
Stéphane Démurget committed
8 9
AM_CONFIG_HEADER(config.h)

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
dnl Define convenience macros
dnl -------------------------
dnl CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
AC_DEFUN(CHECK_HEADER_DEFINE,
[
	AC_MSG_CHECKING("if $1 is defined in $2")
	AC_EGREP_CPP(yes,
[#include <$2>
#ifdef $1
  yes
#endif
], [
	AC_MSG_RESULT(yes)
	$3
], [
	AC_MSG_RESULT(no)
	$4
]) ])

29 30 31
dnl Initialize xml-i18n-tools
AM_PROG_XML_I18N_TOOLS

Stéphane Démurget's avatar
Stéphane Démurget committed
32 33 34 35 36 37
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AC_HEADER_STDC

38 39 40
dnl check for libtool
AM_PROG_LIBTOOL

Naba Kumar's avatar
Naba Kumar committed
41
dnl Pick up the GNOME macros.
Stéphane Démurget's avatar
Stéphane Démurget committed
42 43
AM_ACLOCAL_INCLUDE(macros)

Naba Kumar's avatar
Naba Kumar committed
44
dnl GNOME macros.
Stéphane Démurget's avatar
Stéphane Démurget committed
45 46 47 48
GNOME_INIT
GNOME_COMPILE_WARNINGS
GNOME_X_CHECKS

49 50 51 52 53 54
dnl Glib flags
GLIB_CFLAGS=`gnome-config --cflags glib`
GLIB_LIBS=`gnome-config --libs glib`
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS)

55 56 57 58 59 60
dnl we need to check the lib first
AC_PATH_PROG(EXTRA_ORBIT_CONFIG, orbit-config,no)
if test x$EXTRA_ORBIT_CONFIG = xno; then
  AC_MSG_ERROR(Couldn't find orbit-config, please install the ORBit package.)
fi

61 62 63 64
AC_PATH_PROG(EXTRA_VFS_CONFIG, gnome-vfs-config,no)
if test x$EXTRA_VFS_CONFIG = xno; then
  AC_MSG_ERROR(Couldn't find gnome-vfs-config, please install the Gnome VFS package.)
fi
65

Stéphane Démurget's avatar
Stéphane Démurget committed
66
dnl Checks for programs.
67 68 69 70 71
dnl ***************************************************************************
dnl Check for Gnome XML
dnl ***************************************************************************
GNOME_XML_CHECK

72 73 74 75 76
dnl ***************************************************************************
dnl Check for ScrollKeeper
dnl ***************************************************************************
AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
if test x$SCROLLKEEPER_CONFIG = xno; then
77
  AC_MSG_ERROR(Couldn't find scrollkeeper-config, please install the scrollkeeper package. You can get it from http://scrollkeeper.sourceforge.net/)
78 79 80 81
fi
SCROLLKEEPER_REQUIRED=0.1.4
AC_SUBST(SCROLLKEEPER_REQUIRED)

82 83 84 85 86 87
dnl Check for pkg-config
AC_PATH_PROG(PKGCONFIG_CONFIG, pkg-config,no)
if test x$PKGCONFIG_CONFIG = xno; then
  AC_MSG_ERROR(Please install the pkg-config package from http://www.freedesktop.org/software/pkgconfig/)
fi

88 89 90 91 92 93 94 95 96 97 98 99
dnl ***************************************************************************
dnl Test whether jw is installed
dnl ***************************************************************************
AC_PATH_PROG(JW,jw,no)
if test x$JW = xno; then
  HAVE_JW="no"
else
  HAVE_JW="yes"
fi
AM_CONDITIONAL(HAVE_JW, test "x$HAVE_JW" = "xyes")
AC_SUBST(HAVE_JW)

100

Stéphane Démurget's avatar
Stéphane Démurget committed
101
dnl Checks for libraries.
102 103 104 105 106 107 108 109 110 111 112
EXTRA_GNOME_LIBS=`gnome-config --libs gnorba zvt vfs bonobo`
EXTRA_GNOME_CFLAGS=`gnome-config --cflags gnorba zvt vfs bonobo`

AC_SUBST(EXTRA_GNOME_LIBS)
AC_SUBST(EXTRA_GNOME_CFLAGS)

EXTRA_ORBIT_LIBS=`orbit-config --libs client`
EXTRA_ORBIT_CFLAGS=`orbit-config --cflags client`

AC_SUBST(EXTRA_ORBIT_LIBS)
AC_SUBST(EXTRA_ORBIT_CFLAGS)
113

114
IDL_CFLAGS=`gnome-config --cflags idl`
115

Stéphane Démurget's avatar
Stéphane Démurget committed
116
dnl Checks for header files.
117 118 119
AC_CHECK_HEADERS(dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h)
AC_CHECK_HEADERS(time.h types.h unistd.h)
AC_CHECK_HEADERS(sys/dir.h sys/stat.h sys/times.h sys/types.h)
Naba Kumar's avatar
Naba Kumar committed
120 121


Stéphane Démurget's avatar
Stéphane Démurget committed
122
dnl Checks for typedefs, structures, and compiler characteristics.
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
AC_CYGWIN
AC_MINGW32
AC_C_CONST
AC_OBJEXT
AC_EXEEXT

AC_TYPE_SIZE_T
AC_TYPE_OFF_T

AC_MSG_CHECKING("for fpos_t")
AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),
[
    AC_MSG_RESULT(no)
    AC_DEFINE(fpos_t, long)
])

AC_MSG_CHECKING("for clock_t")
AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
[
    AC_MSG_RESULT(no)
    AC_DEFINE(clock_t, long)
])

CHECK_HEADER_DEFINE(L_tmpnam, stdio.h,, AC_DEFINE(L_tmpnam, 20))

CHECK_HEADER_DEFINE(INT_MAX, limits.h,,
    CHECK_HEADER_DEFINE(MAXINT, limits.h,
        AC_DEFINE(INT_MAX, MAXINT), AC_DEFINE(INT_MAX, 32767)))

AC_MSG_CHECKING(if struct stat contains st_ino)
AC_TRY_COMPILE([#include <sys/stat.h>], [
    struct stat st;
    stat(".", &st);
    if (st.st_ino > 0)
        exit(0);
], have_st_ino=yes, have_st_ino=no)
AC_MSG_RESULT($have_st_ino)
if test yes = "$have_st_ino"; then
    AC_DEFINE(HAVE_STAT_ST_INO)
fi
Naba Kumar's avatar
Naba Kumar committed
163 164


Stéphane Démurget's avatar
Stéphane Démurget committed
165
dnl Checks for library functions.
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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
AC_CHECK_FUNCS(fnmatch)
AC_CHECK_FUNCS(strstr)
AC_CHECK_FUNCS(stricmp)
AC_CHECK_FUNCS(strnicmp)

AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)

dnl SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
if test "$have_fgetpos" != yes ; then
    CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
        CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
            AC_DEFINE(SEEK_SET, 0)))
fi

AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
if test "$have_mkstemp" != yes ; then
    AC_CHECK_FUNCS(chmod)
    if test "$tmpdir_specified" = yes ; then
        AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
    fi
else
    AC_MSG_CHECKING(directory to use for temporary files)
    if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ;
        then tmpdir=/tmp
        else tmpdir="$enable_tmpdir"
    fi
    if test -d $tmpdir ; then
        AC_MSG_RESULT($tmpdir)
        AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir")
    else
        AC_MSG_WARN($tmpdir does not exist)
    fi
fi

AC_CHECK_FUNCS(strerror opendir)
AC_CHECK_FUNCS(clock times, break)
AC_CHECK_FUNCS(remove, have_remove=yes,
    CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink)))

AC_CHECK_FUNCS(truncate, have_truncate=yes)
dnl === Cannot nest AC_CHECK_FUNCS() calls
if test "$have_truncate" != yes  ; then
    AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes)
    if test "$have_ftruncate" != yes ; then
        AC_CHECK_FUNCS(chsize)
    fi
fi

AC_CHECK_FUNCS(setenv, have_setenv=yes)
dnl === Cannot nest AC_CHECK_FUNCS() calls
if test "$have_setenv" != yes ; then
    AC_CHECK_FUNCS(putenv, have_putenv=yes)
    if test "$have_putenv" = yes ; then
        AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes)
        if test "$have_putenv_prototype" = yes ; then
            AC_MSG_CHECKING("putenv prototype")
            AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[   ]*\(.*const.*\)[    ]*;],
                stdlib.h, AC_MSG_RESULT(correct),
                [
                    AC_MSG_RESULT(no const)
                    AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE)
                ])
        fi
    fi
fi

dnl
dnl if test yes = "$CYGWIN"; then with_posix_regex=no; fi
if test no != "$with_posix_regex"; then
    AC_CHECK_FUNCS(regcomp)
    AC_MSG_CHECKING(if regcomp works)
    AC_TRY_RUN([
#include <sys/types.h>
#include <regex.h>
main() {
    regex_t patbuf;
    exit (regcomp (&patbuf, "/hello/", 0) != 0);
}],regcomp_works=yes,regcomp_works=no,AC_DEFINE(CHECK_REGCOMP))
    AC_MSG_RESULT($regcomp_works)
    if test yes != "$regcomp_works"; then
        AC_DEFINE(REGCOMP_BROKEN)
    fi
fi


dnl Checks for missing prototypes
dnl -----------------------------
AC_CHECKING("for missing prototypes")

AC_DEFUN(CHECK_PROTO, [AC_EGREP_HEADER([[^A-Za-z0-9_]$1([   ]+[A-Za-z0-9_]*)?\(], $2,, AC_DEFINE(patsubst([NEED_PROTO_NAME], [NAME], translit($1, [a-z], [A-Z]))) AC_MSG_RESULT(adding prototype for $1))])

if test "$have_remove" = yes ; then
    CHECK_PROTO(remove, stdio.h)
else
    CHECK_PROTO(unlink, unistd.h)
fi
CHECK_PROTO(malloc, stdlib.h)
CHECK_PROTO(getenv, stdlib.h)
CHECK_PROTO(stat,   sys/stat.h)
CHECK_PROTO(lstat,  sys/stat.h)
if test "$have_fgetpos" = yes ; then
    CHECK_PROTO(fgetpos, stdio.h)
fi
if test "$have_truncate" = yes ; then
    CHECK_PROTO(truncate, unistd.h)
fi
if test "$have_ftruncate" = yes ; then
    CHECK_PROTO(ftruncate, unistd.h)
fi
Naba Kumar's avatar
Naba Kumar committed
275 276


Stéphane Démurget's avatar
Stéphane Démurget committed
277 278
dnl Checks for Additional stuffs.

Naba Kumar's avatar
Naba Kumar committed
279 280


Stéphane Démurget's avatar
Stéphane Démurget committed
281
dnl Languages which your application supports
282
ALL_LINGUAS="az da de el es fr it ja nl no pl pt pt_BR ru sv ta tr uk zh_CN zh_TW"
283
AM_GNOME_GETTEXT
Stéphane Démurget's avatar
Stéphane Démurget committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305

dnl Set PACKAGE_LOCALE_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
else
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
fi


dnl Set PACKAGE SOURCE DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`

dnl Set PACKAGE PREFIX
if test "x${prefix}" = "xNONE"; then
  packageprefix=${ac_default_prefix}
else
  packageprefix=${prefix}
fi

dnl Set PACKAGE DATA & DOC DIR
packagedatadir=share/${PACKAGE}
packagedocdir=doc/${PACKAGE}
306
packageplugindir=lib/${PACKAGE}/plugins/${VERSION}
Stéphane Démurget's avatar
Stéphane Démurget committed
307 308 309 310 311

dnl Set PACKAGE DIRs in config.h.
packagepixmapsdir=share/pixmaps/${PACKAGE}
packagehelpdir=share/gnome/help/${PACKAGE}
packagemenudir=share/gnome/apps
312 313 314
packageplugindir=lib/${PACKAGE}
dnl packageplugindir could be anjuta-1 or something like that but anjuta 2 will
dnl be the new reference and so we'll use ${prefix} with it.
Stéphane Démurget's avatar
Stéphane Démurget committed
315 316 317 318

dnl Subst PACKAGE_DATA_DIR.
NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
Naba Kumar's avatar
Naba Kumar committed
319 320
PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
AC_SUBST(PACKAGE_DATA_DIR)
Stéphane Démurget's avatar
Stéphane Démurget committed
321 322 323 324

dnl Subst PACKAGE_DOC_DIR.
NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
Naba Kumar's avatar
Naba Kumar committed
325 326
PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
AC_SUBST(PACKAGE_DOC_DIR)
Stéphane Démurget's avatar
Stéphane Démurget committed
327 328 329 330

dnl Subst PACKAGE_PIXMAPS_DIR.
NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}"
AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR)
Naba Kumar's avatar
Naba Kumar committed
331 332
PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}"
AC_SUBST(PACKAGE_PIXMAPS_DIR)
Stéphane Démurget's avatar
Stéphane Démurget committed
333 334 335 336

dnl Subst PACKAGE_HELP_DIR.
NO_PREFIX_PACKAGE_HELP_DIR="${packagehelpdir}"
AC_SUBST(NO_PREFIX_PACKAGE_HELP_DIR)
Naba Kumar's avatar
Naba Kumar committed
337 338
PACKAGE_HELP_DIR="${packageprefix}/${packagehelpdir}"
AC_SUBST(PACKAGE_HELP_DIR)
Stéphane Démurget's avatar
Stéphane Démurget committed
339 340 341 342

dnl Subst PACKAGE_MENU_DIR.
NO_PREFIX_PACKAGE_MENU_DIR="${packagemenudir}"
AC_SUBST(NO_PREFIX_PACKAGE_MENU_DIR)
Naba Kumar's avatar
Naba Kumar committed
343 344
PACKAGE_MENU_DIR="${packageprefix}/${packagemenudir}"
AC_SUBST(PACKAGE_MENU_DIR)
Stéphane Démurget's avatar
Stéphane Démurget committed
345

346 347 348 349 350 351
dnl Subst PACKAGE_PLUGIN_DIR.
NO_PREFIX_PACKAGE_PLUGIN_DIR="${packageplugindir}"
AC_SUBST(NO_PREFIX_PACKAGE_PLUGIN_DIR)
PACKAGE_PLUGIN_DIR="${packageprefix}/${packageplugindir}"
AC_SUBST(PACKAGE_PLUGIN_DIR)

Stéphane Démurget's avatar
Stéphane Démurget committed
352 353 354 355 356
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}")
AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}")
AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}")
AC_DEFINE_UNQUOTED(PACKAGE_HELP_DIR, "${packageprefix}/${packagehelpdir}")
AC_DEFINE_UNQUOTED(PACKAGE_MENU_DIR, "${packageprefix}/${packagemenudir}")
357
AC_DEFINE_UNQUOTED(PACKAGE_PLUGIN_DIR, "${packageprefix}/${packageplugindir}")
Stéphane Démurget's avatar
Stéphane Démurget committed
358 359 360 361 362 363 364
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")

AC_OUTPUT([
Makefile
intl/Makefile
po/Makefile.in
macros/Makefile
365 366 367
tagmanager/Makefile
tagmanager/include/Makefile
global-tags/Makefile
Stéphane Démurget's avatar
Stéphane Démurget committed
368 369
scintilla/Makefile
widgets/Makefile
370
manuals/Makefile
371
omf-install/Makefile
Stéphane Démurget's avatar
Stéphane Démurget committed
372
scintilla/include/Makefile
373 374 375
manuals/C/Makefile
manuals/C/anjuta-manual/Makefile
manuals/C/anjuta-faqs/Makefile
Stéphane Démurget's avatar
Stéphane Démurget committed
376 377 378 379
anjuta.spec
src/Makefile
pixmaps/Makefile
data/Makefile
Naba Kumar's avatar
Naba Kumar committed
380
data/properties/Makefile
Stéphane Démurget's avatar
Stéphane Démurget committed
381
doc/Makefile
382
scripts/Makefile
383
scripts/anjuta_import.sh
Stéphane Démurget's avatar
Stéphane Démurget committed
384
launcher/Makefile
385 386
plugins/Makefile
plugins/sample1/Makefile
387
plugins/class-gen/Makefile
388
anjuta.desktop.in
Stéphane Démurget's avatar
Stéphane Démurget committed
389
])