diff options
author | Fritz Elfert <felfert@to.com> | 2001-01-31 01:59:56 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2001-01-31 01:59:56 +0000 |
commit | 7e68b8205a603a7ec53ed0d9798126de155321f7 (patch) | |
tree | 95ffddd1b5e3dc4d1e585913cd2e95eb0ee2ae31 /conf/m4 | |
parent | 0aa44f1a1017280fd2b0b7708c5c77e8b1b214c8 (diff) | |
download | plptools-7e68b8205a603a7ec53ed0d9798126de155321f7.tar.gz plptools-7e68b8205a603a7ec53ed0d9798126de155321f7.tar.bz2 plptools-7e68b8205a603a7ec53ed0d9798126de155321f7.zip |
Reworked configuration:
- Splitted up acinclude.m4
- Added m4 macros, needed for KDE stuff
Diffstat (limited to 'conf/m4')
28 files changed, 1434 insertions, 0 deletions
diff --git a/conf/m4/kde/AC_BASE_PATH_KDE.m4 b/conf/m4/kde/AC_BASE_PATH_KDE.m4 new file mode 100644 index 0000000..0430f83 --- /dev/null +++ b/conf/m4/kde/AC_BASE_PATH_KDE.m4 @@ -0,0 +1,141 @@ +dnl ------------------------------------------------------------------------ +dnl Now, the same with KDE +dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) +dnl and $(kde_includes) will be the kdehdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN(AC_BASE_PATH_KDE, +[ +AC_PREREQ([2.13]) +AC_REQUIRE([KDE_MISC_TESTS]) +AC_REQUIRE([AC_PATH_QT])dnl +AC_CHECK_RPATH +AC_MSG_CHECKING([for KDE]) + +if test "${prefix}" != NONE; then + kde_includes=${prefix}/include + ac_kde_includes=$prefix/include + + if test "${exec_prefix}" != NONE; then + kde_libraries=${exec_prefix}/lib + ac_kde_libraries=$exec_prefix/lib + else + kde_libraries=${prefix}/lib + ac_kde_libraries=$prefix/lib + fi +else + ac_kde_includes= + ac_kde_libraries= + kde_libraries="" + kde_includes="" +fi + +AC_CACHE_VAL(ac_cv_have_kde, +[#try to guess kde locations + +if test -z "$1"; then + +kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde/include $x_includes $qt_includes" +test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR $kde_incdirs" +kde_incdirs="$ac_kde_includes $kde_incdirs" +AC_FIND_FILE(ksock.h, $kde_incdirs, kde_incdir) +ac_kde_includes="$kde_incdir" + +if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/ksock.h"; then + AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE headers installed. This will fail. +So, check this please and use another prefix!]) +fi + +kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde/lib /usr/X11R6/kde/lib" +test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs" +kde_libdirs="$ac_kde_libraries $kde_libdirs" +AC_FIND_FILE(libkdecore.la, $kde_libdirs, kde_libdir) +ac_kde_libraries="$kde_libdir" + +if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/libkdecore.la"; then +AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE libraries installed. This will fail. +So, check this please and use another prefix!]) +fi +ac_kde_libraries="$kde_libdir" + +if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then + ac_cv_have_kde="have_kde=no" +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" +fi + +else dnl test -z $1 + + ac_cv_have_kde="have_kde=no" + +fi +])dnl + +eval "$ac_cv_have_kde" + +if test "$have_kde" != "yes"; then + if test "${prefix}" = NONE; then + ac_kde_prefix="$ac_default_prefix" + else + ac_kde_prefix="$prefix" + fi + if test "$exec_prefix" = NONE; then + ac_kde_exec_prefix="$ac_kde_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix]) + else + ac_kde_exec_prefix="$exec_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix]) + fi + + kde_libraries="${ac_kde_exec_prefix}/lib" + kde_includes=${ac_kde_prefix}/include + +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" + AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes]) + + kde_libraries="$ac_kde_libraries" + kde_includes="$ac_kde_includes" +fi +AC_SUBST(kde_libraries) +AC_SUBST(kde_includes) + +if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then + KDE_INCLUDES="" +else + KDE_INCLUDES="-I$kde_includes" + all_includes="$KDE_INCLUDES $all_includes" +fi + +if test "$kde_libraries" = "$x_libraries" || test "$kde_libraries" = "$qt_libraries" ; then + KDE_LDFLAGS="" +else + KDE_LDFLAGS="-L$kde_libraries" + all_libraries="$KDE_LDFLAGS $all_libraries" +fi + +AC_SUBST(KDE_LDFLAGS) +AC_SUBST(KDE_INCLUDES) + +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +AC_SUBST(all_includes) +AC_SUBST(all_libraries) + +AC_SUBST(AUTODIRS) + +if test -z "$DCOPIDL"; then + DCOPIDL='$(kde_bindir)/dcopidl' +fi +if test -z "$DCOPIDL2CPP"; then + DCOPIDL2CPP='$(kde_bindir)/dcopidl2cpp' +fi +DCOP_DEPENDENCIES='$(DCOPIDL)' +AC_SUBST(DCOPIDL) +AC_SUBST(DCOPIDL2CPP) +AC_SUBST(DCOP_DEPENDENCIES) +]) diff --git a/conf/m4/kde/AC_CHECK_BOOL.m4 b/conf/m4/kde/AC_CHECK_BOOL.m4 new file mode 100644 index 0000000..467bc74 --- /dev/null +++ b/conf/m4/kde/AC_CHECK_BOOL.m4 @@ -0,0 +1,16 @@ +AC_DEFUN(AC_CHECK_BOOL, +[ + AC_MSG_CHECKING([for bool]) + AC_CACHE_VAL(ac_cv_have_bool, + [ + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([], + [bool aBool = true;], + [ac_cv_have_bool="yes"], + [ac_cv_have_bool="no"]) + ]) dnl end AC_CHECK_VAL + AC_MSG_RESULT($ac_cv_have_bool) + if test "$ac_cv_have_bool" = "yes"; then + AC_DEFINE(HAVE_BOOL, 1, [Define if the C++ compiler supports BOOL]) + fi +]) diff --git a/conf/m4/kde/AC_CHECK_KDEMAXPATHLEN.m4 b/conf/m4/kde/AC_CHECK_KDEMAXPATHLEN.m4 new file mode 100644 index 0000000..4255106 --- /dev/null +++ b/conf/m4/kde/AC_CHECK_KDEMAXPATHLEN.m4 @@ -0,0 +1,35 @@ +dnl ------------------------------------------------------------------------ +dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN(AC_CHECK_KDEMAXPATHLEN, +[ +AC_MSG_CHECKING(for MAXPATHLEN) +AC_CACHE_VAL(ac_cv_maxpathlen, +[ +AC_LANG_C +cat > conftest.$ac_ext <<EOF +#include <stdio.h> +#include <sys/param.h> +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +KDE_HELLO MAXPATHLEN + +EOF + +ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out" + +if AC_TRY_EVAL(ac_try) && test -s conftest.out; then + ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out` +else + ac_cv_maxpathlen=1024 +fi + +rm conftest.* + +]) +AC_MSG_RESULT($ac_cv_maxpathlen) +AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXLENPATH] ) +]) diff --git a/conf/m4/kde/AC_CHECK_KSIZE_T.m4 b/conf/m4/kde/AC_CHECK_KSIZE_T.m4 new file mode 100644 index 0000000..df09679 --- /dev/null +++ b/conf/m4/kde/AC_CHECK_KSIZE_T.m4 @@ -0,0 +1,44 @@ +dnl Check for the type of the third argument of getsockname +AC_DEFUN(AC_CHECK_KSIZE_T, +[AC_MSG_CHECKING(for the third argument of getsockname) +AC_CACHE_VAL(ac_cv_ksize_t, +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +[AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/socket.h> +],[ +socklen_t a=0; +getsockname(0,(struct sockaddr*)0, &a); +], +ac_cv_ksize_t=socklen_t, +ac_cv_ksize_t=) +if test -z "$ac_cv_ksize_t"; then +ac_safe_cxxflags="$CXXFLAGS" +if test "$GCC" = "yes"; then + CXXFLAGS="-Werror $CXXFLAGS" +fi +AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/socket.h> +],[ +int a=0; +getsockname(0,(struct sockaddr*)0, &a); +], +ac_cv_ksize_t=int, +ac_cv_ksize_t=size_t) +CXXFLAGS="$ac_safe_cxxflags" +fi +AC_LANG_RESTORE +]) + +if test -z "$ac_cv_ksize_t"; then + ac_cv_ksize_t=int +fi + +AC_MSG_RESULT($ac_cv_ksize_t) +AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t, + [Define the type of the third argument for getsockname] +) + +]) diff --git a/conf/m4/kde/AC_CHECK_RPATH.m4 b/conf/m4/kde/AC_CHECK_RPATH.m4 new file mode 100644 index 0000000..a0e94d9 --- /dev/null +++ b/conf/m4/kde/AC_CHECK_RPATH.m4 @@ -0,0 +1,26 @@ +AC_DEFUN(AC_CHECK_RPATH, +[ +AC_MSG_CHECKING(for rpath) +AC_ARG_ENABLE(rpath, + [ --disable-rpath do not use the rpath feature of ld], + USE_RPATH=$enableval, USE_RPATH=yes) + +if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then + + KDE_RPATH="-rpath \$(kde_libraries)" + + if test -n "$qt_libraries"; then + KDE_RPATH="$KDE_RPATH -rpath \$(qt_libraries)" + fi + dnl $x_libraries is set to /usr/lib in case + if test -n "$X_LDFLAGS"; then + KDE_RPATH="$KDE_RPATH -rpath \$(x_libraries)" + fi + if test -n "$KDE_EXTRA_RPATH"; then + KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" + fi +fi +AC_SUBST(KDE_EXTRA_RPATH) +AC_SUBST(KDE_RPATH) +AC_MSG_RESULT($USE_RPATH) +]) diff --git a/conf/m4/kde/AC_CREATE_KFSSTND.m4 b/conf/m4/kde/AC_CREATE_KFSSTND.m4 new file mode 100644 index 0000000..a771332 --- /dev/null +++ b/conf/m4/kde/AC_CREATE_KFSSTND.m4 @@ -0,0 +1,94 @@ +AC_DEFUN(AC_CREATE_KFSSTND, +[ +AC_MSG_CHECKING([for KDE paths]) +kde_result="" + +AC_CACHE_VAL(kde_cv_all_paths, +[ + if test -z "$kde_htmldir"; then + kde_htmldir='\$(prefix)/share/doc/HTML' + fi + if test -z "$kde_appsdir"; then + kde_appsdir='\$(prefix)/share/applnk' + fi + if test -z "$kde_icondir"; then + kde_icondir='\$(prefix)/share/icons' + fi + if test -z "$kde_sounddir"; then + kde_sounddir='\$(prefix)/share/sounds' + fi + if test -z "$kde_datadir"; then + kde_datadir='\$(prefix)/share/apps' + fi + if test -z "$kde_locale"; then + kde_locale='\$(prefix)/share/locale' + fi + if test -z "$kde_cgidir"; then + kde_cgidir='\$(exec_prefix)/cgi-bin' + fi + if test -z "$kde_confdir"; then + kde_confdir='\$(prefix)/share/config' + fi + if test -z "$kde_mimedir"; then + kde_mimedir='\$(prefix)/share/mimelnk' + fi + if test -z "$kde_toolbardir"; then + kde_toolbardir='\$(prefix)/share/toolbar' + fi + if test -z "$kde_wallpaperdir"; then + kde_wallpaperdir='\$(prefix)/share/wallpapers' + fi + if test -z "$kde_bindir"; then + kde_bindir='\$(exec_prefix)/bin' + fi + if test -z "$kde_servicesdir"; then + kde_servicesdir='\$(prefix)/share/services' + fi + if test -z "$kde_servicetypesdir"; then + kde_servicetypesdir='\$(prefix)/share/servicetypes' + fi + + kde_cv_all_paths="kde_have_all_paths=\"yes\" \ + kde_htmldir=\"$kde_htmldir\" \ + kde_appsdir=\"$kde_appsdir\" \ + kde_icondir=\"$kde_icondir\" \ + kde_sounddir=\"$kde_sounddir\" \ + kde_datadir=\"$kde_datadir\" \ + kde_locale=\"$kde_locale\" \ + kde_cgidir=\"$kde_cgidir\" \ + kde_confdir=\"$kde_confdir\" \ + kde_mimedir=\"$kde_mimedir\" \ + kde_toolbardir=\"$kde_toolbardir\" \ + kde_wallpaperdir=\"$kde_wallpaperdir\" \ + kde_bindir=\"$kde_bindir\" \ + kde_servicesdir=\"$kde_servicesdir\" \ + kde_servicetypesdir=\"$kde_servicetypesdir\" \ + kde_result=defaults" + +]) + +eval "$kde_cv_all_paths" + +if test -z "$kde_htmldir" || test -z "$kde_appsdir" || + test -z "$kde_icondir" || test -z "$kde_sounddir" || + test -z "$kde_datadir" || test -z "$kde_locale" || + test -z "$kde_cgidir" || test -z "$kde_confdir" || + test -z "$kde_mimedir" || test -z "$kde_toolbardir" || + test -z "$kde_wallpaperdir" || test -z "$kde_bindir" || + test -z "$kde_servicesdir" || + test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then + kde_have_all_paths=no + AC_MSG_ERROR([configure could not run a little KDE program to test the environment. +Since it had compiled and linked before, it must be a strange problem on your system. +Look at config.log for details. If you are not able to fix this, look at +http://www.kde.org/faq/installation.html or any www.kde.org mirror. +(If you're using an egcs version on Linux, you may update binutils!) +]) +else + rm -f conftest* + AC_MSG_RESULT($kde_result) +fi + +bindir=$kde_bindir + +]) diff --git a/conf/m4/kde/AC_FIND_FILE.m4 b/conf/m4/kde/AC_FIND_FILE.m4 new file mode 100644 index 0000000..b87ae1a --- /dev/null +++ b/conf/m4/kde/AC_FIND_FILE.m4 @@ -0,0 +1,18 @@ +dnl ------------------------------------------------------------------------ +dnl Find a file (or one of more files in a list of dirs) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN(AC_FIND_FILE, +[ +$3=NO +for i in $2; +do + for j in $1; + do + if test -r "$i/$j"; then + $3=$i + break 2 + fi + done +done +]) diff --git a/conf/m4/kde/AC_FIND_PNG.m4 b/conf/m4/kde/AC_FIND_PNG.m4 new file mode 100644 index 0000000..404a647 --- /dev/null +++ b/conf/m4/kde/AC_FIND_PNG.m4 @@ -0,0 +1,38 @@ +AC_DEFUN(AC_FIND_PNG, +[ +AC_REQUIRE([AC_FIND_ZLIB]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for libpng]) +AC_CACHE_VAL(ac_cv_lib_png, +[ +kde_save_LIBS="$LIBS" +LIBS="$LIBS $all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes" +AC_LANG_C +AC_TRY_LINK(dnl + [ + #include<png.h> + ], + [ + png_structp png_ptr = png_create_read_struct( /* image ptr */ + PNG_LIBPNG_VER_STRING, 0, 0, 0 ); + return( png_ptr != 0 ); + ], + eval "ac_cv_lib_png='-lpng $LIBZ -lm'", + eval "ac_cv_lib_png=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng]) + LIBPNG="$ac_cv_lib_png" + AC_SUBST(LIBPNG) + AC_MSG_RESULT($ac_cv_lib_png) +else + AC_MSG_RESULT(no) + LIBPNG="" + AC_SUBST(LIBPNG) +fi +]) diff --git a/conf/m4/kde/AC_FIND_ZLIB.m4 b/conf/m4/kde/AC_FIND_ZLIB.m4 new file mode 100644 index 0000000..527bf1e --- /dev/null +++ b/conf/m4/kde/AC_FIND_ZLIB.m4 @@ -0,0 +1,32 @@ +AC_DEFUN(AC_FIND_ZLIB, +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for libz]) +AC_CACHE_VAL(ac_cv_lib_z, +[ +AC_LANG_C +kde_save_LIBS="$LIBS" +LIBS="$all_libraries -lz $LIBSOCKET" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes" +AC_TRY_LINK(dnl +[ +#include<zlib.h> +], + [return (zlibVersion() == ZLIB_VERSION); ], + eval "ac_cv_lib_z='-lz'", + eval "ac_cv_lib_z=no") +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) + LIBZ="$ac_cv_lib_z" + AC_SUBST(LIBZ) + AC_MSG_RESULT($ac_cv_lib_z) +else + AC_MSG_RESULT(no) + LIBZ="" + AC_SUBST(LIBZ) +fi +]) diff --git a/conf/m4/kde/AC_PATH_KDE.m4 b/conf/m4/kde/AC_PATH_KDE.m4 new file mode 100644 index 0000000..d49c45a --- /dev/null +++ b/conf/m4/kde/AC_PATH_KDE.m4 @@ -0,0 +1,19 @@ +dnl +AC_DEFUN(AC_PATH_KDE,[ + AC_BASE_PATH_KDE + AC_ARG_ENABLE(path-check, + [ --disable-path-check don't try to find out, where to install], + [ + if test "$enableval" = "no"; then + ac_use_path_checking="default" + else + ac_use_path_checking="" + fi + ], [ac_use_path_checking="default"] + ) + + AC_CREATE_KFSSTND($ac_use_path_checking) + + AC_SUBST_KFSSTND + KDE_CREATE_LIBS_ALIASES +]) diff --git a/conf/m4/kde/AC_PATH_QT.m4 b/conf/m4/kde/AC_PATH_QT.m4 new file mode 100644 index 0000000..ba2a0ab --- /dev/null +++ b/conf/m4/kde/AC_PATH_QT.m4 @@ -0,0 +1,4 @@ +AC_DEFUN(AC_PATH_QT, +[ +AC_PATH_QT_1_3 +]) diff --git a/conf/m4/kde/AC_PATH_QT_1_3.m4 b/conf/m4/kde/AC_PATH_QT_1_3.m4 new file mode 100644 index 0000000..213d79f --- /dev/null +++ b/conf/m4/kde/AC_PATH_QT_1_3.m4 @@ -0,0 +1,168 @@ +dnl ------------------------------------------------------------------------ +dnl Try to find the Qt headers and libraries. +dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) +dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +dnl +AC_DEFUN(AC_PATH_QT_1_3,[ + AC_REQUIRE([K_PATH_X]) + AC_REQUIRE([KDE_USE_QT]) + + LIBQT="-lqt" + if test $kde_qtver = 2; then + AC_REQUIRE([AC_FIND_PNG]) + LIBQT="$LIBQT $LIBPNG" + fi + + AC_MSG_CHECKING([for Qt]) + + LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSOCKET" + ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO + qt_libraries="" + qt_includes="" + kde_qt_libs_given=no + + AC_ARG_WITH(qt-dir, + [ --with-qt-dir=DIR where the root of Qt is installed ], + [ ac_qt_includes="$withval"/include + ac_qt_libraries="$withval"/lib + ac_qt_bindir="$withval"/bin + ] + ) + + AC_ARG_WITH(qt-includes, + [ --with-qt-includes=DIR where the Qt includes are. ], + [ ac_qt_includes="$withval" ] + ) + + + AC_ARG_WITH(qt-libraries, + [ --with-qt-libraries=DIR where the Qt library is installed.], + [ ac_qt_libraries="$withval" + kde_qt_libs_given=yes + ] + ) + + AC_CACHE_VAL(ac_cv_have_qt,[ + #try to guess Qt locations + + qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/lib/qt2/include /usr/X11R6/include/X11/qt $x_includes" + test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs" + qt_incdirs="$ac_qt_includes $qt_incdirs" + + if test "$kde_qtver" = "2"; then + kde_qt_header=qstyle.h + else + kde_qt_header=qglobal.h + fi + + AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) + ac_qt_includes="$qt_incdir" + + qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt /usr/lib/qt2/lib $x_libraries" + test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs" + if test ! "$ac_qt_libraries" = "NO"; then + qt_libdirs="$ac_qt_libraries $qt_libdirs" + fi + + qt_libdir=NONE + for dir in $qt_libdirs; do + try="ls -1 $dir/libqt*" + if eval $try >/dev/null 2>&1 ; then + qt_libdir=$dir; + break; + else + echo "tried $dir" >&AC_FD_CC + fi + done + + ac_qt_libraries="$qt_libdir" + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + ac_cxxflags_safe="$CXXFLAGS" + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" + LDFLAGS="-L$qt_libdir $all_libraries" + LIBS="$LIBS $LIBQT" + + KDE_PRINT_QT_PROGRAM + + if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* + else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ac_qt_libraries="NO" + fi + rm -f conftest* + CXXFLAGS="$ac_cxxflags_safe" + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + AC_LANG_RESTORE + + if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then + ac_cv_have_qt="have_qt=no" + ac_qt_notfound="" + if test "$ac_qt_includes" = NO; then + if test "$ac_qt_libraries" = NO; then + ac_qt_notfound="(headers and libraries)"; + else + ac_qt_notfound="(headers)"; + fi + else + ac_qt_notfound="(libraries)"; + fi + + AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! ]); + else + have_qt="yes" + fi + ]) + + eval "$ac_cv_have_qt" + + if test "$have_qt" != yes; then + AC_MSG_RESULT([$have_qt]); + else + ac_cv_have_qt="have_qt=yes \ + ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" + AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes]) + + qt_libraries="$ac_qt_libraries" + qt_includes="$ac_qt_includes" + fi + + if test ! "$kde_qt_libs_given" = "yes"; then + KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) + fi + + AC_SUBST(qt_libraries) + AC_SUBST(qt_includes) + + if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then + QT_INCLUDES=""; + else + QT_INCLUDES="-I$qt_includes" + all_includes="$QT_INCLUDES $all_includes" + fi + + if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then + QT_LDFLAGS="" + else + QT_LDFLAGS="-L$qt_libraries" + all_libraries="$QT_LDFLAGS $all_libraries" + fi + + AC_SUBST(QT_INCLUDES) + AC_SUBST(QT_LDFLAGS) + AC_PATH_QT_MOC + + LIB_QT='-lqt $(LIBPNG) -lXext $(LIB_X11) $(X_PRE_LIBS)' + AC_SUBST(LIB_QT) +]) diff --git a/conf/m4/kde/AC_PATH_QT_MOC.m4 b/conf/m4/kde/AC_PATH_QT_MOC.m4 new file mode 100644 index 0000000..7eee5d8 --- /dev/null +++ b/conf/m4/kde/AC_PATH_QT_MOC.m4 @@ -0,0 +1,29 @@ +dnl ------------------------------------------------------------------------ +dnl Find the meta object compiler in the PATH, in $QTDIR/bin, and some +dnl more usual places +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN(AC_PATH_QT_MOC, +[ + KDE_FIND_PATH(moc, MOC, [$ac_qt_bindir $QTDIR/bin $QTDIR/src/moc \ + /usr/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/lib/qt2/bin \ + /usr/local/qt/bin], [KDE_MOC_ERROR_MESSAGE]) + + if test -z "$MOC"; then + if test -n "$ac_cv_path_moc"; then + eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" > cfout.$$ + fi + echo "configure:__oline__: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&AC_FD_CC + echo "configure:__oline__: moc output:" >&AC_FD_CC + cat cfout.$$ >&AC_FD_CC + + if test -s cfout.$$; then + rm -f cfout.$$ + else + KDE_MOC_ERROR_MESSAGE + fi + rm -f cfout.$$ + fi + + AC_SUBST(MOC) +]) diff --git a/conf/m4/kde/AC_SUBST_KFSSTND.m4 b/conf/m4/kde/AC_SUBST_KFSSTND.m4 new file mode 100644 index 0000000..5c1316f --- /dev/null +++ b/conf/m4/kde/AC_SUBST_KFSSTND.m4 @@ -0,0 +1,17 @@ +AC_DEFUN(AC_SUBST_KFSSTND, +[ +AC_SUBST(kde_htmldir) +AC_SUBST(kde_appsdir) +AC_SUBST(kde_icondir) +AC_SUBST(kde_sounddir) +AC_SUBST(kde_datadir) +AC_SUBST(kde_locale) +AC_SUBST(kde_cgidir) +AC_SUBST(kde_confdir) +AC_SUBST(kde_mimedir) +AC_SUBST(kde_toolbardir) +AC_SUBST(kde_wallpaperdir) +AC_SUBST(kde_bindir) +AC_SUBST(kde_servicesdir) +AC_SUBST(kde_servicetypesdir) +]) diff --git a/conf/m4/kde/KDE_CHECK_EXTRA_LIBS.m4 b/conf/m4/kde/KDE_CHECK_EXTRA_LIBS.m4 new file mode 100644 index 0000000..c7477bb --- /dev/null +++ b/conf/m4/kde/KDE_CHECK_EXTRA_LIBS.m4 @@ -0,0 +1,56 @@ +AC_DEFUN(KDE_CHECK_EXTRA_LIBS, +[ +AC_MSG_CHECKING(for extra includes) +AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR + adds non standard include paths], + kde_use_extra_includes="$withval", + kde_use_extra_includes=NONE +) +kde_extra_includes= +if test -n "$kde_use_extra_includes" && \ + test "$kde_use_extra_includes" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_includes; do + kde_extra_includes="$kde_extra_includes $dir" + all_includes="$all_includes -I$dir" + USER_INCLUDES="$USER_INCLUDES -I$dir" + done + IFS=$ac_save_ifs + kde_use_extra_includes="added" +else + kde_use_extra_includes="no" +fi +AC_SUBST(USER_INCLUDES) + +AC_MSG_RESULT($kde_use_extra_includes) + +kde_extra_libs= +AC_MSG_CHECKING(for extra libs) +AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths], + kde_use_extra_libs=$withval, + kde_use_extra_libs=NONE +) +if test -n "$kde_use_extra_libs" && \ + test "$kde_use_extra_libs" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_libs; do + kde_extra_libs="$kde_extra_libs $dir" + all_libraries="$all_libraries -L$dir" + KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir" + USER_LDFLAGS="$USER_LDFLAGS -L$dir" + done + IFS=$ac_save_ifs + kde_use_extra_libs="added" +else + kde_use_extra_libs="no" +fi + +AC_SUBST(USER_LDFLAGS) + +AC_MSG_RESULT($kde_use_extra_libs) + +]) diff --git a/conf/m4/kde/KDE_CHECK_LIBDL.m4 b/conf/m4/kde/KDE_CHECK_LIBDL.m4 new file mode 100644 index 0000000..8d230c5 --- /dev/null +++ b/conf/m4/kde/KDE_CHECK_LIBDL.m4 @@ -0,0 +1,14 @@ +AC_DEFUN(KDE_CHECK_LIBDL, +[ +AC_CHECK_LIB(dl, dlopen, [ +LIBDL="-ldl" +ac_cv_have_dlfcn=yes +]) + +AC_CHECK_LIB(dld, shl_unload, [ +LIBDL="-ldld" +ac_cv_have_shload=yes +]) + +AC_SUBST(LIBDL) +]) diff --git a/conf/m4/kde/KDE_CHECK_QT_DIRECT.m4 b/conf/m4/kde/KDE_CHECK_QT_DIRECT.m4 new file mode 100644 index 0000000..c57f927 --- /dev/null +++ b/conf/m4/kde/KDE_CHECK_QT_DIRECT.m4 @@ -0,0 +1,52 @@ +AC_DEFUN(KDE_CHECK_QT_DIRECT, +[ +AC_REQUIRE([KDE_USE_QT]) +AC_MSG_CHECKING([if Qt compiles without flags]) +AC_CACHE_VAL(kde_cv_qt_direct, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH +ac_LIBRARY_PATH="$LIBRARY_PATH" +ac_cxxflags_safe="$CXXFLAGS" +ac_ldflags_safe="$LDFLAGS" +ac_libs_safe="$LIBS" + +CXXFLAGS="$CXXFLAGS -I$qt_includes" +LDFLAGS="$X_LDFLAGS" +LIBS="-lqt -lXext -lX11 $LIBSOCKET" +LD_LIBRARY_PATH= +export LD_LIBRARY_PATH +LIBRARY_PATH= +export LIBRARY_PATH + +KDE_PRINT_QT_PROGRAM + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + kde_cv_qt_direct="yes" +else + kde_cv_qt_direct="no" + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +fi + +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" +export LD_LIBRARY_PATH +LIBRARY_PATH="$ac_LIBRARY_PATH" +export LIBRARY_PATH +AC_LANG_RESTORE +]) + +if test "$kde_cv_qt_direct" = "yes"; then + AC_MSG_RESULT(yes) + $1 +else + AC_MSG_RESULT(no) + $2 +fi +]) diff --git a/conf/m4/kde/KDE_CREATE_LIBS_ALIASES.m4 b/conf/m4/kde/KDE_CREATE_LIBS_ALIASES.m4 new file mode 100644 index 0000000..88e9780 --- /dev/null +++ b/conf/m4/kde/KDE_CREATE_LIBS_ALIASES.m4 @@ -0,0 +1,42 @@ +AC_DEFUN(KDE_CREATE_LIBS_ALIASES, +[ + AC_REQUIRE([KDE_MISC_TESTS]) + AC_REQUIRE([KDE_CHECK_LIBDL]) + AC_REQUIRE([K_PATH_X]) + +if test $kde_qtver = 2; then + LIB_KDECORE='-lkdecore' + AC_SUBST(LIB_KDECORE) + LIB_KDEUI='-lkdeui' + AC_SUBST(LIB_KDEUI) + LIB_KFORMULA='-lformula' + AC_SUBST(LIB_KFORMULA) + LIB_KIO='-lkio' + AC_SUBST(LIB_KIO) + LIB_SMB='-lsmb' + AC_SUBST(LIB_SMB) + LIB_KFILE='-lkfile' + AC_SUBST(LIB_KFILE) + LIB_KAB='-lkab' + AC_SUBST(LIB_KAB) + LIB_MEDIATOOL='-lmediatool' + AC_SUBST(LIB_MEDIATOOL) + LIB_KHTML='-lkhtml' + AC_SUBST(LIB_KHTML) + LIB_KSPELL='-lkspell' + AC_SUBST(LIB_KSPELL) +else + LIB_KDECORE='-lkdecore -lXext $(LIB_QT)' + AC_SUBST(LIB_KDECORE) + LIB_KDEUI='-lkdeui $(LIB_KDECORE)' + AC_SUBST(LIB_KDEUI) + LIB_KFM='-lkfm $(LIB_KDECORE)' + AC_SUBST(LIB_KFM) + LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)' + AC_SUBST(LIB_KFILE) + LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)' + AC_SUBST(LIB_KAB) + LIB_MEDIATOOL='-lmediatool $(LIB_KDECORE)' + AC_SUBST(LIB_MEDIATOOL) +fi +]) diff --git a/conf/m4/kde/KDE_FIND_PATH.m4 b/conf/m4/kde/KDE_FIND_PATH.m4 new file mode 100644 index 0000000..382a3d9 --- /dev/null +++ b/conf/m4/kde/KDE_FIND_PATH.m4 @@ -0,0 +1,53 @@ +dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, +dnl if-not-found, test-parameter) +AC_DEFUN(KDE_FIND_PATH, +[ + AC_MSG_CHECKING([for $1]) + kde_cache=`echo $1 | sed 'y%./+-%__p_%'` + + AC_CACHE_VAL(kde_cv_path_$kde_cache, + [ + kde_cv_path="NONE" + if test -n "$$2"; then + kde_cv_path="$$2"; + else + dirs="$3" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + dirs="$dirs $dir" + done + IFS=$kde_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5" + then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + kde_cv_path="$dir/$1" + break + fi + else + kde_cv_path="$dir/$1" + break + fi + fi + done + + fi + + eval "kde_cv_path_$kde_cache=$kde_cv_path" + + ]) + + eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" + if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($kde_cv_path) + $2=$kde_cv_path + + fi +]) diff --git a/conf/m4/kde/KDE_MISC_TESTS.m4 b/conf/m4/kde/KDE_MISC_TESTS.m4 new file mode 100644 index 0000000..30c97fe --- /dev/null +++ b/conf/m4/kde/KDE_MISC_TESTS.m4 @@ -0,0 +1,64 @@ +AC_DEFUN(KDE_MISC_TESTS, +[ + AC_LANG_C + dnl Checks for libraries. + AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD + AC_SUBST(LIBCOMPAT) + kde_have_crypt= + AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], + AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ + AC_MSG_WARN([you have no crypt in either libcrypt or libc. +You should install libcrypt from another source or configure with PAM +support]) + kde_have_crypt=no + ])) + AC_SUBST(LIBCRYPT) + if test $kde_have_crypt = yes; then + AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) + fi + AC_CHECK_KSIZE_T + AC_LANG_C + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi + AC_CHECK_FUNC(inet_ntoa) + if test $ac_cv_func_inet_ntoa = no; then + AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + fi + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat) + if test $ac_cv_func_shmat = no; then + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc") + fi + + LIBSOCKET="$X_EXTRA_LIBS" + AC_SUBST(LIBSOCKET) + AC_SUBST(X_EXTRA_LIBS) + AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 + AC_SUBST(LIBUCB) + + case $host in dnl this *is* LynxOS specific + *-*-lynxos* ) + AC_MSG_CHECKING([LynxOS header file wrappers]) + [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] + AC_MSG_RESULT(disabled) + AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS + ;; + esac + + AC_REQUIRE([KDE_CHECK_LIBDL]) + AC_CHECK_BOOL +]) diff --git a/conf/m4/kde/KDE_PRINT_QT_PROGRAM.m4 b/conf/m4/kde/KDE_PRINT_QT_PROGRAM.m4 new file mode 100644 index 0000000..71e6269 --- /dev/null +++ b/conf/m4/kde/KDE_PRINT_QT_PROGRAM.m4 @@ -0,0 +1,35 @@ +AC_DEFUN(KDE_PRINT_QT_PROGRAM,[ + AC_REQUIRE([KDE_USE_QT]) + cat > conftest.$ac_ext <<-EOF + #include "confdefs.h" + #include <qglobal.h> + #include <qapplication.h> + #include <qapp.h> + #include <qobjcoll.h> + EOF + if test "$kde_qtver" = "2"; then + cat >> conftest.$ac_ext <<-EOF + #include <qstyle.h> + #include <qiconview.h> + EOF + fi + + echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext + cat >> conftest.$ac_ext <<-EOF + #error 1 + #endif + + int main() { + EOF + if test "$kde_qtver" = "2"; then + cat >> conftest.$ac_ext <<-EOF + QStringList *t = new QStringList(); + QIconView iv(0); + iv.setWordWrapIconText(false); + EOF + fi + cat >> conftest.$ac_ext <<-EOF + return 0; + } + EOF +]) diff --git a/conf/m4/kde/KDE_USE_QT.m4 b/conf/m4/kde/KDE_USE_QT.m4 new file mode 100644 index 0000000..651ed7b --- /dev/null +++ b/conf/m4/kde/KDE_USE_QT.m4 @@ -0,0 +1,28 @@ +AC_DEFUN(KDE_USE_QT, +[ +if test -z "$1"; then + kde_qtver=2 +else + kde_qtver=$1 +fi + +if test -z "$2"; then + if test $kde_qtver = 2; then + kde_qt_minversion=">= 19991109" + else + kde_qt_minversion=">= 1.42 and < 2.0" + fi +else + kde_qt_minversion=$2 +fi + +if test -z "$3"; then + if test $kde_qtver = 2; then + kde_qt_verstring="QT_VERSION >= 200" + else + kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" + fi +else + kde_qt_verstring=$3 +fi +]) diff --git a/conf/m4/kde/K_PATH_X.m4 b/conf/m4/kde/K_PATH_X.m4 new file mode 100644 index 0000000..4e54abf --- /dev/null +++ b/conf/m4/kde/K_PATH_X.m4 @@ -0,0 +1,135 @@ +dnl ------------------------------------------------------------------------ +dnl Find the header files and libraries for X-Windows. Extended the +dnl macro AC_PATH_X +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN(K_PATH_X,[ + AC_REQUIRE([AC_PROG_CPP]) + AC_MSG_CHECKING(for X) + AC_LANG_SAVE + AC_LANG_C + AC_CACHE_VAL(ac_cv_have_x,[ + # One or both of the vars are not set, and there is no + # cached value. + if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then + kde_x_includes=NO + else + kde_x_includes=$x_includes + fi + if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then + kde_x_libraries=NO + else + kde_x_libraries=$x_libraries + fi + + # below we use the standard autoconf calls + ac_x_libraries=$kde_x_libraries + ac_x_includes=$kde_x_includes + + AC_PATH_X_DIRECT + AC_PATH_X_XMKMF + if test -z "$ac_x_includes"; then + ac_x_includes="." + fi + if test -z "$ac_x_libraries"; then + ac_x_libraries="/usr/lib" + fi + #from now on we use our own again + + # when the user already gave --x-includes, we ignore + # what the standard autoconf macros told us. + if test "$kde_x_includes" = NO; then + kde_x_includes=$ac_x_includes + fi + + if test "$kde_x_includes" = NO; then + AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) + fi + + if test "$ac_x_libraries" = NO; then + AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) + fi + + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries" + ])dnl + eval "$ac_cv_have_x" + + if test "$have_x" != yes; then + AC_MSG_RESULT($have_x) + no_x=yes + else + AC_MSG_RESULT([libraries $ac_x_libraries, headers $kde_x_includes]) + fi + + if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then + X_INCLUDES="" + x_includes="."; dnl better than nothing :- + else + x_includes=$kde_x_includes + X_INCLUDES="-I$x_includes" + fi + + if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then + X_LDFLAGS="" + x_libraries="/usr/lib"; dnl better than nothing :- + else + x_libraries=$ac_x_libraries + X_LDFLAGS="-L$x_libraries" + fi + all_includes="$all_includes $X_INCLUDES" + all_libraries="$all_libraries $X_LDFLAGS" + + AC_SUBST(X_INCLUDES) + AC_SUBST(X_LDFLAGS) + AC_SUBST(x_libraries) + AC_SUBST(x_includes) + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + AC_CHECK_LIB(ICE, IceConnectionNumber, + [LIBSM="$X_PRELIBS -lSM"], , $X_EXTRA_LIBS) + AC_SUBST(LIBSM) + LDFLAGS="$ac_save_LDFLAGS" + + AC_SUBST(X_PRE_LIBS) + + LIB_X11='-lX11 $(LIBSOCKET)' + AC_SUBST(LIB_X11) + + AC_MSG_CHECKING(for libXext) + AC_CACHE_VAL(kde_cv_have_libXext,[ + kde_ldflags_safe="$LDFLAGS" + kde_libs_safe="$LIBS" + + LDFLAGS="$X_LDFLAGS $USER_LDFLAGS" + LIBS="-lXext -lX11 $LIBSOCKET" + + AC_TRY_LINK([#include <stdio.h>],[printf("hello Xext\n");], + kde_cv_have_libXext=yes, + kde_cv_have_libXext=no + ) + + LDFLAGS=$kde_ldflags_safe + LIBS=$kde_libs_safe + ]) + + AC_MSG_RESULT($kde_cv_have_libXext) + + if test "kde_cv_have_libXext" = "no"; then + AC_MSG_ERROR([We need a working libXext to proceed. Since configure +can't find it itself, we stop here assuming that make wouldn't find +them either.]) + fi + + AC_LANG_RESTORE +]) diff --git a/conf/m4/plptools/PLP_CHECK_COMPILERS.m4 b/conf/m4/plptools/PLP_CHECK_COMPILERS.m4 new file mode 100644 index 0000000..bd61ed2 --- /dev/null +++ b/conf/m4/plptools/PLP_CHECK_COMPILERS.m4 @@ -0,0 +1,190 @@ +dnl +dnl Check for various compiler options +dnl +AC_DEFUN(PLP_CHECK_COMPILERS, +[ + dnl this is somehow a fat lie, but prevents other macros from double checking + AC_PROVIDE([AC_PROG_CC]) + AC_PROVIDE([AC_PROG_CPP]) + AC_REQUIRE([PLP_HELP_MSG]) + PLP_HELP_MSG([Generic build options:]) + AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]], + [ + if test $enableval = "no"; dnl + then ac_use_debug_code="no" + else ac_use_debug_code="yes" + fi + ], [ac_use_debug_code="no"]) + + AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], + [ + if test $enableval = "no"; then + ac_use_strict_options="no" + else + ac_use_strict_options="yes" + fi + ], [ac_use_strict_options="no"]) + +dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it + AC_MSG_CHECKING(for a C-Compiler) + dnl if there is one, print out. if not, don't matter + AC_MSG_RESULT($CC) + + if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi + if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi + if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) + + AC_PROG_CC_WORKS + AC_PROG_CC_GNU + + if test $ac_cv_prog_gcc = yes; then + GCC=yes + else + GCC= + fi + + if test -z "$CFLAGS"; then + if test "$ac_use_debug_code" = "yes"; then + AC_PROG_CC_G + if test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g" + fi + else + if test "$GCC" = "yes"; then + CFLAGS="-O2" + else + CFLAGS="" + fi + fi + + if test "$GCC" = "yes"; then + CFLAGS="$CFLAGS -Wall" + + if test "$ac_use_strict_options" = "yes"; then + CFLAGS="$CFLAGS -W -ansi -pedantic" + fi + fi + else + AC_MSG_RESULT(Using predefined CFLAGS $CFLAGS) + fi + + case "$host" in + *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";; + esac + + # + # If debugging is off, strip all programs + # + if test "$ac_use_debug_code" = "no"; then + if test -z "$LDFLAGS" && test "$GCC" = "yes"; then + LDFLAGS="-s" + fi + else + AC_DEFINE_UNQUOTED(DEBUG) + fi + + +dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks +dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?) + + AC_MSG_CHECKING(how to run the C preprocessor) + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then + AC_CACHE_VAL(ac_cv_prog_CPP, + [ # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + dnl Use a header file that comes with gcc, so configuring glibc + dnl with a fresh cross-compiler works. + AC_TRY_CPP([#include <assert.h> + Syntax Error], , + CPP="${CC-cc} -E -traditional-cpp" + AC_TRY_CPP([#include <assert.h> + Syntax Error], , CPP=/lib/cpp)) + ac_cv_prog_CPP="$CPP"])dnl + CPP="$ac_cv_prog_CPP" + else + ac_cv_prog_CPP="$CPP" + fi + AC_MSG_RESULT($CPP) + AC_SUBST(CPP)dnl + + + AC_MSG_CHECKING(for a C++-Compiler) + dnl if there is one, print out. if not, don't matter + AC_MSG_RESULT($CXX) + + if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi + if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi + if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi + if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi + test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH]) + + AC_PROG_CXX_WORKS + AC_PROG_CXX_GNU + + if test $ac_cv_prog_gxx = yes; then + GXX=yes + else + AC_MSG_CHECKING(whether we are using SPARC CC) + GXX= + cat > conftest.C << EOF +#ifdef __SUNPRO_CC + yes; +#endif +EOF + + ac_try="$CXX -E conftest.C" + if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_CC=yes + else + ac_cv_prog_CC=no + fi + AC_MSG_RESULT($ac_cv_prog_CC) + fi + + if test -z "$CXXFLAGS"; then + if test "$ac_use_debug_code" = "yes"; then + AC_PROG_CXX_G + if test $ac_cv_prog_cxx_g = yes; then + CXXFLAGS="-g" + fi + if test "$ac_cv_prog_CC" = "yes"; then + CXXFLAGS="$CXXFLAGS -pto" + fi + else + if test "$GXX" = "yes"; then + CXXFLAGS="-O2" + else + if test "$ac_cv_prog_CC" = "yes"; then + CXXFLAGS="-pto -O2" + else + CXXFLAGS="" + fi + fi + fi + + if test "$GXX" = "yes"; then + CXXFLAGS="$CXXFLAGS -Wall" + + if test "$ac_use_strict_options" = "yes"; then + CXXFLAGS="$CXXFLAGS -W -ansi -Wtraditional -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wbad-function-cast -Wsynth" + fi + + if test "$ac_very_strict" = "yes"; then + CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wshadow -Wredundant-decls -Wconversion" + fi + fi + fi + + case "$host" in + *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";; + esac + +]) diff --git a/conf/m4/plptools/PLP_CHECK_READLINE.m4 b/conf/m4/plptools/PLP_CHECK_READLINE.m4 new file mode 100644 index 0000000..1b99a19 --- /dev/null +++ b/conf/m4/plptools/PLP_CHECK_READLINE.m4 @@ -0,0 +1,41 @@ +dnl +dnl Check for libreadline and if it is available, check if it +dnl depends on libcurses. (Normally, it silently resolves the +dnl following symbols from libtermcap: +dnl tgetnum, tgoto, tgetflag, tputs, tgetent, BC, PC, UP +dnl On RedHat 7.0 however, libtermcap is broken: It contains no +dnl symbols at all. Fortunately, libcurses provides the same +dnl and therefore we have to check for that special case.) +dnl +AC_DEFUN(PLP_CHECK_READLINE, +[ + AC_MSG_CHECKING(for readline in -lreadline) + ac_cv_addcurses=false + ac_cv_have_libreadline=false + saved_libs=$LIBS + LIBS="$LIBS -lreadline" + link1ok=0 + link2ok=0 + AC_TRY_LINK(,[extern char *readline(void); readline();],link1ok=1) + LIBS="$LIBS -lreadline -lcurses" + AC_TRY_LINK(,[extern char *readline(void); readline();],link2ok=1) + LIBS="$saved_LIBS" + case "$link1ok$link2ok" in + 00) + AC_MSG_RESULT(no) + ;; + 01) + ac_cv_have_libreadline=true; + ac_cv_addcurses=true + AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE) + AC_MSG_RESULT([yes, and needs libcurses]) + ;; + 1*) + ac_cv_have_libreadline=true; + AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE) + AC_MSG_RESULT(yes) + ;; + esac + AM_CONDITIONAL(HAVE_LIBREADLINE, test x$ac_cv_have_libreadline = xtrue) + AM_CONDITIONAL(ADD_LIBCURSES, test x$ac_cv_addcurses = xtrue) +]) diff --git a/conf/m4/plptools/PLP_FIND_CDEV.m4 b/conf/m4/plptools/PLP_FIND_CDEV.m4 new file mode 100644 index 0000000..557d7e9 --- /dev/null +++ b/conf/m4/plptools/PLP_FIND_CDEV.m4 @@ -0,0 +1,17 @@ +dnl +dnl Select first existing char device from a list of given devices +dnl Usage: +dnl PLP_FIND_CDEV(/dev/tty1 /dev/tty2 /dev/console, FOUND) +dnl +dnl On return, variable FOUND is set to one of the devices or to NO, if none +dnl was found. +dnl +AC_DEFUN(PLP_FIND_CDEV,[ + $2=NO + for i in $1; do + if test -c "$i" ; then + $2=$i + break 2 + fi + done +]) diff --git a/conf/m4/plptools/PLP_FIND_FILE.m4 b/conf/m4/plptools/PLP_FIND_FILE.m4 new file mode 100644 index 0000000..868b2d5 --- /dev/null +++ b/conf/m4/plptools/PLP_FIND_FILE.m4 @@ -0,0 +1,17 @@ +dnl +dnl Select first existing file from a list of given files +dnl Usage: +dnl PLP_FIND_FILE(filea fileb filec, FOUND) +dnl +dnl On return, variable FOUND is set to one of fileX or to NO, if none +dnl was found. +dnl +AC_DEFUN(PLP_FIND_FILE,[ + $2=NO + for i in $1; do + if test -r "$i" ; then + $2=$i + break 2 + fi + done +]) diff --git a/conf/m4/plptools/PLP_HELP_MESSAGE.m4 b/conf/m4/plptools/PLP_HELP_MESSAGE.m4 new file mode 100644 index 0000000..dea8d50 --- /dev/null +++ b/conf/m4/plptools/PLP_HELP_MESSAGE.m4 @@ -0,0 +1,9 @@ +dnl +dnl Insert a custom line into the output of configure --help +dnl +AC_DEFUN(PLP_HELP_MSG,[ + AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl + ac_help="$ac_help +[$1]" + AC_DIVERT_POP()dnl +]) |