xmlada/xmlada-destdir.patch
2011-03-04 17:11:19 +03:00

152 lines
6.7 KiB
Diff

--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
## The type of library we want to build. Possible values:
## relocatable
## static
-LIBRARY_TYPE=static
-
+LIBRARY_TYPE=relocatable
+DESTDIR ?=
# Replace with the location for the installation directory
INSTALL=@INSTALL@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
@@ -50,8 +50,8 @@
.PHONY: all obj clean install install_dirs build_library_type install_library_type
ifeq (${BUILDS_SHARED},yes)
-all: static relocatable
-install: install_static install_relocatable
+all: relocatable
+install: install_relocatable
else
all: static
install: install_static
@@ -64,17 +64,17 @@
${MAKE} LIBRARY_TYPE=relocatable build_library_type
obj: force
- ${GNATMAKE} -p -Punicode/unicode.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Pinput_sources/input_sources.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Psax/sax.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Pdom/dom.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Pschema/schema.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Punicode/unicode.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Pinput_sources/input_sources.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Psax/sax.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Pdom/dom.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Pschema/schema.gpr ${MAKE_ARGS}
test: force
- ${GNATMAKE} -p -Punicode/test/unicode_test.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Psax/test/sax_test.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Pdom/test/dom_test.gpr ${MAKE_ARGS}
- ${GNATMAKE} -p -Pschema/test/schema_test.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Punicode/test/unicode_test.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Psax/test/sax_test.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Pdom/test/dom_test.gpr ${MAKE_ARGS}
+ ${GNATMAKE} -R -p -Pschema/test/schema_test.gpr ${MAKE_ARGS}
run_test: force
@cd unicode/test; ./test_unicode
@@ -88,57 +88,55 @@
# Rule for installing the modules
%_inst: force
- ${CP} $*/*.ad[bs] ${includedir}/xmlada
- cd $*; ls *.ad[bs] > ${libdir}/gnat/xmlada/xmlada_$*.lgpr
- -cd ${xmllib}; ${CHMOD} ugo+w *.ali
- -${CP} $*/lib/${LIBRARY_TYPE}/*.ali ${xmllib}
- ${RM} ${libdir}/libxmlada_$**
- ${RM} ${xmllib}libxmlada_$**
+ ${CP} $*/*.ad[bs] ${DESTDIR}/${includedir}/xmlada
+ cd $*; ls *.ad[bs] > ${DESTDIR}/${ADA_PROJECT_PATH}/xmlada/xmlada_$*.lgpr
+ -cd ${DESTDIR}/${xmllib}; ${CHMOD} ugo+w *.ali
+ -${CP} $*/lib/${LIBRARY_TYPE}/*.ali ${DESTDIR}/${xmllib}
+ ${RM} ${DESTDIR}/${libdir}/libxmlada_$**
+ ${RM} ${DESTDIR}/${xmllib}libxmlada_$**
ifeq (${LIBRARY_TYPE},static)
- ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.a ${xmllib}
+ ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.a ${DESTDIR}/${xmllib}
else
ifeq (${OS},Windows_NT)
- ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT} ${xmllib}
+ ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT} ${DESTDIR}/${xmllib}
cd ${bindir}; ${CP} ${libdir}/xmlada/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT} libxmlada_$*.${LIBEXT}
else
- ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} ${xmllib}
- cd ${xmllib}; ${LN_S} libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}
- cd ${xmllib}; ${LN_S} libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${basename ${VERSION}}
- cd ${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${basename ${VERSION}}
- cd ${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${VERSION}
+ ${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} ${DESTDIR}/${xmllib}
+ cd ${DESTDIR}/${xmllib}; ${LN_S} libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}
+ cd ${DESTDIR}/${xmllib}; ${LN_S} libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${basename ${VERSION}}
+ cd ${DESTDIR}/${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${basename ${VERSION}}
+ cd ${DESTDIR}/${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*.${LIBEXT}.${VERSION} libxmlada_$*.${LIBEXT}.${VERSION}
endif
endif
- cd ${xmllib}; ${CHMOD} ugo-w *.ali
+ cd ${DESTDIR}/${xmllib}; ${CHMOD} ugo-w *.ali
install_dirs: force
- @${MKDIR} ${bindir}
- @${MKDIR} ${xmllib}
- @${MKDIR} ${libdir}/gnat/xmlada
- @${MKDIR} ${datadir}/doc/xmlada
- @${MKDIR} ${includedir}/xmlada
- @${MKDIR} ${datadir}/gps/plug-ins/
+ @${MKDIR} ${DESTDIR}/${bindir}
+ @${MKDIR} ${DESTDIR}/${xmllib}
+ @${MKDIR} ${DESTDIR}/${ADA_PROJECT_PATH}/xmlada
+ @${MKDIR} ${DESTDIR}/${datadir}/doc/xmlada
+ @${MKDIR} ${DESTDIR}/${includedir}/xmlada
+ @${MKDIR} ${DESTDIR}/${datadir}/gps/plug-ins/
## Do the installation for either shared or static, depending on
## $LIBRARY_TYPE
install_library_type: install_dirs ${MODULE_INSTALL}
- ${INSTALL} distrib/xmlada_shared.gpr ${libdir}/gnat
- ${INSTALL} distrib/xmlada.gpr ${libdir}/gnat/
- ${INSTALL} distrib/xmlada_dom.gpr ${libdir}/gnat/
- ${INSTALL} distrib/xmlada_sax.gpr ${libdir}/gnat/
- ${INSTALL} distrib/xmlada_input.gpr ${libdir}/gnat/
- ${INSTALL} distrib/xmlada_schema.gpr ${libdir}/gnat/
- ${INSTALL} distrib/xmlada_unicode.gpr ${libdir}/gnat/
- ${INSTALL} xmlada-config ${bindir}
- -${INSTALL} docs/xml.ps ${datadir}/doc/xmlada 2>/dev/null
- -${INSTALL} docs/xml.pdf ${datadir}/doc/xmlada
- -${INSTALL} docs/xml.html ${datadir}/doc/xmlada
- -${INSTALL} docs/xml.info ${datadir}/doc/xmlada
- ${CHMOD} +x ${bindir}/xmlada-config
- ${INSTALL} distrib/xmlada_gps.py ${datadir}/gps/plug-ins/
+ ${INSTALL} distrib/xmlada_shared.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada_dom.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada_sax.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada_input.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada_schema.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} distrib/xmlada_unicode.gpr ${DESTDIR}/${ADA_PROJECT_PATH}/
+ ${INSTALL} xmlada-config ${DESTDIR}/${bindir}
+ -${INSTALL} docs/xml.ps ${DESTDIR}/${datadir}/doc/xmlada 2>/dev/null
+ -${INSTALL} docs/xml.pdf ${DESTDIR}/${datadir}/doc/xmlada
+ -${INSTALL} docs/xml.html ${DESTDIR}/${datadir}/doc/xmlada
+ -${INSTALL} docs/xml.info ${DESTDIR}/${datadir}/doc/xmlada
+ ${CHMOD} +x ${DESTDIR}/${bindir}/xmlada-config
+ ${INSTALL} distrib/xmlada_gps.py ${DESTDIR}/${datadir}/gps/plug-ins/
## Do the installation for an explicit target
-install_static:
- ${MAKE} LIBRARY_TYPE=static install_library_type
install_shared install_relocatable:
${MAKE} LIBRARY_TYPE=relocatable install_library_type
@@ -153,7 +151,7 @@
-gnat clean -XLIBRARY_TYPE=$* -q -Psax/test/sax_test.gpr
-gnat clean -XLIBRARY_TYPE=$* -q -Pschema/test/schema_test.gpr
-clean: clean_relocatable clean_static
+clean: clean_relocatable
cd docs; ${MAKE} -e clean
distclean: clean