33
31
dnl thanks to Raja R Harinath.
34
32
dnl ------------------------------------------------------------------------
36
ifdef([_AC_PATH_X_DIRECT],[],
37
[AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
38
34
ifdef([_AC_PATH_X_XMKMF],[],
39
35
[AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
36
ifdef([AC_OUTPUT_SUBDIRS],[],
37
[AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
40
dnl Internal subroutine of AC_PATH_X.
41
dnl Set ac_x_includes and/or ac_x_libraries.
42
AC_DEFUN(KDE_PATH_X_DIRECT,
44
AC_REQUIRE([KDE_CHECK_LIB64])
46
if test "$ac_x_includes" = NO; then
47
# Guess where to find include files, by looking for this one X11 .h file.
48
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
50
# First, try using that file with no special directory specified.
51
AC_TRY_CPP([#include <$x_direct_test_include>],
52
[# We can compile using X headers with no special include directory.
54
[# Look for the header file in a standard set of common directories.
55
# Check X11 before X11Rn because it is often a symlink to the current release.
67
/usr/local/X11/include \
68
/usr/local/X11R6/include \
69
/usr/local/X11R5/include \
70
/usr/local/X11R4/include \
72
/usr/local/include/X11 \
73
/usr/local/include/X11R6 \
74
/usr/local/include/X11R5 \
75
/usr/local/include/X11R4 \
79
/usr/XFree86/include/X11 \
83
/usr/unsupported/include \
85
/usr/local/x11r5/include \
86
/usr/lpp/Xamples/include \
88
/usr/openwin/include \
89
/usr/openwin/share/include \
92
if test -r "$ac_dir/$x_direct_test_include"; then
97
fi # $ac_x_includes = NO
99
if test "$ac_x_libraries" = NO; then
100
# Check for the libraries.
102
test -z "$x_direct_test_library" && x_direct_test_library=Xt
103
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
105
# See if we find them without any special options.
106
# Don't add to $LIBS permanently.
108
LIBS="-l$x_direct_test_library $LIBS"
109
AC_TRY_LINK(, [${x_direct_test_function}()],
110
[LIBS="$ac_save_LIBS"
111
# We can link X programs with no special library path.
113
[LIBS="$ac_save_LIBS"
114
# First see if replacing the include by lib works.
115
# Check X11 before X11Rn because it is often a symlink to the current release.
116
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
117
/usr/X11/lib${kdelibsuff} \
118
/usr/X11R6/lib${kdelibsuff} \
119
/usr/X11R5/lib${kdelibsuff} \
120
/usr/X11R4/lib${kdelibsuff} \
122
/usr/lib${kdelibsuff}/X11 \
123
/usr/lib${kdelibsuff}/X11R6 \
124
/usr/lib${kdelibsuff}/X11R5 \
125
/usr/lib${kdelibsuff}/X11R4 \
127
/usr/local/X11/lib${kdelibsuff} \
128
/usr/local/X11R6/lib${kdelibsuff} \
129
/usr/local/X11R5/lib${kdelibsuff} \
130
/usr/local/X11R4/lib${kdelibsuff} \
132
/usr/local/lib${kdelibsuff}/X11 \
133
/usr/local/lib${kdelibsuff}/X11R6 \
134
/usr/local/lib${kdelibsuff}/X11R5 \
135
/usr/local/lib${kdelibsuff}/X11R4 \
137
/usr/X386/lib${kdelibsuff} \
138
/usr/x386/lib${kdelibsuff} \
139
/usr/XFree86/lib${kdelibsuff}/X11 \
141
/usr/lib${kdelibsuff} \
142
/usr/local/lib${kdelibsuff} \
143
/usr/unsupported/lib${kdelibsuff} \
144
/usr/athena/lib${kdelibsuff} \
145
/usr/local/x11r5/lib${kdelibsuff} \
146
/usr/lpp/Xamples/lib${kdelibsuff} \
147
/lib/usr/lib${kdelibsuff}/X11 \
149
/usr/openwin/lib${kdelibsuff} \
150
/usr/openwin/share/lib${kdelibsuff} \
153
dnl Don't even attempt the hair of trying to link an X program!
154
for ac_extension in a so sl; do
155
if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
156
ac_x_libraries=$ac_dir
161
fi # $ac_x_libraries = NO
41
165
dnl ------------------------------------------------------------------------
42
166
dnl Find a file (or one of more files in a list of dirs)
1669
2013
KDE_CREATE_LIBS_ALIASES
1673
AC_DEFUN(AC_CHECK_SETENV,
1675
AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
1676
AC_CHECK_FUNCS([setenv unsetenv])
1679
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
1681
AC_MSG_CHECKING(for getdomainname)
1682
AC_CACHE_VAL(ac_cv_func_getdomainname,
2016
dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
2017
AC_DEFUN(KDE_CHECK_FUNC_EXT,
2019
AC_MSG_CHECKING(for $1)
2020
AC_CACHE_VAL(kde_cv_func_$1,
1685
2023
AC_LANG_CPLUSPLUS
1686
2024
save_CXXFLAGS="$CXXFLAGS"
1687
2025
kde_safe_LIBS="$LIBS"
1688
2026
LIBS="$LIBS $X_EXTRA_LIBS"
1689
if test "$GCC" = "yes"; then
1690
CXXFLAGS="$CXXFLAGS -pedantic-errors"
2027
if test "$GXX" = "yes"; then
2028
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1692
2030
AC_TRY_COMPILE([
1698
getdomainname(buffer, 200);
1700
ac_cv_func_getdomainname=yes,
1701
ac_cv_func_getdomainname=no)
1702
2038
CXXFLAGS="$save_CXXFLAGS"
1703
2039
LIBS=$kde_safe_LIBS
1704
2040
AC_LANG_RESTORE
1706
AC_MSG_RESULT($ac_cv_func_getdomainname)
1708
AC_MSG_CHECKING([if getdomainname needs custom prototype])
1709
AC_CACHE_VAL(ac_cv_proto_getdomainname,
2043
AC_MSG_RESULT($kde_cv_func_$1)
2045
AC_MSG_CHECKING([if $1 needs custom prototype])
2046
AC_CACHE_VAL(kde_cv_proto_$1,
2048
if test "x$kde_cv_func_$1" = xyes; then
2052
setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
2053
kde_cv_proto_$1="yes - in libkdefakes"
2056
kde_cv_proto_$1=unknown
2061
if test "x$kde_cv_proto_$1" = xunknown; then
1712
2064
AC_LANG_CPLUSPLUS
1713
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1714
ac_cv_proto_getdomainname=no
1716
2065
kde_safe_libs=$LIBS
1717
2066
LIBS="$LIBS $X_EXTRA_LIBS"
1722
extern "C" int getdomainname (char *, int);
1726
getdomainname(buffer, 200);
1728
ac_cv_func_getdomainname=yes
1729
ac_cv_proto_getdomainname=yes,
1730
AC_MSG_RESULT([fatal error])
1731
AC_MSG_ERROR([getdomainname unavailable]))
2075
[ kde_cv_func_$1=yes
2076
kde_cv_proto_$1=yes ],
2077
[kde_cv_proto_$1="$1 unavailable"]
1733
2079
LIBS=$kde_safe_libs
1734
2080
AC_LANG_RESTORE
1736
AC_MSG_RESULT($ac_cv_proto_getdomainname)
1738
if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
1739
AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
1741
if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
1742
AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
1743
[Define if you have getdomainname prototype])
2083
AC_MSG_RESULT($kde_cv_proto_$1)
2085
if test "x$kde_cv_func_$1" = xyes; then
2086
AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
2089
if test "x$kde_cv_proto_$1" = xno; then
2090
AC_DEFINE(HAVE_$5_PROTO, 1,
2091
[Define if you have the $1 prototype])
2094
AH_VERBATIM([_HAVE_$5_PROTO],
2096
#if !defined(HAVE_$5_PROTO)
2105
AC_DEFUN(AC_CHECK_SETENV,
2107
KDE_CHECK_FUNC_EXT(setenv, [
2110
[setenv("VAR", "VALUE", 1);],
2111
[int setenv (const char *, const char *, int)],
2115
AC_DEFUN(AC_CHECK_UNSETENV,
2117
KDE_CHECK_FUNC_EXT(unsetenv, [
2121
[void unsetenv (const char *)],
2125
AC_DEFUN(AC_CHECK_GETDOMAINNAME,
2127
KDE_CHECK_FUNC_EXT(getdomainname, [
2133
getdomainname(buffer, 200);
2135
[int getdomainname (char *, unsigned int)],
1748
2139
AC_DEFUN(AC_CHECK_GETHOSTNAME,
1751
AC_MSG_CHECKING([for gethostname])
1752
AC_CACHE_VAL(ac_cv_func_gethostname,
1756
save_CXXFLAGS="$CXXFLAGS"
1757
if test "$GCC" = "yes"; then
1758
CXXFLAGS="$CXXFLAGS -pedantic-errors"
1766
gethostname(buffer, 200);
1768
ac_cv_func_gethostname=yes,
1769
ac_cv_func_gethostname=no)
1770
CXXFLAGS="$save_CXXFLAGS"
1773
AC_MSG_RESULT($ac_cv_func_gethostname)
1775
AC_MSG_CHECKING([if gethostname needs custom prototype])
1776
AC_CACHE_VAL(ac_cv_proto_gethostname,
1780
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1781
ac_cv_proto_gethostname=no
1787
extern "C" int gethostname (char *, int);
1791
gethostname(buffer, 200);
1793
ac_cv_func_gethostname=yes
1794
ac_cv_proto_gethostname=yes,
1795
AC_MSG_RESULT([fatal error])
1796
AC_MSG_ERROR(gethostname unavailable))
1800
AC_MSG_RESULT($ac_cv_proto_gethostname)
1802
if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
1803
AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
1804
[Define if you have gethostname prototype])
1806
if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
1807
AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
2141
KDE_CHECK_FUNC_EXT(gethostname, [
2147
gethostname(buffer, 200);
2149
[int gethostname (char *, unsigned int)],
1811
2153
AC_DEFUN(AC_CHECK_USLEEP,
1813
AC_MSG_CHECKING([for usleep])
1814
AC_CACHE_VAL(ac_cv_func_usleep,
1818
ac_libs_safe="$LIBS"
1819
LIBS="$LIBS $LIBUCB"
2155
KDE_CHECK_FUNC_EXT(usleep, [
1822
2156
#include <unistd.h>
1827
ac_cv_func_usleep=yes,
1828
ac_cv_func_usleep=no)
1829
LIBS="$ac_libs_safe"
1832
AC_MSG_RESULT($ac_cv_func_usleep)
1833
if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
1834
AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
2161
[int usleep (unsigned int)],
1838
2166
AC_DEFUN(AC_CHECK_RANDOM,
1840
AC_MSG_CHECKING([for random])
1841
AC_CACHE_VAL(ac_cv_func_random,
1845
ac_libs_safe="$LIBS"
1846
LIBS="$LIBS $LIBUCB"
2168
KDE_CHECK_FUNC_EXT(random, [
1848
2169
#include <stdlib.h>
1853
ac_cv_func_random=yes,
1854
ac_cv_func_random=no)
1855
LIBS="$ac_libs_safe"
1858
AC_MSG_RESULT($ac_cv_func_random)
1859
if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
1860
AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
2174
[long int random(void)],
2177
KDE_CHECK_FUNC_EXT(srandom, [
2183
[void srandom(unsigned int)],
2188
AC_DEFUN(AC_CHECK_INITGROUPS,
2190
KDE_CHECK_FUNC_EXT(initgroups, [
2191
#include <sys/types.h>
2197
initgroups(buffer, 27);
2199
[int initgroups(const char *, gid_t)],
2203
AC_DEFUN(AC_CHECK_MKSTEMP,
2205
KDE_CHECK_FUNC_EXT(mkstemp, [
2209
mkstemp("/tmp/aaaXXXXXX");
2211
[int mkstemp(char *)],
2215
AC_DEFUN(AC_CHECK_MKSTEMPS,
2217
KDE_CHECK_FUNC_EXT(mkstemps, [
2222
mkstemps("/tmp/aaaXXXXXX", 6);
2224
[int mkstemps(char *, int)],
2228
AC_DEFUN(AC_CHECK_RES_INIT,
2230
AC_MSG_CHECKING([if res_init needs -lresolv])
2231
kde_libs_safe="$LIBS"
2232
LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
2235
#include <sys/types.h>
2236
#include <netinet/in.h>
2237
#include <arpa/nameser.h>
2244
LIBRESOLV="-lresolv"
2246
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2248
[ AC_MSG_RESULT(no) ]
2250
LIBS="$kde_libs_safe"
2253
AC_MSG_CHECKING([if res_init is available])
2256
#include <sys/types.h>
2257
#include <netinet/in.h>
2258
#include <arpa/nameser.h>
2266
AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2268
[ AC_MSG_RESULT(no) ]
2272
AC_DEFUN(AC_CHECK_STRLCPY,
2274
KDE_CHECK_FUNC_EXT(strlcpy, [
2278
strlcpy(buf, "KDE function test", sizeof(buf));
2280
[unsigned long strlcpy(char*, const char*, unsigned long)],
2284
AC_DEFUN(AC_CHECK_STRLCAT,
2286
KDE_CHECK_FUNC_EXT(strlcat, [
2291
strlcat(buf, "KDE function test", sizeof(buf));
2293
[unsigned long strlcat(char*, const char*, unsigned long)],
1864
2297
AC_DEFUN(AC_FIND_GIF,
4138
4753
], ac_java_dir=""
4756
AC_MSG_CHECKING([for Java])
4141
4758
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
4142
if test "x$ac_java_dir" = xno; then
4143
kde_cv_java_bindir=no
4144
kde_cv_java_includedir=no
4145
kde_cv_java_libjvmdir=no
4146
kde_cv_java_libhpidir=no
4759
if test "x$ac_java_dir" = "xno"; then
4761
kde_java_includedir=no
4762
kde_java_libjvmdir=no
4763
kde_java_libhpidir=no
4148
if test "x$ac_java_dir" = x; then
4149
dnl No option set -> look in $PATH
4150
AC_CACHE_VAL(kde_cv_java_bindir,
4152
dnl First look for javac in $PATH. If not found we'll look at the option.
4153
KDE_FIND_PATH(javac, JAVAC, [], [])
4765
if test "x$ac_java_dir" = "x"; then
4768
dnl No option set -> look in $PATH
4769
KDE_JAVA_PREFIX(/usr/j2se)
4770
KDE_JAVA_PREFIX(/usr/j*dk*)
4771
KDE_JAVA_PREFIX(/usr/lib/j*dk*)
4772
KDE_JAVA_PREFIX(/opt/j*sdk*)
4773
KDE_JAVA_PREFIX(/usr/lib/java*)
4774
KDE_JAVA_PREFIX(/usr/java*)
4775
KDE_JAVA_PREFIX(/usr/java/j*dk*)
4776
KDE_JAVA_PREFIX(/usr/java/j*re*)
4777
KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
4778
KDE_JAVA_PREFIX(/usr/lib/SunJava*)
4779
KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
4780
KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
4781
KDE_JAVA_PREFIX(/opt/java*)
4786
for dir in $PATH; do
4787
javadirs="$javadirs $dir"
4792
for dir in $javadirs; do
4793
if test ! -d $dir; then break; fi
4794
if test -x "$dir/java"; then
4795
libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4796
if test ! -f $libjvmdir/libjvm.so; then continue; fi
4797
jredirs="$jredirs $dir"
4804
for dir in $jredirs; do
4806
kde_java_bindir=$dir
4807
if test -x "$dir/javac"; then
4154
4813
if test -n "$JAVAC"; then
4155
kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
4156
4814
dnl this substitution might not work - well, we test for jni.h below
4157
kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
4815
kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
4159
kde_cv_java_bindir=no
4817
kde_java_includedir=no
4163
4820
dnl config option set
4164
kde_cv_java_bindir=$ac_java_dir/bin
4165
kde_cv_java_includedir=$ac_java_dir/include
4821
kde_java_bindir=$ac_java_dir/bin
4822
if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
4823
kde_java_includedir=no
4825
kde_java_includedir=$ac_java_dir/include
4169
dnl Look for libjvm.so
4170
kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4171
dnl Look for libhpi.so and avoid green threads
4172
kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
4830
dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
4831
if test "x$kde_java_bindir" != "xno"; then
4174
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
4175
if test ! "x$kde_cv_java_bindir" = xno; then
4833
dnl Look for libjvm.so
4834
kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
4835
dnl Look for libhpi.so and avoid green threads
4836
kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
4177
4838
dnl Now check everything's fine under there
4179
if test ! -x "$kde_cv_java_bindir/javac"; then
4180
AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
4182
if test ! -x "$kde_cv_java_bindir/javah"; then
4183
AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4185
if test ! -x "$kde_cv_java_bindir/jar"; then
4186
AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
4188
if test ! -r "$kde_cv_java_includedir/jni.h"; then
4189
AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
4191
if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
4192
AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
4194
if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
4195
AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
4198
jni_includes="-I$kde_cv_java_includedir"
4199
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4200
dnl and under linux here..
4201
test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
4202
test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
4204
dnl Check for JNI version
4839
dnl the include dir is our flag for having the JDK
4840
if test -d "$kde_java_includedir"; then
4841
if test ! -x "$kde_java_bindir/javac"; then
4842
AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
4844
if test ! -x "$kde_java_bindir/javah"; then
4845
AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4847
if test ! -x "$kde_java_bindir/jar"; then
4848
AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4850
if test ! -r "$kde_java_includedir/jni.h"; then
4851
AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
4854
jni_includes="-I$kde_java_includedir"
4855
dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
4856
dnl and under linux here..
4857
test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
4858
test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
4859
test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
4866
if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
4867
AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
4870
if test ! -x "$kde_java_bindir/java"; then
4871
AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
4874
if test ! -r "$kde_java_libhpidir/libhpi.so"; then
4875
AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
4878
if test -n "$jni_includes"; then
4879
dnl Check for JNI version
4882
ac_cxxflags_safe="$CXXFLAGS"
4883
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4889
#ifndef JNI_VERSION_1_2
4892
],[ kde_jni_works=yes ],
4893
[ kde_jni_works=no ])
4895
if test $kde_jni_works = no; then
4896
AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
4897
You need to have Java Development Kit (JDK) version 1.2.
4899
Use --with-java to specify another location.
4900
Use --without-java to configure without java support.
4901
Or download a newer JDK and try again.
4902
See e.g. http://java.sun.com/products/jdk/1.2 ])
4905
CXXFLAGS="$ac_cxxflags_safe"
4908
dnl All tests ok, inform and subst the variables
4910
JAVAC=$kde_java_bindir/javac
4911
JAVAH=$kde_java_bindir/javah
4912
JAR=$kde_java_bindir/jar
4913
AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4914
JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
4915
AC_MSG_RESULT([java JDK in $kde_java_bindir])
4918
AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
4919
AC_MSG_RESULT([java JRE in $kde_java_bindir])
4922
AC_MSG_RESULT([none found])
4929
AC_SUBST(jni_includes)
4931
# for backward compat
4932
kde_cv_java_includedir=$kde_java_includedir
4933
kde_cv_java_bindir=$kde_java_bindir
4936
dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
4937
dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
4938
dnl big packages, m4_foreach is dog-slow. So use our own version of
4939
dnl it. (matz@kde.org)
4940
m4_define([mm_foreach],
4941
[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
4942
m4_define([mm_car], [[$1]])
4943
m4_define([mm_car2], [[$@]])
4944
m4_define([_mm_foreach],
4945
[m4_if(m4_quote($2), [], [],
4946
[m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
4947
mm_car2(m4_shift($2)),
4949
m4_define([AC_FOREACH],
4950
[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
4952
AC_DEFUN(KDE_NEED_FLEX,
4955
LIBS="$LIBS $USER_LDFLAGS"
4958
if test -z "$LEXLIB"; then
4959
AC_MSG_ERROR([You need to have flex installed.])
4964
AC_DEFUN(AC_PATH_QTOPIA,
4966
dnl TODO: use AC_CACHE_VAL
4968
if test -z "$1"; then
4973
qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
4974
qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
4975
qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
4978
qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
4979
qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
4981
AC_REQUIRE([AC_PATH_QT])
4983
AC_MSG_CHECKING([for Qtopia])
4986
AC_SUBST(LIB_QTOPIA)
4988
kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
4992
AC_ARG_WITH(qtopia-dir,
4993
[ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
4994
[ ac_qtopia_incdir="$withval"/include] )
4997
for dir in $kde_qtopia_dirs; do
4998
qtopia_incdirs="$qtopia_incdirs $dir/include"
5001
if test ! "$ac_qtopia_incdir" = "NO"; then
5002
qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
5006
AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
5007
ac_qtopia_incdir="$qtopia_incdir"
5009
if test -z "$qtopia_incdir"; then
5010
AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
5013
qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
5014
qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
5015
qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
5017
qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
5018
qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
5019
if test "$qtopia_ver" -lt "$qtopia_minver"; then
5020
AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
4206
5025
AC_LANG_CPLUSPLUS
4207
5027
ac_cxxflags_safe="$CXXFLAGS"
4208
CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
4214
#ifndef JNI_VERSION_1_2
5028
ac_ldflags_safe="$LDFLAGS"
5029
ac_libs_safe="$LIBS"
5031
CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
5032
LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
5033
LIBS="$LIBS $LIB_QTOPIA $LIBQT"
5035
cat > conftest.$ac_ext <<EOF
5036
#include "confdefs.h"
5037
#include <qpe/qpeapplication.h>
5038
#include <qpe/version.h>
5040
int main( int argc, char **argv )
5042
QPEApplication app( argc, argv );
5047
if AC_TRY_EVAL(ac_link) && test -s conftest; then
5051
AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
5052
the end of config.log])
5055
CXXFLAGS="$ac_cxxflags_safe"
5056
LDFLAGS="$ac_ldflags_safe"
5057
LIBS="$ac_libs_safe"
5061
QTOPIA_INCLUDES="-I$qtopia_incdir"
5062
AC_SUBST(QTOPIA_INCLUDES)
5064
AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
5068
AC_DEFUN(KDE_INIT_DOXYGEN,
5070
AC_MSG_CHECKING([for Qt docs])
5072
if test "${with_qt_dir+set}" = set; then
5073
kde_qtdir="$with_qt_dir"
5076
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html ], QTDOCDIR)
5077
AC_MSG_RESULT($QTDOCDIR)
5081
KDE_FIND_PATH(dot, DOT, [], [])
5082
if test -n "$DOT"; then
5087
AC_SUBST(KDE_HAVE_DOT)
5088
KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
5091
DOXYGEN_PROJECT_NAME="$1"
5092
DOXYGEN_PROJECT_NUMBER="$2"
5093
AC_SUBST(DOXYGEN_PROJECT_NAME)
5094
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
5097
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
5100
AC_SUBST(KDE_HAS_DOXYGEN)
5105
AC_DEFUN(AC_FIND_BZIP2,
5107
AC_MSG_CHECKING([for bzDecompress in libbz2])
5108
AC_CACHE_VAL(ac_cv_lib_bzip2,
5111
kde_save_LIBS="$LIBS"
5112
LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
5113
kde_save_CFLAGS="$CFLAGS"
5114
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
5120
[ bz_stream s; (void) bzDecompress(&s); ],
5121
eval "ac_cv_lib_bzip2='-lbz2'",
5122
eval "ac_cv_lib_bzip2=no")
5123
LIBS="$kde_save_LIBS"
5124
CFLAGS="$kde_save_CFLAGS"
5126
AC_MSG_RESULT($ac_cv_lib_bzip2)
5128
if test ! "$ac_cv_lib_bzip2" = no; then
5131
LIBBZ2="$ac_cv_lib_bzip2"
5138
KDE_CHECK_COMPILER_FLAG(shared, [
5139
ld_shared_flag="-shared"
5141
KDE_CHECK_COMPILER_FLAG(fPIC, [
5142
cxx_shared_flag="-fPIC"
5145
AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
5146
AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
5149
kde_save_LIBS="$LIBS"
5150
LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
5151
kde_save_CXXFLAGS="$CXXFLAGS"
5152
CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
5159
[ bz_stream s; (void) BZ2_bzDecompress(&s); ],
5160
eval "ac_cv_lib_bzip2_prefix='-lbz2'",
5161
eval "ac_cv_lib_bzip2_prefix=no")
5162
LIBS="$kde_save_LIBS"
5163
CXXFLAGS="$kde_save_CXXFLAGS"
5166
AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
5170
if test ! "$ac_cv_lib_bzip2_prefix" = no; then
5173
LIBBZ2="$ac_cv_lib_bzip2_prefix"
5176
AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
5177
dnl else, we just ignore this
5181
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5184
dnl ------------------------------------------------------------------------
5185
dnl Try to find the SSL headers and libraries.
5186
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5187
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5188
dnl ------------------------------------------------------------------------
5190
AC_DEFUN(KDE_CHECK_SSL,
5192
LIBSSL="-lssl -lcrypto"
5193
AC_REQUIRE([KDE_CHECK_LIB64])
5195
ac_ssl_includes=NO ac_ssl_libraries=NO
5198
AC_ARG_WITH(ssl-dir,
5199
[ --with-ssl-dir=DIR where the root of OpenSSL is installed],
5200
[ ac_ssl_includes="$withval"/include
5201
ac_ssl_libraries="$withval"/lib$kdelibsuff
5206
[ --without-ssl disable SSL checks],
5207
[want_ssl=$withval])
5209
if test $want_ssl = yes; then
5211
AC_MSG_CHECKING(for OpenSSL)
5213
AC_CACHE_VAL(ac_cv_have_ssl,
5214
[#try to guess OpenSSL locations
5216
ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
5217
ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
5218
AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
5219
ac_ssl_includes="$ssl_incdir"
5221
ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
5222
if test ! "$ac_ssl_libraries" = "NO"; then
5223
ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
5228
for dir in $ssl_libdirs; do
5229
try="ls -1 $dir/libssl*"
5230
if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
5233
ac_ssl_libraries="$ssl_libdir"
5238
ac_cflags_safe="$CFLAGS"
5239
ac_ldflags_safe="$LDFLAGS"
5240
ac_libs_safe="$LIBS"
5242
CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
5243
LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
5244
LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
5246
AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
5252
CFLAGS="$ac_cflags_safe"
5253
LDFLAGS="$ac_ldflags_safe"
5254
LIBS="$ac_libs_safe"
5258
if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
5266
eval "$ac_cv_have_ssl"
5268
AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
5270
AC_MSG_CHECKING([whether OpenSSL uses rsaref])
5271
AC_MSG_RESULT($ac_ssl_rsaref)
5273
AC_MSG_CHECKING([for easter eggs])
5274
AC_MSG_RESULT([none found])
5280
if test "$have_ssl" = yes; then
5281
AC_MSG_CHECKING(for OpenSSL version)
5282
dnl Check for SSL version
5283
AC_CACHE_VAL(ac_cv_ssl_version,
5288
cat >conftest.$ac_ext <<EOF
5289
#include <openssl/opensslv.h>
5293
#ifndef OPENSSL_VERSION_NUMBER
5294
printf("ssl_version=\\"error\\"\n");
5296
if (OPENSSL_VERSION_NUMBER < 0x00906000)
5297
printf("ssl_version=\\"old\\"\n");
5299
printf("ssl_version=\\"ok\\"\n");
4218
],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
4219
You need to have Java Development Kit (JDK) version 1.2.
4221
Use --with-java to specify another location.
4222
Use --without-java to configure without java support.
4223
Or download a newer JDK and try again.
4224
See e.g. http://java.sun.com/products/jdk/1.2 ])
4227
CXXFLAGS="$ac_cxxflags_safe"
4230
dnl All tests ok, inform and subst the variables
4231
AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
4233
JAVAC=$kde_cv_java_bindir/javac
4235
JAVAH=$kde_cv_java_bindir/javah
4237
JAR=$kde_cv_java_bindir/jar
4239
AC_SUBST(jni_includes)
4240
JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"
5305
ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
5306
if AC_TRY_EVAL(ac_compile); then
5308
if eval `./conftest 2>&5`; then
5309
if test $ssl_version = error; then
5310
AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
5312
if test $ssl_version = old; then
5313
AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
5317
ac_cv_ssl_version="ssl_version=$ssl_version"
5319
AC_MSG_ERROR([Your system couldn't run a small SSL test program.
5320
Check config.log, and if you can't figure it out, send a mail to
5321
David Faure <faure@kde.org>, attaching your config.log])
5325
AC_MSG_ERROR([Your system couldn't link a small SSL test program.
5326
Check config.log, and if you can't figure it out, send a mail to
5327
David Faure <faure@kde.org>, attaching your config.log])
5334
eval "$ac_cv_ssl_version"
5335
AC_MSG_RESULT($ssl_version)
5338
if test "$have_ssl" != yes; then
5341
AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
5342
ac_cv_have_ssl="have_ssl=yes \
5343
ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
5346
ssl_libraries="$ac_ssl_libraries"
5347
ssl_includes="$ac_ssl_includes"
5349
if test "$ac_ssl_rsaref" = yes; then
5350
LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
5353
if test $ssl_version = "old"; then
5354
AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
5358
if test "$ssl_includes" = "/usr/include" || test "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
5361
SSL_INCLUDES="-I$ssl_includes"
5364
if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
5367
SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
5370
AC_SUBST(SSL_INCLUDES)
5371
AC_SUBST(SSL_LDFLAGS)
5375
AC_DEFUN(KDE_CHECK_STRLCPY,
5379
AC_CHECK_SIZEOF(size_t)
5380
AC_CHECK_SIZEOF(unsigned long)
5382
AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
5384
#if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
5387
],[AC_MSG_RESULT([yes])],[
5390
Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
5391
does not apply. Please mail kde-devel@kde.org with a description of your system!