forked from qunying/rhide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
180 lines (150 loc) · 4.73 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(idemain.cc)
AC_PROG_CC
AC_CANONICAL_HOST
AC_CONFIG_SUBDIRS(libtvuti)
case "$host" in
i?86-*-linux*) rhide_OS=Linux ;;
i?86-pc-msdosdjgpp) rhide_OS=DJGPP ;;
*-pc-cygwin) rhide_OS=CYGWIN ;;
*) AC_MSG_ERROR([$host is not supported (yet). Sorry.]) ;;
esac
AC_SUBST(rhide_OS)
AC_ARG_WITH(dummy-iconv,[--with-dummy-iconv use dummy iconv function to reduce executable size],
[DUMMY_ICONV=yes])
dnl This fixes the annoing bug in autoconf which
dnl does not handle correct drive letters in diretories
dnl I save at first the original srcdir and translate
dnl it then to the /dev/drive_letter syntax. In the
dnl config files I should refere then abs_srcdir instead
dnl of srcdir
abs_srcdir=`cd $srcdir && pwd`
changequote(, )dnl
if test "$rhide_OS" = DJGPP; then
srcdir=`echo $abs_srcdir | sed "s,^\([a-zA-Z]\):,/dev/\1,g"`
abs_srcdir=`echo $srcdir | sed "s,^/dev/\([a-zA-Z]\)/,\1:/,g"`
fi
changequote([, ])dnl
AC_SUBST(abs_srcdir)
if test "$rhide_OS" = DJGPP; then
AC_CHECK_LIB(c,gettext,
[CONIO_PATCH=$abs_srcdir/conio.o],
[CONIO_PATCH=])
fi
AC_SUBST(CONIO_PATCH)
TV_INC_SEARCH="$abs_srcdir/../tvision/include \
$DJDIR/contrib/tvision/include \
$DJDIR/include/rhtvision \
/usr/local/src/tvision/include \
/usr/src/tvision/include \
/usr/local/include/rhtvision \
/usr/include/rhtvision"
RH_CHECK_FILE_LIST(TV_INC, tv.h, $TV_INC_SEARCH,[Turbo Vision header files])
TV_OBJ_SEARCH="$TV_INC/../`echo $rhide_OS | sed -e s,Linux,linux,g -e s,CYGWIN,win32,g` \
$TV_INC/../../lib"
RH_CHECK_FILE_LIST(TVOBJ, librhtv.a, $TV_OBJ_SEARCH,[Turbo Vision libraray])
SETSRC_SEARCH="$abs_srcdir/../setedit \
$DJDIR/contrib/setedit \
/usr/local/src/setedit \
/usr/src/setedit"
RH_CHECK_FILE_LIST(SETSRC,mainsrc/ceditor.cc,$SETSRC_SEARCH,[SET's editor sources])
RH_CHECK_FILE_LIST(SETOBJ,libset.a,$SETSRC/makes,[SET's editor libraries])
SET_SPECIAL_LDFLAGS=
AC_CHECK_LIB(c,bindtextdomain,
[LIB_INTL=],
[LIB_INTL=no])
if test "x$LIB_INTL" = xno; then
AC_MSG_CHECKING([needed libs for gettext])
rh_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
AC_TRY_LINK([#include <libintl.h>
#include <stdio.h>],printf(gettext("test")),
[LIB_INTL=intl])
LIBS="$rh_save_LIBS"
if test "x$LIB_INTL" = xno; then
rh_save_LIBS="$LIBS"
if test "x$DUMMY_ICONV" != x; then
LIBS="iconv.o -lintl $LIBS"
ICONV_O=`pwd`/iconv.o
ICONV_L=
$CC -o iconv.o -DUSE_DUMMY_ICONV -c $abs_srcdir/iconv.c
else
ICONV_O=
ICONV_L=iconv
LIBS="-lintl -liconv $LIBS"
fi
AC_TRY_LINK([#include <libintl.h>
#include <stdio.h>],
printf(gettext("test")),
[LIB_INTL="intl $ICONV_L"
SET_SPECIAL_LDFLAGS="$ICONV_O $SET_SPECIAL_LDFLAGS"])
LIBS="$rh_save_LIBS"
fi
if test "x$LIB_INTL" = xno; then
rh_save_libs="$LIBS"
LIBS="iconv.o -lintl $LIBS"
$CC -o iconv.o -DUSE_DUMMY_ICONV -c $abs_srcdir/iconv.c
AC_TRY_LINK([#include <libintl.h>
#include <stdio.h>],printf(gettext("test")),
[LIB_INTL=intl
SET_SPECIAL_LDFLAGS="`pwd`/iconv.o $SET_SPECIAL_LDFLAGS"])
LIBS="$rh_save_libs"
fi
AC_MSG_RESULT([$LIB_INTL])
fi
if test "x$LIB_INTL" = xno; then
AC_MSG_WARN([found not usable library providing gettext,
using now a dummy one])
LIB_INTL=tvfintl
SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS -L$TVOBJ/../intl/dummy"
fi
AC_SUBST(LIB_INTL)
gdb_version="gdb-5.3"
GDB_SRC_SEARCH="$abs_srcdir/../$gdb_version \
$DJDIR/gnu/$gdb_version \
/usr/local/src/$gdb_version \
/usr/src/$gdb_version"
RH_CHECK_FILE_LIST(GDB_SRC,gdb/main.c,$GDB_SRC_SEARCH,[GDB sources],[trying older version])
if test "$GDB_SRC" = no; then
gdb_version="gdb-5.0"
GDB_SRC_SEARCH="$abs_srcdir/../$gdb_version \
$DJDIR/gnu/$gdb_version \
/usr/local/src/$gdb_version \
/usr/src/$gdb_version"
RH_CHECK_FILE_LIST(GDB_SRC_OLD,gdb/main.c,$GDB_SRC_SEARCH,[GDB sources])
GDB_SRC="$GDB_SRC_OLD"
fi
AC_CACHE_CHECK([GDB objects],GDB_OBJ,
[
if test "$rhide_OS" = DJGPP; then
GDB_OBJ=$GDB_SRC
else
mkdir gdb_obj
GDB_OBJ=`pwd`/gdb_obj
fi
AC_SUBST(GDB_OBJ)
])
SET_LIBS="pcre bz2 z"
if test -f $SETOBJ/libeasyd.a; then
SET_LIBS="$SET_LIBS easyd settv"
else
SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS $SET_OBJ/easydiag.a"
fi
AC_CHECK_LIB(bz2,BZ2_bzlibVersion,
[],
[SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS -L$SETOBJ/../libbzip2"])
AC_CHECK_LIB(z,zlibVersion,
[],
[SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS -L$SETOBJ/../libz"])
AC_CHECK_LIB(pcre,pcre_version,
[],
[SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS -L$SETOBJ/../libpcre"])
SET_LIBS="$SET_LIBS rhtv"
AC_CHECK_HEADERS(X11/keysym.h,
[SET_SPECIAL_LDFLAGS="$SET_SPECIAL_LDFLAGS -L/usr/X11/lib" SET_LIBS="$SET_LIBS X11"],
[])
AC_SUBST(SET_SPECIAL_LDFLAGS)
AC_SUBST(SET_LIBS)
AC_OUTPUT(config.env:config.in)
$abs_srcdir/configure.sub $abs_srcdir