Fix:Core:Better win32 module loading
[navit-package] / navit / Makefile.am
index c0c9b7d..4610d77 100644 (file)
@@ -1,69 +1,98 @@
 include $(top_srcdir)/Makefile.inc
-DIST_SUBDIRS=binding map fib-1.1 font fonts gui graphics osd speech support vehicle xpm maps
-SUBDIRS=binding map fib-1.1 font gui graphics osd speech support vehicle xpm
-if BUILD_SAMPLEMAP
-  SUBDIRS += maps
+comma=,
+SUBDIRS=fib-1.1 support
+if PLUGINS
+  SUBDIRS += .
 endif
+DIST_SUBDIRS=binding map maptool fib-1.1 font fonts gui graphics osd speech support vehicle xpm maps
+SUBDIRS+=binding map font gui graphics osd speech vehicle xpm
 
 if FONTS
   SUBDIRS += fonts
 endif
+if !PLUGINS
+  SUBDIRS += .
+endif
+
+SUBDIRS+=maptool
+
+if BUILD_SAMPLEMAP
+  SUBDIRS += maps
+endif
+
 
 AM_CPPFLAGS = -I$(top_srcdir)/navit/fib-1.1 @NAVIT_CFLAGS@ @ZLIB_CFLAGS@ -DPREFIX=\"@prefix@\" -DLIBDIR=\"@libdir@\" -DMODULE=navit
 BUILT_SOURCES = version.h navit_config.h
-if BUILD_SAMPLEMAP
-  BUILT_SOURCES += osm2navit$(EXEEXT)
+
+if BIN_NAVIT
+  bin_PROGRAMS = navit
 endif
 
-if SUPPORT_ANDROID
+if SHARED_LIBNAVIT
   lib_LTLIBRARIES        = libnavit.la
-  libnavit_la_LDFLAGS = -module -avoid-version @MODULE_LDFLAGS@
-
+  libnavit_la_LDFLAGS = -avoid-version @MODULE_LDFLAGS@ -no-undefined -Wl,--no-undefined
+  libnavit_la_LIBADD = @NAVIT_LIBS@ @WORDEXP_LIBS@ @ZLIB_LIBS@ @INTLLIBS@ -Lfib-1.1 -lfib @MODULE_LIBADD@
 else
-  bin_PROGRAMS = navit osm2navit
   noinst_LTLIBRARIES        = libnavit.la
 endif
 
 pkgdata_DATA = navit.xml
 
-EXTRA_DIST = navit.xml 
+EXTRA_DIST = navit_shipped.xml navit.dtd
 
-libnavit_la_SOURCES = announcement.c atom.c attr.c cache.c callback.c command.c compass.c coord.c country.c cursor.c data_window.c debug.c \
+libnavit_la_SOURCES = announcement.c atom.c attr.c cache.c callback.c command.c compass.c config_.c coord.c country.c data_window.c debug.c \
        event.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
        linguistics.c mapset.c maptype.c menu.c messages.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
-       profile.c projection.c roadprofile.c route.c search.c speech.c transform.c track.c \
-       util.c vehicle.c vehicleprofile.c xmlconfig.c announcement.h atom.h attr.h attr_def.h cache.h callback.h color.h command.h compass.h coord.h country.h \
-       cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
+       profile.c projection.c roadprofile.c route.c routech.c search.c speech.c start_real.c transform.c track.c \
+       util.c vehicle.c vehicleprofile.c xmlconfig.c announcement.h atom.h attr.h attr_def.h cache.h callback.h color.h command.h compass.h config_.h coord.h country.h \
+       data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
        file.h graphics.h gtkext.h gui.h item.h item_def.h keys.h log.h layer.h layout.h linguistics.h main.h map-share.h map.h\
        map_data.h mapset.h maptype.h menu.h messages.h navigation.h navit.h osd.h \
-       param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h roadprofile.h search.h speech.h \
+       param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h roadprofile.h search.h speech.h start_real.h \
        transform.h track.h util.h vehicle.h vehicleprofile.h window.h xmlconfig.h zipfile.h \
-       navit_nls.h
+       navit_nls.h sunriset.c sunriset.h
+
+XSLTS=@XSLTS@
+navit.xml: navit_shipped.xml  $(foreach xslt, $(subst $(comma), ,$(XSLTS)), $(addsuffix .xslt,$(addprefix xslt/,$(xslt))))
+       cp $< navit.xml.new
+       if [ ! -f "$(builddir)/navit.dtd" ]; then cp -f $(srcdir)/navit.dtd $(builddir)/navit.dtd; fi
+       for i in $^; do if [ "$${i%.xslt}" != "$$i" ]; then echo "Applying $$i" ; @SAXON@ -snone navit.xml.new $$i >navit.xml.tmp || exit ; mv navit.xml.tmp navit.xml.new || exit ; fi ; done
+       mv navit.xml.new navit.xml
+       rm -f navit.xml.tmp
+       
 
 if SUPPORT_ANDROID
   libnavit_la_SOURCES += android.c
   navit_SOURCES =
   navit_LDADD =
-  osm2navit_SOURCES =
-  osm2navit_LDADD =
+
+android/AndroidManifest.xml: android/AndroidManifest.xml.in
+       mkdir -p $(builddir)/android
+       sed '0,/<uses-sdk/!d' <$< >$@
+       for i in $(subst $(comma), ,@ANDROID_PERMISSIONS@); do echo "    <uses-permission android:name=\"android.permission.$$i\" />" >>$@; done
+       sed '0,/<uses-sdk/d' <$< >>$@
+       
 
 android/build.xml: android/AndroidManifest.xml
+       mkdir -p android
+       if [ "$(builddir)" != "$(srcdir)" ]; then cp -rp $(srcdir)/android/* $(builddir)/android; fi
        android update project -t 3 -p android
 
-apk: all-am android/build.xml
+apk: all android/build.xml navit.xml
        mkdir -p android/libs/armeabi
        cp .libs/*.so */*/.libs/*.so android/libs/armeabi
-       for i in $(shell cd xpm && echo *.xpm); do convert xpm/$$i android/res/drawable/$${i%.xpm}.png; done 
-       cp xpm/*.png android/res/drawable
+       for i in $(shell cd $(srcdir)/xpm && echo *.xpm); do convert $(srcdir)/xpm/$$i android/res/drawable/$${i%.xpm}.png; done 
+       for i in $(shell cd $(srcdir)/xpm && echo *.png); do cp $(srcdir)/xpm/$$i android/res/drawable/$$( echo $$i | tr "[A-Z]" "[a-z]") ; done
+       if [ "$(builddir)" != "$(srcdir)" ]; then for i in $(shell cd $(builddir)/xpm && echo *.png); do cp $(builddir)/xpm/$$i android/res/drawable/$$( echo $$i | tr "[A-Z]" "[a-z]") ; done ; fi
+       mkdir -p android/res/raw
+       for i in $(shell cd ../po && echo *.mo); do cp ../po/$$i android/res/raw/$$( echo $$i | tr "[A-Z]" "[a-z]") ; done
+       cp navit.xml android/res/raw
        cd android && ant debug
 
 else
 navit_SOURCES = start.c
-navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @INTLLIBS@ -Lfib-1.1 -lfib
+navit_LDADD = libnavit.la @NAVIT_LIBS@ @WORDEXP_LIBS@ @ZLIB_LIBS@ @INTLLIBS@ -Lfib-1.1 -lfib
 
-osm2navit_CPPFLAGS = $(AM_CPPFLAGS) @ZLIB_CFLAGS@ @POSTGRESQL_CFLAGS@
-osm2navit_SOURCES = osm2navit.c
-osm2navit_LDADD = libnavit.la @NAVIT_LIBS@ @ZLIB_LIBS@ @POSTGRESQL_LIBS@ @INTLLIBS@
 endif
 
 if EVENT_GLIB
@@ -73,8 +102,6 @@ endif
 if !PLUGINS
   navit_SOURCES += builtin.c
   navit_LDADD += $(wildcard $(top_builddir)/navit/*/*/*.la)
-  osm2navit_SOURCES += support-builtin.c
-  osm2navit_LDADD += $(wildcard $(top_builddir)/navit/support/*/*.la)
 endif
 
 if SUPPORT_WIN32
@@ -115,7 +142,8 @@ navit_config.h: ../config.h
 
 
 distclean-local:
-       rm -f version.h version.h.tmp navit_config.h navit_config.h.tmp builtin.c support-builtin.c
+       rm -f version.h version.h.tmp navit_config.h navit_config.h.tmp builtin.c support-builtin.c navit.xml
+       if [ "$(builddir)" != "$(srcdir)" ]; then rm -f navit.dtd; fi
 
 builtin.c: $(top_builddir)/config.h
        ls $(top_builddir)/navit/*/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void module_/" >builtin.c