File: configure.in

package info (click to toggle)
fldiff 1.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 612 kB
  • ctags: 223
  • sloc: cpp: 2,977; sh: 2,650; makefile: 124
file content (264 lines) | stat: -rw-r--r-- 6,636 bytes parent folder | download | duplicates (7)
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
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
#
# "$Id: configure.in 407 2006-11-13 18:54:02Z mike $"
#
# Configure script for fldiff, a graphical diff program.
#
# Copyright 2005-2006 by Michael Sweet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#

dnl We need at least autoconf 2.50...
AC_PREREQ(2.50)

AC_INIT(fldiff.cxx)

dnl Version number...
VERSION="1.1"
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(VERSION, "fldiff $VERSION")

dnl Get the operating system and version number...
uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
if test "x$uname" = xIRIX64; then
    uname="IRIX"
fi
if test "x$uname" = x; then
    # MingW doesn't provide any output when uname is run, even with "-s"...
    uname="CYGWIN"
fi

dnl Clear default debugging options and set normal optimization by
dnl default unless the user asks for debugging specifically.
CXXFLAGS="${CXXFLAGS:=}"
AC_SUBST(CXXFLAGS)

LDFLAGS="${LDFLAGS:=}"
AC_SUBST(LDFLAGS)

OPTIM="-O"
AC_SUBST(OPTIM)

AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging [default=no]],
if eval "test x$enable_debug = xyes"; then
 	OPTIM="-g"
else
	LDFLAGS="$LDFLAGS -s"
fi)

AC_ARG_WITH(docdir, [  --with-docdir           set directory for documentation],
	docdir="$withval",
	docdir="NONE")
AC_SUBST(docdir)

dnl Checks for programs...
AC_PROG_CC
AC_PROG_CXX
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(MKDIR,mkdir)
AC_PATH_PROG(RM,rm)

dnl Check for FLTK...
AC_PATH_PROG(FLTKCONFIG,fltk-config)

if test "x$FLTKCONFIG" = x; then
	AC_MSG_ERROR([Sorry, fldiff requires FLTK 1.1.x.])
else
	CXXFLAGS="`$FLTKCONFIG --use-images --cflags` $CXXFLAGS"
	LIBS="`$FLTKCONFIG --use-images --ldflags` $LIBS"
fi

AC_SUBST(FLTKCONFIG)

dnl Update compiler options...
if test -n "$GCC"; then
	# Starting with GCC 3.0, you must link C++ programs against either
	# libstdc++ (shared by default), or libsupc++ (always static).  If
	# you care about binary portability between Linux distributions,
	# you need to either 1) build your own GCC with static C++ libraries
	# or 2) link using gcc and libsupc++.  We choose the latter since
	# fldiff doesn't (currently) use any of the stdc++ library.
	#
	# Also, GCC 3.0.x still has problems compiling some code.  You may
	# or may not have success with it.  USE 3.0.x WITH EXTREME CAUTION!
	#
	# Previous versions of GCC do not have the reliance on the stdc++
	# or g++ libraries, so the extra supc++ library is not needed.

	AC_MSG_CHECKING(if libsupc++ is required)

 	SUPC="`$CXX -print-file-name=libsupc++.a 2>/dev/null`"
 	if test -n "$SUPC" -a "$SUPC" != "libsupc++.a"; then
 		# This is gcc 3.x, and it knows of libsupc++, so we need it
 		LIBS="$LIBS -lsupc++"
		AC_MSG_RESULT(yes)
	else
		AC_MSG_RESULT(no)
 	fi

	if test "x$uname" != xDarwin; then
		CXX="$CC"
	fi

	if test -z "$OPTIM"; then
        	OPTIM="-O2 -fforce-mem -fforce-addr -fcaller-saves"
	fi

	OPTIM="-Wall -Wno-return-type $OPTIM"

	# See if GCC supports -fno-rtti...
	AC_MSG_CHECKING(if GCC supports -fno-rtti)
	OLDCFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -fno-rtti"
	AC_TRY_COMPILE(,,
		CXXFLAGS="$CXXFLAGS -fno-rtti"
		AC_MSG_RESULT(yes),
		AC_MSG_RESULT(no))
	CFLAGS="$OLDCFLAGS"

	# See if GCC supports -fno-exceptions...
	AC_MSG_CHECKING(if GCC supports -fno-exceptions)
	OLDCFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -fno-exceptions"
	AC_TRY_COMPILE(,,
		OPTIM="$OPTIM -fno-exceptions"
		AC_MSG_RESULT(yes),
		AC_MSG_RESULT(no))
	CFLAGS="$OLDCFLAGS"

	# See if we are running HP-UX or Solaris; if so, try the
	# -fpermissive option...
	case $uname in
		SunOS* | HP-UX*)
			AC_MSG_CHECKING(if GCC supports -fpermissive)

			OLDCFLAGS="$CFLAGS"
			CFLAGS="$CFLAGS -fpermissive"
			AC_TRY_COMPILE(,,
				OPTIM="$OPTIM -fpermissive"
				AC_MSG_RESULT(yes),
				AC_MSG_RESULT(no))
			CFLAGS="$OLDCFLAGS"
			;;
		*)
			;;
	esac
else
	case $uname in
		AIX*)
			if test -z "$OPTIM"; then
				OPTIM="-O2"
			fi
			;;
		HP-UX*)
			if test -z "$OPTIM"; then
				OPTIM="+O2"
			fi
			OPTIM="$OPTIM +DAportable"
			;;
        	IRIX*)
			if test -z "$OPTIM"; then
        			OPTIM="-O2"
			fi
			if test $uversion -ge 62; then
				OPTIM="$OPTIM -n32 -mips3"
				OPTIM="$OPTIM -OPT:Olimit=3000"
				OPTIM="-fullwarn -woff 1209,1506,1692 $OPTIM"
			else
				OPTIM="-fullwarn $OPTIM"
			fi
			;;
		SunOS*)
			# Solaris
			if test -z "$OPTIM"; then
				OPTIM="-xO4"
			fi
			;;
		*)
			# Running some other operating system; inform the user they
			# should contribute the necessary options to
			# epm@easysw.com...
			echo "Building fldiff with default compiler optimizations; contact"
			echo "fldiff@easysw.com with the uname and compiler options needed for"
			echo "your platform, or set the CFLAGS and CXXFLAGS environment"
			echo "variable before running configure."
			;;
	esac
fi

dnl Fix "prefix" variable if it hasn't been specified...
if test "$prefix" = "NONE"; then
	prefix="/usr/local"
fi

dnl Fix "exec_prefix" variable if it hasn't been specified...
if test "$exec_prefix" = "NONE"; then
	exec_prefix="$prefix"
fi

dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
	datadir="$prefix/share"
fi

dnl Fix "docdir" variable if it hasn't been specified...
if test "$docdir" = "NONE"; then
	docdir="$datadir/doc/fldiff"
fi

dnl Fix "mandir" variable if it hasn't been specified...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
	case "$uname" in
        	*BSD* | Darwin* | Linux*)
        		# BSD, Darwin (MacOS X), and Linux
        		mandir="/usr/share/man"
        		;;
        	IRIX*)
        		# SGI IRIX
        		mandir="/usr/share/catman/u_man"
        		;;
        	*)
        		# All others
        		mandir="/usr/man"
        		;;
	esac
fi

dnl See if we have the X11 desktop stuff used by GNOME and KDE...
AC_MSG_CHECKING(if GNOME/KDE desktop is in use)
desktopdir=""
for dir in /usr/share/applnk /etc/X11/applnk; do
	if test -d $dir; then
		desktopdir=$dir
		break
	fi
done

if test x$desktopdir = x; then
	AC_MSG_RESULT(no)
	INSTALLDESKTOP=""
	UNINSTALLDESKTOP=""
else
	AC_MSG_RESULT(yes)
	INSTALLDESKTOP="install-desktop"
	UNINSTALLDESKTOP="uninstall-desktop"
fi

AC_SUBST(desktopdir)
AC_SUBST(INSTALLDESKTOP)
AC_SUBST(UNINSTALLDESKTOP)

dnl Output the makefile and list file...
AC_OUTPUT(Makefile fldiff.list)

#
# End of "$Id: configure.in 407 2006-11-13 18:54:02Z mike $".
#