diff --git a/bootstrap b/bootstrap index 10cae85..4ee5014 100755 --- a/bootstrap +++ b/bootstrap @@ -37,11 +37,30 @@ if test "$amvers" = "no"; then exit 1 fi +libtoolize="no" +if glibtoolize --version >/dev/null 2>&1; then + libtoolize="glibtoolize" +elif libtoolize --version >/dev/null 2>&1; then + libtoolize="libtoolize" +fi + +if test "$libtoolize" = "no"; then + set +x + echo "$0: you need libtool" + exit 1 +fi + # Remove old cruft rm -f aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh INSTALL rm -Rf autom4te.cache (cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh) +${libtoolize} --copy --force +if test -f "ltmain.sh"; then + echo "$0: working around a minor libtool issue" + mv ltmain.sh autotools/ +fi + aclocal${amvers} autoconf autoheader diff --git a/configure.ac b/configure.ac index 68861dc..d87feb6 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,10 @@ AM_CONFIG_HEADER(config.h) AM_PROG_CC_C_O AC_PROG_CPP -AC_PROG_RANLIB + +AC_LIBTOOL_WIN32_DLL +AC_DISABLE_SHARED +AM_PROG_LIBTOOL AC_C_CONST AC_C_INLINE diff --git a/examples/Makefile.am b/examples/Makefile.am index 8c0a117..88be511 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -7,27 +7,27 @@ EXTRA_DIST = caca.txt bin_PROGRAMS = cacademo cacafire cacaball cacaplas cacaview cacamoir cacademo_SOURCES = demo.c -cacademo_LDADD = ../src/libcaca.a @CACA_LIBS@ @MATH_LIBS@ +cacademo_LDADD = ../src/libcaca.la @CACA_LIBS@ @MATH_LIBS@ cacademo_CPPFLAGS = -I$(top_srcdir)/src -DDATADIR=\"$(pkgdatadir)\" cacafire_SOURCES = aafire.c -cacafire_LDADD = ../src/libcaca.a @CACA_LIBS@ +cacafire_LDADD = ../src/libcaca.la @CACA_LIBS@ cacafire_CPPFLAGS = -I$(top_srcdir)/src -DLIBCACA=1 cacaball_SOURCES = cacaball.c -cacaball_LDADD = ../src/libcaca.a @CACA_LIBS@ @MATH_LIBS@ +cacaball_LDADD = ../src/libcaca.la @CACA_LIBS@ @MATH_LIBS@ cacaball_CPPFLAGS = -I$(top_srcdir)/src cacaplas_SOURCES = cacaplas.c -cacaplas_LDADD = ../src/libcaca.a @CACA_LIBS@ @MATH_LIBS@ +cacaplas_LDADD = ../src/libcaca.la @CACA_LIBS@ @MATH_LIBS@ cacaplas_CPPFLAGS = -I$(top_srcdir)/src cacamoir_SOURCES = cacamoir.c -cacamoir_LDADD = ../src/libcaca.a @CACA_LIBS@ @MATH_LIBS@ +cacamoir_LDADD = ../src/libcaca.la @CACA_LIBS@ @MATH_LIBS@ cacamoir_CPPFLAGS = -I$(top_srcdir)/src cacaview_SOURCES = cacaview.c -cacaview_LDADD = ../src/libcaca.a @CACA_LIBS@ +cacaview_LDADD = ../src/libcaca.la @CACA_LIBS@ cacaview_CPPFLAGS = -I$(top_srcdir)/src -DX_DISPLAY_MISSING=1 if USE_IMLIB2 cacaview_CFLAGS = `imlib2-config --cflags` diff --git a/src/Makefile.am b/src/Makefile.am index 8008b7a..fab7f70 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,8 +2,8 @@ include_HEADERS = caca.h -lib_LIBRARIES = libcaca.a $(libcaca_pic_a) -libcaca_a_SOURCES = \ +lib_LTLIBRARIES = libcaca.la +libcaca_la_SOURCES = \ caca.c \ caca.h \ caca_internals.h \ @@ -18,10 +18,13 @@ libcaca_a_SOURCES = \ bitmap.c \ time.c \ $(NULL) +libcaca_la_LDFLAGS = -no-undefined +libcaca_la_LIBADD = @CACA_LIBS@ if NEED_PIC libcaca_pic_a = libcaca_pic.a endif -libcaca_pic_a_SOURCES = $(libcaca_a_SOURCES) +lib_LIBRARIES = $(libcaca_pic_a) +libcaca_pic_a_SOURCES = $(libcaca_la_SOURCES) libcaca_pic_a_CPPFLAGS = -fPIC -DPIC diff --git a/test/Makefile.am b/test/Makefile.am index db34d31..13c7dba 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,26 +3,26 @@ noinst_PROGRAMS = colors dithering event hsv optipal spritedit colors_SOURCES = colors.c -colors_LDADD = ../src/libcaca.a @CACA_LIBS@ +colors_LDADD = ../src/libcaca.la @CACA_LIBS@ colors_CPPFLAGS = -I$(top_srcdir)/src dithering_SOURCES = dithering.c -dithering_LDADD = ../src/libcaca.a @CACA_LIBS@ +dithering_LDADD = ../src/libcaca.la @CACA_LIBS@ dithering_CPPFLAGS = -I$(top_srcdir)/src event_SOURCES = event.c -event_LDADD = ../src/libcaca.a @CACA_LIBS@ +event_LDADD = ../src/libcaca.la @CACA_LIBS@ event_CPPFLAGS = -I$(top_srcdir)/src hsv_SOURCES = hsv.c -hsv_LDADD = ../src/libcaca.a @CACA_LIBS@ +hsv_LDADD = ../src/libcaca.la @CACA_LIBS@ hsv_CPPFLAGS = -I$(top_srcdir)/src optipal_SOURCES = optipal.c -optipal_LDADD = ../src/libcaca.a @CACA_LIBS@ +optipal_LDADD = ../src/libcaca.la @CACA_LIBS@ optipal_CPPFLAGS = -I$(top_srcdir)/src spritedit_SOURCES = spritedit.c -spritedit_LDADD = ../src/libcaca.a @CACA_LIBS@ +spritedit_LDADD = ../src/libcaca.la @CACA_LIBS@ spritedit_CPPFLAGS = -I$(top_srcdir)/src