configure.in 3.31 KB
Newer Older
Dave Camp's avatar
Dave Camp committed
1 2 3 4
AC_INIT(gdlConf.sh.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gdl,0.1.0)

Dave Camp's avatar
Dave Camp committed
5 6
AM_ACLOCAL_INCLUDE(macros)

Dave Camp's avatar
Dave Camp committed
7 8
AM_MAINTAINER_MODE

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
dnl
dnl GDL_CHECK_LIB is defined in gdl.m4.  However, we can't use that yet.
dnl So we have a copy here.  If you modify this, see if you should modify
dnl the one in gdl.m4 too.
dnl
AC_DEFUN(CHECK_LIB, [
	dispname="$1"
	pkgname="$2"
	minvers="$3"
	maxvers="$4"

	AC_MSG_CHECKING(for $dispname)

	if gnome-config --libs $pkgname > /dev/null 2>&1; then
		pkgvers=`gnome-config --modversion $pkgname | sed -e 's/^[[^0-9]]*//'`
	else
		pkgvers=not
	fi
	AC_MSG_RESULT($pkgvers found)

	pkgvers=`echo $pkgvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
	cmpminvers=`echo $minvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
	cmpmaxvers=`echo $maxvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
	ok=yes
	if test "$pkgvers" -lt $cmpminvers; then
		ok=no
	elif test -n "$maxvers" -a "$pkgvers" -ge $cmpmaxvers; then
		ok=no
	fi
	if test $ok = no; then
		case $maxvers in
		"")
			dispvers="$minvers or higher"
			;;
		$minvers)
			dispvers="$minvers (exactly)"
			;;
		*)
			dispvers="$minvers or higher, but less than $maxvers,"
			;;
		esac

		AC_MSG_ERROR([
""
"You need $dispname $dispvers to build GDL"
"If you think you already have this installed, consult the README."])
	fi

	tmp_bsnom=`echo $pkgname | tr a-z A-Z`
	eval $tmp_bsnom'_CFLAGS'=\"`gnome-config --cflags $pkgname`\"
	eval $tmp_bsnom'_LIBS'=\"`gnome-config --libs $pkgname`\"
])

Dave Camp's avatar
Dave Camp committed
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
dnl libtool versioning

dnl gdl-0.1.0 = 0
dnl increment if any interfaces have been added; set to 0
dnl  if any interfaces have been removed. removal has 
dnl  precedence over adding, so set to 0 if both happened.
dnl AKA Major
GDL_AGE=0

dnl gdl-0.1.0 = 1
dnl increment any time the source changes; set to 
dnl  0 if you increment CURRENT
dnl AKA Minor
GDL_REVISION=1

dnl gdl-0.1.0 = 1
dnl increment if the interface has additions, changes, removals.
dnl AKA Micro
GAL_CURRENT=1

AC_SUBST(GDL_CURRENT)
AC_SUBST(GDL_REVISION)
AC_SUBST(GDL_AGE)

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_YACC
AM_PROG_LEX
AC_STDC_HEADERS
AC_ARG_PROGRAM
AM_PROG_LIBTOOL

Dave Camp's avatar
Dave Camp committed
95 96
AM_PROG_XML_I18N_TOOLS

Dave Camp's avatar
Dave Camp committed
97 98 99 100
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

Dave Camp's avatar
Dave Camp committed
101 102 103 104 105 106 107 108
GNOME_INIT()
GNOME_COMPILE_WARNINGS
GNOME_X_CHECKS

dnl ***************
dnl GNOME Libraries 
dnl ***************

109 110 111 112 113
CHECK_LIB(gnome-libs, gnome, 1.2.9)
CHECK_LIB(Bonobo, bonobo, 1.0.7)
CHECK_LIB(Bonobo X, bonobox, 1.0.7)
CHECK_LIB(OAF, oaf, 0.6.5)
CHECK_LIB(GNOME-VFS, vfs, 1.0)
Dave Camp's avatar
Dave Camp committed
114 115 116

IDL_CFLAGS=`gnome-config --cflags idl`

Dave Camp's avatar
Dave Camp committed
117 118 119 120 121
AC_SUBST(BONOBO_CFLAGS)
AC_SUBST(BONOBO_LIBS)
AC_SUBST(BONOBOX_CFLAGS)
AC_SUBST(BONOBOX_LIBS)
AC_SUBST(OAF_CFLAGS)
Dave Camp's avatar
Dave Camp committed
122 123
AC_SUBST(VFS_CFLAGS)
AC_SUBST(VFS_LIBS)
Dave Camp's avatar
Dave Camp committed
124
AC_SUBST(IDL_CFLAGS)
Dave Camp's avatar
Dave Camp committed
125 126 127 128

GNOME_IDL_DIR="`$GNOME_CONFIG --datadir`/idl"

AM_GNOME_GETTEXT
129
ALL_LINGUAS="it ru sv"
Dave Camp's avatar
Dave Camp committed
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(gnomelocaledir)

GDL_LIBDIR='-L${libdir}'
GDL_INCLUDEDIR=" -I${includedir} `$GNOME_CONFIG --cflags gnomeui ` $UNICODE_LIBS"
GDL_LIBS="-lgdl `$GNOME_CONFIG --libs bonobox`"
AC_SUBST(GDL_LIBDIR)
AC_SUBST(GDL_INCLUDEDIR)
AC_SUBST(GDL_LIBS)

AC_OUTPUT([
Makefile
gdl/Makefile
idl/Makefile
scintilla-control/Makefile
scintilla-control/scintilla/Makefile
intl/Makefile
po/Makefile.in 
stamp.h
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])