File: configure.in

package info (click to toggle)
yudit 2.5.4-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,528 kB
  • ctags: 8,403
  • sloc: cpp: 59,394; ansic: 2,585; perl: 2,398; makefile: 864; sh: 321
file content (239 lines) | stat: -rwxr-xr-x 4,822 bytes parent folder | download
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
#  configure.in version 2.5
#  yudit package - Unicode Editor for the X Window System (and Linux) 
#
#  Author: gsinai@yudit.org (Gaspar Sinai)
#  GNU Copyright (C) 1997,1998,1999,2000,2001  Gaspar Sinai
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License, version 2,
#  dated June 1991, 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.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
dnl Process this file with autoconf to produce a configure script.
AC_INIT(gui/SYudit.h)
AC_PREFIX_DEFAULT(/usr)

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
dnl AC_PROG_INSTALL

dnl Unfortunatelly hpux does not have mmap that is
dnl considered good by configure
dnl AC_FUNC_MMAP

AC_PATH_XTRA

AC_PATH_PROG(RANLIB, ranlib)
if test x$RANLIB = x; then
   AC_MSG_RESULT(---: ranlib not found.)
   RANLIB=":"
fi

LPR_COMMAND=""
LPR_CFLAGS="-DLPR_COMMAND=\\\"/bin/lpr\\\""
AC_PATH_PROG(LPR_COMMAND,lpr)

if test x$LPR_COMMAND = x; then
   AC_MSG_RESULT(using lpr defualt:/bin/lpr)
else
   LPR_CFLAGS="-DLPR_COMMAND=\\\"${LPR_COMMAND}\\\""
fi
AC_SUBST(LPR_CFLAGS)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE

dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)

AC_LANG_SAVE
AC_LANG_C

HAVE_LONG_LONG=
AC_TRY_COMPILE([ #include <sys/types.h> ],
	[ u_int64_t a; ],
	[HAVE_LONG_LONG=-DHAVE_LONG_LONG])

AC_TRY_COMPILE([ #include <stdio.h> ],
	[ unsigned long long  a; ],
	[HAVE_LONG_LONG=-DHAVE_LONG_LONG])

if test x$HAVE_LONG_LONG = x ; then
	AC_MSG_RESULT(---: long long  not supported.)
fi

NO_MEMMOVE="-DNO_MEMMOVE"
AC_TRY_LINK([ #include <string.h> ],
	[ char*a; char*b; memmove(a,b,1); ],
	[NO_MEMMOVE=])

if test x$NO_MEMMOVE = x ; then
	AC_MSG_RESULT(+++: has memmove.)
else
	AC_MSG_RESULT(---: no memmove.)
fi

CPPFLAGS="$HAVE_LONG_LONG $NO_MEMMOVE $CPPFLAGS"

AC_LANG_RESTORE

AC_SUBST(HAVE_LONG_LONG)


dnl
dnl solaris has this library outside libc
dnl

SOCKET_FLAGS=-lsocket

AC_TRY_LINK([#include <sys/socket.h>],
	[ socket(1,1,1);] , 
	[ SOCKET_FLAGS= ])

dnl 
dnl check if it is real
dnl
if test x$SOCKET_FLAGS = x-lsocket
then

SAVELD=$LIBS
LIBS="$SAVELD -lsocket"

AC_TRY_LINK([#include <sys/socket.h>],
	[ sockett(1,1,1);] , 
	[ SOCKET_FLAGS=-lsocket ], [ SOCKET_FLAGS= ])

LIBS="$SAVELD $SOCKET_FLAGS"

fi

if test x$SOCKET_FLAGS = x-lsocket
then
	AC_MSG_RESULT(+++: -lsocket added to LIBS.)
fi

dnl
dnl solaris has this library outside libc
dnl

NSL_FLAGS=-lnsl

AC_TRY_LINK([#include <netdb.h>],
	[ gethostbyname("localhost");] , 
	[ NSL_FLAGS= ])

dnl 
dnl check if it is real
dnl
if test x$NSL_FLAGS = x-nsl
then

SAVELD=$LIBS
LIBS="$SAVELD -lnsl"

AC_TRY_LINK([#include <netdb.h>],
	[ gethostbyname("localhost");] , 
	[ NSL_FLAGS=-lnsl ], [ NSL_FLAGS= ])

LIBS="$SAVELD $NSL_FLAGS"

fi

if test x$NSL_FLAGS = x-nsl
then
	AC_MSG_RESULT(+++: -lnsl added to LIBS.)
fi

dnl
dnl People complained that gettext distribution does not have it.
dnl
MSGMERGE=
AC_PATH_PROG(MSGMERGE, msgmerge)
if test x$MSGMERGE = x; then
   AC_MSG_RESULT(---: msgmerge of gettext will not be used.)
   MSGMERGE=":"
fi

dnl
dnl finding xgettext to find the libs
dnl version > 2.4  does not need it.
dnl 
GETTEXT_CFLAGS=
GETTEXT_LFLAGS=

TOPDIR=`pwd`
AC_SUBST(TOPDIR)
AC_SUBST(MSGMERGE)
AC_SUBST(GETTEXT_CFLAGS)
AC_SUBST(GETTEXT_LFLAGS)

#
# Sorry guys this autoconf program is a monster - useful features are missing 
#
cat > /tmp/gaspar$$.sh <<+
prefix=${prefix}
if test  ${prefix} = NONE
then
  prefix=${ac_default_prefix}
fi
echo ${datadir}/yudit
+

YUDIT_DATA=`sh /tmp/gaspar$$.sh`

/bin/rm -f /tmp/gaspar$$.sh 

#
# Check if I can compile with cc
#
CAN_USE_CC="0"
cat > /tmp/gaspar$$.cpp <<+
#include <stdio.h>

class A{
 public:
    A(void) {};
    ~A() {};
    void print(void) {
      fprintf (stderr, "Hi\n");
    }
};

int
main(int argc, char* argv[])
{
  A a;
  a.print();
  return (0);
}
+

${CC} -o /tmp/gaspar$$ /tmp/gaspar$$.cpp 2> /dev/null
if test $? = 0 
then
  CAN_USE_CC="1"
  AC_MSG_RESULT(+++: $CC will be used to compile cpp files.)
  CXX=$CC
fi

/bin/rm -f  /tmp/gaspar$$ /tmp/gaspar$$.cpp


AC_SUBST(YUDIT_DATA)

AC_OUTPUT(Makefile.conf uniconv/uniconv.1 uniprint/uniprint.1 yudit.properties doc/FAQ.TXT doc/de/FAQ.TXT doc/hu/FAQ.TXT doc/ja/FAQ.TXT doc/yi/FAQ.TXT doc/es/FAQ.TXT doc/fi/FAQ.TXT doc/cz/FAQ.TXT Makefile)