From: Rhys Weatherley Date: Tue, 11 May 2004 10:23:04 +0000 (+0000) Subject: Modify the autoconf/automake build system to use libtool. X-Git-Tag: r.0.0.2~15 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6a8a9226ad74749727e2ea32d844aa8b9f24394b;p=francis%2Flibjit.git Modify the autoconf/automake build system to use libtool. --- diff --git a/.cvsignore b/.cvsignore index 3ae6b91..9ba7e9b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -11,3 +11,6 @@ config.h config.h.in stamp-h stamp-h.in +libtool +ltconfig +ltmain.sh diff --git a/ChangeLog b/ChangeLog index 569c492..347ac03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,13 @@ report errors for unimplemented expressions and statements, so that users are not "surprised" when things silently fail. + * .cvsignore, auto_gen.sh, configure.in, doc/.cvsignore, + dpas/.cvsignore, dpas/Makefile.am, include/.cvsignore, + jit/.cvsignore, jit/Makefile.am, jitdynamic/.cvsignore, + jitdynamic/Makefile.am, jitplus/.cvsignore, jitplus/Makefile.am, + tools/.cvsignore, tutorial/.cvsignore, tutorial/Makefile.am: + modify the autoconf/automake build system to use libtool. + 2004-05-10 Rhys Weatherley * jit/jit-reg-alloc.c, jit/jit-reg-alloc.h, jit/jit-rules-interp.c: diff --git a/auto_gen.sh b/auto_gen.sh index 766ba35..abf83d8 100755 --- a/auto_gen.sh +++ b/auto_gen.sh @@ -31,6 +31,11 @@ case "$AM_VERSION" in *) AM_FLAGS="--ignore-deps" ;; esac +# Run libtoolize if necessary. +if test ! -f "ltconfig" ; then + libtoolize --copy 2>/dev/null +fi + # Run automake and autoconf. automake --add-missing --copy $AM_FLAGS autoconf diff --git a/configure.in b/configure.in index 3b582e9..1389504 100644 --- a/configure.in +++ b/configure.in @@ -8,6 +8,10 @@ dnl Initialize automake. AM_INIT_AUTOMAKE(libjit, 0.0.1) AM_CONFIG_HEADER(config.h) +dnl Set the version number for the shared libraries. +AC_SUBST(LIBJIT_VERSION) +LIBJIT_VERSION=0:0:0 + dnl Turn off the cygwin library if building for Win32. dnl Note: We have to include if we will be using "__int64" dnl because otherwise the mingw32 compiler won't define it correctly. @@ -54,9 +58,10 @@ AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX +AC_LIBTOOL_WIN32_DLL +AM_PROG_LIBTOOL dnl Set the correct flags for compiling with MSVC. "/QIfist" is needed dnl on systems with both VC 6.0 and VC 7.0 installed: sometimes VC 7.0 @@ -339,6 +344,24 @@ if test "x$ac_cv_prog_no_gcse" = "xyes" ; then CXXFLAGS="-fno-gcse $CXXFLAGS" fi +dnl Determine if the C++ compiler understands the "-lstdc++" option. +dnl Needed to force the shared libraries to link in the C++ code. +AC_CACHE_CHECK(for -lstdc++ option, ac_cv_prog_stdcpp, +[echo 'int main(int argc, char **argv){ return 0;}' > conftest.c +if test -z "`${CXX-c++} -o conftest conftest.c -lstdc++ 2>&1`"; then + ac_cv_prog_stdcpp=yes +else + ac_cv_prog_stdcpp=no +fi +rm -f conftest* +]) +AC_SUBST(LIB_STDCPP) +if test "x$ac_cv_prog_stdcpp" = "xyes" ; then + LIB_STDCPP="-lstdc++" +else + LIB_STDCPP="" +fi + dnl Checks for library functions. if test "x$suppress_libm" = "xno" ; then AC_CHECK_LIB(m, sin) diff --git a/doc/.cvsignore b/doc/.cvsignore index ef955d2..8df5be2 100644 --- a/doc/.cvsignore +++ b/doc/.cvsignore @@ -1,6 +1,9 @@ Makefile Makefile.in .deps +.libs libjit.info* libjitext-* *.pdf +*.lo +*.la diff --git a/dpas/.cvsignore b/dpas/.cvsignore index 8722e93..aac375d 100644 --- a/dpas/.cvsignore +++ b/dpas/.cvsignore @@ -1,7 +1,10 @@ Makefile Makefile.in .deps +.libs dpas-parser.h dpas-parser.c dpas-scanner.c dpas +*.lo +*.la diff --git a/dpas/Makefile.am b/dpas/Makefile.am index a379b41..4afa20d 100644 --- a/dpas/Makefile.am +++ b/dpas/Makefile.am @@ -17,8 +17,8 @@ AM_YFLAGS = -d CCLD = $(CXX) -dpas_LDADD = $(top_builddir)/jit/libjit.a -dpas_DEPENDENCIES = $(top_builddir)/jit/libjit.a +dpas_LDADD = $(top_builddir)/jit/libjit.la +dpas_DEPENDENCIES = $(top_builddir)/jit/libjit.la AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir) \ -DDPAS_INCLUDE_DIR=\"$(datadir)/dpas\" diff --git a/include/.cvsignore b/include/.cvsignore index 051d1bd..6e5ca7e 100644 --- a/include/.cvsignore +++ b/include/.cvsignore @@ -1,3 +1,6 @@ Makefile Makefile.in .deps +.libs +*.lo +*.la diff --git a/jit/.cvsignore b/jit/.cvsignore index 3bfe1a5..743b011 100644 --- a/jit/.cvsignore +++ b/jit/.cvsignore @@ -1,4 +1,7 @@ Makefile Makefile.in .deps +.libs jit-apply-rules.h +*.lo +*.la diff --git a/jit/Makefile.am b/jit/Makefile.am index a3a08dc..9fb01c9 100644 --- a/jit/Makefile.am +++ b/jit/Makefile.am @@ -1,7 +1,7 @@ -lib_LIBRARIES = libjit.a +lib_LTLIBRARIES = libjit.la -libjit_a_SOURCES = \ +libjit_la_SOURCES = \ jit-alloc.c \ jit-apply.c \ jit-apply-func.h \ @@ -50,3 +50,5 @@ libjit_a_SOURCES = \ AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir) AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir) + +libjit_la_LDFLAGS = -version-info $(LIBJIT_VERSION) $(LIB_STDCPP) diff --git a/jitdynamic/.cvsignore b/jitdynamic/.cvsignore index 051d1bd..6e5ca7e 100644 --- a/jitdynamic/.cvsignore +++ b/jitdynamic/.cvsignore @@ -1,3 +1,6 @@ Makefile Makefile.in .deps +.libs +*.lo +*.la diff --git a/jitdynamic/Makefile.am b/jitdynamic/Makefile.am index 5ceb183..e0a033d 100644 --- a/jitdynamic/Makefile.am +++ b/jitdynamic/Makefile.am @@ -1,9 +1,13 @@ -lib_LIBRARIES = libjitdynamic.a +lib_LTLIBRARIES = libjitdynamic.la -libjitdynamic_a_SOURCES = \ +libjitdynamic_la_SOURCES = \ jit-dynlib.c \ jit-cpp-mangle.c AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ -I. -I$(srcdir) -I$(top_srcdir)/jit -I$(top_builddir)/jit + +libjitdynamic_la_LDFLAGS = -version-info $(LIBJIT_VERSION) \ + -L$(top_builddir)/jit/.libs -ljit $(LIB_STDCPP) +libjitdynamic_la_DEPENDENCIES = $(top_builddir)/jit/libjit.la diff --git a/jitplus/.cvsignore b/jitplus/.cvsignore index 051d1bd..6e5ca7e 100644 --- a/jitplus/.cvsignore +++ b/jitplus/.cvsignore @@ -1,3 +1,6 @@ Makefile Makefile.in .deps +.libs +*.lo +*.la diff --git a/jitplus/Makefile.am b/jitplus/Makefile.am index 6df7893..86e2c8e 100644 --- a/jitplus/Makefile.am +++ b/jitplus/Makefile.am @@ -1,9 +1,13 @@ -lib_LIBRARIES = libjitplus.a +lib_LTLIBRARIES = libjitplus.la -libjitplus_a_SOURCES = \ +libjitplus_la_SOURCES = \ jit-plus-context.cpp \ jit-plus-function.cpp \ jit-plus-value.cpp AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir) + +libjitplus_la_LDFLAGS = -version-info $(LIBJIT_VERSION) \ + -L$(top_builddir)/jit/.libs -ljit $(LIB_STDCPP) +libjitplus_la_DEPENDENCIES = $(top_builddir)/jit/libjit.la diff --git a/tools/.cvsignore b/tools/.cvsignore index 8a86675..76e6f48 100644 --- a/tools/.cvsignore +++ b/tools/.cvsignore @@ -1,5 +1,8 @@ Makefile Makefile.in .deps +.libs gen-apply gen-apply.exe +*.lo +*.la diff --git a/tutorial/.cvsignore b/tutorial/.cvsignore index 9b064a5..0bc6365 100644 --- a/tutorial/.cvsignore +++ b/tutorial/.cvsignore @@ -1,8 +1,11 @@ Makefile Makefile.in .deps +.libs *.exe t1 t2 t3 t4 +*.lo +*.la diff --git a/tutorial/Makefile.am b/tutorial/Makefile.am index 89186a7..692e46f 100644 --- a/tutorial/Makefile.am +++ b/tutorial/Makefile.am @@ -4,21 +4,21 @@ noinst_PROGRAMS = t1 t2 t3 t4 CCLD = $(CXX) t1_SOURCES = t1.c -t1_LDADD = $(top_builddir)/jit/libjit.a -t1_DEPENDENCIES = $(top_builddir)/jit/libjit.a +t1_LDADD = $(top_builddir)/jit/libjit.la +t1_DEPENDENCIES = $(top_builddir)/jit/libjit.la t2_SOURCES = t2.c -t2_LDADD = $(top_builddir)/jit/libjit.a -t2_DEPENDENCIES = $(top_builddir)/jit/libjit.a +t2_LDADD = $(top_builddir)/jit/libjit.la +t2_DEPENDENCIES = $(top_builddir)/jit/libjit.la t3_SOURCES = t3.c -t3_LDADD = $(top_builddir)/jit/libjit.a -t3_DEPENDENCIES = $(top_builddir)/jit/libjit.a +t3_LDADD = $(top_builddir)/jit/libjit.la +t3_DEPENDENCIES = $(top_builddir)/jit/libjit.la t4_SOURCES = t4.cpp -t4_LDADD = $(top_builddir)/jitplus/libjitplus.a $(top_builddir)/jit/libjit.a -t4_DEPENDENCIES = $(top_builddir)/jitplus/libjitplus.a \ - $(top_builddir)/jit/libjit.a +t4_LDADD = $(top_builddir)/jitplus/libjitplus.la $(top_builddir)/jit/libjit.la +t4_DEPENDENCIES = $(top_builddir)/jitplus/libjitplus.la \ + $(top_builddir)/jit/libjit.la AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir) AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I. -I$(srcdir)