~ubuntu-branches/ubuntu/feisty/digikam/feisty

« back to all changes in this revision

Viewing changes to admin/acinclude.m4.in

  • Committer: Bazaar Package Importer
  • Author(s): Achim Bohnet
  • Date: 2005-03-10 02:39:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050310023902-023nymfst5mg696c
Tags: 0.7.2-2
* debian/TODO: clean
* digikam manpage: better --detect-camera description

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
  # Don't add to $LIBS permanently.
97
97
  ac_save_LIBS="$LIBS"
98
98
  LIBS="-l$x_direct_test_library $LIBS"
99
 
AC_TRY_LINK(, [${x_direct_test_function}()],
 
99
AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
100
100
[LIBS="$ac_save_LIBS"
101
101
# We can link X programs with no special library path.
102
102
ac_x_libraries=],
561
561
AC_DEFUN([KDE_SUBST_PROGRAMS],
562
562
[
563
563
    AC_ARG_WITH(arts,
564
 
        AC_HELP_STRING([--without-arts],[build without aRts [default=yes]]),
 
564
        AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
565
565
        [build_arts=$withval],
566
566
        [build_arts=yes]
567
567
    )
568
 
    AM_CONDITIONAL(include_ARTS, test "$build_arts" != "no")
569
 
    if test "$build_arts" == "no"; then
 
568
    AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
 
569
    if test "$build_arts" = "no"; then
570
570
        AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
571
571
    fi
572
572
 
574
574
        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
575
575
        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
576
576
        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
577
 
        if test "$build_arts" != "no"; then
 
577
        if test "$build_arts" '!=' "no"; then
578
578
          KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
579
579
          KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
580
580
        fi
581
581
        KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
582
582
 
583
583
        kde32ornewer=1
 
584
        kde33ornewer=1
584
585
        if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
585
586
            kde32ornewer=
 
587
            kde33ornewer=
586
588
        else
587
 
            if test "$kde_qtver" = "3" && test "$kde_qtsubver" -le 1; then
 
589
            if test "$kde_qtver" = "3"; then
 
590
              if test "$kde_qtsubver" -le 1; then
588
591
                kde32ornewer=
 
592
              fi
 
593
              if test "$kde_qtsubver" -le 2; then
 
594
                kde33ornewer=
 
595
              fi
589
596
            fi
590
597
        fi
591
598
 
593
600
            KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
594
601
            KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
595
602
        fi
596
 
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [XMLLINT=""])
 
603
        if test -n "$kde33ornewer"; then
 
604
            KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
 
605
            AC_SUBST(MAKEKDEWIDGETS)
 
606
        fi
 
607
        KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
597
608
 
598
609
        if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
599
610
            kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
762
773
   # darwin requires a poll emulation library
763
774
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
764
775
 
 
776
   # for some image handling on Mac OS X
 
777
   AC_CHECK_HEADERS(Carbon/Carbon.h)
 
778
 
765
779
   # CoreAudio framework
766
780
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
767
781
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
873
887
  kde_use_qt_mac=no
874
888
)
875
889
 
 
890
# used to disable x11-specific stuff on special platforms
 
891
AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
 
892
 
876
893
if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
877
894
 
878
895
AC_MSG_CHECKING(for X)
968
985
  X_LDFLAGS="-L$x_libraries"
969
986
fi
970
987
all_includes="$X_INCLUDES"
971
 
all_libraries="$X_LDFLAGS"
 
988
all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
972
989
 
973
990
# Check for libraries that X11R6 Xt/Xaw programs need.
974
991
ac_save_LDFLAGS="$LDFLAGS"
1130
1147
AC_DEFUN([KDE_USE_QT],
1131
1148
[
1132
1149
if test -z "$1"; then
1133
 
  # Current default Qt version: 3.1
 
1150
  # Current default Qt version: 3.3
1134
1151
  kde_qtver=3
1135
 
  kde_qtsubver=1
 
1152
  kde_qtsubver=3
1136
1153
else
1137
1154
  kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
1138
1155
  # following is the check if subversion isnt found in passed argument
1156
1173
  if test "$kde_qtver" = "3"; then
1157
1174
    if test $kde_qtsubver -gt 0; then
1158
1175
         if test $kde_qtsubver -gt 1; then
1159
 
            kde_qt_minversion=">= Qt 3.2"
 
1176
            if test $kde_qtsubver -gt 2; then
 
1177
                kde_qt_minversion=">= Qt 3.3"
 
1178
            else
 
1179
                kde_qt_minversion=">= Qt 3.2"
 
1180
            fi
1160
1181
         else
1161
1182
            kde_qt_minversion=">= Qt 3.1 (20021021)"
1162
1183
         fi
1174
1195
if test -z "$3"; then
1175
1196
   if test $kde_qtver = 3; then
1176
1197
     if test $kde_qtsubver -gt 0; then
1177
 
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
 
1198
       kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
1178
1199
       qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
1179
1200
       kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
1180
1201
     else
1181
 
       kde_qt_verstring="QT_VERSION >= 300"
 
1202
       kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
1182
1203
     fi
1183
1204
   fi
1184
1205
   if test $kde_qtver = 2; then
1546
1567
 QT_LDFLAGS=""
1547
1568
else
1548
1569
 QT_LDFLAGS="-L$qt_libraries"
1549
 
 all_libraries="$all_libraries $QT_LDFLAGS"
 
1570
 all_libraries="$QT_LDFLAGS $all_libraries"
1550
1571
fi
1551
1572
test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
1552
1573
 
1676
1697
  AC_SUBST(KDE_NO_UNDEFINED)
1677
1698
])
1678
1699
 
 
1700
dnl Check if the linker supports --enable-new-dtags and --as-needed
 
1701
AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
 
1702
[
 
1703
  AC_ARG_ENABLE(new_ldflags,
 
1704
                AC_HELP_STRING([--enable-new-ldflags],
 
1705
                [enable the new linker flags]),
 
1706
        kde_use_new_ldflags=$enableval, 
 
1707
        kde_use_new_ldflags=no)
 
1708
 
 
1709
  LDFLAGS_AS_NEEDED=""
 
1710
  LDFLAGS_NEW_DTAGS=""
 
1711
  if test "x$kde_use_new_ldflags" = "xyes"; then
 
1712
       LDFLAGS_NEW_DTAGS=""
 
1713
       KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
 
1714
                [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
 
1715
 
 
1716
       KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
 
1717
                [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
 
1718
  fi
 
1719
  AC_SUBST(LDFLAGS_AS_NEEDED)
 
1720
  AC_SUBST(LDFLAGS_NEW_DTAGS)
 
1721
])
 
1722
 
1679
1723
AC_DEFUN([KDE_CHECK_NMCHECK],
1680
1724
[
1681
1725
  AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
1836
1880
 
1837
1881
KDE_LDFLAGS="-L$kde_libraries"
1838
1882
if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
1839
 
 all_libraries="$all_libraries $KDE_LDFLAGS"
 
1883
 all_libraries="$KDE_LDFLAGS $all_libraries"
1840
1884
fi
1841
1885
 
1842
1886
AC_SUBST(KDE_LDFLAGS)
2015
2059
   AC_SUBST(LIB_KDECORE, "-lkdecore")
2016
2060
   AC_SUBST(LIB_KDEUI, "-lkdeui")
2017
2061
   AC_SUBST(LIB_KIO, "-lkio")
 
2062
   AC_SUBST(LIB_KJS, "-lkjs")
2018
2063
   AC_SUBST(LIB_SMB, "-lsmb")
2019
2064
   AC_SUBST(LIB_KAB, "-lkab")
2020
2065
   AC_SUBST(LIB_KABC, "-lkabc")
2024
2069
   AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
2025
2070
   AC_SUBST(LIB_KUTILS, "-lkutils")
2026
2071
   AC_SUBST(LIB_KDEPIM, "-lkdepim")
 
2072
   AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
 
2073
   AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
 
2074
   AC_SUBST(LIB_KDNSSD, "-lkdnssd")
2027
2075
# these are for backward compatibility
2028
2076
   AC_SUBST(LIB_KSYCOCA, "-lkio")
2029
2077
   AC_SUBST(LIB_KFILE, "-lkio")
2277
2325
        [MKSTEMPS])
2278
2326
])
2279
2327
 
 
2328
AC_DEFUN([AC_CHECK_MKSTEMP],
 
2329
[
 
2330
        KDE_CHECK_FUNC_EXT(mkstemp, [
 
2331
#include <stdlib.h>
 
2332
#include <unistd.h>
 
2333
],
 
2334
        [
 
2335
mkstemp("/tmp/aaaXXXXXX");
 
2336
],
 
2337
        [int mkstemp(char *)],
 
2338
        [MKSTEMP])
 
2339
])
 
2340
 
2280
2341
AC_DEFUN([AC_CHECK_MKDTEMP],
2281
2342
[
2282
2343
        KDE_CHECK_FUNC_EXT(mkdtemp, [
2316
2377
  LIBS=$kde_libs_safe
2317
2378
  AC_SUBST(LIBRESOLV)
2318
2379
 
2319
 
  AC_MSG_CHECKING([if res_init is available])
2320
 
  AC_TRY_COMPILE(
 
2380
  KDE_CHECK_FUNC_EXT(res_init,
2321
2381
    [
2322
2382
#include <sys/types.h>
2323
2383
#include <netinet/in.h>
2324
2384
#include <arpa/nameser.h>
2325
2385
#include <resolv.h>
2326
2386
    ],
2327
 
    [
2328
 
      res_init();
2329
 
    ],
2330
 
    [
2331
 
      AC_MSG_RESULT(yes)
2332
 
      AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
2333
 
    ],
2334
 
    [ AC_MSG_RESULT(no) ]
2335
 
  )
 
2387
    [res_init()],
 
2388
    [int res_init(void)],
 
2389
    [RES_INIT])
2336
2390
])
2337
2391
 
2338
2392
AC_DEFUN([AC_CHECK_STRLCPY],
2360
2414
        [STRLCAT])
2361
2415
])
2362
2416
 
 
2417
AC_DEFUN([AC_CHECK_RES_QUERY],
 
2418
[
 
2419
        KDE_CHECK_FUNC_EXT(res_query, [
 
2420
#include <sys/types.h>
 
2421
#include <netinet/in.h>
 
2422
#include <arpa/nameser.h>
 
2423
#include <resolv.h>
 
2424
#include <netdb.h>
 
2425
],
 
2426
[
 
2427
res_query(NULL, 0, 0, NULL, 0);
 
2428
],
 
2429
        [int res_query(const char *, int, int, unsigned char *, int)],
 
2430
        [RES_QUERY])
 
2431
])
 
2432
 
 
2433
AC_DEFUN([AC_CHECK_DN_SKIPNAME],
 
2434
[
 
2435
        KDE_CHECK_FUNC_EXT(dn_skipname, [
 
2436
#include <sys/types.h>
 
2437
#include <netinet/in.h>
 
2438
#include <arpa/nameser.h>
 
2439
#include <resolv.h>
 
2440
],
 
2441
[
 
2442
dn_skipname (NULL, NULL);
 
2443
],
 
2444
        [int dn_skipname (unsigned char *, unsigned char *)],
 
2445
        [DN_SKIPNAME])
 
2446
])
 
2447
 
 
2448
 
2363
2449
AC_DEFUN([AC_FIND_GIF],
2364
2450
   [AC_MSG_CHECKING([for giflib])
2365
2451
AC_CACHE_VAL(ac_cv_lib_gif,
2867
2953
    fi
2868
2954
   ], [kde_use_strict_options="no"])
2869
2955
 
2870
 
  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similiar]),
 
2956
  AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
2871
2957
   [
2872
2958
    if test $enableval = "no"; then
2873
2959
         kde_use_warnings="no"
2965
3051
        CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
2966
3052
        case $host in
2967
3053
          *-*-linux-gnu)        
2968
 
            CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
 
3054
            CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
2969
3055
            CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
2970
3056
            KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
2971
3057
            KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
2980
3066
  if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
2981
3067
    CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
2982
3068
  fi
2983
 
    
 
3069
 
 
3070
  AC_ARG_ENABLE(pch,
 
3071
     AC_HELP_STRING([--enable-pch],
 
3072
                    [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
 
3073
    [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
 
3074
 
 
3075
  HAVE_GCC_VISIBILITY=0
 
3076
  AC_SUBST([HAVE_GCC_VISIBILITY])
 
3077
 
2984
3078
  if test "$GXX" = "yes"; then
2985
3079
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
2986
3080
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
2987
3081
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
2988
3082
    KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS=       )
2989
3083
    ENABLE_PERMISSIVE_FLAG="-fpermissive"
 
3084
 
 
3085
    if test "$kde_use_pch" = "yes"; then
 
3086
        AC_MSG_CHECKING(whether gcc supports precompiling c header files)
 
3087
        echo >conftest.h
 
3088
        if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
 
3089
            kde_gcc_supports_pch=yes
 
3090
            AC_MSG_RESULT(yes)
 
3091
        else
 
3092
            kde_gcc_supports_pch=no
 
3093
            AC_MSG_RESULT(no)
 
3094
        fi
 
3095
        if test "$kde_gcc_supports_pch" = "yes"; then
 
3096
            AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
 
3097
            if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
 
3098
                kde_gcc_supports_pch=yes
 
3099
                AC_MSG_RESULT(yes)
 
3100
            else
 
3101
                kde_gcc_supports_pch=no
 
3102
                AC_MSG_RESULT(no)
 
3103
            fi
 
3104
        fi
 
3105
        rm -f conftest.h conftest.h.gch
 
3106
    fi
 
3107
    AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
2990
3108
  fi
2991
3109
  if test "$CXX" = "KCC"; then
2992
3110
    dnl unfortunately we currently cannot disable exception support in KCC
2994
3112
    dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
2995
3113
    dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS=   )
2996
3114
 
2997
 
    AC_ARG_ENABLE(pch,
2998
 
        AC_HELP_STRING([--enable-pch],
2999
 
                       [enables precompiled header support (currently only KCC) [default=no]]),
3000
 
    [
3001
 
      kde_use_pch=$enableval
3002
 
    ],[kde_use_pch=no])
3003
 
 
3004
3115
    if test "$kde_use_pch" = "yes"; then
3005
3116
      dnl TODO: support --pch-dir!
3006
3117
      KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
3055
3166
  fi
3056
3167
  KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
3057
3168
 
 
3169
  AC_ARG_ENABLE(coverage,
 
3170
    AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
 
3171
      if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
 
3172
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
 
3173
        ac_coverage_linker="-lgcc"
 
3174
      elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
 
3175
        ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
 
3176
        ac_coverage_linker=""
 
3177
      else
 
3178
        AC_MSG_ERROR([coverage with your compiler is not supported])
 
3179
      fi
 
3180
      CFLAGS="$CFLAGS $ac_coverage_compiler"
 
3181
      CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
 
3182
      LDFLAGS="$LDFLAGS $ac_coverage_linker"
 
3183
    ])
 
3184
 
3058
3185
  AC_SUBST(NOOPT_CXXFLAGS)
3059
3186
  AC_SUBST(NOOPT_CFLAGS)
3060
3187
  AC_SUBST(ENABLE_PERMISSIVE_FLAG)
3061
3188
 
 
3189
  KDE_CHECK_NEW_LDFLAGS
3062
3190
  KDE_CHECK_FINAL
3063
3191
  KDE_CHECK_CLOSURE
3064
3192
  KDE_CHECK_NMCHECK
3066
3194
  ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
3067
3195
])
3068
3196
 
 
3197
AC_DEFUN([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY],
 
3198
[
 
3199
  if test "$GXX" = "yes"; then
 
3200
    KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
 
3201
    KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
 
3202
    KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
 
3203
    KDE_CHECK_COMPILER_FLAG(fvisibility=hidden, 
 
3204
    [
 
3205
        CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
 
3206
        HAVE_GCC_VISIBILITY=1
 
3207
        AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
 
3208
    ])
 
3209
  fi
 
3210
])
 
3211
 
 
3212
AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
 
3213
[
 
3214
  AC_REQUIRE([KDE_CHECK_AND_ADD_HIDDEN_VISIBILITY])
 
3215
])
 
3216
 
3069
3217
AC_DEFUN([KDE_ADD_DEPENDENCIES],
3070
3218
[
3071
3219
   [A]M_DEPENDENCIES(CC)
3099
3247
 
3100
3248
AC_DEFUN([KDE_CHECK_LIB64],
3101
3249
[
3102
 
    kdelibsuff=no
 
3250
    kdelibsuff="$kde_libs_suffix"
 
3251
    if test -z "$kdelibsuff"; then
 
3252
       kdelibsuff=no
 
3253
    fi
3103
3254
    AC_ARG_ENABLE(libsuffix,
3104
3255
        AC_HELP_STRING([--enable-libsuffix],
3105
3256
            [/lib directory suffix (64,32,none[=default])]),
3117
3268
            libdir="$libdir${kdelibsuff}"
3118
3269
            AC_SUBST([libdir], ["$libdir"])  dnl ugly hack for lib64 platforms
3119
3270
        fi
3120
 
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories)
 
3271
        AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
3121
3272
        AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
3122
3273
    fi
3123
3274
])
3152
3303
 
3153
3304
if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
3154
3305
 
3155
 
  KDE_RPATH="-R \$(kde_libraries)"
 
3306
  KDE_RPATH="-R \$(libdir)"
 
3307
 
 
3308
  if test "$kde_libraries" != "$libdir"; then
 
3309
      KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
 
3310
  fi
3156
3311
 
3157
3312
  if test -n "$qt_libraries"; then
3158
3313
    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
3173
3328
])
3174
3329
 
3175
3330
dnl Check for the type of the third argument of getsockname
3176
 
AC_DEFUN([AC_CHECK_SOCKLEN_T], [
3177
 
  AC_MSG_CHECKING(for socklen_t)
3178
 
  AC_CACHE_VAL(ac_cv_socklen_t, [
3179
 
    AC_LANG_SAVE
3180
 
    AC_LANG_CPLUSPLUS
3181
 
    AC_TRY_COMPILE([
3182
 
#include <sys/types.h>
3183
 
#include <sys/socket.h>
3184
 
      ],[
3185
 
socklen_t a=0;
3186
 
getsockname(0,(struct sockaddr*)0, &a);
3187
 
      ],
3188
 
      ac_cv_socklen_t=socklen_t,
 
3331
AC_DEFUN([AC_CHECK_SOCKLEN_T],
 
3332
[
 
3333
   AC_MSG_CHECKING(for socklen_t)
 
3334
   AC_CACHE_VAL(kde_cv_socklen_t,
 
3335
   [
 
3336
      AC_LANG_PUSH(C++)
 
3337
      kde_cv_socklen_t=no
3189
3338
      AC_TRY_COMPILE([
3190
 
#include <sys/types.h>
3191
 
#include <sys/socket.h>
3192
 
        ],[
3193
 
int a=0;
3194
 
getsockname(0,(struct sockaddr*)0, &a);
3195
 
        ],
3196
 
        ac_cv_socklen_t=int,
3197
 
        ac_cv_socklen_t=size_t
3198
 
      )
3199
 
    )
3200
 
    AC_LANG_RESTORE
3201
 
  ])
3202
 
 
3203
 
  AC_MSG_RESULT($ac_cv_socklen_t)
3204
 
  if test "$ac_cv_socklen_t" != "socklen_t"; then
3205
 
    AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
3206
 
        [Define the real type of socklen_t])
3207
 
  fi
3208
 
  AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
3209
 
 
 
3339
         #include <sys/types.h>
 
3340
         #include <sys/socket.h>
 
3341
      ],
 
3342
      [
 
3343
         socklen_t len;
 
3344
         getpeername(0,0,&len);
 
3345
      ],
 
3346
      [
 
3347
         kde_cv_socklen_t=yes
 
3348
         kde_cv_socklen_t_equiv=socklen_t
 
3349
      ])
 
3350
      AC_LANG_POP(C++)
 
3351
   ])
 
3352
   AC_MSG_RESULT($kde_cv_socklen_t)
 
3353
   if test $kde_cv_socklen_t = no; then
 
3354
      AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
 
3355
      AC_CACHE_VAL(kde_cv_socklen_t_equiv,
 
3356
      [
 
3357
         kde_cv_socklen_t_equiv=int
 
3358
         AC_LANG_PUSH(C++)
 
3359
         for t in int size_t unsigned long "unsigned long"; do
 
3360
            AC_TRY_COMPILE([
 
3361
               #include <sys/types.h>
 
3362
               #include <sys/socket.h>
 
3363
            ],
 
3364
            [
 
3365
               $t len;
 
3366
               getpeername(0,0,&len);
 
3367
            ],
 
3368
            [
 
3369
               kde_cv_socklen_t_equiv="$t"
 
3370
               break
 
3371
            ])
 
3372
         done
 
3373
         AC_LANG_POP(C++)
 
3374
      ])
 
3375
      AC_MSG_RESULT($kde_cv_socklen_t_equiv)
 
3376
   fi
 
3377
   AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
 
3378
                     [type to use in place of socklen_t if not defined])
 
3379
   AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
 
3380
                     [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
3210
3381
])
3211
3382
 
3212
3383
dnl This is a merge of some macros out of the gettext aclocal.m4
3596
3767
    AC_LANG_CPLUSPLUS
3597
3768
    ac_save_ldflags="$LDFLAGS"
3598
3769
    ac_save_cxxflags="$CXXFLAGS"
3599
 
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
 
3770
    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lGL -lGLU"
3600
3771
    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3601
3772
    LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3602
3773
    CXXFLAGS="$CFLAGS $X_INCLUDES"
3604
3775
    AC_TRY_LINK([#include <GL/gl.h>
3605
3776
#include <GL/glu.h>
3606
3777
], [],
3607
 
        ac_cv_have_gl="mesa", ac_cv_have_gl="no")
3608
 
    if test "x$ac_cv_have_gl" = "xno"; then
3609
 
      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
3610
 
      test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
3611
 
      LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
3612
 
      CXXFLAGS="$ac_save_cflags $X_INCLUDES"
3613
 
      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
3614
 
      AC_TRY_LINK([#include <GL/gl.h>
3615
 
#include <GL/glu.h>
3616
 
], [],
3617
 
          ac_cv_have_gl="yes", ac_cv_have_gl="no")
3618
 
    fi
 
3778
        ac_cv_have_gl="yes", ac_cv_have_gl="no")
3619
3779
    AC_LANG_RESTORE
3620
3780
    LDFLAGS="$ac_save_ldflags"
3621
3781
    CXXFLAGS="$ac_save_cxxflags"
3629
3789
  else
3630
3790
    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
3631
3791
    if test "$GL_LDFLAGS" = ""; then
3632
 
       if test "$ac_cv_have_gl" = "mesa"; then
3633
 
          GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
3634
 
       else
3635
 
          GLLIB='-lGLU -lGL $(LIB_X11)'
3636
 
       fi
 
3792
       GLLIB='-lGLU -lGL $(LIB_X11)'
3637
3793
    else
3638
 
       if test "$ac_cv_have_gl" = "mesa"; then
3639
 
          GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
3640
 
       else
3641
 
          GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3642
 
       fi
 
3794
       GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
3643
3795
    fi
3644
3796
    if test "$GL_INCLUDE" = ""; then
3645
3797
       GLINC=""
3938
4090
 
3939
4091
AC_DEFUN([KDE_CHECK_LIBPTHREAD],
3940
4092
[
 
4093
  dnl This code is here specifically to handle the
 
4094
  dnl various flavors of threading library on FreeBSD
 
4095
  dnl 4-, 5-, and 6-, and the (weird) rules around it.
 
4096
  dnl There may be an environment PTHREAD_LIBS that 
 
4097
  dnl specifies what to use; otherwise, search for it.
 
4098
  dnl -pthread is special cased and unsets LIBPTHREAD
 
4099
  dnl below if found.
3941
4100
  LIBPTHREAD=""
3942
4101
 
3943
4102
  if test -n "$PTHREAD_LIBS"; then
3944
 
    PTHREAD_LIBS_save="$PTHREAD_LIBS"
3945
 
    PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
3946
 
    KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [LIBPTHREAD="$PTHREAD_LIBS_save"] )
3947
 
    PTHREAD_LIBS="$PTHREAD_LIBS_save"
 
4103
    if test "x$PTHREAD_LIBS" = "x-pthread" ; then
 
4104
      LIBPTHREAD="PTHREAD"
 
4105
    else
 
4106
      PTHREAD_LIBS_save="$PTHREAD_LIBS"
 
4107
      PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
 
4108
      AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
 
4109
      KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
 
4110
          LIBPTHREAD="$PTHREAD_LIBS_save"])
 
4111
      PTHREAD_LIBS="$PTHREAD_LIBS_save"
 
4112
    fi
3948
4113
  fi
3949
4114
 
 
4115
  dnl Is this test really needed, in the face of the Tru64 test below?
3950
4116
  if test -z "$LIBPTHREAD"; then
3951
 
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
 
4117
    AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
 
4118
  fi
 
4119
 
 
4120
  dnl This is a special Tru64 check, see BR 76171 issue #18.
 
4121
  if test -z "$LIBPTHREAD" ; then
 
4122
    AC_MSG_CHECKING([for pthread_create in -lpthread])
 
4123
    kde_safe_libs=$LIBS
 
4124
    LIBS="$LIBS -lpthread"
 
4125
    AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
 
4126
        AC_MSG_RESULT(yes)
 
4127
        LIBPTHREAD="-lpthread"],[
 
4128
        AC_MSG_RESULT(no)])
 
4129
    LIBS=$kde_safe_libs
 
4130
  fi
 
4131
 
 
4132
  dnl Un-special-case for FreeBSD.
 
4133
  if test "x$LIBPTHREAD" = "xPTHREAD" ; then
 
4134
    LIBPTHREAD=""
3952
4135
  fi
3953
4136
 
3954
4137
  AC_SUBST(LIBPTHREAD)
4178
4361
 
4179
4362
AC_DEFUN([KDE_CHECK_PYTHON],
4180
4363
[
4181
 
  KDE_CHECK_PYTHON_INTERN("2.3", 
4182
 
   [KDE_CHECK_PYTHON_INTERN("2.2", 
4183
 
     [KDE_CHECK_PYTHON_INTERN("2.1", 
4184
 
       [KDE_CHECK_PYTHON_INTERN("2.0", 
4185
 
         [KDE_CHECK_PYTHON_INTERN($1, $2) ])
 
4364
  KDE_CHECK_PYTHON_INTERN("2.4",
 
4365
   [KDE_CHECK_PYTHON_INTERN("2.3", 
 
4366
     [KDE_CHECK_PYTHON_INTERN("2.2", 
 
4367
       [KDE_CHECK_PYTHON_INTERN("2.1", 
 
4368
         [KDE_CHECK_PYTHON_INTERN("2.0", 
 
4369
           [KDE_CHECK_PYTHON_INTERN($1, $2) ])
 
4370
         ])
4186
4371
       ])
4187
4372
     ])
4188
 
   ])
 
4373
  ])
4189
4374
])
4190
4375
 
4191
4376
AC_DEFUN([KDE_CHECK_STL],
4217
4402
   else
4218
4403
         AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
4219
4404
Check config.log for details - if you're using a Linux distribution you might miss
4220
 
a package named similiar to libstd++-dev.])
 
4405
a package named similar to libstdc++-dev.])
4221
4406
   fi
4222
4407
 
4223
4408
   CXXFLAGS="$ac_save_CXXFLAGS"
4309
4494
[
4310
4495
 
4311
4496
DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
 
4497
TOPSUBDIRS=""
4312
4498
 
4313
4499
if test ! -s $srcdir/subdirs; then
4314
4500
  dnl Note: Makefile.common creates subdirs, so this is just a fallback
4315
 
  TOPSUBDIRS=""
4316
4501
  files=`cd $srcdir && ls -1`
4317
4502
  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
4318
4503
  for i in $dirs; do
4512
4697
  # And delete superfluous '/' to make compares easier
4513
4698
  prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
4514
4699
  exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
 
4700
 
 
4701
  kde_libs_prefix='$(prefix)'
 
4702
  kde_libs_htmldir='$(kde_htmldir)'
 
4703
  AC_SUBST(kde_libs_prefix)
 
4704
  AC_SUBST(kde_libs_htmldir)
4515
4705
  KDE_FAST_CONFIGURE
4516
4706
  KDE_CONF_FILES
4517
4707
])
4544
4734
                    ])
4545
4735
  fi
4546
4736
  kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
 
4737
  kde_libs_suffix=`$KDECONFIG --libsuffix`
4547
4738
 
4548
4739
  AC_MSG_CHECKING([where to install])
4549
4740
  if test "x$prefix" = "xNONE"; then
5440
5631
        ])
5441
5632
    AC_SUBST(PERL)
5442
5633
])
 
5634
 
 
5635
AC_DEFUN([KDE_CHECK_LARGEFILE],
 
5636
[
 
5637
AC_SYS_LARGEFILE
 
5638
if test "$ac_cv_sys_file_offset_bits" != no; then
 
5639
  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
 
5640
fi
 
5641
 
 
5642
if test "x$ac_cv_sys_large_files" != "xno"; then
 
5643
  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
 
5644
fi
 
5645
 
 
5646
])
 
5647
 
 
5648
dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
 
5649
dnl which allows to search for libs that get installed into the KDE prefix.
 
5650
dnl
 
5651
dnl Syntax:  KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
 
5652
dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
 
5653
dnl also defines KSTUFF_PKG_ERRORS on error
 
5654
AC_DEFUN([KDE_PKG_CHECK_MODULES], [
 
5655
 
 
5656
   PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
 
5657
   if test "$prefix" != "$kde_libs_prefix"; then
 
5658
       PKG_CONFIG_PATH="$kde_libs_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
 
5659
   fi
 
5660
   export PKG_CONFIG_PATH
 
5661
   PKG_CHECK_MODULES($1,$2,$3,$4)
 
5662
])
 
5663