]> rtime.felk.cvut.cz Git - orte.git/commitdiff
Fix a problem in configure on Windows
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 14 Sep 2013 14:16:20 +0000 (16:16 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 14 Sep 2013 14:19:14 +0000 (16:19 +0200)
On Windows, we link ORTE against a version of pthread library shipped
in our tree. Therefore we add some switches to linker command line.
The problem is that this command line is also used for all configure
tests. Since our library is not yet compiled at compile time, it
caused many configure checks to fail even if they should succeed.

With this change, I'm able to cross-compile ORTE for Windows on Debian
Wheezy with mingw32 package. The used configure command was:

  CC=i586-mingw32msvc-gcc ./configure --host=i586-mingw32msvc

Whether ORTE also runs on Windows correctly was not yet tested.

configure.ac

index ce6c0a2a9dcee9f7a65cb839cda2cb52129fce1a..2441af406d85b49940f80187729450258024d946 100644 (file)
@@ -137,7 +137,7 @@ if test -z ${CONFIG_ORTE_RT} ; then
   AC_CHECK_LIB(pthread, pthread_create, ,
          AC_CHECK_LIB(c_r, pthread_create, ,
               if test ${MINGW} == 'yes' ; then
-                     LIBS=$LIBS' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread'
+                     INTERNAL_PTHREAD_LIBS=' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread'
                      AC_MSG_NOTICE([Using internal version of pthreads!!!])
               else
                      AC_MSG_ERROR([Can't compile without pthreads!!!])
@@ -320,6 +320,7 @@ AC_CONFIG_FILES([Makefile
                 orte/libjorte/Makefile
                  orte/manager/Makefile])
 
+LIBS="$LIBS$INTERNAL_PTHREAD_LIBS"
 
 AC_OUTPUT([
 modtool