]>
Commit | Line | Data |
---|---|---|
ad1ae0b1 | 1 | AC_INIT([newt_pr.h]) |
2 | ||
3 | PACKAGE=newt | |
e271d0b0 | 4 | VERSION=$(awk '/^Version: / {print $2}' $srcdir/newt.spec) |
ad1ae0b1 | 5 | SONAME=0.52 |
6 | ||
7 | AC_CONFIG_HEADER([config.h]) | |
8 | ||
9 | AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Package Name]) | |
10 | AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [NEWT Version String]) | |
11 | AC_SUBST([VERSION]) | |
12 | AC_SUBST([SONAME]) | |
13 | AC_PROG_CC | |
14 | AC_PROG_INSTALL | |
15 | AC_PROG_LN_S | |
83fe9fde ML |
16 | AC_PROG_GREP |
17 | ||
18 | # Are we using GNU ld? | |
19 | AC_MSG_CHECKING([for GNU ld]) | |
20 | LD=`$CC -print-prog-name=ld 2>&5` | |
21 | ||
22 | if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU ld"` = 0; then | |
23 | # Not | |
24 | GNU_LD="" | |
25 | AC_MSG_RESULT([no]) | |
26 | else | |
27 | GNU_LD="$LD" | |
28 | AC_MSG_RESULT([yes]) | |
29 | AC_SUBST([GNU_LD]) | |
30 | fi | |
ad1ae0b1 | 31 | |
32 | AC_CHECK_HEADERS([sys/select.h alloca.h]) | |
83fe9fde ML |
33 | AC_CHECK_HEADER([slang.h], [], [ |
34 | old_CPPFLAGS=${CPPFLAGS} | |
35 | CPPFLAGS="${CPPFLAGS} -I/opt/local/include" | |
36 | unset ac_cv_header_slang_h | |
37 | AC_CHECK_HEADER([slang.h]) | |
38 | if test x$ac_cv_header_slang_h = x; then | |
39 | CPPFLAGS="${old_CPPFLAGS}" | |
40 | else | |
41 | LDFLAGS="${LDFLAGS} -L/opt/local/lib" | |
42 | fi | |
43 | ]) | |
44 | if test x$ac_cv_header_slang_h = x; then | |
45 | old_CPPFLAGS=${CPPFLAGS} | |
46 | CPPFLAGS="${CPPFLAGS} -I/sw/include" | |
47 | AC_CHECK_HEADER([slang.h]) | |
48 | if test x$ac_cv_header_slang_h = x; then | |
49 | CPPFLAGS=${old_CPPFLAGS} | |
50 | else | |
51 | LDFLAGS="${LDFLAGS} -L/sw/lib" | |
52 | fi | |
53 | fi | |
54 | AC_CHECK_HEADERS([popt.h libintl.h]) | |
ad1ae0b1 | 55 | |
56 | AC_MSG_CHECKING([for python versions]) | |
57 | PYTHONVERS=$(echo /usr/include/python*/Python.h | sed "s|/usr/include/||g"| sed "s|/Python.h||g" 2> /dev/null) | |
58 | AC_MSG_RESULT([$PYTHONVERS]) | |
59 | AC_SUBST([PYTHONVERS]) | |
60 | ||
61 | AC_ARG_WITH([tcl], [ --without-tcl do not compile whiptcl.so]) | |
62 | if test "x$with_tcl" = "xno"; then | |
63 | WHIPTCLSO= | |
64 | else | |
83fe9fde ML |
65 | AC_MSG_CHECKING([for tcl configuration]) |
66 | ||
67 | # check in a few common install locations | |
68 | if test x"${ac_cv_c_tclconfig}" = x ; then | |
69 | for i in `ls -d ${libdir} 2>/dev/null` \ | |
70 | `ls -d /usr/lib 2>/dev/null` \ | |
71 | `ls -d /usr/lib64 2>/dev/null` \ | |
72 | `ls -d /usr/local/lib 2>/dev/null` \ | |
73 | `ls -d /usr/contrib/lib 2>/dev/null` \ | |
74 | `ls -d /usr/pkg/lib 2>/dev/null` \ | |
75 | `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \ | |
76 | `ls -d /usr/local/lib/tcl8.4 2>/dev/null` \ | |
77 | `ls -d /usr/lib/tcl8.5 2>/dev/null` \ | |
78 | `ls -d /usr/lib/tcl8.4 2>/dev/null` \ | |
79 | `ls -d /opt/local/lib 2>/dev/null` \ | |
80 | ; do | |
81 | if test -f "$i/tclConfig.sh" ; then | |
82 | ac_cv_c_tclconfig=`(cd $i; pwd)` | |
83 | break | |
84 | fi | |
85 | done | |
86 | fi | |
87 | ||
88 | if test x"${ac_cv_c_tclconfig}" != x ; then | |
89 | AC_MSG_RESULT([found]) | |
90 | . ${ac_cv_c_tclconfig}/tclConfig.sh | |
91 | AC_SUBST([TCL_LIB_FLAG]) | |
92 | WHIPTCLSO=whiptcl.so | |
93 | else | |
94 | AC_MSG_RESULT([NOT found]) | |
95 | fi | |
ad1ae0b1 | 96 | fi |
97 | AC_SUBST([WHIPTCLSO]) | |
98 | ||
99 | AC_ARG_WITH([gpm-support], [ --with-gpm-support compile with GPM support]) | |
100 | ||
101 | if test "x$with_gpm_support" = "xyes"; then | |
102 | AC_DEFINE([USE_GPM], 1, [Define to 1 if GPM support is enabled]) | |
103 | fi | |
104 | ||
970ce9d5 | 105 | AC_ARG_ENABLE([nls], [ --disable-nls compile without NLS support]) |
106 | ||
107 | if test "x$enable_nls" != "xno"; then | |
83fe9fde ML |
108 | AC_CHECK_LIB([c], [gettext], [ ], [ |
109 | AC_CHECK_LIB([intl], [gettext], [ | |
110 | LIBS="-lintl" | |
111 | AC_SUBST([LIBS])], [ | |
112 | if test "x$enable_nls" != "xcheck"; then | |
113 | AC_MSG_FAILURE([--enable-nls was specified, but the configure check failed]) | |
114 | else | |
115 | enable_nls=no | |
116 | fi | |
117 | ]) | |
118 | ]) | |
119 | if test "x$enable_nls" != "xno"; then | |
120 | AC_DEFINE([ENABLE_NLS], 1, [Define to 1 if NLS support is enabled]) | |
121 | fi | |
970ce9d5 | 122 | fi |
123 | ||
aa4c11f3 | 124 | AC_CONFIG_FILES([Makefile libnewt.pc]) |
ad1ae0b1 | 125 | AC_OUTPUT |
126 |