From 3bdaa3229d1485015e78c2d08e65c05d61844dd4 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 22 Jun 2008 08:08:38 +0000 Subject: [PATCH] --- ase/cmd/awk/makefile.am | 4 +- ase/cmd/awk/makefile.in | 4 +- ase/configure | 133 ++++++++++++++++++++++++++++++++++++++++ ase/configure.ac | 22 +++++++ 4 files changed, 159 insertions(+), 4 deletions(-) diff --git a/ase/cmd/awk/makefile.am b/ase/cmd/awk/makefile.am index d19f51da..3b4ca595 100644 --- a/ase/cmd/awk/makefile.am +++ b/ase/cmd/awk/makefile.am @@ -6,5 +6,5 @@ bin_PROGRAMS = aseawk aseawk++ aseawk_SOURCES = awk.c aseawk___SOURCES = Awk.cpp -aseawk_LDADD = -L../../lib/cmn -L../../lib/awk -L../../lib/utl -laseawk -lasecmn -aseawk___LDADD = -laseawk++ +aseawk_LDADD = -L../../lib/cmn -L../../lib/awk -L../../lib/utl -laseutl -laseawk -lasecmn +aseawk___LDADD = -L../../lib/awk -laseawk++ diff --git a/ase/cmd/awk/makefile.in b/ase/cmd/awk/makefile.in index b057e0fc..4ebdb452 100644 --- a/ase/cmd/awk/makefile.in +++ b/ase/cmd/awk/makefile.in @@ -195,8 +195,8 @@ target_alias = @target_alias@ AM_CPPFLAGS = -I$(top_srcdir)/include aseawk_SOURCES = awk.c aseawk___SOURCES = Awk.cpp -aseawk_LDADD = -L../../lib/cmn -L../../lib/awk -L../../lib/utl -laseawk -lasecmn -aseawk___LDADD = -laseawk++ +aseawk_LDADD = -L../../lib/cmn -L../../lib/awk -L../../lib/utl -laseutl -laseawk -lasecmn +aseawk___LDADD = -L../../lib/awk -laseawk++ all: all-am .SUFFIXES: diff --git a/ase/configure b/ase/configure index 052b7726..4dde35cd 100755 --- a/ase/configure +++ b/ase/configure @@ -19589,6 +19589,139 @@ else fi fi +# Do we need libm for math functions? +{ echo "$as_me:$LINENO: checking for libm math function in std libs" >&5 +echo $ECHO_N "checking for libm math function in std libs... $ECHO_C" >&6; } +OCFL="$CFLAGS" +CFLAGS="-Werror $CFLAGS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + double x; + pow(x, x); + return 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + needlibm=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + needlibm=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS="$OCFL" +if test "$needlibm" = "yes"; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { echo "$as_me:$LINENO: checking for pow in -lm" >&5 +echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_m_pow=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_m_pow=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 +echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; } +if test $ac_cv_lib_m_pow = yes; then + LIBS="$LIBS -lm" +else + { { echo "$as_me:$LINENO: error: libm is needed and is not available" >&5 +echo "$as_me: error: libm is needed and is not available" >&2;} + { (exit 1); exit 1; }; } +fi + +else + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +fi + # Checks for header files. { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } diff --git a/ase/configure.ac b/ase/configure.ac index 292c46c2..526f2f80 100644 --- a/ase/configure.ac +++ b/ase/configure.ac @@ -57,6 +57,28 @@ else fi fi +# Do we need libm for math functions? +AC_MSG_CHECKING([for libm math function in std libs]) +OCFL="$CFLAGS" +CFLAGS="-Werror $CFLAGS" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ + double x; + pow(x, x); + return 0; + ]])],[needlibm=no],[needlibm=yes]) +CFLAGS="$OCFL" +if test "$needlibm" = "yes"; then + AC_MSG_RESULT([no]) + AC_CHECK_LIB([m], [pow], + LIBS="$LIBS -lm", + AC_MSG_ERROR([libm is needed and is not available])) +else + AC_MSG_RESULT([yes]) +fi + # Checks for header files. AC_HEADER_STDC