From: Niels Möller Date: Tue, 1 Oct 2002 20:33:03 +0000 (+0200) Subject: New option --enable-shared, and a first attempt at X-Git-Tag: nettle_1.6_release_20021003~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a998129080942768dca2111a8f8937b4830b1fcd;p=thirdparty%2Fnettle.git New option --enable-shared, and a first attempt at building a shared library (*without* using libtool). Rev: src/nettle/configure.ac:1.11 --- diff --git a/configure.ac b/configure.ac index 79675c54..f4e6c17c 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,9 @@ AC_PREREQ(2.50) AM_INIT_AUTOMAKE AM_CONFIG_HEADER([config.h]) +SHLIBMAJOR=0 +SHLIBMINOR=0 + AC_CANONICAL_HOST # Command line options @@ -36,6 +39,10 @@ AC_ARG_ENABLE(assembler, AC_HELP_STRING([--disable-assembler],[Disable assembler code]),, [enable_assembler=yes]) +AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], [Build a shared library]), + [enable_shared=no]) + LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \ `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \ /usr/local/lib /sw/local/lib /sw/lib \ @@ -83,6 +90,21 @@ if test "x$enable_assembler" = xyes ; then fi fi +SHLIBCFLAGS="-fpic" +SHLIBFORLINK=libnettle.so +SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)' +SHLIBFILE='$(SHLIBSONAME).$(MINOR)' +SHLIBLINK='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME)' + +if test "x$enable_shared" = xyes ; then + SHLIBTARGET='$(SHLIBFORLINK)' + SHLIBINSTALL=install-shared +fi + +AC_SUBST(SHLIBCFLAGS) +AC_SUBST(SHLIBTARGET) +AC_SUBST(SHLIBINSTALL) + AC_PATH_PROG(M4, m4, m4) # Checks for typedefs, structures, and compiler characteristics.