]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
New option --enable-shared, and a first attempt at
authorNiels Möller <nisse@lysator.liu.se>
Tue, 1 Oct 2002 20:33:03 +0000 (22:33 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 1 Oct 2002 20:33:03 +0000 (22:33 +0200)
building a shared library (*without* using libtool).

Rev: src/nettle/configure.ac:1.11

configure.ac

index 79675c54aa14e2e08dbfe9685479d74ecb1e398e..f4e6c17c8d65fc277dc3c21a7bbe59f54d3b2edd 100644 (file)
@@ -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.