if test "x$DEAL_II_ADVANCE_WARNING" = "xyes" ; then
CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-W //g;'`"
fi
+
+ dnl In order to link shared libraries, almost all versions of gcc can
+ dnl use CXX, i.e. the C++ compiler. The exception is gcc2.95, for which
+ dnl we have to use the C compiler, unless we want to get linker errors
+ SHLIBLD="$CXX"
+ if test "$GXX_VERSION" = "gcc2.95"; then
+ SHLIBLD="$CC"
+ fi
else
- dnl Non-gcc compilers
+ dnl Non-gcc compilers. By default, use the C++ compiler also for linking
+ dnl shared libraries. If some compiler cannot do that and needs something
+ dnl different, then this must be specified in the respective section
+ dnl below, overriding this define:
+ SHLIBLD="$CXX"
case "$GXX_VERSION" in
ibm_xlc)
$(LIBDIR)/libbase.so: $(o-files)
@echo "=====base=============optimized==$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(o-files)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files)
$(LIBDIR)/libbase.g.so: $(go-files)
@echo "=====base=============debug======$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(go-files)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(go-files)
CC = @CC@
CXX = @CXX@
GXX-VERSION = @GXX_VERSION@
+SHLIBLD = @SHLIBLD@
LDFLAGS = @LDFLAGS@
F77 = @F77@
F77-VERSION = @F77_VERSION@
CXXFLAGSG="`echo $CXXFLAGSG | perl -pi -e 's/-W //g;'`"
fi
+ SHLIBLD="$CXX"
+ if test "$GXX_VERSION" = "gcc2.95"; then
+ SHLIBLD="$CC"
+ fi
+
else
+ SHLIBLD="$CXX"
case "$GXX_VERSION" in
ibm_xlc)
+
# Check whether --enable-multithreading or --disable-multithreading was given.
if test "${enable_multithreading+set}" = set; then
enableval="$enable_multithreading"
s,@CXXFLAGSG@,$CXXFLAGSG,;t t
s,@CXXFLAGSO@,$CXXFLAGSO,;t t
s,@CXXFLAGSPIC@,$CXXFLAGSPIC,;t t
+s,@SHLIBLD@,$SHLIBLD,;t t
s,@LDFLAGSPIC@,$LDFLAGSPIC,;t t
s,@enablemultithreading@,$enablemultithreading,;t t
s,@withmultithreading@,$withmultithreading,;t t
AC_SUBST(CXXFLAGSG)
AC_SUBST(CXXFLAGSO)
AC_SUBST(CXXFLAGSPIC)
+AC_SUBST(SHLIBLD)
AC_SUBST(LIBS)
AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGSPIC)
$(LIBDIR)/libdeal_II_1d.g.so: $(go-files-1d)
@echo "=====deal.II====1d====debug======$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(go-files-1d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(go-files-1d)
$(LIBDIR)/libdeal_II_1d.so: $(o-files-1d)
@echo "=====deal.II====1d====optimized==$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(o-files-1d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files-1d)
$(LIBDIR)/libdeal_II_2d.g.so: $(go-files-2d)
@echo "=====deal.II====2d====debug======$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(go-files-2d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(go-files-2d)
$(LIBDIR)/libdeal_II_2d.so: $(o-files-2d)
@echo "=====deal.II====2d====optimized==$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(o-files-2d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files-2d)
$(LIBDIR)/libdeal_II_3d.g.so: $(go-files-3d)
@echo "=====deal.II====3d====debug======$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(go-files-3d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(go-files-3d)
$(LIBDIR)/libdeal_II_3d.so: $(o-files-3d)
@echo "=====deal.II====3d====optimized==$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(o-files-3d)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files-3d)
@echo '<li><code>GXX-VERSION=$(GXX-VERSION)</code>' >> $@
@echo '<li><code>F77=$(F77)</code>' >> $@
@echo '<li><code>F77-VERSION=$(F77-VERSION)</code>' >> $@
+ @echo '<li><code>SHLIBLD=$(SHLIBLD)</code>' >> $@
@echo '<li><code>PERL=$(PERL)</code>' >> $@
@echo '<li><code>DEAL_II_MAJOR=$(DEAL_II_MAJOR)</code>' >> $@
@echo '<li><code>DEAL_II_MINOR=$(DEAL_II_MINOR)</code>' >> $@
</dd>
+ <dt> <code>SHLIBLD</code> </dt>
+ <dd> <p>
+ Executable name of compiler that is used to link object
+ files to shared libraries. This will usually be the C++
+ compiler, but as this does not work for gcc 2.95, it is the
+ C compiler in that case.
+ </p>
+ </dd>
+
+
<dt> <code>PERL</code> </dt>
<dd> <p>
Executable name of the `perl' program
$(LIBDIR)/liblac.so: $(o-files)
@echo "=====lac==============optimized==$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(o-files)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(o-files)
$(LIBDIR)/liblac.g.so: $(go-files)
@echo "=====lac==============debug======$(MT)== Linking library: $(@F)"
- @$(CXX) $(LDFLAGS) -shared -o $@ $(go-files)
+ @$(SHLIBLD) $(LDFLAGS) -shared -o $@ $(go-files)