Hacks to make it work with jlibtool
authorAlan T. DeKok <aland@freeradius.org>
Thu, 13 Sep 2012 13:00:13 +0000 (15:00 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 13 Sep 2012 13:00:13 +0000 (15:00 +0200)
Make.inc.in
Makefile
configure
configure.in
src/main/Makefile.in

index 373fb9a..c42211b 100644 (file)
@@ -59,8 +59,11 @@ LIBLTDL              = @LIBLTDL@
 INCLTDL                = @INCLTDL@
 CFLAGS         += $(INCLTDL)
 
-USE_SHARED_LIBS        = @USE_SHARED_LIBS@
-USE_STATIC_LIBS = @USE_STATIC_LIBS@
+#USE_SHARED_LIBS       = @USE_SHARED_LIBS@
+#USE_STATIC_LIBS = @USE_STATIC_LIBS@
+
+USE_SHARED_LIBS = yes
+USE_STATIC_LIBS = yes
 STATIC_MODULES = @STATIC_MODULES@
 
 OPENSSL_LIBS   = @OPENSSL_LIBS@
@@ -144,3 +147,8 @@ ifneq "$(findstring Darwin,$(shell uname -a))" ""
 LA             := dylib
 endif
 endif
+
+all: $(top_srcdir)/scripts/jlibtool
+
+$(top_srcdir)/scripts/jlibtool: $(top_srcdir)/scripts/jlibtool.c
+       $(CC) $^ -o $@
index ce04c4b..a26c73a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,30 +23,9 @@ BOILERMAKE=$(subst 3.8,yes,$(subst 3.80,,$(MAKE_VERSION)))
 
 # The version of GNU Make is too old, don't use it.
 ifeq "" "$(findstring yes,$(BOILERMAKE))"
-BOILERMAKE=
+$(error The build system requires GNU Make 3.81 or later.)
 endif
 
-# Static-only builds still require libtool.
-# This is because it does all kinds of preload magic in order
-# to force the linker to put the libraries into the main binary.
-# We don't support that yet, so we miss it...
-ifneq "$(USE_SHARED_LIBS)" "yes"
-BOILERMAKE=
-endif
-endif
-
-# If possible, drastically decrease the build time.
-# The new build system means that 
-ifneq "" "$(BOILERMAKE)"
-
-# Don't use libtool or libltdl.
-# They are a blight upon the face of the earth.
-LIBLTDL                :=
-INCLTDL                := 
-CFLAGS         += 
-LIBTOOL                := JLIBTOOL
-LTDL_SUBDIRS   :=
-
 export DESTDIR := $(R)
 
 # And over-ride all of the other magic.
@@ -64,16 +43,6 @@ all:
 clean:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
        @rm -f *~
-
-ifeq "scripts/jlibtool" "$(JLIBTOOL)"
-all: scripts/jlibtool
-
-scripts/jlibtool: scripts/jlibtool.c
-       $(CC) $^ -o $@
-
-LIBTOOL := $(top_srcdir)/scripts/jlibtool
-endif
-
 endif
 
 .PHONY: tests
index 15f93a1..a9ec96a 100755 (executable)
--- a/configure
+++ b/configure
@@ -15130,7 +15130,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 else
 
-  LIBTOOL="`pwd`/libtool"
+  LIBTOOL='${top_srcdir}/scripts/jlibtool'
 
     enable_dlopen=yes
 
index 7751d7e..e31292a 100644 (file)
@@ -93,13 +93,10 @@ AC_ARG_WITH(system-libtool,
 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) AC_LIBTOOL_DLOPEN
  AC_PROG_LIBTOOL],
 [
-  LIBTOOL="`pwd`/libtool"
+  LIBTOOL='${top_srcdir}/scripts/jlibtool'
   AC_SUBST(LIBTOOL)
   dnl ensure that we're looking for dlopen
   AC_LIBTOOL_DLOPEN
-
-  dnl Figure out how to build shared libraries
-  AC_PROG_LIBTOOL
 ])
 
 
index 33a7efb..0f093e1 100644 (file)
@@ -66,7 +66,7 @@ all: $(BINARIES)
 $(SERVER_OBJS): $(INCLUDES)
 
 radiusd$(EXEEXT): $(SERVER_OBJS) $(MODULE_OBJS) $(LIBRADIUS)
-       $(LIBTOOL) --quiet --mode=link $(CC) -export-dynamic -dlopen self \
+       $(LIBTOOL) --quiet --mode=link $(CC) -export-dynamic \
                $(LDFLAGS) $(LINK_MODE) -o $@ $(SERVER_OBJS)      \
                $(MODULE_LIBS) $(LIBRADIUS) $(LIBS) $(SNMP_LIBS) \
                $(LCRYPT) $(PTHREADLIB) $(LIBLTDL) $(OPENSSL_LIBS)