You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kvirc/acinclude.m4

10196 lines
354 KiB

dnl # // ##################################################################################################################
dnl # // ## Initialization
dnl # // ##################################################################################################################
AC_DEFUN([AC_SS_INIT_VARIABLES],
[
SS_BUILD_FLAGS=""
SS_BUILD_NUMBER=""
dnl # // X Stuff
SS_X_INCDIR=""
SS_X_LIBDIR=""
SS_X_LDFLAGS=""
SS_X_CPPFLAGS=""
dnl # // Qt Stuff
SS_QT3_GENERAL_DIR=""
SS_QT3_INCDIR=""
SS_QT3_LIBDIR=""
SS_QT3_MOC=""
dnl # // KDE Stuff
SS_KDE_REQUESTED="no"
SS_KDE_GENERAL_DIR=""
SS_KDE_INCDIR=""
SS_KDE_LIBDIR=""
SS_KDE_SERVICESDIR=""
SS_KDE_ICONS32DIR=""
dnl # // Perl stuff
SS_PERL_ENABLE="no"
SS_PERL_CCFLAGS=""
SS_PERL_LDFLAGS=""
SS_PERL_BINARY="true"
dnl # // CXXFLAGS, will be set by AC_SS_CXXFLAGS
dnl # CXXFLAGS=""
dnl Build flags:
dnl g - Debug version
dnl h - Memory checks
dnl m - Memory profiling
dnl s - System memmove
dnl S - splash screen
dnl o = openssl support
dnl b - Big channels
dnl x - ix86 asm
dnl T - tips
dnl c - crypt
dnl I - IPC
dnl G - GSM codec
dnl 8 - local 8 bit
dnl A - dcc sound audio support
dnl a - ignore sigalarm
dnl i - ipv6
dnl B - big endian
dnl k - KDE
dnl p - pseudo transparency
dnl e - Esound daemon support
dnl r - Arts daemon support
dnl f - Audiofile support
dnl P - profiling support
dnl p - perl scripting support
])
dnl # // ##################################################################################################################
dnl # // ## OUTPUT MACROS
dnl # // ##################################################################################################################
AC_DEFUN([AC_CROSS_COLOR],
[
TPUT=0
PRINTF=0
COLOR=0
IFS_OLD=$IFS
IFS=":"
for i in $PATH; do
if test -x "$i/tput"; then
TPUT=1
fi
done
type printf >/dev/null 2>&1 && PRINTF=1
for i in $PATH; do
if test -x "$i/printf"; then
PRINTF=1
fi
done
if test "$TPUT" = "1" -o "$PRINTF" = "1"; then
COLOR=1
fi
if test "$COLOR" = 1; then
if test "$TPUT" = "1"; then
if test "$1" = "1"; then
tput bold
else
tput sgr0
fi
if test "$2" != ""; then
tput setaf $2
fi
elif test "$PRINTF" = "1"; then
if test "$2" != ""; then
printf "\033\1330$1;3$2m"
fi
fi
fi
IFS=$IFS_OLD
])
AC_DEFUN([AC_SS_HEADER],
[
AC_CROSS_COLOR([1],[2])
echo "################################################################################"
echo "### $1"
echo "################################################################################"
AC_CROSS_COLOR([0],[9])
])
AC_DEFUN([AC_SS_SECTION],
[
AC_CROSS_COLOR([1],[3])
echo "### $1"
AC_CROSS_COLOR([0],[9])
])
AC_DEFUN([AC_SS_SET_REDINK],
[
AC_CROSS_COLOR([1],[1])
])
AC_DEFUN([AC_SS_SET_GREENINK],
[
AC_CROSS_COLOR([1],[2])
])
AC_DEFUN([AC_SS_SET_NORMALINK],
[
AC_CROSS_COLOR([0],[9])
])
dnl # // ##################################################################################################################
dnl # // ## FILE LOOKUP MACROS
dnl # // ##################################################################################################################
AC_DEFUN([AC_SS_FIND_FILE_PATH],
[
$3="FAILED"
for a_dir in $2; do
for a_file in $1; do
if test -r "$a_dir/$a_file"; then
$3=$(echo "$a_dir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g')
break 2
fi
done
done
])
AC_DEFUN([AC_SS_FIND_FILE_PATH_EXT],
[
$4="FAILED"
for a_dir in $2; do
for a_semidir in $3; do
for a_file in $1; do
if test -r "$a_dir/$a_semidir/$a_file"; then
$4=$(echo "$a_dir/$a_semidir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g')
break 3
fi
done
done
done
])
dnl # // ##################################################################################################################
dnl # // ## BASIC COMPILER FLAGS
dnl # // ##################################################################################################################
AC_DEFUN([AC_SS_CXXFLAGS_DEBUG_SYMBOLS],
[
dnl # // Checks if the --with-debug-symbols option has been passed to configure
dnl # // adds -g to SS_CXXFLAGS
dnl # // adds g to SS_BUILD_FLAGS
AC_MSG_CHECKING([if you want the debug symbols])
SS_LOCAL_ADD_DEBUG_SYMBOLS=""
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[Compile an executable suitable for debugging]),
[SS_LOCAL_ADD_DEBUG_SYMBOLS="true"])
if test -n "$SS_LOCAL_ADD_DEBUG_SYMBOLS"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -g"
else
SS_CXXFLAGS="-g"
fi
SS_BUILD_FLAGS="g$SS_BUILD_FLAGS"
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_PIPES],
[
dnl # // Checks if the --with-pipes option has been passed to configure
dnl # // adds -pipe to CXXFLAGS
AC_MSG_CHECKING([if you want to use pipes for compilation])
SS_LOCAL_USE_PIPES=""
AC_ARG_ENABLE(pipes,
AC_HELP_STRING([--enable-pipes],[Use pipes instead of files for the compilation]),
[SS_LOCAL_USE_PIPES="true"])
if test -n "$SS_LOCAL_USE_PIPES"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -pipe"
else
SS_CXXFLAGS="-pipe"
fi
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_PROFILING],
[
AC_MSG_CHECKING([if you want the profiling information])
SS_LOCAL_ADD_PROFILING=""
AC_ARG_ENABLE(profiling,
AC_HELP_STRING([--enable-profiling],[Compile an executable suitable for profiling]),
[SS_LOCAL_ADD_PROFILING="true"])
if test -n "$SS_LOCAL_ADD_PROFILING"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -pg"
else
SS_CXXFLAGS="-pg"
fi
if test -n "$SS_LDFLAGS"; then
SS_LDFLAGS="$SS_LDFLAGS -pg"
else
SS_LDFLAGS="-pg"
fi
SS_BUILD_FLAGS="P$SS_BUILD_FLAGS"
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_FNORTTI],
[
AC_MSG_CHECKING([if you want to use -fno-rtti])
SS_LOCAL_FNORTTI=""
AC_ARG_ENABLE(fno-rtti,
AC_HELP_STRING([--enable-fno-rtti],[Disable runtime type information (dangerous)]),
SS_LOCAL_FNORTTI="true")
if test -n "$SS_LOCAL_FNORTTI"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -fno-rtti"
else
SS_CXXFLAGS="-fno-rtti"
fi
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_ANSI],
[
SS_ANSI_COMPILATION=""
AC_MSG_CHECKING([if you want a strict ansi compilation])
AC_ARG_ENABLE(ansi,
AC_HELP_STRING([--enable-ansi],[Strict ansi compilation (might not compile)]),
SS_ANSI_COMPILATION="true")
if test -n "$SS_ANSI_COMPILATION"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -ansi"
else
SS_CXXFLAGS="-ansi"
fi
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_WALL],
[
SS_WALL_COMPILATION=""
AC_MSG_CHECKING([if you want gcc to be paranoic])
AC_ARG_ENABLE(wall,
AC_HELP_STRING([--enable-wall],[Make gcc be paranoic (might not compile)]),
SS_WALL_COMPILATION="true")
if test -n "$SS_WALL_COMPILATION"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -Wall"
else
SS_CXXFLAGS="-Wall"
fi
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_PEDANTIC],
[
SS_PEDANTIC_COMPILATION=""
AC_MSG_CHECKING([if you want a strict ansi compilation])
AC_ARG_ENABLE(pedantic,
AC_HELP_STRING([--enable-pedantic],[Pedantic compilation (might not compile)]),
SS_PEDANTIC_COMPILATION="true")
if test -n "$SS_PEDANTIC_COMPILATION"; then
AC_MSG_RESULT([yes])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -pedantic"
else
SS_CXXFLAGS="-pedantic"
fi
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS_OPTIMISATION],
[
AC_MSG_CHECKING([for the optimisation level])
SS_LOCAL_OPTIMISATION=""
AC_ARG_ENABLE(optimisation,
AC_HELP_STRING([--enable-optimisation=N],[Use optimisation level N when compiling]),
SS_LOCAL_OPTIMISATION="$enableval")
if test -n "$SS_LOCAL_OPTIMISATION"; then
AC_MSG_RESULT([using -O$SS_LOCAL_OPTIMISATION])
if test -n "$SS_CXXFLAGS"; then
SS_CXXFLAGS="$SS_CXXFLAGS -O$SS_LOCAL_OPTIMISATION"
else
SS_CXXFLAGS="-O$SS_LOCAL_OPTIMISATION"
fi
SS_BUILD_FLAGS="$SS_LOCAL_OPTIMISATION$SS_BUILD_FLAGS"
else
AC_MSG_RESULT([using no optimisation flag])
fi
])
AC_DEFUN([AC_SS_CXXFLAGS],
[
SS_CXXFLAGS=""
AC_SS_CXXFLAGS_DEBUG_SYMBOLS
AC_SS_CXXFLAGS_PROFILING
AC_SS_CXXFLAGS_PIPES
AC_SS_CXXFLAGS_OPTIMISATION
AC_SS_CXXFLAGS_FNORTTI
AC_SS_CXXFLAGS_ANSI
AC_SS_CXXFLAGS_PEDANTIC
AC_SS_CXXFLAGS_WALL
if test -n "$SS_CXXFLAGS"; then
if test -n "$CXXFLAGS"; then
CXXFLAGS="$CXXFLAGS $SS_CXXFLAGS"
else
CXXFLAGS="$SS_CXXFLAGS"
fi
fi
])
dnl ###################################################################################################################
dnl ### HEADERS AND FUNCTIONS
dnl ###################################################################################################################
AC_DEFUN([AC_SS_HEADER_CHECKS],
[
SS_HAS_OSS_SUPPORT="false"
AC_CHECK_HEADER(strings.h)
AC_CHECK_HEADERS(linux/soundcard.h sys/soundcard.h soundcard.h,SS_HAS_OSS_SUPPORT="true")
if test "$SS_HAS_OSS_SUPPORT" = "true"; then
AC_DEFINE([COMPILE_OSS_SUPPORT], 1, [define if you want to enable OSS sound support])
fi
])
AC_DEFUN([AC_SS_FUNCTION_CHECKS],
[
SS_HAVE_IPV6_FUNCTIONS="true"
AC_CHECK_FUNCS(getenv strerror)
AC_CHECK_FUNCS(inet_ntoa inet_aton)
AC_CHECK_FUNCS(setenv unsetenv putenv)
AC_CHECK_FUNCS(gmtime_r localtime_r)
AC_CHECK_FUNC(inet_ntop,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
AC_CHECK_FUNC(inet_pton,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
AC_CHECK_FUNC(getaddrinfo,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
AC_CHECK_FUNCS(getnameinfo)
])
dnl ###################################################################################################################
dnl ### MISC OPTIONS
dnl ###################################################################################################################
AC_DEFUN([AC_SS_MISC_OPTIONS],
[
AC_MSG_CHECKING([if you want the memory profiling])
AC_ARG_WITH(memory-profile, [ --with-memory-profile Compile the memory profile],SS_COMPILE_MEMORY_PROFILE="true")
if test "$SS_COMPILE_MEMORY_PROFILE" = "true"; then
AC_MSG_RESULT(yes)
AC_DEFINE([COMPILE_MEMORY_PROFILE], 1, [define if you want the gcc memory profile])
SS_BUILD_FLAGS="m$SS_BUILD_FLAGS"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([how to waste your time])
AC_MSG_RESULT(by performing senseless checks)
AC_MSG_CHECKING([if you want memory checking in malloc])
AC_ARG_WITH(memory-checks, [ --with-memory-checks Enable malloc memory checks],SS_COMPILE_MEMORY_CHECKS="true")
if test "$SS_COMPILE_MEMORY_CHECKS" = "true"; then
AC_MSG_RESULT(yes)
AC_DEFINE([COMPILE_MEMORY_CHECKS], 1, [define if you want the memory checks])
SS_BUILD_FLAGS="h$SS_BUILD_FLAGS"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to use system memmove])
AC_ARG_WITH(system-memmove, [ --without-system-memmove Do not use system memmove and memcpy],SS_DO_NOT_USE_SYSTEM_MEMMOVE="true")
if test "$SS_DO_NOT_USE_SYSTEM_MEMMOVE" = "true"; then
AC_MSG_RESULT(no)
else
AC_DEFINE([COMPILE_WITH_SYSTEM_MEMMOVE], 1, [define if you trust your memmove() function])
AC_MSG_RESULT(yes)
SS_BUILD_FLAGS="s$SS_BUILD_FLAGS"
fi
AC_MSG_CHECKING([if you want to optimize for big channels])
AC_ARG_WITH(big-channels, [ --with-big-channels Optimize for big irc channels],SS_OPTIMIZE_BIG_CHANNELS="true")
if test "$SS_OPTIMIZE_BIG_CHANNELS" = "true"; then
AC_MSG_RESULT(yes: using 349 as dict size)
AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],349, [define this to the number of average channel users])
SS_BUILD_FLAGS="b$SS_BUILD_FLAGS"
else
AC_MSG_RESULT(no: using 101 as dict size)
AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],101, [define this to the number of average channel users])
fi
AC_MSG_CHECKING([if you want ix86 assembly optimisations])
AC_ARG_WITH(ix86-asm, [ --with-ix86-asm Compile ix86 assembly optimisations],SS_COMPILE_ix86_ASM="true")
if test "$SS_COMPILE_ix86_ASM" = "true"; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(target system CPU)
if test "$target_cpu" = "i386"; then
AC_MSG_RESULT(i386 : compiling asm code)
else
if test "$target_cpu" = "i486"; then
AC_MSG_RESULT(i486 : compiling asm code)
else
if test "$target_cpu" = "i586"; then
AC_MSG_RESULT(i586 : compiling asm code)
else
if test "$target_cpu" = "i686"; then
AC_MSG_RESULT(i686 : compiling asm code)
else
AC_MSG_RESULT($target_cpu , no i386 optimisations)
unset SS_COMPILE_ix86_ASM
fi
fi
fi
fi
if test "$SS_COMPILE_ix86_ASM" = "true"; then
AC_DEFINE([COMPILE_ix86_ASM], 1, [define if you want the i386 asm code])
SS_BUILD_FLAGS="x$SS_BUILD_FLAGS"
fi
else
AC_MSG_RESULT(no)
fi
AC_PATH_PROG(SS_MSGFMT,msgfmt,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin)
if test -z "SS_MSGFMT"; then
SS_MSGFMT=":"
fi
AC_SUBST(SS_MSGFMT)
AC_MSG_CHECKING([if you want the DCC VOICE sound support])
AC_ARG_WITH(dcc-sound,[ --without-dcc-sound Do not compile the DCC VOICE sound support],SS_NO_SOUND="true")
if test "$SS_NO_SOUND" = "true"; then
AC_MSG_RESULT(no)
AC_DEFINE([COMPILE_DISABLE_DCC_VOICE], 1, [define if you want to disable DCC VOICE sound support])
else
AC_MSG_RESULT(yes)
SS_BUILD_FLAGS="A$SS_BUILD_FLAGS"
fi
SS_BUILD_FLAGS="T$SS_BUILD_FLAGS"
AC_DEFINE([COMPILE_INFO_TIPS], 1, [define if you want the info tips to be compiled in])
AC_MSG_CHECKING([if you want to disable the ipV6 support])
AC_ARG_WITH(ipv6-support,[ --without-ipv6-support Do not compile the IpV6 support],SS_NOIPV6_SUPPORT="true")
if test "$SS_NOIPV6_SUPPORT" = "true"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to disable the cryptography support])
AC_ARG_WITH(crypt-support,[ --without-crypt-support Do not compile the cryptography support],SS_NOCRYPT_SUPPORT="true")
if test "$SS_NOCRYPT_SUPPORT" = "true"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_DEFINE([COMPILE_CRYPT_SUPPORT], 1, [define if you want to compile the crypt support])
SS_BUILD_FLAGS="c$SS_BUILD_FLAGS"
fi
AC_MSG_CHECKING([if you want to disable the X bell support])
AC_ARG_WITH(x-bell,[ --without-x-bell Disable the X bell support],SS_NO_X_BELL="true")
if test "$SS_NO_X_BELL" = "true"; then
AC_MSG_RESULT(yes)
AC_DEFINE([COMPILE_NO_X_BELL], 1, [define if you want to disable the X bell support])
else
AC_MSG_RESULT(no)
fi
AC_DEFINE([COMPILE_NEW_KVS], 1, [define if you want to enable the new KVS parser])
AC_DEFINE([COMPILE_ONLY_NEW_KVS], 1, [define if you want to use only the new KVS parser])
AC_MSG_CHECKING([if you want to link to the embedded version of qt])
AC_ARG_WITH(qt-embedded,[ --with-qt-embedded Link to qt-embedded (see INSTALL)],SS_QT3_EMBEDDED="true")
if test "$SS_QT3_EMBEDDED" = "true"; then
AC_MSG_RESULT(yes)
SS_BUILD_FLAGS="E$SS_BUILD_FLAGS"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to disable inter-process communication])
AC_ARG_WITH(ipc,[ --without-ipc Disable inter-process communication support],SS_NO_IPC="true")
if test "$SS_NO_IPC" = "true"; then
AC_MSG_RESULT(yes)
SS_BUILD_FLAGS="I$SS_BUILD_FLAGS"
AC_DEFINE([COMPILE_NO_IPC], 1, [define this if you want to disable the inter-process communication support])
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to explicitly disable the gsm codec support])
AC_ARG_WITH(gsm,[ --without-gsm Disable gsm codec support],SS_NO_GSM="true")
if test "$SS_NO_GSM" = "true"; then
AC_MSG_RESULT(yes)
else
AC_DEFINE([COMPILE_USE_GSM], 1, [define if you have libgsm and want the GSM code to be compiled])
SS_BUILD_FLAGS="G$SS_BUILD_FLAGS"
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to ignore SIGALARM])
AC_ARG_WITH(ignore-sigalarm, [ --with-ignore-sigalarm Ignore SIGALARM in all threads],SS_IGNORE_SIGALARM="true")
if test "$SS_IGNORE_SIGALARM" = "true"; then
AC_MSG_RESULT(yes)
AC_DEFINE([COMPILE_IGNORE_SIGALARM], 1, [define this if you want to ignore the SIGALARM signal])
SS_BUILD_FLAGS="a$SS_BUILD_FLAGS"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want the pseudo-transparency support])
AC_ARG_WITH(transparency, [ --without-transparency Do NOT compile the pseudo-transparency support],SS_NO_PSEUDO_TRANSPARENCY="true")
if test "$SS_NO_PSEUDO_TRANSPARENCY" = "true"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
AC_DEFINE([COMPILE_PSEUDO_TRANSPARENCY], 1, [define if you have the KDE support and want the pseudo transparency])
SS_BUILD_FLAGS="p$SS_BUILD_FLAGS"
fi
AC_ARG_WITH(pizza,[ --with-pizza Use this when hungry],SS_PIZZA="true")
])
dnl ###################################################################################################################
dnl ### DYNAMIC LABELS
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_DYNAMIC_LABELS],
[
AC_MSG_CHECKING([if the compiler supports dynamic labels])
AC_ARG_WITH(dyn-labels, [ --without-dyn-labels Disable usage of the dynamic label jumps],SS_DISABLE_DYNAMIC_LABELS="true")
if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then
AC_MSG_RESULT("no: trusting you")
else
AC_TRY_RUN([
int main(int argc,char ** argv)
{
int retVal = 10;
void * label = &&action4;
goto action2;
action1:
retVal -= 4;
label = &&endofcode;
goto *label;
action2:
retVal -= 5;
goto *label;
action3:
retVal += 40;
action4:
retVal -= 1;
label = &&action1;
goto *label;
endofcode:
return retVal;
}
],SS_DISABLE_DYNAMIC_LABELS="false",SS_DISABLE_DYNAMIC_LABELS="true",SS_DISABLE_DYNAMIC_LABELS="true")
if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then
AC_MSG_RESULT("no")
else
AC_MSG_RESULT("yes")
AC_DEFINE([COMPILE_USE_DYNAMIC_LABELS], 1, [define if your compiler supports gotos do dynamic labels])
fi
fi
])
dnl ###################################################################################################################
dnl ### BIG_ENDIAN
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_BIG_ENDIAN],
[
AC_MSG_CHECKING([if this system is big endian])
AC_TRY_RUN([
int main(int argc,char ** argv)
{
int nl;
unsigned char * nlc;
nl = 0x12CAFE34;
nlc = (unsigned char *)(&nl);
if((nlc[0] == 0x12) && (nlc[1] == 0xCA) && (nlc[2] == 0xFE) && (nlc[3] == 0x34))return 0;
return 1;
}
],SS_BIG_ENDIAN_MACHINE="true",SS_BIG_ENDIAN_MACHINE="false",SS_BIG_ENDIAN_MACHINE="false")
dnl # This will fail if we're cross compiling...
if test "$SS_BIG_ENDIAN_MACHINE" = "true"; then
AC_MSG_RESULT([yes])
SS_BUILD_FLAGS="B$SS_BUILD_FLAGS"
AC_DEFINE([BIG_ENDIAN_MACHINE_BYTE_ORDER], 1, [define this if you are on a big endian machine])
else
AC_MSG_RESULT([no])
fi
])
dnl ###################################################################################################################
dnl ### DLOPEN
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_DL],
[
AC_MSG_CHECKING([for dlopen capabilities])
SS_LINK_TO_LIBDL="no"
SS_SAVE_LIBS="$LIBS"
LIBS="-rdynamic"
AC_TRY_LINK([
#include <dlfcn.h>
],[
/* sparc-unknown-openbsd3.0 hack */
#ifndef RTLD_NOW
#define RTLD_NOW RTLD_LAZY
#endif
dlopen("/lib/libc.so.6",RTLD_NOW);
],
eval "SS_DLOPEN_OK=yes"
,
eval "SS_DLOPEN_OK=no"
)
LIBS="$SS_SAVE_LIBS"
if test "$SS_DLOPEN_OK" = "yes"; then
AC_MSG_RESULT([builtin in libc])
else
SS_SAVE_LIBS="$LIBS"
LIBS="-rdynamic -ldl"
AC_TRY_LINK([
#include <dlfcn.h>
],[
/* sparc-unknown-openbsd3.0 hack */
#ifndef RTLD_NOW
#define RTLD_NOW RTLD_LAZY
#endif
dlopen("/usr/lib/libdl.so",RTLD_NOW);
],
eval "SS_DLOPEN_OK=yes",
eval "SS_DLOPEN_OK=no"
)
LIBS="$SS_SAVE_LIBS"
if test "$SS_DLOPEN_OK" = "yes"; then
SS_LINK_TO_LIBDL="yes"
AC_MSG_RESULT([external in libdl])
else
AC_MSG_RESULT([FAILED])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### No dlopen capabilities found."
echo "### It looks that your system has no interface to the dynamic linker ?"
echo "### If you're on linux, you either miss libdl , or the linker is not"
echo "### able to find it. Make sure that libdl is in /lib or /usr/lib."
echo "### If you're sure you have libdl, make sure you have also g++ installed."
echo "### If you're not on linux, please drop a mail to pragma at kvirc dot net"
echo "### describing your system and I'll try to fix it."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR(["This was fatal...aborting"])
fi
fi
])
dnl ###################################################################################################################
dnl ### PERL
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_PERL],
[
SS_PERL_ENABLE="yes"
SS_PERL_CCFLAGS=""
SS_PERL_LDFLAGS=""
SS_PERL_BINARY="true"
SS_PERL_RESULT_MESSAGE=""
AC_ARG_ENABLE(perl,AC_HELP_STRING([--enable-perl],[Enable perl scripting support (default=detect)]),eval "SS_PERL_ENABLE=$enableval")
if test "$SS_PERL_ENABLE" = "yes"; then
AC_PATH_PROG(SS_PERL_BINARY,perl,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin)
if test -z "SS_PERL_BINARY"; then
SS_PERL_RESULT_MESSAGE="disabled: can't find the perl binary"
SS_PERL_ENABLE="no"
SS_PERL_BINARY="true"
fi
else
SS_PERL_RESULT_MESSAGE="disabled by user"
fi
if test "$SS_PERL_ENABLE" = "yes"; then
AC_MSG_CHECKING([if perl il compiled with MULTIPLICITY option])
SS_PERL_TEMP=$($SS_PERL_BINARY -V | grep MULTIPLICITY)
if test -z "$SS_PERL_TEMP"; then
AC_MSG_RESULT([no])
SS_PERL_ENABLE="no"
SS_PERL_BINARY="true"
SS_PERL_RESULT_MESSAGE="disabled: MULTIPLICITY not defined"
fi
fi
if test "$SS_PERL_ENABLE" = "yes"; then
AC_MSG_CHECKING([for the system perl directory])
SS_PERL_DIR=$($SS_PERL_BINARY -MConfig -e 'print $Config{archlib}')
SS_PERL_DIR="$SS_PERL_DIR/CORE"
AC_MSG_RESULT([got $SS_PERL_DIR])
AC_MSG_CHECKING([for the perl ccflags])
SS_PERL_CCFLAGS=$($SS_PERL_BINARY -MConfig -e 'print $Config{ccflags}')
AC_MSG_RESULT([got $SS_PERL_CCFLAGS])
AC_MSG_CHECKING([for the perl ldflags])
SS_PERL_LDFLAGS=$($SS_PERL_BINARY -MExtUtils::Embed -e ldopts)
AC_MSG_RESULT([got $SS_PERL_LDFLAGS])
AC_MSG_CHECKING([if we can compile a perl application])
SS_SAVED_LIBS="$LIBS"
SS_SAVED_CFLAGS="$CFLAGS"
SS_SAVED_CCFLAGS="$CCFLAGS"
SS_SAVED_LDFLAGS="$LDFLAGS"
SS_SAVED_CXXFLAGS="$CXXFLAGS"
SS_SAVED_CPPFLAGS="$CPPFLAGS"
LIBS="$SS_PERL_LDFLAGS"
LDFLAGS="$LIBS"
CFLAGS="$SS_PERL_CCFLAGS -I$SS_PERL_DIR"
CCFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS"
CPPFLAGS="$CFLAGS"
AC_TRY_LINK([
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
extern "C" void boot_DynaLoader(pTHX_ CV* cv);
extern "C" void xs_init(pTHX)
{
char * file = __FILE__;
newXS("DynaLoader::boot_DynaLoader",boot_DynaLoader,file);
}
],[
PerlInterpreter *my_perl;
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl,xs_init, 0, 0, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
],
eval "SS_PERL_ENABLE=yes",
eval "SS_PERL_ENABLE=no"
)
SS_PERL_LDFLAGS="$LDFLAGS"
SS_PERL_CCFLAGS="$CCFLAGS"
LIBS="$SS_SAVED_LIBS"
CFLAGS="$SS_SAVED_CFLAGS"
LDFLAGS="$SS_SAVED_LDFLAGS"
CXXFLAGS="$SS_SAVED_CXXFLAGS"
CPPFLAGS="$SS_SAVED_CPPFLAGS"
CCFLAGS="$SS_SAVED_CCFLAGS"
if test "$SS_PERL_ENABLE" = "yes"; then
AC_MSG_RESULT([seems ok])
AC_DEFINE([COMPILE_PERL_SUPPORT], 1, [define if you have perl and want the perl scripting support in kvirc])
SS_BUILD_FLAGS="p$SS_BUILD_FLAGS"
SS_PERL_RESULT_MESSAGE="enabled"
else
AC_MSG_RESULT([seems broken])
SS_PERL_RESULT_MESSAGE="disabled: failed to compile the test program"
SS_PERL_LDFLAGS=""
SS_PERL_CCFLAGS=""
fi
fi
AC_SUBST(SS_PERL_CCFLAGS)
AC_SUBST(SS_PERL_LDFLAGS)
AC_SUBST(SS_PERL_BINARY)
AC_MSG_CHECKING([for perl scripting support])
AC_MSG_RESULT([$SS_PERL_RESULT_MESSAGE])
])
dnl ###################################################################################################################
dnl ### OPENSSL
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_OPENSSL],
[
SS_LINK_TO_LIBSSL="false"
SS_SSL_RESULT_MESSAGE=""
SS_ENABLE_SSL_SUPPORT="yes"
AC_ARG_ENABLE(ssl,AC_HELP_STRING([--disable-ssl],[Disable OpenSSL support]),eval "SS_ENABLE_SSL_SUPPORT=$enableval")
if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
AC_MSG_CHECKING([If we can compile and link a small SSL test application])
SS_SAVED_LIBS="$LIBS"
LIBS="-lcrypto -lssl"
AC_TRY_LINK([
#include <openssl/ssl.h>
],[
SSL_new(0);
],
eval "SS_ENABLE_SSL_SUPPORT=yes",
eval "SS_ENABLE_SSL_SUPPORT=no"
)
LIBS="$SS_SAVED_LIBS"
if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
AC_MSG_RESULT([yes])
AC_CHECK_HEADER(openssl/ssl.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
AC_CHECK_HEADER(openssl/err.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
AC_CHECK_HEADER(openssl/asn1.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
AC_CHECK_HEADER(openssl/evp.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
AC_DEFINE([COMPILE_SSL_SUPPORT], 1, [define if you have openssl and want the ssl support in kvirc])
SS_LINK_TO_LIBSSL="true"
SS_BUILD_FLAGS="o$SS_BUILD_FLAGS"
SS_SSL_RESULT_MESSAGE="enabled"
else
SS_SSL_RESULT_MESSAGE="disabled: missing header files"
fi
else
AC_MSG_RESULT([no])
SS_SSL_RESULT_MESSAGE="disabled: failed to compile the test program"
fi
else
SS_SSL_RESULT_MESSAGE="disabled by user"
fi
AC_MSG_CHECKING([for secure connections support])
AC_MSG_RESULT([$SS_SSL_RESULT_MESSAGE])
])
dnl ###################################################################################################################
dnl ### ESD
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_ESD],
[
SS_LINK_TO_LIBESD="false"
SS_DISABLE_ESD_SUPPORT="true"
SS_SAVED_LIBS=$LIBS
LIBS="$LIBS -lesd"
AC_CHECK_LIB(esd,esd_play_file,SS_DISABLE_ESD_SUPPORT="false")
LIBS="$SS_SAVED_LIBS"
if test "$SS_DISABLE_ESD_SUPPORT" = "false"; then
SS_DISABLE_ESD_SUPPORT="true"
AC_CHECK_HEADER(esd.h,SS_DISABLE_ESD_SUPPORT="false")
fi
AC_MSG_CHECKING([for Esound daemon support])
AC_ARG_WITH(esd-support, [ --without-esd-support Disable Esound daemon support],SS_DISABLE_ESD_SUPPORT="true")
if test "$SS_DISABLE_ESD_SUPPORT" = "true"; then
AC_MSG_RESULT(disabled by user)
else
AC_MSG_RESULT(yes: have libs and headers)
AC_DEFINE([COMPILE_ESD_SUPPORT], 1, [define if you want to enable the Esound daemon support])
SS_LINK_TO_LIBESD="true"
SS_BUILD_FLAGS="e$SS_BUILD_FLAGS"
fi
])
dnl ###################################################################################################################
dnl ### ZLIB
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_ZLIB],
[
SS_LINK_TO_LIBZLIB="no"
SS_DISABLE_ZLIB_SUPPORT="true"
SS_SAVED_LIBS=$LIBS
LIBS="$LIBS -lz"
AC_CHECK_LIB(z,gzopen,SS_DISABLE_ZLIB_SUPPORT="false")
LIBS="$SS_SAVED_LIBS"
if test "$SS_DISABLE_ZLIB_SUPPORT" = "false"; then
SS_DISABLE_ZLIB_SUPPORT="true"
AC_CHECK_HEADER(zlib.h,SS_DISABLE_ZLIB_SUPPORT="false")
fi
AC_MSG_CHECKING([for GZip support])
AC_ARG_WITH(zlib-support, [ --without-zlib-support Disable ZLIB support],SS_DISABLE_ZLIB_SUPPORT="true")
if test "$SS_DISABLE_ZLIB_SUPPORT" = "true"; then
AC_MSG_RESULT(disabled by user)
else
AC_MSG_RESULT(yes: have libs and headers)
AC_DEFINE([COMPILE_ZLIB_SUPPORT], 1, [define if you want to enable the ZLib library support])
SS_LINK_TO_LIBZ="yes"
SS_BUILD_FLAGS="Z$SS_BUILD_FLAGS"
fi
])
dnl ###################################################################################################################
dnl ### XSS
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_XSS],
[
SS_LINK_TO_XSS="no"
SS_COMPILE_XSS_SUPPORT="false"
SS_SAVED_LIBS=$LIBS
LIBS="$LIBS -lXss"
AC_CHECK_LIB(Xss,XScreenSaverAllocInfo,SS_COMPILE_XSS_SUPPORT="true")
LIBS="$SS_SAVED_LIBS"
AC_MSG_CHECKING([for Xss support])
if test "$SS_COMPILE_XSS_SUPPORT" = "false"; then
AC_MSG_RESULT(disabled)
else
AC_MSG_RESULT(yes: lib is ok)
AC_DEFINE([COMPILE_XSS_SUPPORT], 1, [define if you want to enable the ZLib library support])
SS_LINK_TO_XSS="yes"
SS_BUILD_FLAGS="$SS_BUILD_FLAGS"
fi
])
dnl ###################################################################################################################
dnl ### Audiofile library
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_AUDIOFILE],
[
SS_LINK_TO_LIBAUDIOFILE="false"
SS_DISABLE_AUDIOFILE_SUPPORT="true"
SS_SAVED_LIBS=$LIBS
LIBS="$LIBS -laudiofile"
AC_CHECK_LIB(audiofile,afOpenFile,SS_DISABLE_AUDIOFILE_SUPPORT="false")
if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then
SS_DISABLE_AUDIOFILE_SUPPORT="true"
AC_CHECK_LIB(audiofile,afGetVirtualFrameSize,SS_DISABLE_AUDIOFILE_SUPPORT="false")
fi
LIBS="$SS_SAVED_LIBS"
if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then
SS_DISABLE_AUDIOFILE_SUPPORT="true"
AC_CHECK_HEADER(audiofile.h,SS_DISABLE_AUDIOFILE_SUPPORT="false")
fi
AC_MSG_CHECKING([for audiofile support])
if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then
AC_MSG_RESULT(missing header or libs or wrong version)
else
if test "$SS_HAS_OSS_SUPPORT" = "false"; then
SS_DISABLE_AUDIOFILE_SUPPORT="true"
AC_MSG_RESULT(no oss support at all)
else
AC_ARG_WITH(af-support, [ --without-af-support Disable Audiofile library for playing files to OSS support], SS_DISABLE_AUDIOFILE_SUPPORT="true")
if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then
AC_MSG_RESULT(disabled by user)
else
AC_MSG_RESULT(yes: have libs and headers)
AC_DEFINE([COMPILE_AUDIOFILE_SUPPORT], 1, [define if you want to enable the Audiofile library support])
SS_LINK_TO_LIBAUDIOFILE="true"
SS_BUILD_FLAGS="f$SS_BUILD_FLAGS"
fi
fi
fi
])
dnl ###################################################################################################################
dnl ### ARTS
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_ARTS],
[
SS_LINK_TO_LIBARTS="false"
SS_DISABLE_ARTS_SUPPORT="false"
AC_MSG_CHECKING([if Arts support is requested])
AC_ARG_WITH(arts-support, [ --without-arts-support Disable Arts daemon support],SS_DISABLE_ARTS_SUPPORT="true")
if test "$SS_KDE_REQUESTED" = "yes"; then
if test "$SS_DISABLE_ARTS_SUPPORT" = "true"; then
AC_MSG_RESULT(disabled by user)
else
AC_MSG_RESULT([yes])
AC_MSG_CHECKING(if we can compile a simple Arts application)
AC_LANG_CPLUSPLUS
ss_save_CPPFLAGS="$CPPFLAGS"
ss_save_CXXFLAGS="$CXXFLAGS"
ss_save_LDFLAGS="$LDFLAGS"
ss_save_LIBS="$LIBS"
CPPFLAGS="-I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR $CPPFLAGS $X_CFLAGS"
CXXFLAGS="-O2 -Wall $CXXFLAGS"
LIBS="-L$SS_KDE_LIBDIR -L$SS_X_LIBDIR $SS_X_LDFLAGS $SS_X_LIBLINK -L$SS_QT3_LIBDIR $LIBS -lsoundserver_idl -ltdecore -l$SS_TQTLIB_NAME -Wl,-rpath $SS_KDE_LIBDIR"
if test "$SS_LINK_TO_LIBDL" = "yes"; then
LIBS="$LIBS -ldl";
fi
LDFLAGS="-s $LDFLAGS"
AC_TRY_LINK([
#include <arts/soundserver.h>
],[
Arts::Dispatcher * d = new Arts::Dispatcher();
Arts::SimpleSoundServer *server = new Arts::SimpleSoundServer(Arts::Reference("global:Arts_SimpleSoundServer"));
],
SS_ARTS_LINKED_OK="TRUE",
SS_ARTS_LINKED_OK="FALSE"
)
if test "$SS_ARTS_LINKED_OK" = "FALSE"; then
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(success)
AC_DEFINE([COMPILE_ARTS_SUPPORT], 1, [define if you want to enable the Arts daemon support])
SS_LINK_TO_LIBARTS="true"
SS_BUILD_FLAGS="r$SS_BUILD_FLAGS"
fi
LIBS="$ss_save_LIBS"
LDFLAGS="$ss_save_LDFLAGS"
CXXFLAGS="$ss_save_CXXFLAGS"
CPPFLAGS="$ss_save_CPPFLAGS"
fi
else
SS_DISABLE_ARTS_SUPPORT="true"
AC_MSG_RESULT([no KDE so no Arts])
fi
])
dnl ###################################################################################################################
dnl ### INTERFACE ADDRESS STUFF
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_IFADDR_STUFF],
[
AC_MSG_CHECKING([if we can get interface addresses])
AC_TRY_LINK([
#include <stdio.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
],[
struct ifreq ifr;
int ret;
struct sockaddr * sa;
ret = IFNAMSIZ;
ret = ioctl(ret,SIOCGIFADDR,&ifr);
if(ifr.ifr_name != 0)sa = (struct sockaddr *)&(ifr.ifr_addr);
],
eval "SS_DISABLE_IFADDR=false"
,
eval "SS_DISABLE_IFADDR=true"
)
if test "$SS_DISABLE_IFADDR" = "true"; then
AC_MSG_RESULT("no")
else
AC_MSG_RESULT("yes")
AC_DEFINE([COMPILE_GET_INTERFACE_ADDRESS], 1, [define if you have the SIOCGIFADDR ioctl and the related headers])
fi
])
dnl ###################################################################################################################
dnl ### PTHREAD
dnl ###################################################################################################################
AC_DEFUN([AC_SS_CHECK_THREAD_STUFF],
[
SS_THREAD_LIBLINK=""
AC_MSG_CHECKING([if you want to use the solaris lthread])
SS_DO_IT="false"
AC_ARG_WITH(solaris-lthread, [ --with-solaris-lthread Use the Solaris native libthread],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_THREAD_LIBLINK="-lthread"
AC_DEFINE([COMPILE_THREADS_USE_SOLARIS_LIBTHREAD], 1, [define if you want to use the solaris libthread])
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING([if you want to use freebsd native pthread support])
SS_DO_IT="false"
AC_ARG_WITH(freebsd-pthread, [ --with-freebsd-pthread Use the FreeBSD native libc_r for threading],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_THREAD_LIBLINK="-pthread"
AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
else
AC_MSG_RESULT(no..using lpthread)
SS_THREAD_LIBLINK="-lpthread"
AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
fi
AC_MSG_CHECKING([if your pthread implementation works])
SS_DO_IT="false"
AC_ARG_WITH(no-pthread-check, [ --with-no-pthread-check Do not check if pthreads stuff compiles],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes, trusting you)
else
SS_SAVE_LIBS="$LIBS"
LIBS="$SS_THREAD_LIBLINK"
AC_TRY_LINK([
#include <pthread.h>
],[
pthread_mutex_lock(0);
],
eval "SS_PTHREAD_OK=yes"
,
eval "SS_PTHREAD_OK=no"
)
LIBS="$SS_SAVE_LIBS"
if test "$SS_PTHREAD_OK" = "yes"; then
AC_MSG_RESULT(yes, it seems to)
else
AC_MSG_RESULT(["FAILED"])
AC_SS_SET_REDINK
if test "$SS_THREAD_LIBLINK" = "-pthread"; then
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the pthread test program."
echo "### You have specified to use the native FreeBSD libc_r for threading"
echo "### but it looks that this does not work."
echo "### Make sure that you have libc_r floating around your system"
echo "### and that the -pthread special gcc flag works."
echo "### (You need to use the native FreeBSD gcc compiler for this to work)"
echo "################################################################################"
else
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the pthread test program."
echo "### It looks that you either don't have libpthread installed or"
echo "### it is not reachable by the linker."
echo "### Make sure that libpthread is in /lib or /usr/lib."
echo "### If you're on solaris you might try the --with-solaris-lthread"
echo "### configure option. If you're on FreeBSD you should use"
echo "### --with-freebsd-pthread."
echo "### Good luck :)"
echo "################################################################################"
fi
AC_SS_SET_NORMALINK
AC_MSG_ERROR(["This was fatal...aborting"])
fi
fi
fi
])
dnl ###################################################################################################################
dnl ### X
dnl ###################################################################################################################
AC_DEFUN([AC_SS_FIND_X],
[
SS_DISABLE_X_SUPPORT="false"
AC_MSG_CHECKING([if you want to ignore X at all])
AC_ARG_ENABLE(x-support, [ --disable-x-support Ignore X Windows completely],SS_DISABLE_X_SUPPORT="true")
if test $SS_DISABLE_X_SUPPORT = "true"; then
AC_DEFINE([COMPILE_NO_X], 1, [define if you want to ignore X Windows completely])
SS_X_INCDIR="/usr/include"
SS_X_LIBDIR="/usr/lib"
SS_X_LDFLAGS=""
SS_X_CPPFLAGS=""
SS_X_LIBLINK=""
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no, proceeding with checks)
AC_PATH_XTRA
if test -n "$no_x"; then
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Can not find the X libraries."
echo "### Make sure that X is installed on your system and try to run configure again,"
echo "### this time passing the --x-includes and --x-libraries options."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which checks have failed and maybe more about the"
echo "### reason of the failure."
echo "###"
echo "### If you use an environment that does not require X support such as Qt-Mac"
echo "### you may try to rerun configure with --disable-x-support"
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
# Set the X include and lib dir
SS_X_INCDIR="$x_includes"
SS_X_LIBDIR="$x_libraries"
SS_X_LIBLINK="-lX11 -lXext"
if test -z "$SS_X_INCDIR"; then
# Ops... X headers not found ?
AC_TRY_COMPILE([
#include <X11/Xlib.h>
],[
Display * d = XOpenDisplay(0);
XCloseDisplay(d);
],
eval "ss_x_incdir_found=yes"
,
eval "ss_x_incdir_found=no"
)
if test "$ss_x_incdir_found" = "no"; then
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Can not find the X headers."
echo "### Possible reasons:"
echo "### 1) You miss the X server development files (Xlib.h for example)"
echo "###"
echo "### 2) Autoconf/Automake wasn't able to find the headers"
echo "### for some ugly reason."
echo "###"
echo "### You might try looking for a file named Xlib.h in your hard-drive"
echo "### and try passing the --x-includes option to ./configure"
echo "### Remember that if you find Xlib.h in /somepath/include/X11/Xlib.h"
echo "### Then you must pass --x-includes=/somepath/include to ./configure"
echo "### For example, my Xlib.h is in /usr/X11R6/include/X11/Xlib.h"
echo "### then i would try: ./configure --x-includes=/usr/X11R6/include"
echo "### If you can't find Xlib.h on your hard drive then install the X-devel"
echo "### package from your distribution."
echo "### If Xlib.h is there and --x-includes doesn't help, well , there is something"
echo "### wrong with X , autoconf or automake."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which checks have failed and maybe more about the"
echo "### reason of the failure."
echo "###"
echo "### If you use an environment that does not require X support such as Qt-Mac"
echo "### you may try to rerun configure with --disable-x-support"
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
# We can compile X programs without any additional path... use a dummy include path then
# Should we print a warning ?
SS_X_INCDIR="/usr/include"
fi
fi
if test -z "$SS_X_LIBDIR"; then
# Ops... X libs not found ?
SS_SAVE_LIBS="$LIBS"
SS_SAVE_CFLAGS="$CFLAGS"
SS_SAVE_CPPFLAGS="$CPPFLAGS"
SS_SAVE_CXXFLAGS="$CXXFLAGS"
CFLAGS="-I$SS_X_INCDIR"
CPPFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS"
LIBS="$SS_X_LIBLINK"
AC_TRY_LINK([
#include <X11/Xlib.h>
],[
Display * d = XOpenDisplay(0);
XCloseDisplay(d);
],
eval "ss_x_libdir_found=yes"
,
eval "ss_x_libdir_found=no"
)
LIBS="$SS_SAVE_LIBS"
CFLAGS="$SS_SAVE_CFLAGS"
CPPFLAGS="$SS_SAVE_CPPFLAGS"
CXXFLAGS="$SS_SAVE_CXXFLAGS"
if test "$ss_x_libdir_found" = "no"; then
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Can not find the X libraries."
echo "### Possible reasons:"
echo "### 1) You have no X server : KVIrc can't run on this system"
echo "###"
echo "### 2) Autoconf/Automake wasn't able to find the libraries"
echo "### for some ugly reason."
echo "###"
echo "### You might try looking for a file named libX11.so in your hard-drive"
echo "### and try passing the --x-libraries option to ./configure"
echo "### Remember that if you find libX11.so in /somepath/lib/libX11.so"
echo "### Then you must pass --x-libraries=/somepath/lib to ./configure"
echo "### For example, my libX11.so is in /usr/X11R6/lib/libX11.so"
echo "### then i would try: ./configure --x-libraries=/usr/X11R6/lib"
echo "### If you can't find libX11.so on your hard drive then install the X server"
echo "### package from your distribution."
echo "### If libX11.so is there and --x-libraries doesn't help, well , there is something"
echo "### wrong with X , autoconf or automake."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which checks have failed and maybe more about the"
echo "### reason of the failure."
echo "###"
echo "### If you use an environment that does not require X support such as Qt-Mac"
echo "### you may try to rerun configure with --disable-x-support"
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
# We can link X programs without any additional path... use a dummy lib path then
# Should we print a warning ?
SS_X_LIBDIR="/usr/lib"
fi
fi
# Add any extra libs needed
SS_X_LDFLAGS=""
if test -n "$X_PRE_LIBS"; then
SS_X_LDFLAGS="$X_PRE_LIBS $SS_X_LDFLAGS"
fi
if test -n "$X_EXTRA_LIBS"; then
SS_X_LDFLAGS="$SS_X_LDFLAGS $X_EXTRA_LIBS"
fi
if test -n "$X_LIBS"; then
SS_X_LDFLAGS="$SS_X_LDFLAGS $X_LIBS"
fi
# Add any extra gcc flags
SS_X_CPPFLAGS=$X_CFLAGS
fi
fi
])
dnl ###################################################################################################################
dnl ### QT
dnl ###################################################################################################################
AC_DEFUN([AC_SS_FIND_QT],
[
AC_ARG_ENABLE(qt-check,
AC_HELP_STRING([--disable-qt-check],[Do not check if Qt and X compile]),
SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_QTX_COMPILE="NOTGIVEN")
AC_ARG_ENABLE(qt4,
AC_HELP_STRING([--enable-qt4],[Enable WORK IN PROGRESS Qt4 support]),
SS_USE_QT4="$withval",SS_USE_QT4="no")
if test "$SS_USE_QT4" = "no"; then
AC_SS_FIND_QT3_NAME
AC_SS_FIND_QT3_GENERAL_DIR
AC_SS_FIND_QT3_LIBRARY_DIR
AC_SS_FIND_QT3_INCLUDE_DIR
AC_SS_FIND_QT3_MOC
AC_SS_FIND_QT3_MT
if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then
AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3
fi
else
AC_SS_FIND_QT4_GENERAL_DIR
AC_SS_FIND_QT4_LIBRARY_DIR
AC_SS_FIND_QT4_INCLUDE_DIR
AC_SS_FIND_QT4_MOC
if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then
AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4
fi
fi
])
AC_DEFUN([AC_SS_FIND_QT3_NAME],
[
AC_MSG_CHECKING([for the TQt library name])
AC_ARG_WITH(qt-name,[ --with-tqt-name=NAME Use NAME instead of \"tqt\" as TQt library name],SS_TQTLIB_NAME="$withval",SS_TQTLIB_NAME="tqt")
AC_MSG_RESULT("$SS_TQTLIB_NAME")
])
AC_DEFUN([AC_SS_FIND_QT3_GENERAL_DIR],
[
AC_MSG_CHECKING([for the general Qt3.x directory])
lib_multiarch="`gcc -print-multiarch 2>/dev/null`"
ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib/$lib_multiarch /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /"
ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde"
if test -n "$HOME"; then
ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib"
fi
if test -n "$TQTDIR"; then
ss_qt_general_test_dirs="$TQTDIR $ss_qt_general_test_dirs"
fi
ss_qt_general_test_path_suffix="qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ."
AC_SS_FIND_FILE_PATH_EXT($SS_TQT3_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT3_GENERAL_DIR)
if test "$SS_QT3_GENERAL_DIR" = "FAILED"; then
AC_SS_FIND_FILE_PATH_EXT($SS_QT3_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT3_GENERAL_DIR)
if test "$SS_QT3_GENERAL_DIR" = "FAILED"; then
AC_MSG_RESULT([failed...continuing with normal checks])
unset SS_QT3_GENERAL_DIR
else
AC_MSG_RESULT([Seems to be $SS_QT3_GENERAL_DIR])
fi
else
AC_MSG_RESULT([Seems to be $SS_QT3_GENERAL_DIR])
fi
])
AC_DEFUN([AC_SS_FIND_QT4_GENERAL_DIR],
[
AC_MSG_CHECKING([for the general Qt4.x directory])
ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /"
ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde /usr/lib/qt4 /usr/local/lib/qt4"
if test -n "$HOME"; then
ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib"
fi
if test -n "$TQTDIR"; then
ss_qt_general_test_dirs="$TQTDIR $ss_qt_general_test_dirs"
fi
ss_qt_general_test_path_suffix="qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib"
ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ."
AC_SS_FIND_FILE_PATH_EXT($SS_QT4_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT4_GENERAL_DIR)
if test "$SS_QT4_GENERAL_DIR" = "FAILED"; then
AC_MSG_RESULT([failed...continuing with normal checks])
unset SS_QT4_GENERAL_DIR
else
AC_MSG_RESULT([Seems to be $SS_QT4_GENERAL_DIR])
fi
])
AC_DEFUN([AC_SS_FIND_QT3_INCLUDE_DIR],
[
AC_ARG_WITH(qt-include-dir,[ --with-qt-include-dir path to the Qt 3.x headers ],SS_QT3_INCDIR="$withval",SS_QT3_INCDIR="NOTGIVEN")
if test "$SS_QT3_INCDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the Qt 3.x header files])
ss_qt_include_test_dirs="$SS_QT3_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
test -n "$TQTDIR" && ss_qt_include_test_dirs="$TQTDIR/include $TQTDIR $ss_qt_include_test_dirs"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/tqt3 /usr/include/qt3 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/tqt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT3_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/tqt$SS_QT3_MAJOR_VERSION_REQUIRED /include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT3_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
AC_SS_FIND_FILE_PATH($SS_TQT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR)
if test "$SS_QT3_INCDIR" = "FAILED"; then
AC_SS_FIND_FILE_PATH($SS_QT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR)
fi
if test "$SS_QT3_INCDIR" = "FAILED"; then
dnl HACK HACK HACK
ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
test -n "$TQTDIR" && ss_qt_include_test_dirs="$TQTDIR/include $TQTDIR $ss_qt_include_test_dirs"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR)
SS_QT3_INCDIR="$SS_QT4_INCDIR -I/usr/include/tqt -include tqt.h"
AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_INCDIR])
dnl AC_MSG_RESULT([FAILED])
dnl AC_SS_SET_REDINK
dnl echo "################################################################################"
dnl echo "### CONFIGURE ERROR:"
dnl echo "### Can not find the qt 3.x header files."
dnl echo "### Make sure that qt is correctly installed on your system,"
dnl echo "### and the qt version is the one requested by this version of kvirc."
dnl echo "### Try to run configure again, this time passing the --with-qt-include-dir"
dnl echo "### option (see ./configure --help)."
dnl echo "### You may also take a look at the config.log file in this directory,"
dnl echo "### that will tell you which check has failed and maybe more about the reason"
dnl echo "### of the failure."
dnl echo "### If you're feeling that this may be a bug in this configure script"
dnl echo "### and want to report this to me , please include your configure script,"
dnl echo "### the config.log file as well as the complete configure output."
dnl echo "################################################################################"
dnl AC_SS_SET_NORMALINK
dnl AC_MSG_ERROR([This was a fatal one...aborting])
else
SS_QT3_INCDIR="$SS_QT3_INCDIR -I/usr/include/tqt -include tqt.h"
AC_MSG_RESULT([found in $SS_QT3_INCDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the Qt 3.x include files $SS_QT3_INCDIR])
SS_QT3_INCDIR="$SS_QT3_INCDIR -I/usr/include/tqt -include tqt.h"
fi
])
AC_DEFUN([AC_SS_FIND_QT4_INCLUDE_DIR],
[
AC_ARG_WITH(qt4-include-dir,[ --with-qt4-include-dir path to the Qt 4.x headers ],SS_QT4_INCDIR="$withval",SS_QT4_INCDIR="NOTGIVEN")
if test "$SS_QT4_INCDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the Qt 4.x header files])
ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
test -n "$TQTDIR" && ss_qt_include_test_dirs="$TQTDIR/include $TQTDIR $ss_qt_include_test_dirs"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR)
if test "$SS_QT4_INCDIR" = "FAILED"; then
AC_MSG_RESULT([FAILED])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Can not find the qt 4.x header files."
echo "### Make sure that qt is correctly installed on your system,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### Try to run configure again, this time passing the --with-qt4-include-dir"
echo "### option (see ./configure --help)."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
AC_MSG_RESULT([found in $SS_QT4_INCDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the Qt 4.x include files $SS_QT4_INCDIR])
fi
SS_QT4_INCDIRECTORIES="-I$SS_QT4_INCDIR -I$SS_QT4_INCDIR/Qt/ -I$SS_QT4_INCDIR/QtCore/ -I$SS_QT4_INCDIR/QtGui/";
])
AC_DEFUN([AC_SS_FIND_QT3_LIBRARY_DIR],
[
AC_ARG_WITH(qt-library-dir,[ --with-qt-library-dir path to the Qt 3.x library ],SS_QT3_LIBDIR="$withval",SS_QT3_LIBDIR="NOTGIVEN")
if test "$SS_QT3_LIBDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the TQt library])
lib_multiarch="`gcc -print-multiarch 2>/dev/null`"
ss_qt_library_test_dirs="$SS_QT3_GENERAL_DIR/lib /lib/$lib_multiarch /usr/lib/$lib_multiarch /usr/local/lib/$lib_multiarch /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
test -n "$TQTDIR" && ss_qt_library_test_dirs="$TQTDIR/lib $TQTDIR $ss_qt_library_test_dirs"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
ss_qt_libs_to_find="lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.so"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.a"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME.a"
AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT3_LIBDIR)
if test "$SS_QT3_LIBDIR" = "FAILED"; then
dnl HACK HACK HACK
AC_MSG_CHECKING([for the Qt 4.x libraries])
ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
test -n "$TQTDIR" && ss_qt_library_test_dirs="$TQTDIR/lib $TQTDIR $ss_qt_library_test_dirs"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib"
ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a"
AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR)
SS_QT3_LIBDIR="$SS_QT4_LIBDIR"
SS_TQTLIB_NAME="tqt"
AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_LIBDIR])
dnl AC_MSG_RESULT([FAILED])
dnl AC_SS_SET_REDINK
dnl echo "################################################################################"
dnl echo "### CONFIGURE ERROR:"
dnl echo "### Can not find the qt 3.x library file."
dnl echo "### Make sure that qt is correctly installed on your system,"
dnl echo "### and the qt version is the one requested by this version of kvirc."
dnl echo "### (Usually a greater version is OK too)"
dnl echo "### Try to run configure again, this time passing the --with-qt-library-dir"
dnl echo "### option (see ./configure --help)."
dnl echo "### You may also take a look at the config.log file in this directory,"
dnl echo "### that will tell you which check has failed and maybe more about the reason"
dnl echo "### of the failure."
dnl echo "### If you're feeling that this may be a bug in this configure script"
dnl echo "### and want to report this to me , please include your configure script,"
dnl echo "### the config.log file as well as the complete configure output."
dnl echo "################################################################################"
dnl AC_SS_SET_NORMALINK
dnl AC_MSG_ERROR([This was a fatal one...aborting])
else
AC_MSG_RESULT([TQt3 found in $SS_QT3_LIBDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the Qt library $SS_QT3_LIBDIR])
fi
])
AC_DEFUN([AC_SS_FIND_QT4_LIBRARY_DIR],
[
AC_ARG_WITH(qt4-library-dir,[ --with-qt4-library-dir path to the Qt 4.x library ],SS_QT4_LIBDIR="$withval",SS_QT4_LIBDIR="NOTGIVEN")
if test "$SS_QT4_LIBDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the Qt 4.x libraries])
ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
test -n "$TQTDIR" && ss_qt_library_test_dirs="$TQTDIR/lib $TQTDIR $ss_qt_library_test_dirs"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4"
ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib"
ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a"
AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR)
if test "$SS_QT4_LIBDIR" = "FAILED"; then
AC_MSG_RESULT([FAILED])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Can not find the qt 4.x library files."
echo "### Make sure that qt is correctly installed on your system,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### (Usually a greater version is OK too)"
echo "### Try to run configure again, this time passing the --with-qt4-library-dir"
echo "### option (see ./configure --help)."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
AC_MSG_RESULT([found in $SS_QT4_LIBDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the Qt 4.x library $SS_QT4_LIBDIR])
fi
])
AC_DEFUN([AC_SS_FIND_QT3_MOC],
[
AC_ARG_WITH(qt-moc,[ --with-qt-moc filename of the Qt 3.x meta object compiler ],SS_QT3_MOC="$withval",SS_QT3_MOC="NOTGIVEN")
if test "$SS_QT3_MOC" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the Qt 3.x tmoc])
unset SS_QT3_MOC
ss_moc_test_dirs="$TQTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin"
if test -n "$SS_QT3_GENERAL_DIR"; then
ss_moc_test_dirs="$SS_QT3_GENERAL_DIR/bin $ss_moc_test_dirs"
fi
AC_SS_FIND_FILE_PATH(tmoc,$ss_moc_test_dirs,SS_QT3_MOC)
if test "$SS_QT3_MOC" = "FAILED"; then
AC_MSG_RESULT([FAILED])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### The Qt meta object compiler can not be found."
echo "### Make sure that qt is correctly installed on your system, it is on your path,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### Try to run configure again, this time passing the --with-qt-moc"
echo "### option (see ./configure --help)."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
SS_QT3_MOC="$SS_QT3_MOC/tmoc"
AC_MSG_RESULT([found as $SS_QT3_MOC])
fi
else
AC_MSG_RESULT([trusting you: using $SS_QT3_MOC])
fi
])
AC_DEFUN([AC_SS_FIND_QT4_MOC],
[
AC_ARG_WITH(qt4-moc,[ --with-qt4-moc filename of the Qt 4.x meta object compiler ],SS_QT4_MOC="$withval",SS_QT4_MOC="NOTGIVEN")
if test "$SS_QT4_MOC" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the Qt 4.x moc])
unset SS_QT4_MOC
ss_moc_test_dirs="$TQTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin"
if test -n "$SS_QT4_GENERAL_DIR"; then
ss_moc_test_dirs="$SS_QT4_GENERAL_DIR/bin $ss_moc_test_dirs"
fi
AC_SS_FIND_FILE_PATH(moc,$ss_moc_test_dirs,SS_QT4_MOC)
if test "$SS_QT4_MOC" = "FAILED"; then
AC_MSG_RESULT([FAILED])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### The Qt 4.x meta object compiler can not be found."
echo "### Make sure that qt is correctly installed on your system, it is on your path,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### In particular you should make sure that the moc compiler is NOT the one"
echo "### shipped with Qt 3.x."
echo "### Try to run configure again, this time passing the --with-qt4-moc"
echo "### option (see ./configure --help)."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
else
SS_QT4_MOC="$SS_QT4_MOC/moc"
AC_MSG_RESULT([found as $SS_QT4_MOC])
fi
else
AC_MSG_RESULT([trusting you: using $SS_QT4_MOC])
fi
])
AC_DEFUN([AC_SS_FIND_QT3_MT],
[
AC_ARG_ENABLE(qt-mt,[ --disable-qt-mt ignore the threaded version of Qt],SS_QT3_NOMT="$withval",SS_QT3_NOMT="NOTGIVEN")
AC_MSG_CHECKING([for the multithreaded version of Qt])
if test "$SS_QT3_NOMT" = "NOTGIVEN"; then
ss_qt_libs_to_find="lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.so"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.dylib"
ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_TQTLIB_NAME-mt.a"
AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$SS_QT3_LIBDIR,SS_QTMTLIBDIR)
if test "$SS_QTMTLIBDIR" = "FAILED"; then
AC_MSG_RESULT([not found])
else
AC_MSG_RESULT([seems to be available])
SS_TQTLIB_NAME="$SS_TQTLIB_NAME-mt"
fi
else
AC_MSG_RESULT([disabled by user])
fi
])
AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3],
[
AC_MSG_CHECKING([if we can compile an X-Qt 3.x application])
AC_LANG_CPLUSPLUS
ss_save_CPPFLAGS="$CPPFLAGS"
ss_save_CXXFLAGS="$CXXFLAGS"
ss_save_LDFLAGS="$LDFLAGS"
ss_save_LIBS="$LIBS"
if test -n "$SS_X_INCDIR"; then
CPPFLAGS="-I$SS_X_INCDIR"
else
CPPFLAGS=""
fi
CPPFLAGS="$CPPFLAGS -I$SS_QT3_INCDIR"
CXXFLAGS="-O2 -Wall -I/usr/include/tqt -include tqt.h $CXXFLAGS"
if test -n "$SS_X_LIBDIR"; then
LIBS="-L$SS_X_LIBDIR"
else
LIBS=""
fi
LIBS="$LIBS -L$SS_QT3_LIBDIR -l$SS_TQTLIB_NAME"
if test -n "$SS_X_LDFLAGS"; then
LIBS="$LIBS $SS_X_LDFLAGS"
fi
if test -n "$SS_X_LIBLINK"; then
LIBS="$LIBS $SS_X_LIBLINK"
fi
LDFLAGS="-s $LDFLAGS"
AC_TRY_LINK([
#include <tqglobal.h>
],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE")
if test "$SS_QTX_LINKED_OK" = "FALSE"; then
AC_MSG_RESULT([FAILED]);
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the Qt library test program."
echo "### This may be a bad sign :)"
echo "### First of all, make sure that qt is correctly installed on your system,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### Ensure that you have only one copy of qt visible at a time."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### The CPPFLAGS used were:"
for a_flag in $CPPFLAGS ; do
echo "### $a_flag"
done
echo "### The CXXFLAGS used were:"
for a_flag in $CXXFLAGS ; do
echo "### $a_flag"
done
echo "### The LIBS used were:"
for a_flag in $LIBS ; do
echo "### $a_flag"
done
echo "### The LDFLAGS used were:"
for a_flag in $LDFLAGS ; do
echo "### $a_flag"
done
echo "### If you're sure that qt is correctly installed , you may force configure"
echo "### to skip this check and try to compile kvirc anyway."
echo "### Try using the --without-qt-check option."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
fi
LIBS="$ss_save_LIBS"
LDFLAGS="$ss_save_LDFLAGS"
CXXFLAGS="$ss_save_CXXFLAGS"
CPPFLAGS="$ss_save_CPPFLAGS"
AC_MSG_RESULT([success])
])
AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4],
[
AC_MSG_CHECKING([if we can compile an X-Qt 4.x application])
AC_LANG_CPLUSPLUS
ss_save_CPPFLAGS="$CPPFLAGS"
ss_save_CXXFLAGS="$CXXFLAGS"
ss_save_LDFLAGS="$LDFLAGS"
ss_save_LIBS="$LIBS"
if test -n "$SS_X_INCDIR"; then
CPPFLAGS="-I$SS_X_INCDIR"
else
CPPFLAGS=""
fi
CPPFLAGS="$CPPFLAGS $SS_QT4_INCDIRECTORIES"
CXXFLAGS="-O2 -Wall $CXXFLAGS"
if test -n "$SS_X_LIBDIR"; then
LIBS="-L$SS_X_LIBDIR"
else
LIBS=""
fi
LIBS="$LIBS -L$SS_QT4_LIBDIR -lQtCore"
if test -n "$SS_X_LDFLAGS"; then
LIBS="$LIBS $SS_X_LDFLAGS"
fi
if test -n "$SS_X_LIBLINK"; then
LIBS="$LIBS $SS_X_LIBLINK"
fi
LDFLAGS="-s $LDFLAGS"
AC_TRY_LINK([
#include <qglobal.h>
#if (TQT_VERSION < 0x040000)
#error "Bad qt version: too old"
#endif
],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE")
if test "$SS_QTX_LINKED_OK" = "FALSE"; then
AC_MSG_RESULT([FAILED]);
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the Qt 4.x library test program."
echo "### This may be a bad sign :)"
echo "### First of all, make sure that qt is correctly installed on your system,"
echo "### and the qt version is the one requested by this version of kvirc."
echo "### Ensure that you have only one copy of qt visible at a time."
echo "### You may also take a look at the config.log file in this directory,"
echo "### that will tell you which check has failed and maybe more about the reason"
echo "### of the failure."
echo "### The CPPFLAGS used were:"
for a_flag in $CPPFLAGS ; do
echo "### $a_flag"
done
echo "### The CXXFLAGS used were:"
for a_flag in $CXXFLAGS ; do
echo "### $a_flag"
done
echo "### The LIBS used were:"
for a_flag in $LIBS ; do
echo "### $a_flag"
done
echo "### The LDFLAGS used were:"
for a_flag in $LDFLAGS ; do
echo "### $a_flag"
done
echo "### If you're sure that qt is correctly installed , you may force configure"
echo "### to skip this check and try to compile kvirc anyway."
echo "### Try using the --without-qt-check option."
echo "### If you're feeling that this may be a bug in this configure script"
echo "### and want to report this to me , please include your configure script,"
echo "### the config.log file as well as the complete configure output."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR([This was a fatal one...aborting])
fi
LIBS="$ss_save_LIBS"
LDFLAGS="$ss_save_LDFLAGS"
CXXFLAGS="$ss_save_CXXFLAGS"
CPPFLAGS="$ss_save_CPPFLAGS"
AC_MSG_RESULT([success])
])
dnl ###################################################################################################################
dnl ### KDE
dnl ###################################################################################################################
AC_DEFUN([AC_SS_FIND_KDE],
[
AC_SS_CHECK_IF_KDE_IS_REQUESTED
if test "$SS_KDE_REQUESTED" = "yes"; then
AC_SS_FIND_KDE_GENERAL_DIR
if test "$SS_KDE_REQUESTED" = "yes"; then
AC_SS_FIND_KDE_SERVICES_DIR
AC_SS_FIND_KDE_LIBRARY_DIR
if test "$SS_KDE_REQUESTED" = "yes"; then
AC_SS_FIND_KDE_INCLUDE_DIR
if test "$SS_KDE_REQUESTED" = "yes"; then
AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE
fi
fi
fi
fi
])
AC_DEFUN([AC_SS_CHECK_IF_KDE_IS_REQUESTED],
[
AC_MSG_CHECKING([if KDE support is requested])
if test "$SS_USE_QT4" = "no"; then
SS_KDE_REQUESTED="yes"
AC_ARG_WITH(kde-support,[ --without-kde-support Disable the KDE support even if it is detected ],SS_KDE_REQUESTED="$withval")
if test "$SS_KDE_REQUESTED" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
else
SS_KDE_REQUESTED="no"
AC_MSG_RESULT([unsupported with qt 4.x])
fi
])
AC_DEFUN([AC_SS_FIND_KDE_GENERAL_DIR],
[
AC_MSG_CHECKING([for the general KDE directory])
ss_kde_general_test_dirs="/usr /usr/local /usr /usr/local /usr/build /usr/X11R6 /opt /usr/opt /usr/lib /usr/lib /usr/src /usr/lib /usr/local/lib"
if test -n "$HOME"; then
ss_kde_general_test_dirs="$ss_kde_general_test_dirs $HOME $HOME/lib"
fi
if test -n "$TDEDIR"; then
ss_kde_general_test_dirs="$TDEDIR $ss_kde_general_test_dirs"
fi
ss_kde_general_test_path_suffix="trinity tde TDE kde kde3.0 kde3 KDE Kde KDE3 kde3 ."
AC_SS_FIND_FILE_PATH_EXT($SS_KDE_GENERAL_FILE_TO_SEARCH,$ss_kde_general_test_dirs,$ss_kde_general_test_path_suffix,SS_KDE_GENERAL_DIR)
if test "$SS_KDE_GENERAL_DIR" = "FAILED"; then
AC_MSG_RESULT([failed...continuing with normal checks])
unset SS_KDE_GENERAL_DIR
else
AC_MSG_RESULT([Seems to be $SS_KDE_GENERAL_DIR])
fi
])
AC_DEFUN([AC_SS_FIND_KDE_SERVICES_DIR],
[
AC_ARG_WITH(kde-services-dir,[ --with-kde-services-dir path to the KDE protocol services dir ],SS_KDE_SERVICESDIR="$withval",SS_KDE_SERVICESDIR="NOTGIVEN")
if test "$SS_KDE_SERVICESDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for KDE services directory])
ss_kde_services_test_dirs="/usr/share/services /usr/local/share/services /usr/kde/share/services /usr/local/kde/share/services /usr/X11R6/share/services /opt/kde/share/services /usr/lib/kde/share/services"
test -n "$TDEDIR" && ss_kde_services_test_dirs="$TDEDIR/share/services $ss_kde_services_test_dirs"
ss_kde_services_test_dirs="$ss_kde_services_test_dirs /usr/share/kde/services"
test -n "$SS_KDE_GENERAL_DIR" && ss_kde_services_test_dirs="$SS_KDE_GENERAL_DIR/share/services $ss_kde_services_test_dirs"
AC_SS_FIND_FILE_PATH("http.protocol",$ss_kde_services_test_dirs,SS_KDE_SERVICESDIR)
if test "$SS_KDE_SERVICESDIR" = "FAILED"; then
SS_KDE_SERVICESDIR=""
AC_MSG_RESULT([unknown])
else
AC_MSG_RESULT([found in $SS_KDE_SERVICESDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the KDE services dir $SS_KDE_SERVICESDIR])
fi
])
AC_DEFUN([AC_SS_FIND_KDE_INCLUDE_DIR],
[
AC_ARG_WITH(kde-include-dir,[ --with-kde-include-dir path to the KDE headers ],SS_KDE_INCDIR="$withval",SS_KDE_INCDIR="NOTGIVEN")
if test "$SS_KDE_INCDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for KDE header files])
ss_kde_include_test_dirs="/include /usr/include /usr/local/include /usr/kde/include /usr/local/kde/include /usr/X11R6/include /opt/kde/include /usr/lib/kde/include /usr/lib/kde /usr/include/X11"
test -n "$TDEDIR" && ss_kde_include_test_dirs="$TDEDIR/include $TDEDIR $ss_kde_include_test_dirs"
ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/tde /usr/local/include/tde /include/tde /usr/X11R6/include/tde /usr/build/kde/include"
ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/tde2 /usr/local/include/tde2 /include/tde2 /usr/X11R6/include/tde2 /usr/include/X11/kde2"
test -n "$SS_KDE_GENERAL_DIR" && ss_kde_include_test_dirs="$SS_KDE_GENERAL_DIR/include $ss_kde_include_test_dirs"
test -n "$SS_KDE_GENERAL_DIR" && ss_kde_include_test_dirs="`$SS_KDE_GENERAL_DIR/bin/tde-config --expandvars --install include` $ss_kde_include_test_dirs"
AC_SS_FIND_FILE_PATH($SS_KDE_INCLUDE_FILE_TO_SEARCH,$ss_kde_include_test_dirs,SS_KDE_INCDIR)
if test "$SS_KDE_INCDIR" = "FAILED"; then
AC_MSG_RESULT("FAILED")
SS_KDE_REQUESTED="no"
SS_KDE_INCDIR=""
else
AC_MSG_RESULT([found in $SS_KDE_INCDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the KDE include files $SS_KDE_INCDIR])
fi
if test -z "$SS_KDE_GENERAL_DIR"; then
# Set it.... we need it :)...
SS_KDE_GENERAL_DIR=`echo $SS_KDE_INCDIR | sed -e 's/\/include\$//'`
fi
])
AC_DEFUN([AC_SS_FIND_KDE_LIBRARY_DIR],
[
AC_ARG_WITH(kde-library-dir,[ --with-kde-library-dir path to the KDE libraries ],SS_KDE_LIBDIR="$withval",SS_KDE_LIBDIR="NOTGIVEN")
if test "$SS_KDE_LIBDIR" = "NOTGIVEN"; then
AC_MSG_CHECKING([for the KDE libraries])
ss_kde_library_test_dirs="/lib /usr/lib /usr/local/lib /usr/kde/lib /opt/kde/lib /opt/lib /usr/opt/kde/lib /usr/local/kde/lib /usr/X11R6/lib /usr/lib/kde/lib /usr/lib/kde /usr/local/lib/kde/lib"
test -n "$TDEDIR" && ss_kde_library_test_dirs="$TDEDIR/lib $TDEDIR $ss_kde_library_test_dirs"
ss_kde_library_test_dirs="$ss_kde_library_test_dirs /usr/local/lib/kde /usr/X11R6/lib/kde /usr/build/kde/lib"
if test -n "$SS_KDE_GENERAL_DIR"; then
ss_kde_library_test_dirs="$SS_KDE_GENERAL_DIR/lib $ss_kde_library_test_dirs"
fi
AC_SS_FIND_FILE_PATH(libtdecore.so.6 libtdecore.so.5 libtdecore.so.4 libtdecore.so.3 libtdecore.so,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
if test "$SS_KDE_LIBDIR" = "FAILED"; then
AC_SS_FIND_FILE_PATH(libtdecore.so.8 libtdecore.so.7 libtdecore.so.4.0.0 libtdecore.so.4.1.0 libtdecore.so.4.2.0 ,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
if test "$SS_KDE_LIBDIR" = "FAILED"; then
# Try the senseless too
AC_SS_FIND_FILE_PATH(libtdecore.so.4.0.0 libtdecore.so.4.1.0 libtdecore.so.4.2.0 libtdecore.so.4.3.0,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
if test "$SS_KDE_LIBDIR" = "FAILED"; then
AC_SS_FIND_FILE_PATH(libtdecore.so.4.4.0 libtdecore.so.4.5.0 libtdecore.so.4.6.0 libtdecore.so.4.7.0 libtdecore.a,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
fi
fi
fi
if test "$SS_KDE_LIBDIR" = "FAILED"; then
AC_MSG_RESULT("FAILED")
SS_KDE_REQUESTED="no"
SS_KDE_LIBDIR=""
else
AC_MSG_RESULT([found in $SS_KDE_LIBDIR])
fi
else
AC_MSG_RESULT([using user supplied path for the KDE libraries $SS_KDE_LIBDIR])
fi
if test -z "$SS_KDE_GENERAL_DIR"; then
# Set it.... we need it :)...
SS_KDE_GENERAL_DIR=`echo $SS_KDE_LIBDIR | sed -e 's/\/lib\$//'`
fi
])
AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE],
[
AC_ARG_WITH(kde-check,[ --without-kde-check Do not check if Qt,KDE and X compile ],SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_KQTX_COMPILE="yes")
if test "$SS_CHECK_KQTX_COMPILE" = "yes"; then
AC_MSG_CHECKING(if we can compile an X-Qt-KDE application)
AC_LANG_CPLUSPLUS
ss_save_CPPFLAGS="$CPPFLAGS"
ss_save_CXXFLAGS="$CXXFLAGS"
ss_save_LDFLAGS="$LDFLAGS"
ss_save_LIBS="$LIBS"
if test -n "$SS_X_INCDIR"; then
CPPFLAGS="-I$SS_X_INCDIR"
else
CPPFLAGS=""
fi
CPPFLAGS="$CPPFLAGS -I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR"
CXXFLAGS="-O2 -Wall $CXXFLAGS"
if test -n "$SS_X_LIBDIR"; then
LIBS="-L$SS_X_LIBDIR"
else
LIBS=""
fi
if test -n "$SS_X_LDFLAGS"; then
LIBS="$SS_X_LDFLAGS $LIBS"
fi
if test -n "$SS_X_LIBLINK"; then
LIBS="$LIBS $SS_X_LIBLINK"
fi
LIBS="-L$SS_KDE_LIBDIR -L$SS_QT3_LIBDIR -ltdecore -l$SS_TQTLIB_NAME $LIBS -Wl,-rpath $SS_KDE_LIBDIR"
if test "$SS_LINK_TO_LIBDL" = "yes"; then
LIBS="$LIBS -ldl";
fi
LDFLAGS="-s $LDFLAGS"
AC_TRY_LINK([
#include "kapp.h"
#include "twin.h"
],[
int a = KWin::currentDesktop();
TDEApplication app(a,0,TQCString("kvirc"));
],
SS_KQTX_LINKED_OK="TRUE",
SS_KQTX_LINKED_OK="FALSE"
)
if test "$SS_KQTX_LINKED_OK" = "FALSE"; then
AC_MSG_RESULT(failed)
AC_MSG_ERROR([This was a fatal one...aborting])
else
AC_MSG_RESULT(success)
fi
LIBS="$ss_save_LIBS"
LDFLAGS="$ss_save_LDFLAGS"
CXXFLAGS="$ss_save_CXXFLAGS"
CPPFLAGS="$ss_save_CPPFLAGS"
fi
])
AC_DEFUN([AC_SS_CHECK_OTHER_LIBS],
[
SS_OTHER_LIBDIRS=""
SS_OTHER_LIBLINK=""
SS_OTHER_INCDIRS=""
AC_MSG_CHECKING([if you want to link to libresolv])
SS_DO_IT="false"
AC_ARG_WITH(libresolv, [ --with-libresolv Link to libresolv],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lresolv"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to link to libsocket])
SS_DO_IT="false"
AC_ARG_WITH(libsocket, [ --with-libsocket Link to libsocket],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lsocket"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to link to libnsl])
SS_DO_IT="false"
AC_ARG_WITH(libnsl, [ --with-libnsl Link to libnsl],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lnsl"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to link to libcompat])
SS_DO_IT="false"
AC_ARG_WITH(libnsl, [ --with-libcompat Link to libcompat],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lcompat"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if you want to link to other libraries])
SS_DO_IT="false"
AC_ARG_WITH(other-libs, [ --with-other-libs=... Link to the specified libraries],SS_DO_IT="$withval")
if test "$SS_DO_IT" != "false"; then
AC_MSG_RESULT([yes])
SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK $SS_DO_IT"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if you want to add other library search paths])
SS_DO_IT="false"
AC_ARG_WITH(other-ldirs, [ --with-other-ldirs=... Add the specified library paths],SS_DO_IT="$withval")
if test "$SS_DO_IT" != "false"; then
AC_MSG_RESULT([yes])
SS_OTHER_LIBDIRS="$SS_OTHER_LIBDIRS $SS_DO_IT"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if you want to add other include search paths])
SS_DO_IT="false"
AC_ARG_WITH(other-idirs, [ --with-other-idirs=... Add the specified include search paths],SS_DO_IT="$withval")
if test "$SS_DO_IT" != "false"; then
AC_MSG_RESULT([yes])
SS_OTHER_INCDIRS="$SS_OTHER_INCDIRS $SS_DO_IT"
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN([AC_SS_FINAL_CONFIG],
[
AC_MSG_CHECKING([if we finally have to compile the IpV6 support])
if test "$SS_NOIPV6_SUPPORT" = "true"; then
AC_MSG_RESULT([no: disabled by user])
else
if test "$SS_HAVE_IPV6_FUNCTIONS" = "true"; then
AC_MSG_RESULT([yes])
AC_DEFINE([COMPILE_IPV6_SUPPORT], 1, [define if you want the IpV6 support])
SS_BUILD_FLAGS="i$SS_BUILD_FLAGS"
else
AC_MSG_RESULT([no: the system lacks support])
fi
fi
dnl # // Toplevel source directory
SS_TOPSRCDIR=`pwd`
AC_SUBST(SS_TOPSRCDIR)
SS_CPPFLAGS="-D_REENTRANT -DREENTRANT"
if test -n "$SS_X_CPPFLAGS"; then
SS_CPPFLAGS="$SS_CPPFLAGS $SS_X_CPPFLAGS"
fi
if test "$SS_USE_QT4" = "no"; then
SS_INCDIRS="-I$SS_QT3_INCDIR -I$SS_X_INCDIR"
else
AC_DEFINE([COMPILE_USE_QT4], 1, [define if you want to compile the Qt 4.x support])
SS_INCDIRS="$SS_QT4_INCDIRECTORIES -I$SS_X_INCDIR"
SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_SUPPORT"
fi
if test -n "$SS_X_INCDIR"; then
SS_INCDIRS="$SS_INCDIRS -I$SS_X_INCDIR"
fi
if test -n "$SS_X_LDFLAGS"; then
SS_LDFLAGS="$SS_X_LDFLAGS"
else
SS_LDFLAGS=""
fi
if test "$SS_USE_QT4" = "no"; then
SS_RPATH="-rpath $SS_QT3_LIBDIR -rpath $libdir"
else
SS_RPATH="-rpath $SS_QT4_LIBDIR -rpath $libdir"
fi
if test -n "$SS_X_LIBDIR"; then
SS_RPATH="$SS_RPATH -rpath $SS_X_LIBDIR"
fi
if test "$SS_USE_QT4" = "no"; then
SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT3_LIBDIR"
else
SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT4_LIBDIR"
fi
if test -n "$SS_X_LIBDIR"; then
SS_LIBDIRS="$SS_LIBDIRS -L$SS_X_LIBDIR"
fi
if test "$SS_USE_QT4" = "no"; then
SS_LIBLINK="-l$SS_TQTLIB_NAME"
else
#if test -n "SS_LOCAL_ADD_DEBUG_SYMBOLS"; then
# SS_LIBLINK="-lQtCore_debug -lQtGui_debug -lQt3Support_debug"
#else
SS_LIBLINK="-lQtCore -lQtGui -lQt3Support"
#fi
fi
if test -n "$SS_X_LIBLINK"; then
SS_LIBLINK="$SS_LIBLINK $SS_X_LIBLINK"
fi
SS_LIBLINK="$SS_LIBLINK $SS_THREAD_LIBLINK"
if test "$SS_LINK_TO_LIBSSL" = "true"; then
SS_LIBLINK="$SS_LIBLINK -lssl -lcrypto"
fi
if test "$SS_LINK_TO_LIBESD" = "true"; then
SS_LIBLINK="$SS_LIBLINK -lesd"
fi
if test "$SS_LINK_TO_LIBARTS" = "true"; then
SS_LIBLINK="$SS_LIBLINK -lsoundserver_idl"
fi
if test "$SS_LINK_TO_LIBAUDIOFILE" = "true"; then
SS_LIBLINK="$SS_LIBLINK -laudiofile -lm"
fi
if test "$SS_LOCAL_8BIT" = "true"; then
SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_NO_ASCII_CAST -DQT3_NO_COMPAT"
fi
if test "$SS_QT3_EMBEDDED" = "true"; then
SS_CPPFLAGS="$SS_CPPFLAGS -DQWS"
fi
if test "$SS_KDE_REQUESTED" = "yes"; then
SS_INCDIRS="$SS_INCDIRS -I$SS_KDE_INCDIR"
SS_RPATH="$SS_RPATH -rpath $SS_KDE_LIBDIR"
SS_LIBDIRS="$SS_LIBDIRS -L$SS_KDE_LIBDIR"
SS_LIBLINK="-ltdecore -ltdeui -ltdeparts -lDCOP -ltdefx -ltdeio $SS_LIBLINK"
AC_DEFINE([COMPILE_TDE_SUPPORT], 1, [define if you want to compile the TDE support])
AC_DEFINE_UNQUOTED([TDE_DIR], "$SS_KDE_GENERAL_DIR", [contain path to TDE if compiled with the TDE support])
AC_DEFINE_UNQUOTED([TDE_LIBDIR], "$SS_KDE_LIBDIR", [contain path to TDE libs if compiled with the TDE support])
SS_BUILD_FLAGS="k$SS_BUILD_FLAGS"
else
AC_DEFINE_UNQUOTED([TDE_DIR], "", [contain path to TDE if compiled with the TDE support])
AC_DEFINE_UNQUOTED([TDE_LIBDIR], "", [contain path to TDE libs if compiled with the TDE support])
fi
if test -n "$SS_OTHER_LIBLINK"; then
SS_LIBLINK="$SS_LIBLINK $SS_OTHER_LIBLINK"
fi
if test -n "$SS_OTHER_LIBDIRS"; then
SS_LIBDIRS="$SS_LIBDIRS $SS_OTHER_LIBDIRS"
SS_OTHER_LIBDIRS=`echo "$SS_OTHER_LIBDIRS" | sed -e s/-L//g`
SS_RPATH="$SS_RPATH -rpath $SS_OTHER_LIBDIRS"
fi
if test -n "$SS_OTHER_INCDIRS"; then
SS_INCDIRS="$SS_INCDIRS $SS_OTHER_INCDIRS"
fi
if test "$SS_LINK_TO_LIBDL" = "yes"; then
SS_LIBLINK="$SS_LIBLINK -ldl"
fi
if test "$SS_LINK_TO_LIBZ" = "yes"; then
SS_LIBLINK="$SS_LIBLINK -lz"
fi
if test "$SS_LINK_TO_XSS" = "yes"; then
SS_LIBLINK="$SS_LIBLINK -lXss"
fi
AC_SUBST(SS_CPPFLAGS)
AC_SUBST(SS_INCDIRS)
AC_SUBST(SS_LDFLAGS)
AC_SUBST(SS_RPATH)
AC_SUBST(SS_LIBDIRS)
AC_SUBST(SS_LIBLINK)
if test "$SS_USE_QT4" = "no"; then
SS_QT_MOC=$SS_QT3_MOC
SS_QT_MOC_FLAGS=""
else
SS_QT_MOC=$SS_QT4_MOC
SS_QT_MOC_FLAGS="-DCOMPILE_USE_QT4"
fi
AC_SUBST(SS_QT_MOC)
AC_SUBST(SS_QT_MOC_FLAGS)
build_date=`date -u`
if test -z "$build_date"; then
build_date=`date`
fi
if test -z "$build_date"; then
build_date="unknown"
fi
AC_DEFINE_UNQUOTED([BUILD_DATE],"$build_date", [this is the build date (configure date rather)])
dnl # Let's sort the build flags
SS_AUX_CHARS="a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9"
buid_flags=""
for achar in $SS_AUX_CHARS; do
tmp_val=`echo "$SS_BUILD_FLAGS" | grep $achar`
if test "$tmp_val"; then
build_flags="$build_flags$achar"
fi
done
SS_DIRTAG=`echo $VERSION | cut -d . -f 1,2`
AC_DEFINE_UNQUOTED([VERSION_BRANCH], "$SS_DIRTAG", [MAJOR.MINOR part of version])
AC_DEFINE_UNQUOTED([BUILD_FLAGS],"$target_cpu-$build_flags", [these are the build flags])
globalkvircdir="\${datadir}/kvirc/$SS_DIRTAG"
AC_SUBST(globalkvircdir)
configdir="\${globalkvircdir}/config"
AC_SUBST(configdir)
picsdir="\${globalkvircdir}/pics"
AC_SUBST(picsdir)
helpdir="\${globalkvircdir}/help/en"
AC_SUBST(helpdir)
pluglibdir="\${globalkvircdir}/modules"
AC_SUBST(pluglibdir)
modulelibdir="\${globalkvircdir}/modules"
AC_SUBST(modulelibdir)
defscriptdir="\${globalkvircdir}/defscript"
AC_SUBST(defscriptdir)
themedir="\${globalkvircdir}/themes"
AC_SUBST(themedir)
msgcolorsdir="\${globalkvircdir}/msgcolors"
AC_SUBST(msgcolorsdir)
if test -z "$mandir"; then
mandir="\${exec_prefix}/man/man1"
fi
AC_SUBST(mandir)
licensedir="\${globalkvircdir}/license"
AC_SUBST(licensedir)
if test -n "$SS_KDE_SERVICESDIR"; then
kdeservicesdir="$SS_KDE_SERVICESDIR"
else
kdeservicesdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/protocols"
fi
AC_SUBST(kdeservicesdir)
if test "$SS_KDE_REQUESTED" = "yes"; then
iconapps16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/apps"
iconapps32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/apps"
iconapps48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/apps"
iconapps64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/apps"
iconapps128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/apps"
iconappsscalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/apps"
iconmime16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/mimetypes"
iconmime32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/mimetypes"
iconmime48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/mimetypes"
iconmime64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/mimetypes"
iconmime128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/mimetypes"
iconmimescalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/mimetypes"
applnkdir="$SS_KDE_GENERAL_DIR/share/applnk/Internet"
mimelnkdir="$SS_KDE_GENERAL_DIR/share/mimelnk/text"
else
iconapps16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16"
iconapps32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32"
iconapps48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48"
iconapps64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64"
iconapps128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128"
iconappsscalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable"
iconmime16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16"
iconmime32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32"
iconmime48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48"
iconmime64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64"
iconmime128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128"
iconmimescalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable"
applnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/applnk"
mimelnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/mimelnk"
fi
AC_SUBST(iconapps16datadir)
AC_SUBST(iconapps32datadir)
AC_SUBST(iconapps48datadir)
AC_SUBST(iconapps64datadir)
AC_SUBST(iconapps128datadir)
AC_SUBST(iconappsscalabledatadir)
AC_SUBST(iconmime16datadir)
AC_SUBST(iconmime32datadir)
AC_SUBST(iconmime48datadir)
AC_SUBST(iconmime64datadir)
AC_SUBST(iconmime128datadir)
AC_SUBST(iconmimescalabledatadir)
AC_SUBST(applnkdir)
AC_SUBST(mimelnkdir)
localedir="\${globalkvircdir}/locale"
AC_SUBST(localedir)
headersdir="\${exec_prefix}/include/kvirc/$VERSION"
AC_SUBST(headersdir)
configmodulesdir="\${globalkvircdir}/config/modules"
AC_SUBST(configmodulesdir)
topdir=`pwd`
AC_SUBST(topdir)
AC_SS_HEADER([Configuration status:])
AC_SS_SET_GREENINK
echo "### The kvirc binary will be installed in:"
echo "### $bindir"
echo "### The libraries will be installed in:"
echo "### $libdir"
echo "### Modules will be installed in:"
echo "### $pluglibdir"
AC_SS_SET_NORMALINK
AC_SS_HEADER([Take a look at the paths above just to be sure that they're correct])
])
dnl just a wrapper to clean up configure.in
AC_DEFUN([KVIRC_PROG_LIBTOOL],
[
AM_PROG_LIBTOOL
LIBTOOL_SHELL="/bin/sh ./libtool"
# LIBTOOL="$LIBTOOL --silent"
AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps (experimental, needs objprelink in path)],
kvirc_use_objprelink=$enableval, kvirc_use_objprelink=no)
if test "x$kvirc_use_objprelink" = "xyes"; then
echo Patching libtool to run objprelink.
mv libtool libtool.orig
cat > libtool <<\EOF
#! /bin/sh
ALREADYPRELINKED=""
for n
do
case $n in
*.o) k=$n
if test -r $k; then
ISELF=`file $k | grep ELF`
if test -n "$ISELF"; then
ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
if test -z "$ALREADY"; then
echo objprelink $k
objprelink $k
ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
fi
fi
fi
;;
*.lo) k=$n
if test -r $k; then
ISELF=`file $k | grep ELF`
if test -n "$ISELF"; then
ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
if test -z "$ALREADY"; then
echo objprelink $k
objprelink $k
ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
fi
fi
fi
ASHORTNAME=`echo $n | sed -e 's/\.lo$//'`
k=".libs/$ASHORTNAME.o"
if test -r $k; then
ISELF=`file $k | grep ELF`
if test -n "$ISELF"; then
ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
if test -z "$ALREADY"; then
echo objprelink $k
objprelink $k
ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
fi
fi
fi
k=".libs/$ASHORTNAME.lo"
if test -r $k; then
ISELF=`file $k | grep ELF`
if test -n "$ISELF"; then
ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
if test -z "$ALREADY"; then
echo objprelink $k
objprelink $k
ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
fi
fi
fi
k="$ASHORTNAME.o"
if test -r $k; then
ISELF=`file $k | grep ELF`
if test -n "$ISELF"; then
ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
if test -z "$ALREADY"; then
echo objprelink $k
objprelink $k
ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
fi
fi
fi
;;
esac
done
EOF
cat >> libtool libtool.orig
rm libtool.orig
chmod a+x libtool
fi
])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
])
# serial 56 LT_INIT
# LT_PREREQ(VERSION)
# ------------------
# Complain and exit if this libtool version is less that VERSION.
m4_defun([LT_PREREQ],
[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
[m4_default([$3],
[m4_fatal([Libtool version $1 or higher is required],
63)])],
[$2])])
# _LT_CHECK_BUILDDIR
# ------------------
# Complain if the absolute build directory name contains unusual characters
m4_defun([_LT_CHECK_BUILDDIR],
[case `pwd` in
*\ * | *\ *)
AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
esac
])
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
AC_BEFORE([$0], [LTDL_INIT])dnl
m4_require([_LT_CHECK_BUILDDIR])dnl
dnl Autoconf doesn't catch unexpanded LT_ macros by default:
m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
dnl unless we require an AC_DEFUNed macro:
AC_REQUIRE([LTOPTIONS_VERSION])dnl
AC_REQUIRE([LTSUGAR_VERSION])dnl
AC_REQUIRE([LTVERSION_VERSION])dnl
AC_REQUIRE([LTOBSOLETE_VERSION])dnl
m4_require([_LT_PROG_LTMAIN])dnl
dnl Parse OPTIONS
_LT_SET_OPTIONS([$0], [$1])
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
_LT_SETUP
# Only expand once:
m4_define([LT_INIT])
])# LT_INIT
# Old names:
AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
# _LT_CC_BASENAME(CC)
# -------------------
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
m4_defun([_LT_CC_BASENAME],
[for cc_temp in $1""; do
case $cc_temp in
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
])
# _LT_FILEUTILS_DEFAULTS
# ----------------------
# It is okay to use these file commands and assume they have been set
# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
m4_defun([_LT_FILEUTILS_DEFAULTS],
[: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}
])# _LT_FILEUTILS_DEFAULTS
# _LT_SETUP
# ---------
m4_defun([_LT_SETUP],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
dnl
_LT_DECL([], [build_alias], [0], [The build system])dnl
_LT_DECL([], [build], [0])dnl
_LT_DECL([], [build_os], [0])dnl
dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
test -z "$LN_S" && LN_S="ln -s"
_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
dnl
AC_REQUIRE([LT_CMD_MAX_LEN])dnl
_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
])
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
_LT_CHECK_OBJDIR
m4_require([_LT_TAG_COMPILER])dnl
_LT_PROG_ECHO_BACKSLASH
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\([["`\\]]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
# Global variables:
ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
_LT_CC_BASENAME([$compiler])
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
_LT_PATH_MAGIC
fi
;;
esac
# Use C for the default configuration in the libtool script
LT_SUPPORTED_TAG([CC])
_LT_LANG_C_CONFIG
_LT_LANG_DEFAULT_CONFIG
_LT_CONFIG_COMMANDS
])# _LT_SETUP
# _LT_PROG_LTMAIN
# ---------------
# Note that this code is called both from `configure', and `config.status'
# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
# `config.status' has no value for ac_aux_dir unless we are using Automake,
# so we pass a copy along to make sure it has a sensible value anyway.
m4_defun([_LT_PROG_LTMAIN],
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
ltmain="$ac_aux_dir/ltmain.sh"
])# _LT_PROG_LTMAIN
## ------------------------------------- ##
## Accumulate code for creating libtool. ##
## ------------------------------------- ##
# So that we can recreate a full libtool script including additional
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
# in macros and then make a single call at the end using the `libtool'
# label.
# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
# ----------------------------------------
# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL_INIT],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_INIT],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_INIT])
# _LT_CONFIG_LIBTOOL([COMMANDS])
# ------------------------------
# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
m4_define([_LT_CONFIG_LIBTOOL],
[m4_ifval([$1],
[m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
[$1
])])])
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
# -----------------------------------------------------
m4_defun([_LT_CONFIG_SAVE_COMMANDS],
[_LT_CONFIG_LIBTOOL([$1])
_LT_CONFIG_LIBTOOL_INIT([$2])
])
# _LT_FORMAT_COMMENT([COMMENT])
# -----------------------------
# Add leading comment marks to the start of each line, and a trailing
# full-stop to the whole comment if one is not present already.
m4_define([_LT_FORMAT_COMMENT],
[m4_ifval([$1], [
m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
[['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
)])
## ------------------------ ##
## FIXME: Eliminate VARNAME ##
## ------------------------ ##
# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
# -------------------------------------------------------------------
# CONFIGNAME is the name given to the value in the libtool script.
# VARNAME is the (base) name used in the configure script.
# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
# VARNAME. Any other value will be used directly.
m4_define([_LT_DECL],
[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
[lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
[m4_ifval([$1], [$1], [$2])])
lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
m4_ifval([$4],
[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
lt_dict_add_subkey([lt_decl_dict], [$2],
[tagged?], [m4_ifval([$5], [yes], [no])])])
])
# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
# --------------------------------------------------------
m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_tag_varnames],
[_lt_decl_filter([tagged?], [yes], $@)])
# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
# ---------------------------------------------------------
m4_define([_lt_decl_filter],
[m4_case([$#],
[0], [m4_fatal([$0: too few arguments: $#])],
[1], [m4_fatal([$0: too few arguments: $#: $1])],
[2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
[3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
[lt_dict_filter([lt_decl_dict], $@)])[]dnl
])
# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
# --------------------------------------------------
m4_define([lt_decl_quote_varnames],
[_lt_decl_filter([value], [1], $@)])
# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_dquote_varnames],
[_lt_decl_filter([value], [2], $@)])
# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
# ---------------------------------------------------
m4_define([lt_decl_varnames_tagged],
[m4_assert([$# <= 2])dnl
_$0(m4_quote(m4_default([$1], [[, ]])),
m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
m4_define([_lt_decl_varnames_tagged],
[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
# ------------------------------------------------
m4_define([lt_decl_all_varnames],
[_$0(m4_quote(m4_default([$1], [[, ]])),
m4_if([$2], [],
m4_quote(lt_decl_varnames),
m4_quote(m4_shift($@))))[]dnl
])
m4_define([_lt_decl_all_varnames],
[lt_join($@, lt_decl_varnames_tagged([$1],
lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
])
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
# ------------------------------------
# Quote a variable value, and forward it to `config.status' so that its
# declaration there will have the same value as in `configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
# _LT_CONFIG_STATUS_DECLARATIONS
# ------------------------------
# We delimit libtool config variables with single quotes, so when
# we write them to config.status, we have to be sure to quote all
# embedded single quotes properly. In configure, this macro expands
# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
#
# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
[m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAGS
# ----------------
# Output comment and list of tags supported by the script
m4_defun([_LT_LIBTOOL_TAGS],
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
available_tags="_LT_TAGS"dnl
])
# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
# -----------------------------------
# Extract the dictionary values for VARNAME (optionally with TAG) and
# expand to a commented shell variable setting:
#
# # Some comment about what VAR is for.
# visible_name=$lt_internal_name
m4_define([_LT_LIBTOOL_DECLARE],
[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
[description])))[]dnl
m4_pushdef([_libtool_name],
m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
[0], [_libtool_name=[$]$1],
[1], [_libtool_name=$lt_[]$1],
[2], [_libtool_name=$lt_[]$1],
[_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
])
# _LT_LIBTOOL_CONFIG_VARS
# -----------------------
# Produce commented declarations of non-tagged libtool config variables
# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
# section) are produced by _LT_LIBTOOL_TAG_VARS.
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
[m4_foreach([_lt_var],
m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
# _LT_LIBTOOL_TAG_VARS(TAG)
# -------------------------
m4_define([_LT_LIBTOOL_TAG_VARS],
[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
[m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
# _LT_TAGVAR(VARNAME, [TAGNAME])
# ------------------------------
m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
# _LT_CONFIG_COMMANDS
# -------------------
# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
# variables for single and double quote escaping we saved from calls
# to _LT_DECL, we can put quote escaped variables declarations
# into `config.status', and then the shell code to quote escape them in
# for loops in `config.status'. Finally, any additional code accumulated
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
m4_defun([_LT_CONFIG_COMMANDS],
[AC_PROVIDE_IFELSE([LT_OUTPUT],
dnl If the libtool generation code has been placed in $CONFIG_LT,
dnl instead of duplicating it all over again into config.status,
dnl then we will have config.status run $CONFIG_LT later, so it
dnl needs to know what name is stored there:
[AC_CONFIG_COMMANDS([libtool],
[$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
dnl If the libtool generation code is destined for config.status,
dnl expand the accumulated commands and init code now:
[AC_CONFIG_COMMANDS([libtool],
[_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
])#_LT_CONFIG_COMMANDS
# Initialize.
m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
[
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
_LT_CONFIG_STATUS_DECLARATIONS
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
# Quote evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_quote_varnames); do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Double-quote double-evaled strings.
for var in lt_decl_all_varnames([[ \
]], lt_decl_dquote_varnames); do
case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
*[[\\\\\\\`\\"\\\$]]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Fix-up fallback echo if it was mangled by the above quoting rules.
case \$lt_ECHO in
*'\\\[$]0 --fallback-echo"')dnl "
lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
;;
esac
_LT_OUTPUT_LIBTOOL_INIT
])
# LT_OUTPUT
# ---------
# This macro allows early generation of the libtool script (before
# AC_OUTPUT is called), incase it is used in configure for compilation
# tests.
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
AC_MSG_NOTICE([creating $CONFIG_LT])
cat >"$CONFIG_LT" <<_LTEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate a libtool stub with the current configuration.
lt_cl_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_LTEOF
cat >>"$CONFIG_LT" <<\_LTEOF
AS_SHELL_SANITIZE
_AS_PREPARE
exec AS_MESSAGE_FD>&1
exec AS_MESSAGE_LOG_FD>>config.log
{
echo
AS_BOX([Running $as_me.])
} >&AS_MESSAGE_LOG_FD
lt_cl_help="\
\`$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.
Usage: $[0] [[OPTIONS]]
-h, --help print this help, then exit
-V, --version print version number, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
Copyright (C) 2008 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
while test $[#] != 0
do
case $[1] in
--version | --v* | -V )
echo "$lt_cl_version"; exit 0 ;;
--help | --h* | -h )
echo "$lt_cl_help"; exit 0 ;;
--debug | --d* | -d )
debug=: ;;
--quiet | --q* | --silent | --s* | -q )
lt_cl_silent=: ;;
-*) AC_MSG_ERROR([unrecognized option: $[1]
Try \`$[0] --help' for more information.]) ;;
*) AC_MSG_ERROR([unrecognized argument: $[1]
Try \`$[0] --help' for more information.]) ;;
esac
shift
done
if $lt_cl_silent; then
exec AS_MESSAGE_FD>/dev/null
fi
_LTEOF
cat >>"$CONFIG_LT" <<_LTEOF
_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
_LTEOF
cat >>"$CONFIG_LT" <<\_LTEOF
AC_MSG_NOTICE([creating $ofile])
_LT_OUTPUT_LIBTOOL_COMMANDS
AS_EXIT(0)
_LTEOF
chmod +x "$CONFIG_LT"
# configure is writing to config.log, but config.lt does its own redirection,
# appending to config.log, which fails on DOS, as config.log is still kept
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
if test "$no_create" != yes; then
lt_cl_success=:
test "$silent" = yes &&
lt_config_lt_args="$lt_config_lt_args --quiet"
exec AS_MESSAGE_LOG_FD>/dev/null
$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
exec AS_MESSAGE_LOG_FD>>config.log
$lt_cl_success || AS_EXIT(1)
fi
])# LT_OUTPUT
# _LT_CONFIG(TAG)
# ---------------
# If TAG is the built-in tag, create an initial libtool script with a
# default configuration from the untagged config vars. Otherwise add code
# to config.status for appending the configuration named by TAG from the
# matching tagged config vars.
m4_defun([_LT_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_CONFIG_SAVE_COMMANDS([
m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
m4_if(_LT_TAG, [C], [
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
cfgfile="${ofile}T"
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
_LT_COPYING
_LT_LIBTOOL_TAGS
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
# ### END LIBTOOL CONFIG
_LT_EOF
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
_LT_EOF
;;
esac
_LT_PROG_LTMAIN
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
_LT_PROG_XSI_SHELLFNS
sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
[cat <<_LT_EOF >> "$ofile"
dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
dnl in a comment (ie after a #).
# ### BEGIN LIBTOOL TAG CONFIG: $1
_LT_LIBTOOL_TAG_VARS(_LT_TAG)
# ### END LIBTOOL TAG CONFIG: $1
_LT_EOF
])dnl /m4_if
],
[m4_if([$1], [], [
PACKAGE='$PACKAGE'
VERSION='$VERSION'
TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'], [])
])dnl /_LT_CONFIG_SAVE_COMMANDS
])# _LT_CONFIG
# LT_SUPPORTED_TAG(TAG)
# ---------------------
# Trace this macro to discover what tags are supported by the libtool
# --tag option, using:
# autoconf --trace 'LT_SUPPORTED_TAG:$1'
AC_DEFUN([LT_SUPPORTED_TAG], [])
# C support is built-in for now
m4_define([_LT_LANG_C_enabled], [])
m4_define([_LT_TAGS], [])
# LT_LANG(LANG)
# -------------
# Enable libtool support for the given language if not already enabled.
AC_DEFUN([LT_LANG],
[AC_BEFORE([$0], [LT_OUTPUT])dnl
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
[Windows Resource], [_LT_LANG(RC)],
[m4_ifdef([_LT_LANG_]$1[_CONFIG],
[_LT_LANG($1)],
[m4_fatal([$0: unsupported language: "$1"])])])dnl
])# LT_LANG
# _LT_LANG(LANGNAME)
# ------------------
m4_defun([_LT_LANG],
[m4_ifdef([_LT_LANG_]$1[_enabled], [],
[LT_SUPPORTED_TAG([$1])dnl
m4_append([_LT_TAGS], [$1 ])dnl
m4_define([_LT_LANG_]$1[_enabled], [])dnl
_LT_LANG_$1_CONFIG($1)])dnl
])# _LT_LANG
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
[AC_PROVIDE_IFELSE([AC_PROG_CXX],
[LT_LANG(CXX)],
[m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
AC_PROVIDE_IFELSE([AC_PROG_F77],
[LT_LANG(F77)],
[m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
AC_PROVIDE_IFELSE([AC_PROG_FC],
[LT_LANG(FC)],
[m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
dnl pulling things in needlessly.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
[LT_LANG(GCJ)],
[AC_PROVIDE_IFELSE([LT_PROG_GCJ],
[LT_LANG(GCJ)],
[m4_ifdef([AC_PROG_GCJ],
[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([A][M_PROG_GCJ],
[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
])# _LT_LANG_DEFAULT_CONFIG
# Obsolete macros:
AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
dnl AC_DEFUN([AC_LIBTOOL_F77], [])
dnl AC_DEFUN([AC_LIBTOOL_FC], [])
dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
# _LT_TAG_COMPILER
# ----------------
m4_defun([_LT_TAG_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
])# _LT_TAG_COMPILER
# _LT_COMPILER_BOILERPLATE
# ------------------------
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
m4_defun([_LT_COMPILER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*
])# _LT_COMPILER_BOILERPLATE
# _LT_LINKER_BOILERPLATE
# ----------------------
# Check for linker boilerplate output or warnings with
# the simple link test code.
m4_defun([_LT_LINKER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
])# _LT_LINKER_BOILERPLATE
# _LT_REQUIRED_DARWIN_CHECKS
# -------------------------
m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
case $host_os in
rhapsody* | darwin*)
AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
AC_CHECK_TOOL([LIPO], [lipo], [:])
AC_CHECK_TOOL([OTOOL], [otool], [:])
AC_CHECK_TOOL([OTOOL64], [otool64], [:])
_LT_DECL([], [DSYMUTIL], [1],
[Tool to manipulate archived DWARF debug symbol files on Mac OS X])
_LT_DECL([], [NMEDIT], [1],
[Tool to change global to local symbols on Mac OS X])
_LT_DECL([], [LIPO], [1],
[Tool to manipulate fat objects and archives on Mac OS X])
_LT_DECL([], [OTOOL], [1],
[ldd/readelf like tool for Mach-O binaries on Mac OS X])
_LT_DECL([], [OTOOL64], [1],
[ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
[lt_cv_apple_cc_single_mod=no
if test -z "${LT_MULTI_MODULE}"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
# link flags.
rm -rf libconftest.dylib*
echo "int foo(void){return 1;}" > conftest.c
echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
fi
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[lt_cv_ld_exported_symbols_list=yes],
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
case $host_os in
rhapsody* | darwin1.[[012]])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
_lt_dar_single_mod='$single_module'
fi
if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
if test "$DSYMUTIL" != ":"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
fi
;;
esac
])
# _LT_DARWIN_LINKER_FEATURES
# --------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
m4_require([_LT_REQUIRED_DARWIN_CHECKS])
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
case $cc_basename in
ifort*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=echo
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
m4_if([$1], [CXX],
[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
],[])
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
])
# _LT_SYS_MODULE_PATH_AIX
# -----------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
AC_LINK_IFELSE(AC_LANG_PROGRAM,[
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\(.*\)$/\1/
p
}
}'
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_SYS_MODULE_PATH_AIX
# _LT_SHELL_INIT(ARG)
# -------------------
m4_define([_LT_SHELL_INIT],
[ifdef([AC_DIVERSION_NOTICE],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
$1
AC_DIVERT_POP
])# _LT_SHELL_INIT
# _LT_PROG_ECHO_BACKSLASH
# -----------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
m4_defun([_LT_PROG_ECHO_BACKSLASH],
[_LT_SHELL_INIT([
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
case X$lt_ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
;;
esac
ECHO=${lt_ECHO-echo}
if test "X[$]1" = X--no-reexec; then