Add DSOFLAGS to DSOCOMMAND's, so that we inherit X_LIBS and other options

for linking of shared libs.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5426 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2006-09-12 01:31:42 +00:00
parent 44264e3c4e
commit ef2dc5bd87
2 changed files with 13 additions and 9 deletions

View File

@ -60,6 +60,8 @@ ARCHFLAGS="${ARCHFLAGS:=}"
CFLAGS="${CFLAGS:=}"
CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
DSOFLAGS="${DSOFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
OPTIM="${OPTIM:=}"
AC_SUBST(ARCHFLAGS)
@ -128,7 +130,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.$FL_API_VERSION.dylib"
GLDSONAME="libfltk_gl.$FL_API_VERSION.dylib"
IMGDSONAME="libfltk_images.$FL_API_VERSION.dylib"
DSOCOMMAND="\$(CXX) $DSOFLAGS -dynamiclib -lc -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -dynamiclib -lc -o"
;;
SunOS* | UNIX_S*)
@ -136,7 +138,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
if test "x$libdir" != "x/usr/lib"; then
DSOLINK="-R$libdir"
fi
@ -146,7 +148,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.sl.$FL_API_VERSION"
GLDSONAME="libfltk_gl.sl.$FL_API_VERSION"
IMGDSONAME="libfltk_images.sl.$FL_API_VERSION"
DSOCOMMAND="ld -b -z +h \$@ $DEBUGFLAG -o"
DSOCOMMAND="ld \$(DSOFLAGS) -b -z +h \$@ $DEBUGFLAG -o"
if test "x$libdir" != "x/usr/lib"; then
DSOLINK="-Wl,-rpath,$libdir"
fi
@ -156,7 +158,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32" -a "x$libdir" != "x/usr/lib64"; then
DSOLINK="-Wl,-rpath,$libdir"
fi
@ -166,7 +168,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib32"; then
DSOLINK="-Wl,-rpath,$libdir"
fi
@ -176,7 +178,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
if test "x$libdir" != "x/usr/lib"; then
DSOLINK="-Wl,-rpath,$libdir"
fi
@ -186,7 +188,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms_s.a"
GLDSONAME="libfltk_gl_s.a"
IMGDSONAME="libfltk_images_s.a"
DSOCOMMAND="\$(CXX) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
SHAREDSUFFIX="_s"
;;
CYGWIN* | MINGW*)
@ -202,7 +204,7 @@ if test x$enable_shared = xyes; then
GLDSONAME="cygfltknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygfltknox_images-$FL_API_VERSION.dll"
fi
DSOCOMMAND="\$(CXX) -shared -Wl,--whole-archive -Wl,--export-all-symbols -Wl,--enable-auto-import -o \$@"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -shared -Wl,--whole-archive -Wl,--export-all-symbols -Wl,--enable-auto-import -o \$@"
;;
*)
AC_MSG_WARN(Shared libraries may not be supported. Trying -shared option with compiler.)
@ -210,7 +212,7 @@ if test x$enable_shared = xyes; then
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
;;
esac
@ -229,6 +231,7 @@ else
fi
AC_SUBST(DSOCOMMAND)
AC_SUBST(DSOFLAGS)
AC_SUBST(DSOLINK)
AC_SUBST(DSONAME)
AC_SUBST(FLDSONAME)

View File

@ -75,6 +75,7 @@ DSOCOMMAND = @DSOCOMMAND@
# libraries to link with:
AUDIOLIBS = @AUDIOLIBS@
DSOFLAGS = @DSOFLAGS@
LDFLAGS = $(OPTIM) @LDFLAGS@
LDLIBS = @LIBS@
GLDLIBS = @GLLIB@ @LIBS@