* configure.in: Add --with-glib-static option.

This commit is contained in:
Pavel Roskin 2003-03-07 18:10:37 +00:00
parent 6f35fce869
commit 949f2c3167
3 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-03-07 Pavel Roskin <proski@gnu.org>
* configure.in: Add --with-glib-static option.
2003-03-06 Pavel Roskin <proski@gnu.org> 2003-03-06 Pavel Roskin <proski@gnu.org>
* syntax/spec.syntax: Add BuildArch. * syntax/spec.syntax: Add BuildArch.

View File

@ -89,6 +89,11 @@ incomplete, use `configure --help' to get the full list):
flag for testing or if you want to use the binary on systems that flag for testing or if you want to use the binary on systems that
don't have glib 2.0.x installed. don't have glib 2.0.x installed.
`--with-glib-static'
Force linking against glib statically. This option is intended for
building binaries for distribution purposes and may not work on
some operating systems.
`--with-mmap', `--without-mmap' `--with-mmap', `--without-mmap'
Force using or not using the mmap function. It is currently used Force using or not using the mmap function. It is currently used
in the internal viewer. `--with-mmap' may be useful on some in the internal viewer. `--with-mmap' may be useful on some

View File

@ -28,6 +28,9 @@ dnl
AC_ARG_WITH(glib12, AC_ARG_WITH(glib12,
[ --with-glib12 Force using glib 1.2.x [[no]]]) [ --with-glib12 Force using glib 1.2.x [[no]]])
AC_ARG_WITH([glib_static],
[ --with-glib-static Link glib statically [[no]]])
glib_found=no glib_found=no
if test "x$with_glib12" != "xyes"; then if test "x$with_glib12" != "xyes"; then
PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib_found=yes], [:]) PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib_found=yes], [:])
@ -56,8 +59,10 @@ GNU Midnight Commander requires glib 1.2.6 or above.])])
GMODULE_LIBS="$GLIB_LIBS" GMODULE_LIBS="$GLIB_LIBS"
GLIB_CFLAGS="$save_GLIB_CFLAGS" GLIB_CFLAGS="$save_GLIB_CFLAGS"
GLIB_LIBS="$save_GLIB_LIBS" GLIB_LIBS="$save_GLIB_LIBS"
GLIB_LIBDIR="`$GLIB_CONFIG --exec-prefix`/lib"
else else
PKG_CHECK_MODULES(GMODULE, [gmodule-2.0], [gmodule_found=yes]) PKG_CHECK_MODULES(GMODULE, [gmodule-2.0], [gmodule_found=yes])
GLIB_LIBDIR="`$PKG_CONFIG --variable=libdir glib-2.0`"
fi fi
if test "x$gmodule_found" = "xyes" ; then if test "x$gmodule_found" = "xyes" ; then
@ -254,6 +259,40 @@ else
textmode_x11_support="yes" textmode_x11_support="yes"
fi fi
dnl
dnl Try to find static libraries for glib and gmodule.
dnl
if test x$with_glib_static = xyes; then
new_GLIB_LIBS=
for i in $GLIB_LIBS; do
case x$i in
x-lglib*)
lib=glib ;;
x-lgmodule*)
lib=gmodule ;;
*)
lib=
add="$i" ;;
esac
if test -n "$lib"; then
lib1=`echo $i | sed 's/^-l//'`
if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then
add="$GLIB_LIBDIR/lib${lib1}.a"
else
if test -f "$GLIB_LIBDIR/lib${lib}.a"; then
add="$GLIB_LIBDIR/lib${lib}.a"
else
AC_MSG_ERROR([Cannot find static $lib])
fi
fi
fi
new_GLIB_LIBS="$new_GLIB_LIBS $add"
done
GLIB_LIBS="$new_GLIB_LIBS"
fi
dnl dnl
dnl Network related functions dnl Network related functions
dnl dnl