* configure.ac: master
authortrelane@digitasaru.net <trelane@digitasaru.net>
Fri, 16 Oct 2009 03:33:07 +0000 (22:33 -0500)
committertrelane@digitasaru.net <trelane@digitasaru.net>
Fri, 16 Oct 2009 03:33:07 +0000 (22:33 -0500)
    Added ability to specify matdb location
* src/scdataviz.c:
    Modified to use new MATDBFILE macro passed on command-line.

configure.ac
src/scdataviz.c

index 6a306b3..b5df70c 100644 (file)
@@ -28,6 +28,11 @@ AC_ARG_ENABLE([debug],
 esac],[debug=false])
 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
 
 esac],[debug=false])
 AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
 
+AC_ARG_ENABLE([matdbfile],
+[  --enable-matdbfile=location Specify matdb location],
+[CFLAGS="$CFLAGS -DMATDBFILE=${enableval}"],
+[CFLAGS="$CFLAGS -DMATDBFILE=matdb.txt"])
+
 AC_ARG_ENABLE([maemo],
 [  --enable-maemo=device Enable maemo build],
 [case "${enableval}" in
 AC_ARG_ENABLE([maemo],
 [  --enable-maemo=device Enable maemo build],
 [case "${enableval}" in
index 68d6c74..516d6ba 100644 (file)
@@ -24,7 +24,7 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ** Started on  Thu Jul 17 11:03:27 2008 Johnny Q. Hacker
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ** Started on  Thu Jul 17 11:03:27 2008 Johnny Q. Hacker
-** Last update Thu Oct 15 21:51:34 2009 Johnny Q. Hacker
+** Last update Thu Oct 15 22:28:18 2009 Johnny Q. Hacker
 */
 
 #include <stdlib.h>
 */
 
 #include <stdlib.h>
@@ -138,11 +138,19 @@ static void link_materials(gpointer key, gpointer value, gpointer user_data) {
   g_hash_table_foreach(propmap->mdb->materials, &inner_link_materials, propmap);
 }
 
   g_hash_table_foreach(propmap->mdb->materials, &inner_link_materials, propmap);
 }
 
+
+#define xstr(s) str(s)
+#define str(s) #s
+
+#ifndef MATDBFILE
+#define MATDBFILE matdb.txt
+#endif
+
 int main(int   argc, char *argv[]) 
 {
     GtkWidget *window;
     GtkWidget *graph;
 int main(int   argc, char *argv[]) 
 {
     GtkWidget *window;
     GtkWidget *graph;
-    GString *file = g_string_new("matdb.txt");
+    GString *file = g_string_new(xstr(MATDBFILE));
     int err=0;
     struct matdb *mdb = read_matdb_dotcode(file, &err);
     //fprintf(stderr, "read_matdb_dotcode(%s, %d)=%x", file->str, err,
     int err=0;
     struct matdb *mdb = read_matdb_dotcode(file, &err);
     //fprintf(stderr, "read_matdb_dotcode(%s, %d)=%x", file->str, err,