diff --git a/aclocal.m4 b/aclocal.m4 index 25183944294..f28665ef75b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -448,6 +448,9 @@ AC_DEFUN([SC_ENABLE_SHARED], [ # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. +# SHLIB_LDX - Base command to use for combining object files +# into a shared C++ library. Make sure "IS_CXX = yes" +# is set in the library's Makefile. # SHLIB_LD_FLAGS -Flags to pass when building a shared library. This # differes from the SHLIB_CFLAGS as it is not used # when building object files or executables. @@ -473,6 +476,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_LD_FLAGS="" SHLIB_SUFFIX="" SHLIB_LD="" + SHLIB_LDX="" STLIB_LD='${AR} cr' STLIB_SUFFIX='.a' GRASS_TRIM_DOTS='`echo ${LIB_VER} | tr -d .`' @@ -487,6 +491,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_LD_FLAGS="-Wl,-soname,\$(notdir \$[@])" SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" LDFLAGS="-Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR} -Wl,-rpath,${INST_DIR}/lib' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" @@ -500,6 +505,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ *-pc-mingw32 | *-w64-mingw32 | *-pc-msys) SHLIB_SUFFIX=".dll" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" LDFLAGS="-Wl,--export-dynamic,--enable-runtime-pseudo-reloc" LD_LIBRARY_PATH_VAR="PATH" ;; @@ -507,6 +513,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_CFLAGS="-fno-common" SHLIB_SUFFIX=".dylib" SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" LDFLAGS="-Wl,-rpath,${INSTDIR}/lib,-rpath,\${GISBASE}/lib" LD_LIBRARY_PATH_VAR="LD_RUN_PATH" ;; @@ -558,6 +565,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_CFLAGS="-fPIC" #SHLIB_LD="ld -Bshareable -x" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" SHLIB_LD_FLAGS="-Wl,-soname,\$(notdir \$[@])" SHLIB_SUFFIX=".so" LDFLAGS="-Wl,--export-dynamic" @@ -573,6 +581,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # NetBSD has ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" SHLIB_LD_LIBS="${LIBS}" LDFLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic' SHLIB_LD_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic' @@ -620,6 +629,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_SUBST(LD_LIBRARY_PATH_VAR) AC_SUBST(SHLIB_LD) + AC_SUBST(SHLIB_LDX) AC_SUBST(SHLIB_LD_FLAGS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_SUFFIX) diff --git a/configure b/configure index b13e10ff494..1f734255f14 100755 --- a/configure +++ b/configure @@ -699,9 +699,6 @@ USE_PDAL PDAL_INC PDAL_CPPFLAGS PDAL_LIBS -ac_ct_CXX -CXXFLAGS -CXX PDAL_CONFIG USE_LIBLAS LIBLAS_INC @@ -773,6 +770,7 @@ STLIB_LD SHLIB_SUFFIX SHLIB_CFLAGS SHLIB_LD_FLAGS +SHLIB_LDX SHLIB_LD LD_LIBRARY_PATH_VAR LD_SEARCH_FLAGS @@ -802,6 +800,9 @@ pwd BINDIR WINDRES MINGW32 +ac_ct_CXX +CXXFLAGS +CXX OBJEXT EXEEXT ac_ct_CC @@ -858,10 +859,10 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +with_cxx enable_macosx_app enable_shared enable_w11 -with_cxx with_macosx_archs with_macosx_sdk with_tiff @@ -950,13 +951,13 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CXX +CXXFLAGS +CCC YACC YFLAGS CPP -XMKMF -CXX -CXXFLAGS -CCC' +XMKMF' # Initialize some variables set by options. @@ -1715,6 +1716,8 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. @@ -1723,8 +1726,6 @@ Some influential environment variables: default value of `-d' given by some make applications. CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System - CXX C++ compiler command - CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1844,6 +1845,44 @@ fi } # ac_fn_c_try_compile +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes @@ -2195,44 +2234,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -3536,100 +3537,382 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -case $host_os in - *cygwin* ) CYGWIN=yes;; -esac - +# Enable C++ option -case $host_os in - *mingw32* ) MINGW32=yes;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for executable suffix" >&5 -$as_echo_n "checking for executable suffix... " >&6; } -if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe +# Check whether --with-cxx was given. +if test "${with_cxx+set}" = set; then : + withval=$with_cxx; else - ac_cv_exeext=no + with_cxx=yes fi -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_exeext}" >&5 -$as_echo "${ac_cv_exeext}" >&6; } -ac_exeext=$EXEEXT - -# Set WINDRES -if test "$MINGW32" = yes ; then - WINDRES=${WINDRES-windres} -else - WINDRES= -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5 +$as_echo_n "checking whether to use C++... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_cxx\"" >&5 +$as_echo "\"$with_cxx\"" >&6; } +case "$with_cxx" in + "no") USE_CXX= ;; + "yes") USE_CXX="1" ;; + *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; +esac -# Check for custom PKG_CONFIG -PKG_CONFIG=${PKG_CONFIG-pkg-config} +if test -n "$USE_CXX"; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } -# Check for full floating-point support, including Infinity and NaN -IEEEFLAG= +if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for full floating-point support" >&5 -$as_echo_n "checking for full floating-point support... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 -$as_echo "unknown (cross-compiling)" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"cc -mieee\" works" >&5 -$as_echo_n "checking whether \"cc -mieee\" works... " >&6; } -ac_save_cflags=${CFLAGS} -CFLAGS="$CFLAGS -mieee" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } -int -main () -{ +if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - IEEEFLAG="-mieee" +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS=${ac_save_cflags} - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int main(void) { - double one = 1.0; - double zero = 0.0; - if (one/zero > DBL_MAX) /* infinity */ - if (zero/zero != zero/zero) /* NaN */ - return 0; - return 1; -} + test -n "$ac_ct_CXX" && break +done -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } + +ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + CXX= + CXXFLAGS= + + +fi + +# Done checking C++ + + +case $host_os in + *cygwin* ) CYGWIN=yes;; +esac + + +case $host_os in + *mingw32* ) MINGW32=yes;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for executable suffix" >&5 +$as_echo_n "checking for executable suffix... " >&6; } + +if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + ac_cv_exeext=no +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_exeext}" >&5 +$as_echo "${ac_cv_exeext}" >&6; } +ac_exeext=$EXEEXT + + + +# Set WINDRES + +if test "$MINGW32" = yes ; then + WINDRES=${WINDRES-windres} +else + WINDRES= +fi + + + +# Check for custom PKG_CONFIG +PKG_CONFIG=${PKG_CONFIG-pkg-config} + +# Check for full floating-point support, including Infinity and NaN +IEEEFLAG= + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for full floating-point support" >&5 +$as_echo_n "checking for full floating-point support... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5 +$as_echo "unknown (cross-compiling)" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"cc -mieee\" works" >&5 +$as_echo_n "checking whether \"cc -mieee\" works... " >&6; } +ac_save_cflags=${CFLAGS} +CFLAGS="$CFLAGS -mieee" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + IEEEFLAG="-mieee" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS=${ac_save_cflags} + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int main(void) { + double one = 1.0; + double zero = 0.0; + if (one/zero > DBL_MAX) /* infinity */ + if (zero/zero != zero/zero) /* NaN */ + return 0; + return 1; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -4012,6 +4295,7 @@ ac_save_ldflags="$LDFLAGS" SHLIB_LD_FLAGS="" SHLIB_SUFFIX="" SHLIB_LD="" + SHLIB_LDX="" STLIB_LD='${AR} cr' STLIB_SUFFIX='.a' GRASS_TRIM_DOTS='`echo ${LIB_VER} | tr -d .`' @@ -4026,6 +4310,7 @@ ac_save_ldflags="$LDFLAGS" SHLIB_LD_FLAGS="-Wl,-soname,\$(notdir \$@)" SHLIB_SUFFIX=".so" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" LDFLAGS="-Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR} -Wl,-rpath,${INST_DIR}/lib' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" @@ -4039,6 +4324,7 @@ ac_save_ldflags="$LDFLAGS" *-pc-mingw32 | *-w64-mingw32 | *-pc-msys) SHLIB_SUFFIX=".dll" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" LDFLAGS="-Wl,--export-dynamic,--enable-runtime-pseudo-reloc" LD_LIBRARY_PATH_VAR="PATH" ;; @@ -4046,6 +4332,7 @@ ac_save_ldflags="$LDFLAGS" SHLIB_CFLAGS="-fno-common" SHLIB_SUFFIX=".dylib" SHLIB_LD="${CC} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" + SHLIB_LDX="${CXX} -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name @rpath/lib\${LIB_NAME}\${SHLIB_SUFFIX}" LDFLAGS="-Wl,-rpath,${INSTDIR}/lib,-rpath,\${GISBASE}/lib" LD_LIBRARY_PATH_VAR="LD_RUN_PATH" ;; @@ -4105,6 +4392,7 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-fPIC" #SHLIB_LD="ld -Bshareable -x" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" SHLIB_LD_FLAGS="-Wl,-soname,\$(notdir \$@)" SHLIB_SUFFIX=".so" LDFLAGS="-Wl,--export-dynamic" @@ -4120,6 +4408,7 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h # NetBSD has ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -shared" + SHLIB_LDX="${CXX} -shared" SHLIB_LD_LIBS="${LIBS}" LDFLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic' SHLIB_LD_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic' @@ -4174,6 +4463,7 @@ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + LDFLAGS="${ac_save_ldflags} $LDFLAGS" # Enable options @@ -4188,16 +4478,6 @@ fi # With options - - -# Check whether --with-cxx was given. -if test "${with_cxx+set}" = set; then : - withval=$with_cxx; -else - with_cxx=yes -fi - - #LOC_ARG_WITH(g77, GNU Fortran 77, no) @@ -8975,303 +9255,58 @@ set dummy pdal-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -case $PDAL_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PDAL_CONFIG="$PDAL_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PDAL_CONFIG" && ac_cv_path_PDAL_CONFIG="no" - ;; -esac -PDAL_CONFIG=$ac_cv_path_PDAL_CONFIG -if test -n "$PDAL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDAL_CONFIG" >&5 -$as_echo "$PDAL_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - if test "$PDAL_CONFIG" = "no" ; then - as_fn_error $? "*** could not find pdal-config" "$LINENO" 5 - fi - - if test "$PDAL_CONFIG" != "" ; then - PDAL_LIBS=`"$PDAL_CONFIG" --libs` - PDAL_CPPFLAGS=`"$PDAL_CONFIG" --cxxflags` - PDAL_INC=`"$PDAL_CONFIG" --includes` - USE_PDAL=1 - fi - - PDAL= - ac_save_libs="$LIBS" - ac_save_cflags="$CFLAGS" - ac_save_cppflags="$CPPFLAGS" - LIBS="$LIBS $PDAL_LIBS" - CFLAGS="$CFLAGS $PDAL_CFLAGS" - CPPFLAGS="$CPPFLAGS $PDAL_CPPFLAGS $PDAL_INC" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } - -if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } - -if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } - -ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +case $PDAL_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PDAL_CONFIG="$PDAL_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_PDAL_CONFIG" && ac_cv_path_PDAL_CONFIG="no" + ;; +esac +PDAL_CONFIG=$ac_cv_path_PDAL_CONFIG +if test -n "$PDAL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDAL_CONFIG" >&5 +$as_echo "$PDAL_CONFIG" >&6; } else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" + + if test "$PDAL_CONFIG" = "no" ; then + as_fn_error $? "*** could not find pdal-config" "$LINENO" 5 fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= + + if test "$PDAL_CONFIG" != "" ; then + PDAL_LIBS=`"$PDAL_CONFIG" --libs` + PDAL_CPPFLAGS=`"$PDAL_CONFIG" --cxxflags` + PDAL_INC=`"$PDAL_CONFIG" --includes` + USE_PDAL=1 fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + PDAL= + ac_save_libs="$LIBS" + ac_save_cflags="$CFLAGS" + ac_save_cppflags="$CPPFLAGS" + LIBS="$LIBS $PDAL_LIBS" + CFLAGS="$CFLAGS $PDAL_CFLAGS" + CPPFLAGS="$CPPFLAGS $PDAL_CPPFLAGS $PDAL_INC" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13730,579 +13765,309 @@ CAIROLIB="$CAIROLIB $with_cairo_ldflags" -ac_save_libs="$LIBS" -ac_save_ldflags="$LDFLAGS" -LIBS=" $CAIROLIB $LIBS" -LDFLAGS=" $LDFLAGS" -ac_fn_c_check_func "$LINENO" "cairo_create" "ac_cv_func_cairo_create" -if test "x$ac_cv_func_cairo_create" = xyes; then : - -: - -else - - -as_fn_error $? "*** Unable to locate cairo_create." "$LINENO" 5 - - -fi - -LIBS=${ac_save_libs} -LDFLAGS=${ac_save_ldflags} - - -ac_save_libs="$LIBS" -ac_save_ldflags="$LDFLAGS" -LIBS=" $CAIROLIB $LIBS" -LDFLAGS=" $LDFLAGS" -ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_create_with_xrender_format" "ac_cv_func_cairo_xlib_surface_create_with_xrender_format" -if test "x$ac_cv_func_cairo_xlib_surface_create_with_xrender_format" = xyes; then : - -CAIRO_HAS_XRENDER=1 - -else - -CAIRO_HAS_XRENDER= - -fi - -LIBS=${ac_save_libs} -LDFLAGS=${ac_save_ldflags} - - - -ac_save_libs="$LIBS" -ac_save_ldflags="$LDFLAGS" -LIBS=" $CAIROLIB $LIBS" -LDFLAGS=" $LDFLAGS" -ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_get_xrender_format" "ac_cv_func_cairo_xlib_surface_get_xrender_format" -if test "x$ac_cv_func_cairo_xlib_surface_get_xrender_format" = xyes; then : - -CAIRO_HAS_XRENDER_SURFACE=1 - -else - -CAIRO_HAS_XRENDER_SURFACE= - -fi - -LIBS=${ac_save_libs} -LDFLAGS=${ac_save_ldflags} - - - -CAIROLIB="$CAIROLIB $CAIROLDFLAGS" - -fi # $USE_CAIRO - - - - - -# Done checking Cairo - -# Enable FreeType option - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use FreeType" >&5 -$as_echo_n "checking whether to use FreeType... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_freetype\"" >&5 -$as_echo "\"$with_freetype\"" >&6; } -case "$with_freetype" in - "no") USE_FREETYPE= ;; - "yes") USE_FREETYPE="1" ;; - *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; -esac - - - -FTINC= -FTLIB= - -if test -n "$USE_FREETYPE"; then - -# With FreeType includes directory - -FTINC=`$PKG_CONFIG --cflags freetype2` - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType includes" >&5 -$as_echo_n "checking for location of FreeType includes... " >&6; } -case "$with_freetype_includes" in -y | ye | yes | n | no) - as_fn_error $? "*** You must supply a directory to --with-freetype-includes." "$LINENO" 5 - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_includes" >&5 -$as_echo "$with_freetype_includes" >&6; } - -if test -n "$with_freetype_includes" ; then - for dir in $with_freetype_includes; do - if test -d "$dir"; then - FTINC="$FTINC -I$dir" - else - as_fn_error $? "*** FreeType includes directory $dir does not exist." "$LINENO" 5 - fi - done -fi - - - -ac_save_cppflags="$CPPFLAGS" -CPPFLAGS="$FTINC $CPPFLAGS" -for ac_header in ft2build.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" -if test "x$ac_cv_header_ft2build_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FT2BUILD_H 1 -_ACEOF - -else - - as_fn_error $? "*** Unable to locate FreeType includes." "$LINENO" 5 - -fi - -done - -CPPFLAGS=$ac_save_cppflags - - -# With FreeType library directory - -FTLIB=`$PKG_CONFIG --libs freetype2` - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType library" >&5 -$as_echo_n "checking for location of FreeType library... " >&6; } -case "$with_freetype_libs" in -y | ye | yes | n | no) - as_fn_error $? "*** You must supply a directory to --with-freetype-libs." "$LINENO" 5 - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_libs" >&5 -$as_echo "$with_freetype_libs" >&6; } - -if test -n "$with_freetype_libs"; then - for dir in $with_freetype_libs; do - if test -d "$dir"; then - FTLIB="$FTLIB -L$dir" - else - as_fn_error $? "*** FreeType library directory $dir does not exist." "$LINENO" 5 - fi - done -fi - - - +ac_save_libs="$LIBS" ac_save_ldflags="$LDFLAGS" -LDFLAGS="$FTLIB $LDFLAGS" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 -$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } +LIBS=" $CAIROLIB $LIBS" +LDFLAGS=" $LDFLAGS" +ac_fn_c_check_func "$LINENO" "cairo_create" "ac_cv_func_cairo_create" +if test "x$ac_cv_func_cairo_create" = xyes; then : -ac_check_lib_save_LIBS=$LIBS -LIBS="-lfreetype $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +: -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FT_Init_FreeType (); -int -main () -{ -return FT_Init_FreeType (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_freetype_FT_Init_FreeType=yes -else - ac_cv_lib_freetype_FT_Init_FreeType=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 -$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : - FTLIB="$FTLIB -lfreetype " else -LDFLAGS=${ac_save_ldflags} - as_fn_error $? "*** Unable to locate FreeType library." "$LINENO" 5 +as_fn_error $? "*** Unable to locate cairo_create." "$LINENO" 5 fi - - +LIBS=${ac_save_libs} LDFLAGS=${ac_save_ldflags} -fi # $USE_FREETYPE +ac_save_libs="$LIBS" +ac_save_ldflags="$LDFLAGS" +LIBS=" $CAIROLIB $LIBS" +LDFLAGS=" $LDFLAGS" +ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_create_with_xrender_format" "ac_cv_func_cairo_xlib_surface_create_with_xrender_format" +if test "x$ac_cv_func_cairo_xlib_surface_create_with_xrender_format" = xyes; then : +CAIRO_HAS_XRENDER=1 +else +CAIRO_HAS_XRENDER= -# Done checking FreeType +fi -# Enable NLS option +LIBS=${ac_save_libs} +LDFLAGS=${ac_save_ldflags} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 -$as_echo_n "checking whether to use NLS... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_nls\"" >&5 -$as_echo "\"$with_nls\"" >&6; } -case "$with_nls" in - "no") USE_NLS= ;; - "yes") USE_NLS="1" ;; - *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; -esac +ac_save_libs="$LIBS" +ac_save_ldflags="$LDFLAGS" +LIBS=" $CAIROLIB $LIBS" +LDFLAGS=" $LDFLAGS" +ac_fn_c_check_func "$LINENO" "cairo_xlib_surface_get_xrender_format" "ac_cv_func_cairo_xlib_surface_get_xrender_format" +if test "x$ac_cv_func_cairo_xlib_surface_get_xrender_format" = xyes; then : +CAIRO_HAS_XRENDER_SURFACE=1 -INTLLIB= -HAVE_NLS= +else -if test -n "${USE_NLS}" ; then +CAIRO_HAS_XRENDER_SURFACE= -$as_echo "#define USE_NLS 1" >>confdefs.h +fi +LIBS=${ac_save_libs} +LDFLAGS=${ac_save_ldflags} -ac_fn_c_check_func "$LINENO" "gettext" "ac_cv_func_gettext" -if test "x$ac_cv_func_gettext" = xyes; then : - INTLLIB= -else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 -$as_echo_n "checking for gettext in -lintl... " >&6; } -ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +CAIROLIB="$CAIROLIB $CAIROLDFLAGS" -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gettext (); -int -main () -{ -return gettext (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_gettext=yes -else - ac_cv_lib_intl_gettext=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 -$as_echo "$ac_cv_lib_intl_gettext" >&6; } -if test "x$ac_cv_lib_intl_gettext" = xyes; then : - INTLLIB=-lintl -else +fi # $USE_CAIRO - as_fn_error $? "*** Unable to locate gettext() function." "$LINENO" 5 -fi -fi - HAVE_NLS=1 -fi +# Done checking Cairo +# Enable FreeType option +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use FreeType" >&5 +$as_echo_n "checking whether to use FreeType... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_freetype\"" >&5 +$as_echo "\"$with_freetype\"" >&6; } +case "$with_freetype" in + "no") USE_FREETYPE= ;; + "yes") USE_FREETYPE="1" ;; + *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; +esac -# Enable C++ option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5 -$as_echo_n "checking whether to use C++... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_cxx\"" >&5 -$as_echo "\"$with_cxx\"" >&6; } -case "$with_cxx" in - "no") USE_CXX= ;; - "yes") USE_CXX="1" ;; - *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; -esac +FTINC= +FTLIB= +if test -n "$USE_FREETYPE"; then +# With FreeType includes directory -if test -n "$USE_CXX"; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +FTINC=`$PKG_CONFIG --cflags freetype2` -if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType includes" >&5 +$as_echo_n "checking for location of FreeType includes... " >&6; } +case "$with_freetype_includes" in +y | ye | yes | n | no) + as_fn_error $? "*** You must supply a directory to --with-freetype-includes." "$LINENO" 5 + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_includes" >&5 +$as_echo "$with_freetype_includes" >&6; } + +if test -n "$with_freetype_includes" ; then + for dir in $with_freetype_includes; do + if test -d "$dir"; then + FTINC="$FTINC -I$dir" + else + as_fn_error $? "*** FreeType includes directory $dir does not exist." "$LINENO" 5 + fi + done fi - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +ac_save_cppflags="$CPPFLAGS" +CPPFLAGS="$FTINC $CPPFLAGS" +for ac_header in ft2build.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" +if test "x$ac_cv_header_ft2build_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FT2BUILD_H 1 +_ACEOF -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + as_fn_error $? "*** Unable to locate FreeType includes." "$LINENO" 5 + +fi - test -n "$ac_ct_CXX" && break done - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +CPPFLAGS=$ac_save_cppflags + + +# With FreeType library directory + +FTLIB=`$PKG_CONFIG --libs freetype2` + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of FreeType library" >&5 +$as_echo_n "checking for location of FreeType library... " >&6; } +case "$with_freetype_libs" in +y | ye | yes | n | no) + as_fn_error $? "*** You must supply a directory to --with-freetype-libs." "$LINENO" 5 + ;; esac - CXX=$ac_ct_CXX - fi -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freetype_libs" >&5 +$as_echo "$with_freetype_libs" >&6; } - fi +if test -n "$with_freetype_libs"; then + for dir in $with_freetype_libs; do + if test -d "$dir"; then + FTLIB="$FTLIB -L$dir" + else + as_fn_error $? "*** FreeType library directory $dir does not exist." "$LINENO" 5 + fi + done fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } + +ac_save_ldflags="$LDFLAGS" +LDFLAGS="$FTLIB $LDFLAGS" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 +$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } + +ac_check_lib_save_LIBS=$LIBS +LIBS="-lfreetype $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char FT_Init_FreeType (); int main () { -#ifndef __GNUC__ - choke me -#endif - +return FT_Init_FreeType (); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_freetype_FT_Init_FreeType=yes else - ac_compiler_gnu=no + ac_cv_lib_freetype_FT_Init_FreeType=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 +$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } +if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : + FTLIB="$FTLIB -lfreetype " else - GXX= + +LDFLAGS=${ac_save_ldflags} + + as_fn_error $? "*** Unable to locate FreeType library." "$LINENO" 5 + + fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +LDFLAGS=${ac_save_ldflags} + + +fi # $USE_FREETYPE + + + + +# Done checking FreeType + +# Enable NLS option + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_nls\"" >&5 +$as_echo "\"$with_nls\"" >&6; } +case "$with_nls" in + "no") USE_NLS= ;; + "yes") USE_NLS="1" ;; + *) as_fn_error $? "*** You must answer yes or no." "$LINENO" 5 ;; +esac -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +INTLLIB= +HAVE_NLS= + +if test -n "${USE_NLS}" ; then + +$as_echo "#define USE_NLS 1" >>confdefs.h + + +ac_fn_c_check_func "$LINENO" "gettext" "ac_cv_func_gettext" +if test "x$ac_cv_func_gettext" = xyes; then : + INTLLIB= else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 +$as_echo_n "checking for gettext in -lintl... " >&6; } + +ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gettext (); int main () { - +return gettext (); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_gettext=yes +else + ac_cv_lib_intl_gettext=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 +$as_echo "$ac_cv_lib_intl_gettext" >&6; } +if test "x$ac_cv_lib_intl_gettext" = xyes; then : + INTLLIB=-lintl else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + + as_fn_error $? "*** Unable to locate gettext() function." "$LINENO" 5 + fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -else - CXX= - CXXFLAGS= +fi + HAVE_NLS=1 fi -# Done checking C++ + + # Enable openDWG option diff --git a/configure.ac b/configure.ac index fae771ea48e..a634a2946ce 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,24 @@ AC_PREREQ([2.69]) AC_CONFIG_HEADER(include/grass/config.h) AC_CANONICAL_HOST AC_PROG_CC + +# Enable C++ option + +LOC_ARG_WITH(cxx, C++) + +LOC_CHECK_USE(cxx,C++,USE_CXX) + +if test -n "$USE_CXX"; then + AC_PROG_CXX +else + CXX= + CXXFLAGS= + AC_SUBST(CXX) + AC_SUBST(CXXFLAGS) +fi + +# Done checking C++ + LOC_EXEEXT AC_SUBST(MINGW32) @@ -259,7 +277,6 @@ AC_ARG_ENABLE(w11, # With options -LOC_ARG_WITH(cxx, C++) #LOC_ARG_WITH(g77, GNU Fortran 77, no) AC_ARG_WITH(macosx-archs, @@ -1779,21 +1796,6 @@ fi AC_SUBST(INTLLIB) AC_SUBST(HAVE_NLS) -# Enable C++ option - -LOC_CHECK_USE(cxx,C++,USE_CXX) - -if test -n "$USE_CXX"; then - AC_PROG_CXX -else - CXX= - CXXFLAGS= - AC_SUBST(CXX) - AC_SUBST(CXXFLAGS) -fi - -# Done checking C++ - # Enable openDWG option LOC_CHECK_USE(opendwg,openDWG,USE_OPENDWG) diff --git a/include/Make/Grass.make b/include/Make/Grass.make index 654a714b899..773fac6677d 100644 --- a/include/Make/Grass.make +++ b/include/Make/Grass.make @@ -261,11 +261,7 @@ $(1)LIB = -l$$($(1)_LIBNAME) $$($(1)DEPS) else $(1)LIB = -l$$($(1)_LIBNAME) endif -ifneq ($(1),IOSTREAM) $(1)DEP = $$(BASE_LIBDIR)/$$(LIB_PREFIX)$$($(1)_LIBNAME)$$(LIB_SUFFIX) -else -$(1)DEP = $$(BASE_LIBDIR)/$$(STLIB_PREFIX)$$($(1)_LIBNAME)$$(STLIB_SUFFIX) -endif endef $(foreach lib,$(libs),$(eval $(call lib_rules,$(firstword $(subst :, ,$(lib))),$(lastword $(subst :, ,$(lib)))))) diff --git a/include/Make/Platform.make.in b/include/Make/Platform.make.in index 710e9ee4151..d57cd0a4d25 100644 --- a/include/Make/Platform.make.in +++ b/include/Make/Platform.make.in @@ -63,6 +63,7 @@ STLIB_SUFFIX = @STLIB_SUFFIX@ #shared libs SHLIB_PREFIX = lib SHLIB_LD = @SHLIB_LD@ +SHLIB_LDX = @SHLIB_LDX@ SHLIB_LDFLAGS = @SHLIB_LD_FLAGS@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ diff --git a/include/Make/Shlib.make b/include/Make/Shlib.make index 8b30756aad9..d778caac6fc 100644 --- a/include/Make/Shlib.make +++ b/include/Make/Shlib.make @@ -6,8 +6,14 @@ CFLAGS += $(SHLIB_CFLAGS) CXXFLAGS += $(SHLIB_CFLAGS) LDFLAGS += $(SHLIB_LDFLAGS) +ifndef IS_CXX +SHL = $(SHLIB_LD) +else +SHL = $(SHLIB_LDX) +endif + $(SHLIB): $(SHLIB_OBJS) - $(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(LIBES) $(EXTRA_LIBS) $(MATHLIB) + $(SHL) -o $@ $(LDFLAGS) $^ $(LIBES) $(EXTRA_LIBS) $(MATHLIB) ifndef MINGW (cd $(ARCH_LIBDIR); ln -f -s $(notdir $@) $(patsubst %.$(GRASS_LIB_VERSION_NUMBER)$(SHLIB_SUFFIX),%$(SHLIB_SUFFIX),$@)) endif diff --git a/lib/iostream/Makefile b/lib/iostream/Makefile index 07640010ccc..df3f5c0f9d9 100644 --- a/lib/iostream/Makefile +++ b/lib/iostream/Makefile @@ -2,9 +2,14 @@ MODULE_TOPDIR = ../.. LIB = IOSTREAM -include $(MODULE_TOPDIR)/include/Make/Lib.make +IS_CXX = yes +include $(MODULE_TOPDIR)/include/Make/Lib.make ifneq ($(strip $(CXX)),) +ifneq ($(strip $(SHLIB_LDX)),) +default: lib +else default: stlib endif +endif