Skip to content

Commit 2c38446

Browse files
committed
- Added compilation check of the sendData dependencies to the configure scripts
- Added support for LDFLAGS="-L/my/path/to/lib/" for LIBSENDDATA_LDFLAGS git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5696 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 1986af6 commit 2c38446

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

configure

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,6 @@ USE_CORBA
626626
LIBLPSOLVE55
627627
LIBNSL
628628
LIBSOCKET
629-
readlinelib
630-
readlineinc
631629
antlrlib
632630
antlrinc
633631
omc_antlr_jar
@@ -2178,8 +2176,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
21782176

21792177

21802178

2181-
2182-
21832179

21842180

21852181

@@ -4527,7 +4523,7 @@ $as_echo_n "checking for CORBA... " >&6; };
45274523
$as_echo "$DESIRED_CORBA" >&6; };
45284524

45294525

4530-
for ac_prog in qmake-qt4 qmake qmake-mac
4526+
for ac_prog in qmake-qt4 qmake-mac qmake
45314527
do
45324528
# Extract the first word of "$ac_prog", so it can be a program name with args.
45334529
set dummy $ac_prog; ac_word=$2
@@ -4592,15 +4588,37 @@ if test "${with_sendData_Qt+set}" = set; then :
45924588
fi
45934589
LIBSENDDATA="sendData"
45944590
if test "Darwin" = `uname`; then
4595-
LIBSENDDATA_LDFLAGS="-lsendData -framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
4591+
LIBSENDDATA_LDFLAGS="-framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
45964592
if test -d /opt/local/Library/Frameworks/; then
45974593
LIBSENDDATA_LDFLAGS="-F/opt/local/Library/Frameworks/ $LIBSENDDATA_LDFLAGS"
45984594
fi
45994595
else
4600-
LIBSENDDATA_LDFLAGS="-lsendData -lQtNetwork -lQtCore -lQtGui"
4596+
LIBSENDDATA_LDFLAGS="-lQtNetwork -lQtCore -lQtGui"
46014597
fi
4598+
4599+
LDFLAGS_BAK=$LDFLAGS
4600+
LDFLAGS+=$LIBSENDDATA_LDFLAGS
4601+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4602+
/* end confdefs.h. */
4603+
4604+
int
4605+
main ()
4606+
{
4607+
4608+
;
4609+
return 0;
4610+
}
4611+
_ACEOF
4612+
if ac_fn_c_try_link "$LINENO"; then :
46024613
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
46034614
$as_echo "ok" >&6; }
4615+
else
4616+
as_fn_error "Compilation failed using LDFLAGS='$LDFLAGS'. Try specifying your own LDFLAGS to link to Qt." "$LINENO" 5
4617+
fi
4618+
rm -f core conftest.err conftest.$ac_objext \
4619+
conftest$ac_exeext conftest.$ac_ext
4620+
LDFLAGS=$LDFLAGS_BAK
4621+
LIBSENDDATA_LDFLAGS="$LDFLAGS -lsendData $LIBSENDDATA_LDFLAGS"
46044622

46054623
else
46064624

configure.in

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ AC_MSG_RESULT([$DESIRED_CORBA]);
250250

251251
dnl Check for Qt
252252

253-
AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake qmake-mac,"")
253+
AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake-mac qmake,"")
254254

255255
if test -n "$QMAKE"; then
256256
AC_MSG_CHECKING([for qmake arguments])
@@ -268,14 +268,19 @@ AC_ARG_WITH(sendData-Qt, [ --with-sendData-Qt Compile with support for plot
268268
fi
269269
LIBSENDDATA="sendData"
270270
if test "Darwin" = `uname`; then
271-
LIBSENDDATA_LDFLAGS="-lsendData -framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
271+
LIBSENDDATA_LDFLAGS="-framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
272272
if test -d /opt/local/Library/Frameworks/; then
273273
LIBSENDDATA_LDFLAGS="-F/opt/local/Library/Frameworks/ $LIBSENDDATA_LDFLAGS"
274274
fi
275275
else
276-
LIBSENDDATA_LDFLAGS="-lsendData -lQtNetwork -lQtCore -lQtGui"
276+
LIBSENDDATA_LDFLAGS="-lQtNetwork -lQtCore -lQtGui"
277277
fi
278-
AC_MSG_RESULT([ok])
278+
279+
LDFLAGS_BAK=$LDFLAGS
280+
LDFLAGS+=$LIBSENDDATA_LDFLAGS
281+
AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([ok]),AC_MSG_ERROR([Compilation failed using LDFLAGS='$LDFLAGS'. Try specifying your own LDFLAGS to link to Qt.]))
282+
LDFLAGS=$LDFLAGS_BAK
283+
LIBSENDDATA_LDFLAGS="$LDFLAGS -lsendData $LIBSENDDATA_LDFLAGS"
279284
],
280285
[
281286
LIBSENDDATA="sendDataHumbug"

0 commit comments

Comments
 (0)