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