@@ -95,6 +95,7 @@ AC_SUBST(BOOST_INCLUDE)
9595AC_SUBST ( LDFLAGS_LIBSTDCXX )
9696AC_SUBST ( CPP_RUNTIME_ARGS )
9797AC_SUBST ( OMENCRYPTION )
98+ AC_SUBST ( MINGW_EXTRA_LIBS )
9899
99100FINAL_MESSAGES="\nConfigured OpenModelica successfully using the following options:"
100101
@@ -467,7 +468,7 @@ if test "$WANT_STATIC_LPSOLVE" = "no"; then
467468 LIBDL="$LIBS"
468469 AC_SEARCH_LIBS ( sqrt ,m )
469470 AC_SEARCH_LIBS ( colamd ,colamd )
470- AC_SEARCH_LIBS ( make_lp ,[ lpsolve55_pic lpsolve55] ,[ LIBLPSOLVE55=$LIBS] ,[ MINGW_EXTRA_LIBS="$MINGW_EXTRA_LIBS lpsolve"; AC_MSG_RESULT ( [ lpsolve linking failed using $LIBS ] ) ] )
471+ AC_SEARCH_LIBS ( make_lp ,[ lpsolve55_pic lpsolve55] ,[ LIBLPSOLVE55=$LIBS] ,[ COMPILE_LPSOLVE=1 ] )
471472 LIBS=""
472473else
473474 if test "$WANT_STATIC_LPSOLVE" = "yes"; then
@@ -480,19 +481,27 @@ else
480481 AC_SEARCH_LIBS ( sqrt ,m )
481482 LIBS="$LPLIB/liblpsolve55_pic.a $LPLIB/libcolamd.a $LIBS"
482483 AC_MSG_CHECKING ( [ for static lpsolve55] )
483- AC_LINK_IFELSE ( [ AC_LANG_CALL ( [ ] , [ make_lp] ) ] , [ LIBLPSOLVE55=$LIBS] , [ MINGW_EXTRA_LIBS="$MINGW_EXTRA_LIBS lpsolve"; AC_MSG_RESULT ( [ failed ] ) ] )
484+ AC_LINK_IFELSE ( [ AC_LANG_CALL ( [ ] , [ make_lp] ) ] , [ LIBLPSOLVE55=$LIBS] , [ COMPILE_LPSOLVE="1" ] )
484485 AC_MSG_RESULT ( [ $LIBLPSOLVE55] )
485486 LIBS=""
486487fi
487488AC_CHECK_HEADER ( [ lp_lib.h] ,[ LPSOLVEINC=lp_lib.h] ,[
488489 AC_CHECK_HEADER ( [ lpsolve/lp_lib.h] ,[ LPSOLVEINC=lpsolve/lp_lib.h] ,[
489- if ! ( echo $MINGW_EXTRA_LIBS | grep -q lpsolve ); then
490- MINGW_EXTRA_LIBS="$MINGW_EXTRA_LIBS lpsolve";
491- fi
492- AC_MSG_RESULT ( [ failed to find lpsolve55 headers] )
490+ COMPILE_LPSOLVE=1
493491 ] )
494492] )
495493
494+ if test "$COMPILE_LPSOLVE" = 1; then
495+ MINGW_EXTRA_LIBS="$MINGW_EXTRA_LIBS lpsolve";
496+ AC_MSG_RESULT ( [ failed to find lpsolve55 headers or library; will compile them ourselves] )
497+ LPSOLVEINC="$ac_pwd/3rdParty/lpsolve/build/include/lpsolve/lp_lib.h"
498+ if test "$WANT_STATIC_LPSOLVE" = "yes"; then
499+ LIBLPSOLVE55="-Wl,-Bstatic -llpsolve55 -Wl,-Bdynamic"
500+ else
501+ LIBLPSOLVE55="-llpsolve55"
502+ fi
503+ fi
504+
496505fi # NO_LPLIB
497506
498507if ! (echo "$host" | grep -q "mingw"); then
0 commit comments