Commits

Barry Schwartz committed 98ac0be

Use C stubs so that we get rpath support when loading libraries.

  • Participants
  • Parent commits 2d62f02

Comments (0)

Files changed (2)

 
 ACLOCAL_AMFLAGS = -I m4
 
-LAPACK_MINUSL = $(filter -l%, $(LAPACK_LIBS))
-LAPACKE_MINUSL = $(filter -l%, $(LAPACKE_LIBS))
+dist_pure_lib_DATA = lapacke.pure lapacke_utils.pure
 
-dist_pure_lib_DATA = lapacke.pure lapacke_utils.pure
+pure_lib_LTLIBRARIES = lapacke.la lapacke_utils.la
+lapacke_la_SOURCES = lapacke.c
+lapacke_la_CPPFLAGS = $(LAPACKE_CFLAGS) $(LAPACK_CFLAGS)
+lapacke_la_LDFLAGS = -module -shared -avoid-version $(LAPACKE_LIBS) $(LAPACK_LIBS)
+lapacke_utils_la_SOURCES = lapacke_utils.c
+lapacke_utils_la_CPPFLAGS = $(LAPACKE_CFLAGS)
+lapacke_utils_la_LDFLAGS = -module -shared -avoid-version $(LAPACKE_LIBS)
 
 # FIXME: Support these functions if xblas support has been compiled
 # into LAPACKE.
 XBLASFUNCS = "(LAPACKE_sgeqrfp|LAPACKE_dgeqrfp|LAPACKE_cgeqrfp|LAPACKE_zgeqrfp|LAPACKE_sgeqrfp_work|LAPACKE_dgeqrfp_work|LAPACKE_cgeqrfp_work|LAPACKE_zgeqrfp_work|dgerfsx_|sgerfsx_|zgerfsx_|cgerfsx_|dgbrfsx_|sgbrfsx_|zgbrfsx_|cgbrfsx_|dporfsx_|sporfsx_|zporfsx_|cporfsx_|dsyrfsx_|ssyrfsx_|zsyrfsx_|csyrfsx_|zherfsx_|cherfsx_|dgesvxx_|sgesvxx_|zgesvxx_|cgesvxx_|dgbsvxx_|sgbsvxx_|zgbsvxx_|cgbsvxx_|dposvxx_|sposvxx_|zposvxx_|cposvxx_|dsysvxx_|ssysvxx_|zsysvxx_|csysvxx_|zhesvxx_|chesvxx_)"
 
-lapacke.pure: $(LAPACKE_INCLUDEDIR)/lapacke.h
+lapacke.pure lapacke.c: $(LAPACKE_INCLUDEDIR)/lapacke.h
+	rm -f lapacke.c
 	$(PUREGEN) -s "$(LAPACKE_INCLUDEDIR)/lapacke.h::"				\
 		-x $(XBLASFUNCS)											\
 		$(filter -I% -D%, $(LAPACKE_CFLAGS) $(CPPFLAGS) $(CFLAGS))	\
 		-o lapacke.pure												\
+		-c lapacke.c												\
 		"$(LAPACKE_INCLUDEDIR)/lapacke.h"							\
-		${LAPACKE_MINUSL:-l%=-llib%}								\
-		${LAPACK_MINUSL:-l%=-llib%}
+		-llapacke
+	touch lapacke.c
 
-lapacke_utils.pure: $(LAPACKE_INCLUDEDIR)/lapacke_utils.h
+lapacke_utils.pure lapacke_utils.c: $(LAPACKE_INCLUDEDIR)/lapacke_utils.h
+	rm -f lapacke_utils.c
 	$(PUREGEN) -s "$(LAPACKE_INCLUDEDIR)/lapacke_utils.h::"			\
 		$(filter -I% -D%, $(LAPACKE_CFLAGS) $(CPPFLAGS) $(CFLAGS))	\
 		-o lapacke_utils.pure										\
 		"$(LAPACKE_INCLUDEDIR)/lapacke_utils.h"						\
-		${LAPACKE_MINUSL:-l%=-llib%}
+		-llapacke_utils
+	touch lapacke_utils.c
 
-MOSTLYCLEANFILES = lapacke.pure lapacke_utils.pure
+MOSTLYCLEANFILES = lapacke.c lapacke.pure lapacke_utils.c	\
+	lapacke_utils.pure
 
 # Checks for programs.
 AC_PROG_CC
+AC_PROG_LIBTOOL
 CRUDFACT_REQUIRE_PUREGEN
 
 # Checks for libraries.