From 9e7e635bddfdb832e1219eff2137308fdb3dd3a3 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Thu, 22 Jan 2009 21:39:40 +0000 Subject: [PATCH] - build: reordered compiler flags checking. Fixed problems with finding location of wx-config when running with cached configuration. Made sure to check ${prefix}/lib when looking for libGL, libGLU, and libglut. svn path=/trunk/boinc/; revision=16989 --- checkin_notes | 11 ++++++++ m4/ax_check_gl.m4 | 4 +-- m4/ax_check_glu.m4 | 4 +-- m4/ax_check_glut.m4 | 4 +-- m4/boinc_set_compile_flags.m4 | 53 ++++++++++++++++++++++------------- m4/boinc_wxwidgets.m4 | 6 +++- 6 files changed, 56 insertions(+), 26 deletions(-) diff --git a/checkin_notes b/checkin_notes index a88b8f5e11..c8475a5e6e 100644 --- a/checkin_notes +++ b/checkin_notes @@ -594,3 +594,14 @@ David 22 Jan 2009 client/ scheduler_op.cpp + +Eric 22 Jan 2009 + - build: reordered compiler flags checking. Fixed problems with finding location of wx-config when running with cached configuration. Made + sure to check ${prefix}/lib when looking for libGL, libGLU, and libglut. + + m4/ + boinc_wxwidgets.m4 + ax_check_glut.m4 + ax_check_glu.m4 + ax_check_gl.m4 + boinc_set_compile_flags.m4 diff --git a/m4/ax_check_gl.m4 b/m4/ax_check_gl.m4 index 309839cbf1..e26ce5b930 100644 --- a/m4/ax_check_gl.m4 +++ b/m4/ax_check_gl.m4 @@ -58,7 +58,7 @@ else else ax_try_lib="${ax_lib}" fi - LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ # if HAVE_WINDOWS_H && defined(_WIN32) @@ -66,7 +66,7 @@ else # endif # include ]], [[glBegin(0)]])], - [ax_cv_check_gl_libgl="${ax_try_lib}"; break]) + [ax_cv_check_gl_libgl="-L${prefix}/lib ${ax_try_lib}"; break]) done LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) diff --git a/m4/ax_check_glu.m4 b/m4/ax_check_glu.m4 index d1c22fa3ce..7a8105a535 100644 --- a/m4/ax_check_glu.m4 +++ b/m4/ax_check_glu.m4 @@ -19,7 +19,7 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then else ax_try_lib="${ax_lib}" fi - LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" # # libGLU typically links with libstdc++ on POSIX platforms. However, # setting the language to C++ means that test program source is named @@ -37,7 +37,7 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then # endif # include ]], [[gluBeginCurve(0)]])], - [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) + [ax_cv_check_glu_libglu="-L${prefix}/lib ${ax_try_lib}"; break]) if test X$ax_compiler_ms = Xyes; then AC_LANG_POP([C]) fi diff --git a/m4/ax_check_glut.m4 b/m4/ax_check_glut.m4 index f883833084..bc70cff588 100644 --- a/m4/ax_check_glut.m4 +++ b/m4/ax_check_glut.m4 @@ -35,7 +35,7 @@ else else ax_try_lib="${ax_lib}" fi - LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" + LIBS="-L${prefix}/lib ${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ # if HAVE_WINDOWS_H && (defined(_WIN32) || defined(CYGWIN_USE_WIN32)) @@ -43,7 +43,7 @@ else # endif # include ]], [[glutMainLoop()]])], - [ax_cv_check_glut_libglut="${ax_try_lib}"; break]) + [ax_cv_check_glut_libglut="-L${prefix}/lib ${ax_try_lib}"; break]) done LIBS=${ax_save_LIBS} diff --git a/m4/boinc_set_compile_flags.m4 b/m4/boinc_set_compile_flags.m4 index f01df513ed..aa818f3bdd 100644 --- a/m4/boinc_set_compile_flags.m4 +++ b/m4/boinc_set_compile_flags.m4 @@ -44,7 +44,7 @@ if test x${enable_optimize} = xyes ; then BOINC_CHECK_FFLAG(-ffast-math) fi -if test x${enable_generic_processor} ; then +if test x${enable_generic_processor} = xyes ; then case ${target} in i*86-*-darwin*) BOINC_CHECK_CFLAG(-march=pentium4) @@ -56,20 +56,23 @@ if test x${enable_generic_processor} ; then ;; i*86-*) dnl gcc - BOINC_CHECK_CFLAG(-march=i486) - BOINC_CHECK_CXXFLAG(-march=i486) - BOINC_CHECK_FFLAG(-march=i486) - BOINC_CHECK_CFLAG(-mtune=generic) - BOINC_CHECK_CXXFLAG(-mtune=generic) - BOINC_CHECK_FFLAG(-mtune=generic) + if test x${ac_cv_c_compiler_gnu} = xyes ; then + BOINC_CHECK_CFLAG(-march=i486) + BOINC_CHECK_CFLAG(-mtune=generic) + else dnl dmc - if test x${ac_cv_c_compiler_gnu} != xyes ; then BOINC_CHECK_CFLAG(-3) fi - if test x${ac_cv_cxx_compiler_gnu} != xyes ; then + if test x${ac_cv_cxx_compiler_gnu} = xyes ; then + BOINC_CHECK_CXXFLAG(-march=i486) + BOINC_CHECK_CXXFLAG(-mtune=generic) + else BOINC_CHECK_CXXFLAG(-3) fi - if test x${ac_cv_f77_compiler_gnu} != xyes ; then + if test x${ac_cv_f77_compiler_gnu} = xyes ; then + BOINC_CHECK_FFLAG(-march=i486) + BOINC_CHECK_FFLAG(-mtune=generic) + else BOINC_CHECK_FFLAG(-3) fi ;; @@ -87,16 +90,28 @@ if test x${enable_generic_processor} ; then ;; sparc-*) dnl gcc - BOINC_CHECK_CFLAG(-march=v8) - BOINC_CHECK_CXXFLAG(-march=v8) - BOINC_CHECK_FFLAG(-march=v8) - BOINC_CHECK_CFLAG(-mtune=ultrasparc) - BOINC_CHECK_CXXFLAG(-mtune=ultrasparc) - BOINC_CHECK_FFLAG(-mtune=ultrasparc) + if test x${ac_cv_c_compiler_gnu} = xyes ; then + BOINC_CHECK_CFLAG(-march=v8) + BOINC_CHECK_CFLAG(-mcpu=v8) + BOINC_CHECK_CFLAG(-mtune=ultrasparc) + else dnl Studio 10 - BOINC_CHECK_CFLAG(-xarch=v8) - BOINC_CHECK_CXXFLAG(-xarch=v8) - BOINC_CHECK_FFLAG(-xarch=v8) + BOINC_CHECK_CFLAG(-xarch=v8) + fi + if test x${ac_cv_cxx_compiler_gnu} = xyes ; then + BOINC_CHECK_CXXFLAG(-march=v8) + BOINC_CHECK_CXXFLAG(-mcpu=v8) + BOINC_CHECK_CXXFLAG(-mtune=ultrasparc) + else + BOINC_CHECK_CXXFLAG(-xarch=v8) + fi + if test x${ac_cv_f77_compiler_gnu} = xyes ; then + BOINC_CHECK_FFLAG(-march=v8) + BOINC_CHECK_FFLAG(-mcpu=v8) + BOINC_CHECK_FFLAG(-mtune=ultrasparc) + else + BOINC_CHECK_FFLAG(-xarch=v8) + fi ;; *) ;; diff --git a/m4/boinc_wxwidgets.m4 b/m4/boinc_wxwidgets.m4 index 6afbe7ad07..15d8beb1ac 100644 --- a/m4/boinc_wxwidgets.m4 +++ b/m4/boinc_wxwidgets.m4 @@ -13,7 +13,11 @@ AC_DEFUN([BOINC_OPTIONS_WXWIDGETS],[ AC_CACHE_CHECK([if wxWidgets works],[ac_cv_have_wxwidgets], [ac_cv_have_wxwidgets="${_ac_cv_have_wxwidgets}"]) AC_CACHE_SAVE - WX_CONFIG="$ac_cv_path_WX_CONFIG_PATH" + if test "x$ac_cv_path_WX_CONFIG_PATH" != "x" ; then + WX_CONFIG="$ac_cv_path_WX_CONFIG_PATH" + elif test "x$WX_CONFIG_PATH" != "x" ; then + WX_CONFIG="$WX_CONFIG_PATH" + fi if test "x${ac_cv_have_wxwidgets}" = "xyes" ; then dnl Find the default wxWidgets options. wx_default_config="`$WX_CONFIG --selected-config`"