# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(setiathome_enhanced, 5.27, ports@setiathome.ssl.berkeley.edu) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(dist-zip) AC_CONFIG_SRCDIR([client/analyze.h]) # Make sure we use the same initial CFLAGS and CXXFLAGS unless otherwise told. if test -z "${CXXFLAGS}" then CXXFLAGS="${CFLAGS}" elif test -z "${CFLAGS}" then CFLAGS="${CXXFLAGS}" fi AC_ARG_ENABLE(intrinsics, AS_HELP_STRING([--disable-intrinsics], [disable use of intrinsics in SIMD code])) if test "x$enable_intrinsics" != xno ; then enable_intrinsics=yes fi enable_client=yes configured_to_build=client AC_MSG_NOTICE(["--- Configuring SETI_BOINC AC_PACKAGE_VERSION (${configured_to_build}) ---"]) AC_COPYRIGHT([ Copyright (C) 2004 Regents of the University of California SETI_BOINC 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, or (at your option) any later version. SETI_BOINC 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 SETI_BOINC; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Contributor(s): ]) AC_REVISION([$Revision: 1.60.2.41 $]) major_version=`echo AC_PACKAGE_VERSION | sed 's/\..*//'` minor_version=`echo AC_PACKAGE_VERSION | sed 's/.*\.//' | sed 's/^0//'` AC_SUBST([MAJOR_VERSION], [$major_version]) AC_SUBST([MINOR_VERSION], [$minor_version]) AC_DEFINE_UNQUOTED([VERSION_MAJOR],$major_version, [SETI@home major version number]) AC_DEFINE_UNQUOTED([VERSION_MINOR],$minor_version, [SETI@home minor version number]) AC_DEFINE_UNQUOTED([SAH_APP_NAME],["$PACKAGE_NAME"], [Define to the BOINC application name for setiathome]) SAH_TOP_DIR=`pwd` AC_SUBST([SAH_TOP_DIR]) AM_MAINTAINER_MODE # Checks for programs. PATH="/usr/xpg4/bin:${PATH}" AC_PROG_CXX AC_PROG_CXXCPP AM_PROG_CC_C_O AC_PROG_AWK AC_PROG_LN_S AC_PATH_PROG(TR,[tr]) AC_PATH_PROGS(AR,[ar lib]) AC_PATH_PROG(GREP,[grep]) AC_PATH_PROG(AUTOCONF,[autoconf]) AC_PATH_PROG(AUTOHEADER,[autoheader]) AC_PATH_PROGS(INDENT,[astyle indent]) AC_PATH_PROGS(CP,[cp copy]) AC_PATH_PROGS(LN,[ln cp copy]) AC_PATH_PROG(SORT,[sort]) AC_PATH_PROG(UNIQ,[uniq]) AC_PATH_PROG(CAT,[cat type]) AC_PATH_PROG(MV,[mv]) AC_PATH_PROGS(RM,[rm Rm del erase delete]) AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL SAH_LINK_DLL AC_SUBST(PICFLAGS,${lt_prog_compiler_pic}) AC_SUBST(SED) AC_C_BIGENDIAN AX_C_FLOAT_WORDS_BIGENDIAN SAH_OPTION_BITNESS dnl Determine the BOINC platform given the target arch-platform-os. BOINC_PLATFORM if test -n `echo $INDENT | grep astyle` then AC_SUBST([INDENT_FLAGS],["--c --indent-classes --indent-switches --brackets=attach --convert-tabs"]) else AC_SUBST([INDENT_FLAGS],["-kr"]) fi AC_PROG_MAKE_SET SAH_DLLEXT SAH_LIBEXT if test -n "$EXEEXT" then DOTEXEEXT=".$EXEEXT" fi AC_SUBST(DOTEXEEXT) AC_SYS_LARGEFILE ACX_PTHREAD([AC_DEFINE(HAVE_PTHREAD,1, [Have pthread])]) STATIC_LIB_LIST="stdc++ gcc gcc_eh gtk* gdk* gmodule gthread glib wx* tiff jpeg png Xi glut socket z fftw3f" case ${target} in *-linux*) STATIC_LIB_LIST="${STATIC_LIB_LIST} nsl ssl crypto" ;; *-solaris*) STATIC_LIB_LIST="${STATIC_LIB_LIST} X* ssl crypto" ;; esac # Checks for libraries. SAH_CHECK_LIB([m], [sin], AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library])) SAH_CHECK_LIB([c],[atexit], AC_DEFINE([HAVE_LIBC],[1],[Define to 1 if you have the c library])) SAH_CHECK_LIB([pthread],[pthread_join], AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define to 1 if you have the pthread library])) SAH_CHECK_LIB([gcc],[sscanf], AC_DEFINE([HAVE_LIBGCC],[1],[Define to 1 if you have the gcc library])) SAH_CHECK_LIB([gcc_eh],[_Unwind_Resume], AC_DEFINE([HAVE_LIBGCC_EH],[1],[Define to 1 if you have the gcc_eh library])) SAH_CHECK_LIB([gcc_s],[sscanf], AC_DEFINE([HAVE_LIBGCC_S],[1],[Define to 1 if you have the gcc_s library])) SAH_CHECK_LIB([stdc++],[sscanf], AC_DEFINE([HAVE_LIBSTDC__],[1],[Define to 1 if you have the stdc++ library])) SAH_CHECK_LIB([z], [uncompress], AC_DEFINE([HAVE_LIBZ],[1],[Define to 1 if you have the z library])) SAH_CHECK_LIB([socket], [bind], AC_DEFINE([HAVE_LIBSOCKET],[1],[Define to 1 if you have the socket library])) SAH_CHECK_LIB([rt], [sched_get_priority_min], AC_DEFINE([HAVE_LIBRT],[1],[Define to 1 if you have the rt library])) SAH_CHECK_LIB([nsl], [gethostbyname], AC_DEFINE([HAVE_LIBNSL],[1],[Define to 1 if you have the nsl library])) SAH_CHECK_LIB([fftw3f], [fftwf_plan_dft_1d], AC_DEFINE([HAVE_LIBFFTW3F],[1],[Define to 1 if you have the fftw3f library])) SAH_CHECK_LIB([elf], [elf_hash], AC_DEFINE([HAVE_LIBELF],[1],[Define to 1 if you have the elf library])) SAH_CHECK_LIB([aio], [aio_fork], AC_DEFINE([HAVE_LIBAIO],[1],[Define to 1 if you have the aio library])) SAH_CHECK_LIB([cygipc],[shmget], AC_DEFINE([HAVE_LIBCYGIPC],[1],[Define to 1 if you have the cygipc library])) CHECK_SSL SAH_CHECK_LIB([ssl], [fopen], [BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} -L${SSLDIR}/lib ${sah_lib_last}"]) SAH_CHECK_LIB([crypto], [RSA_new], [BOINC_EXTRA_LIBS="${BOINC_EXTRA_LIBS} -L${SSLDIR}/lib ${sah_lib_last}"]) SAH_CHECK_LDFLAG([-nodefaultlibs]) SAH_CHECK_LIB([dl], [dlopen], AC_DEFINE([HAVE_LIBDL],[1],[Define to 1 if you have the dl library])) AC_LANG(C++) SAH_CHECK_IPP if test "${ac_cv_cxx_compiler_gnu}" = "yes" ; then gcc_version_string=`g++ --version` AC_DEFINE([COMPILER_STRING],["${gcc_version_string}"],[Define to a string identifying your compiler]) else if test -n "${CXX}" ; then AC_DEFINE([COMPILER_STRING],["${CXX}"],[Define to a string identifying your compiler]) else if test -n "${CC}" ; then AC_DEFINE([COMPILER_STRING],["${CC}"],[Define to a string identifying your compiler]) fi fi fi SAH_REQUIRES([boinc],[SAH_CHECK_BOINC],["${no_boinc}" = yes], [ ERROR: trying to build the seti_boinc client but BOINC was not found. You can get boinc at http://boinc.ssl.berkeley.edu/ ], [exit 1]) AC_CACHE_SAVE # Checks for header files. AC_HEADER_STDC SAH_LARGEFILE_BREAKS_CXX SAH_HEADER_STDCXX AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h memory.h alloca.h malloc.h stdlib.h string.h strings.h errno.h sys/ioctl.h sys/statvfs.h sys/time.h unistd.h dirent.h math.h float.h ieeefp.h floatingpoint.h complex.h fftw3.h setjmp.h signal.h mach/mach_time.h]) save_cxxflags="${CXXFLAGS}" save_cppflags="${CPPFLAGS}" CXXFLAGS="${CXXFLAGS} -msse" CPPFLAGS="${CPPFLAGS} -msse" AC_CHECK_HEADERS([xmmintrin.h emmintrin.h]) CXXFLAGS="${save_cxxflags}" CPPFLAGS="${save_cppflags}" if test "x$enable_intrinsics" != "xno" ; then if test "x$ac_cv_header_xmmintrin_h" != "xno" -o "x$ac_cv_header_emmintrin_h" != "xno" ; then AC_DEFINE([USE_INTRINSICS],[1],[Define to 1 to use SIMD intrinsics rather than inline assembly]) fi fi AC_CACHE_SAVE # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_C_LONG_DOUBLE AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLOCKS AC_STRUCT_TM AC_CHECK_SIZEOF([long int]) AC_CHECK_SIZEOF([long double]) AC_CHECK_TYPES([long long,_int64,int64_t,bool,_int32,int32_t, hrtime_t, uint_fast64_t, uint64_t, _uint64, ptrdiff_t, ssize_t, off64_t]) AC_CACHE_SAVE # Checks for library functions. AC_LANG(C) AC_FUNC_FORK AC_HEADER_MAJOR AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STAT AC_FUNC_STRFTIME AC_CHECK_FUNCS([ _aligned_malloc alloca _alloca memalign atexit exit _exit floor getcwd memset munmap putenv sqrt strchr strstr atoll dlopen sincosf sincos sinf cosf atanf gethrtime mach_absolute_time isnan _isnan]) SAH_CHECK_NAMESPACES AH_TEMPLATE([HAVE_STD_MIN],[Define to 1 if min is in namespace std::]) AH_TEMPLATE([HAVE_STD_MAX],[Define to 1 if max is in namespace std::]) AH_TEMPLATE([HAVE_STD_TRANSFORM],[Define to 1 if transform is in namespace std::]) SAH_FUNCS_IN_NAMESPACE([['min(0,0)'] ['max(0,0)'] ['transform((char *)0,(char *)0,(char *)0,(int(*)(int))malloc)']],std) AM_CONDITIONAL(ENABLE_CLIENT, [test "${enable_client}" = yes]) AM_CONDITIONAL(LINUX, [test -n "`echo ${target} | grep linux`"]) AM_CONDITIONAL(I386, [test -n "`echo ${target} | grep i.86`"]) AM_CONDITIONAL(X86_64, [test -n "`echo ${target} | grep 'x86_64'`"]) AM_CONDITIONAL(PPC, [test -n "`echo ${target} | grep 'powerpc'`" -o -n "`echo ${target} | grep 'ppc'`" ]) AC_CACHE_SAVE AH_TOP([ #ifndef _SAH_CONFIG_H_ #define _SAH_CONFIG_H_ #ifdef _WIN32 #include "win-sah_config.h" #else ]) AH_BOTTOM([ /* Define USE_NAMESPACES if you may access more than one database from the * same program */ #endif /* * Use fftw if we have the library */ #if defined(HAVE_LIBFFTW3F) && defined(HAVE_FFTW3_H) #define USE_FFTWF #endif #if !defined(CUSTOM_STRING) && defined(COMPILER_STRING) #define CUSTOM_STRING PACKAGE_STRING" "COMPILER_STRING #endif #include "std_fixes.h" #endif ]) AC_CONFIG_FILES([Makefile client/Makefile db/Makefile db/tools/Makefile db/schema_to_class ]) AC_CONFIG_HEADERS([sah_config.h]) AC_OUTPUT chmod +x db/schema_to_class