summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac2
-rw-r--r--src/gipfel.cxx12
3 files changed, 17 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index af437a6..205a86a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,7 @@
SUBDIRS = src
+
+EXTRA_DIST = alpinkoordinaten.dat
+
+gpsdir = $(datadir)/gipfel
+
+gps_DATA = alpinkoordinaten.dat
diff --git a/configure.ac b/configure.ac
index 08330d7..088b07a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/Panorama.H])
AC_CONFIG_HEADER(config.h)
-CPPFLAGS="-g -I/usr/local/include $CPPFLAGS"
+CPPFLAGS="-g -I/usr/local/include -DDATADIR=\\\"$datadir\\\" $CPPFLAGS"
CXXFLAGS="-g -I/usr/local/include $CXXFLAGS"
LDFLAGS="-g $LDFLAGS"
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 9db82fa..221bcec 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -50,9 +50,17 @@
#include "Fl_Search_Chooser.H"
#include "GipfelWidget.H"
#include "choose_hill.H"
+#include "../config.h"
+
+#ifndef DATADIR
+#define DATADIR "/usr/local/share"
+#endif
+
+#define DEFAULT_DATAFILE DATADIR "/" PACKAGE_NAME "/alpinkoordinaten.dat"
char *img_file;
-char *data_file;
+char *data_file = DEFAULT_DATAFILE;
+
GipfelWidget *gipf = NULL;
Fl_Dial *s_center = NULL;
Fl_Slider *s_nick = NULL, *s_scale = NULL, *s_tilt = NULL, *s_height_dist;
@@ -321,7 +329,7 @@ int main(int argc, char** argv) {
exit(1);
}
-
+fprintf(stderr, "%s\n", data_file);
control_win = create_control_window();
view_win = new Fl_Window(800, 600);