summaryrefslogtreecommitdiff
blob: d1a359531c32649ca0acaadcf916f03f782cd199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
diff -ur refocus-0.9.0/configure.in refocus-0.9.0-patched/configure.in
--- refocus-0.9.0/configure.in	2010-07-06 18:32:20.047863465 +0200
+++ refocus-0.9.0-patched/configure.in	2010-07-06 18:32:44.900864017 +0200
@@ -16,26 +16,49 @@
 AC_PROG_RANLIB
 
 # Check if the user has ATLAS installed in ./lib-atlas
-fw_save_LIBS=$LIBS
-LIBS=-L./lib-atlas/lib ${LDFLAGS}
-AC_CHECK_LIB(lapack, clapack_dgesv, 
-AC_MSG_RESULT([using atlas in lib-atlas/lib])
-AC_DEFINE(HAVE_ATLAS)
-have_atlas=yes
-LAPACK_LIB_DIR='${top_srcdir}/lib-atlas/lib'
-LAPACK_INCLUDE_DIR='${top_srcdir}/lib-atlas/include'
-,
-AC_MSG_RESULT([using unoptimized lapack in lib])
+dnl fw_save_LIBS=$LIBS
+dnl LIBS=-L./lib-atlas/lib ${LDFLAGS}
+dnl AC_CHECK_LIB(lapack, clapack_dgesv, 
+dnl AC_MSG_RESULT([using atlas in lib-atlas/lib])
+dnl AC_DEFINE(HAVE_ATLAS)
+dnl have_atlas=yes
+dnl LAPACK_LIB_DIR='${top_srcdir}/lib-atlas/lib'
+dnl LAPACK_INCLUDE_DIR='${top_srcdir}/lib-atlas/include'
+dnl ,
+dnl AC_MSG_RESULT([using unoptimized lapack in lib])
+dnl have_atlas=no
+dnl LAPACK_LIB_DIR='${top_srcdir}/lib'
+dnl LAPACK_INCLUDE_DIR='${top_srcdir}/lib'
+dnl ,
+dnl [-lcblas -latlas])
+dnl LIBS=$fw_save_LIBS
+dnl AC_SUBST(LAPACK_LIB_DIR)
+dnl AC_SUBST(LAPACK_INCLUDE_DIR)
+dnl AM_CONDITIONAL(HAVE_ATLAS, test x${have_atlas} = xyes)
+
+BUNDLED_LAPACK_LIB_DIR='${top_srcdir}/lib'
+AC_SUBST(BUNDLED_LAPACK_LIB_DIR)
+
 have_atlas=no
-LAPACK_LIB_DIR='${top_srcdir}/lib'
-LAPACK_INCLUDE_DIR='${top_srcdir}/lib'
-,
-[-lcblas -latlas])
-LIBS=$fw_save_LIBS
-AC_SUBST(LAPACK_LIB_DIR)
-AC_SUBST(LAPACK_INCLUDE_DIR)
+AC_ARG_WITH(lapack-libs, [  --with-lapack-libs=LIBS ])
+if test "x$with_lapack_libs" = "x" ; then
+  LAPACK_LIBS='-L${top_srcdir}/lib -llapack'
+else
+  LAPACK_LIBS="$with_lapack_libs"
+  have_atlas=yes
+fi
+AC_SUBST(LAPACK_LIBS)
 AM_CONDITIONAL(HAVE_ATLAS, test x${have_atlas} = xyes)
 
+AC_ARG_WITH(lapack-includes, [  --with-lapack-includes=INCLUDES ])
+if test "x$with_lapack_includes" = "x" ; then
+  LAPACK_INCLUDES='-I ${top_srcdir}/lib'
+else
+  LAPACK_INCLUDES="$with_lapack_includes"
+fi
+AC_SUBST(LAPACK_INCLUDES)
+
+
 AM_PATH_GIMP_2_0(2.0.0)
 AM_PATH_GTK_2_0(2.0.0)
 AM_PATH_GLIB_2_0(2.0.0)
diff -ur refocus-0.9.0/src/Makefile.am refocus-0.9.0-patched/src/Makefile.am
--- refocus-0.9.0/src/Makefile.am	2010-07-06 18:32:19.991863838 +0200
+++ refocus-0.9.0-patched/src/Makefile.am	2010-07-06 18:35:40.403879796 +0200
@@ -1,22 +1,28 @@
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES=@GTK_CFLAGS@ @GIMP_CFLAGS@ -I @LAPACK_INCLUDE_DIR@
+INCLUDES=@GTK_CFLAGS@ @GIMP_CFLAGS@ @LAPACK_INCLUDES@
 
 bin_PROGRAMS = refocus
 noinst_PROGRAMS = test-matrix
 
-ldadd_atlas=-L@LAPACK_LIB_DIR@ -llapack -lcblas -latlas
+ldadd_atlas=@LAPACK_LIBS@
 
 noinst_HEADERS=bdclosure.h refocus.h matrix.h tilebuf.h conv.h fwlapack.h gimppreview.h prevman.h util.h
 EXTRA_DIST = dummy-plugin.c
 
 refocus_SOURCES = refocus.c conv.c gimppreview.c prevman.c util.c matrix.c tilebuf.c bdclosure.c fwlapack.c
 refocus_LDADD = @GIMP_LIBS@ ${ldadd_atlas}
-refocus_DEPENDENCIES=@LAPACK_LIB_DIR@/liblapack.a
+if HAVE_ATLAS
+else
+refocus_DEPENDENCIES=@BUNDLED_LAPACK_LIB_DIR@/liblapack.a
+endif
 
 test_matrix_SOURCES = matrix.c test-matrix.c fwlapack.c
 test_matrix_LDADD = -lm ${ldadd_atlas} @GLIB_LIBS@
-test_matrix_DEPENDENCIES=@LAPACK_LIB_DIR@/liblapack.a
+if HAVE_ATLAS
+else
+test_matrix_DEPENDENCIES=@BUNDLED_LAPACK_LIB_DIR@/liblapack.a
+endif
 
 install-bin: refocus
 	@if test "x@GIMPTOOL@" = "x" ; then \
@@ -36,8 +42,8 @@
 		@GIMPTOOL@ --install-admin-bin refocus ; \
 	fi
 
-@LAPACK_LIB_DIR@/liblapack.a:
-	cd @LAPACK_LIB_DIR@; make
+@BUNDLED_LAPACK_LIB_DIR@/liblapack.a:
+	cd @BUNDLED_LAPACK_LIB_DIR@; make
 
 %.s: %.c
 	${CC} ${CFLAGS} -S $< -o $@