$NetBSD: patch-ac,v 1.16 2006/02/04 22:25:06 markd Exp $ --- configure.orig 2005-12-16 16:07:00.000000000 +1300 +++ configure @@ -1910,17 +1910,17 @@ fi ## R installation directories -if test -z ${rdocdir}; then +if test -z "${rdocdir}"; then rdocdir='${rhome}/doc' fi -if test -z ${rincludedir}; then +if test -z "${rincludedir}"; then rincludedir='${rhome}/include' fi -if test -z ${rsharedir}; then +if test -z "${rsharedir}"; then rsharedir='${rhome}/share' fi @@ -2246,7 +2246,7 @@ else fi if test "${want_R_shlib}" = yes; then - LIBR="-L\$(R_HOME)/lib -lR" + LIBR="-Wl,-R${prefix}/lib/R/lib -L\$(R_HOME)/lib -lR" else LIBR= fi @@ -6438,7 +6438,7 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | kfreebsd*-gnu) +freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) @@ -8963,7 +8963,7 @@ if test -z "$aix_libpath"; then aix_libp ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -9541,7 +9541,7 @@ kfreebsd*-gnu) dynamic_linker='GNU ld.so' ;; -freebsd*) +freebsd* | dragonfly*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in @@ -11921,7 +11921,7 @@ if test -z "$aix_libpath"; then aix_libp freebsd-elf*) archive_cmds_need_lc_CXX=no ;; - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -12632,7 +12632,7 @@ echo $ECHO_N "checking for $compiler opt ;; esac ;; - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -13243,7 +13243,7 @@ kfreebsd*-gnu) dynamic_linker='GNU ld.so' ;; -freebsd*) +freebsd* | dragonfly*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in @@ -15814,7 +15814,7 @@ if test -z "$aix_libpath"; then aix_libp ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes @@ -16392,7 +16392,7 @@ kfreebsd*-gnu) dynamic_linker='GNU ld.so' ;; -freebsd*) +freebsd* | dragonfly*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in @@ -18165,7 +18165,7 @@ if test -z "$aix_libpath"; then aix_libp ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes @@ -18743,7 +18743,7 @@ kfreebsd*-gnu) dynamic_linker='GNU ld.so' ;; -freebsd*) +freebsd* | dragonfly*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in @@ -21746,13 +21746,13 @@ fi ## only need ncurses if libreadline is not statically linked against it unset ac_cv_lib_readline_rl_callback_read_char -echo "$as_me:$LINENO: checking for main in -lncurses" >&5 -echo $ECHO_N "checking for main in -lncurses... $ECHO_C" >&6 -if test "${ac_cv_lib_ncurses_main+set}" = set; then +echo "$as_me:$LINENO: checking for main in -ltermcap" >&5 +echo $ECHO_N "checking for main in -ltermcap... $ECHO_C" >&6 +if test "${ac_cv_lib_termcap_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" +LIBS="-ltermcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21791,35 +21791,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_ncurses_main=yes + ac_cv_lib_termcap_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_main=no +ac_cv_lib_termcap_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_main" >&6 -if test $ac_cv_lib_ncurses_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_main" >&5 +echo "${ECHO_T}$ac_cv_lib_termcap_main" >&6 +if test $ac_cv_lib_termcap_main = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNCURSES 1 +#define HAVE_LIBTERMCAP 1 _ACEOF - LIBS="-lncurses $LIBS" + LIBS="-ltermcap $LIBS" else -echo "$as_me:$LINENO: checking for main in -ltermcap" >&5 -echo $ECHO_N "checking for main in -ltermcap... $ECHO_C" >&6 -if test "${ac_cv_lib_termcap_main+set}" = set; then +echo "$as_me:$LINENO: checking for main in -ltermlib" >&5 +echo $ECHO_N "checking for main in -ltermlib... $ECHO_C" >&6 +if test "${ac_cv_lib_termlib_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermcap $LIBS" +LIBS="-ltermlib $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21858,35 +21858,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_termcap_main=yes + ac_cv_lib_termlib_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_termcap_main=no +ac_cv_lib_termlib_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_main" >&5 -echo "${ECHO_T}$ac_cv_lib_termcap_main" >&6 -if test $ac_cv_lib_termcap_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_termlib_main" >&5 +echo "${ECHO_T}$ac_cv_lib_termlib_main" >&6 +if test $ac_cv_lib_termlib_main = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBTERMCAP 1 +#define HAVE_LIBTERMLIB 1 _ACEOF - LIBS="-ltermcap $LIBS" + LIBS="-ltermlib $LIBS" else -echo "$as_me:$LINENO: checking for main in -ltermlib" >&5 -echo $ECHO_N "checking for main in -ltermlib... $ECHO_C" >&6 -if test "${ac_cv_lib_termlib_main+set}" = set; then +echo "$as_me:$LINENO: checking for main in -lncurses" >&5 +echo $ECHO_N "checking for main in -lncurses... $ECHO_C" >&6 +if test "${ac_cv_lib_ncurses_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermlib $LIBS" +LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21925,25 +21925,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_termlib_main=yes + ac_cv_lib_ncurses_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_termlib_main=no +ac_cv_lib_ncurses_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_termlib_main" >&5 -echo "${ECHO_T}$ac_cv_lib_termlib_main" >&6 -if test $ac_cv_lib_termlib_main = yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_main" >&6 +if test $ac_cv_lib_ncurses_main = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBTERMLIB 1 +#define HAVE_LIBNCURSES 1 _ACEOF - LIBS="-ltermlib $LIBS" + LIBS="-lncurses $LIBS" fi @@ -27173,6 +27173,7 @@ cat > conftest.c < conftest.c <&6 fi fi - if test "${G77}" = yes; then - ac_safe=_mieee -echo "$as_me:$LINENO: checking whether ${F77} accepts -mieee" >&5 -echo $ECHO_N "checking whether ${F77} accepts -mieee... $ECHO_C" >&6 -if eval "test \"\${r_cv_prog_f77_flag_${ac_safe}+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - -r_save_FFLAGS="${FFLAGS}" -FFLAGS="${FFLAGS} -mieee" -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "r_cv_prog_f77_flag_${ac_safe}=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "r_cv_prog_f77_flag_${ac_safe}=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -FFLAGS="${r_save_FFLAGS}" -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 - - -fi - -if eval "test \"`echo '$r_cv_prog_f77_flag_'$ac_safe`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - separator="" -test -z "${separator}" && separator=" " -if test -z "${R_XTRA_FFLAGS}"; then - R_XTRA_FFLAGS="-mieee" -else - R_XTRA_FFLAGS="${R_XTRA_FFLAGS}${separator}-mieee" -fi -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - ac_safe=_fpe3 -echo "$as_me:$LINENO: checking whether ${F77} accepts -fpe3" >&5 -echo $ECHO_N "checking whether ${F77} accepts -fpe3... $ECHO_C" >&6 -if eval "test \"\${r_cv_prog_f77_flag_${ac_safe}+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - -r_save_FFLAGS="${FFLAGS}" -FFLAGS="${FFLAGS} -fpe3" -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "r_cv_prog_f77_flag_${ac_safe}=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "r_cv_prog_f77_flag_${ac_safe}=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -FFLAGS="${r_save_FFLAGS}" -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 - - -fi - -if eval "test \"`echo '$r_cv_prog_f77_flag_'$ac_safe`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - separator="" -test -z "${separator}" && separator=" " -if test -z "${R_XTRA_FFLAGS}"; then - R_XTRA_FFLAGS="-fpe3" -else - R_XTRA_FFLAGS="${R_XTRA_FFLAGS}${separator}-fpe3" -fi -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - fi if test "${GXX}" = yes; then ac_safe=_mieee echo "$as_me:$LINENO: checking whether ${CXX-c++} accepts -mieee" >&5 @@ -29210,7 +29066,7 @@ fi ;; SHLIB_LIBADD="-lcc_dynamic" fi ;; - freebsd*) + freebsd* | dragonfly*) ## Only sure for FreeBSD 3 and above. main_ldflags="-export-dynamic" shlib_ldflags="-shared" @@ -29458,6 +29314,7 @@ fi fpicflags= ;; netbsd*) + fpicflags="-fPIC" if ${CPP} - -dM < /dev/null | grep __ELF__ >/dev/null ; then main_ldflags="-export-dynamic" shlib_ldflags="-shared"