Skip to content

Commit

Permalink
Update makefiles for better cross-compilation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25826 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 29, 2015
1 parent 1714881 commit 876ee3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.common
Expand Up @@ -107,7 +107,7 @@ build/include/omc/c/gc_pthread_redirects.h: 3rdParty/gc/include/gc_pthread_redir
(cd 3rdParty/gc && autoreconf -vif && automake --add-missing && ./configure "--host=$(host)" $(LIBGC_EXTRA_CONFIGURATION) --disable-gcj-support --disable-java-finalization --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -DLARGE_CONFIG -DTHREAD_LOCAL_ALLOC")

3rdParty/Ipopt-3.11.6/Makefile: $(LAPACK_TARGET)
(cd 3rdParty/Ipopt-3.11.6 && ./configure --with-pic "CC=$(CC)" CXX="$(CXX)" F77="$(FC)" LDFLAGS="-L${abs_top_builddir}/build/lib/omc $(LDFLAGS)" --with-lapack-lib="$(LD_LAPACK)" --with-blas-lib="$(LD_LAPACK)" --without-metis --without-HSLold --without-HSL)
(cd 3rdParty/Ipopt-3.11.6 && ./configure --with-pic "CC=$(CC)" CXX="$(CXX)" F77="$(FC)" LDFLAGS="-L${abs_top_builddir}/build/lib/omc $(LDFLAGS)" --with-lapack-lib="$(LD_LAPACK)" --with-blas-lib="$(LD_LAPACK)" "--host=$(host)" --without-metis --without-HSLold --without-HSL)

build/lib/omc/libipopt.la: 3rdParty/Ipopt-3.11.6/Makefile
$(MAKE) -C 3rdParty/Ipopt-3.11.6
Expand Down
2 changes: 1 addition & 1 deletion Parser/Makefile.common
Expand Up @@ -17,7 +17,7 @@ install: libantlr3.a libomparse.a
cp libantlr3.a libomparse.a ../build/lib/omc/

$(ANTLR)/antlr3config.h: $(ANTLR)/antlr3config.h.in $(ANTLR)/configure
(cd $(ANTLR) && ./configure $(ANTLR64) $(ANTLRDEBUG) CC="$(CC)" LDFLAGS="" CFLAGS="" CPPFLAGS="")
(cd $(ANTLR) && ./configure $(ANTLR64) $(ANTLRDEBUG) $(host) CC="$(CC)" LDFLAGS="" CFLAGS="" CPPFLAGS="")
libantlr3.a: $(ANTLR)/src/*.c $(ANTLR)/include/*.h $(ANTLR)/antlr3config.h
# build the library
$(CC) ${CFLAGS} ${CPPFLAGS} -c $(ANTLR)/src/*.c -I$(ANTLR)/include -I$(ANTLR)
Expand Down
1 change: 1 addition & 0 deletions Parser/Makefile.in
Expand Up @@ -10,6 +10,7 @@ endif
ifeq (arm,@target_cpu@)
ANTLRDEBUG=--disable-antlrdebug --disable-abiflags
endif
host=--host=@host@

include Makefile.common

Expand Down
12 changes: 11 additions & 1 deletion configure.ac
Expand Up @@ -86,9 +86,16 @@ AC_SUBST(BOOST_INCLUDE)

FINAL_MESSAGES="\nConfigured OpenModelica successfully using the following options:"

AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

build_short=$build_cpu-$build_os
host_short=$host_cpu-$host_os

echo "build_short: $build_short"
echo "host_short: $host_short"

if echo $host | grep -i darwin; then
DARWIN=1
else
Expand Down Expand Up @@ -119,7 +126,6 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LEX
AC_PROG_FC

CFLAGS_BEFORE="$CFLAGS"
Expand Down Expand Up @@ -614,6 +620,10 @@ if test -n "$QMAKE"; then
sed "s/-arch//g" > $MAKEFILE.fixed && \
mv $MAKEFILE.fixed $MAKEFILE' >> qmake.sh
QMAKE="sh `pwd`/qmake.sh"
# Needed? Maybe
elif test "$host" != "$build"; then
QMAKE_LIBDIR_QT=`$QMAKE -query QT_INSTALL_LIBS | sed "s/$build_short/$host_short/"`
QMAKE="$QMAKE -spec linux-g++ QMAKE_CXX=\"$CXX\" QMAKE_CC=\"$CC\" QMAKE_LINK=\"$CXX\" QMAKE_LIBDIR_QT=\"$QMAKE_LIBDIR_QT\""
fi
AC_MSG_RESULT([$QMAKE])
fi
Expand Down

0 comments on commit 876ee3e

Please sign in to comment.