From f09dd5400aa3cb57b9b137c2d6124b69d083aa82 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Mon, 27 Feb 2012 01:18:29 +0000 Subject: [PATCH] configure: Install to /usr/local/ by default --- configure.ac | 41 ++++++++++++++++++++++++++++------------- src/Makefile.am | 6 +++--- src/config.h.in | 5 ++++- tiff/Makefile.am | 2 +- xpm/Makefile.am | 2 +- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 9999022..f8929d8 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,9 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix dnl Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +_bindir=`eval echo $bindir` +_bindir=`eval echo $_bindir` + dnl look for X windows first so further libs check AC_PATH_X @@ -150,31 +153,35 @@ fi dnl Support for GNUSTEP_LOCAL_ROOT dnl ============================================== -appspath="" +AC_ARG_WITH(gnustepdir, AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications])) -AC_ARG_WITH(appspath, -[ --with-appspath=PATH specify the directory for GNUstep applications], appspath=$withval ) +if test "x`echo $with_gnustepdir | grep ^/`" != "x"; then + appspath=$with_gnustepdir +fi -if test "x$appspath" = "x"; then - gnustepdir="${prefix}/GNUstep" -dnl WMPrefs uses this method but it doesn't seem to work for me -dnl if there are problems with ICONDIR or fsviewerdir uncomment -dnl the next line -dnl gnustepdir='$(prefix)/GNUstep' +if test "x$appspath$GNUSTEP_LOCAL_ROOT" = "x"; then + fsviewer_base_dir=${prefix} + fsviewer_datadir="${prefix}/GNUstep/FSViewer.app" + fsviewer_bindir="${bindir}" +else + gnustepdir=$appspath if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"` gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'` fi - with_appspath=$gnustepdir/Apps + fsviewer_base_dir=$gnustepdir/Apps + fsviewer_datadir=$fsviewer_base_dir/FSViewer.app + fsviewer_bindir=$fsviewer_base_dir/FSViewer.app fi -fsviewerdir=$with_appspath/FSViewer.app -AC_SUBST(fsviewerdir) +AC_SUBST(fsviewer_base_dir) +AC_SUBST(fsviewer_datadir) +AC_SUBST(fsviewer_bindir) AH_TEMPLATE([ICONDIR],[Where to put icon files]) -AC_DEFINE_UNQUOTED([ICONDIR], "${fsviewerdir}") +AC_DEFINE_UNQUOTED([ICONDIR], "${fsviewer_datadir}") dnl Support for NLS dnl ============================================== @@ -192,3 +199,11 @@ AM_GNU_GETTEXT_VERSION([0.15]) AC_OUTPUT(Makefile src/Makefile src/regexp/Makefile defs/Makefile \ po/Makefile.in m4/Makefile tiff/Makefile xpm/Makefile man/Makefile) + + +echo +echo "FSViewer was configured as follows:" +echo +echo "Installation path prefix : $prefix" +echo "Installation path for binaries : $_bindir" +echo "Installation path for FSViewer.app : $fsviewer_datadir" | sed -e 's|\${prefix}|'"$prefix|" diff --git a/src/Makefile.am b/src/Makefile.am index df8f66c..76daad4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in ## SUBDIRS = regexp -bindir = @fsviewerdir@ +bindir = @fsviewer_bindir@ bin_PROGRAMS = FSViewer -datadir = @fsviewerdir@ -pkgdatadir = @fsviewerdir@ +datadir = @fsviewer_datadir@ +pkgdatadir = @fsviewer_datadir@ FSViewer_SOURCES = FSViewer.c files.c FSFileBrowser.c\ list.c misc.c prop.c timestampWidget.c \ attribsInspector.c editInspector.c exeInspector.c \ diff --git a/src/config.h.in b/src/config.h.in index f261da5..80b4cb7 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -26,7 +26,7 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT -/* Define if you have the iconv() function. */ +/* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ @@ -115,6 +115,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff --git a/tiff/Makefile.am b/tiff/Makefile.am index 15daa86..03e3b2d 100644 --- a/tiff/Makefile.am +++ b/tiff/Makefile.am @@ -8,7 +8,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -tiffdatadir = $(fsviewerdir)/tiff +tiffdatadir = $(fsviewer_datadir)/tiff tiffdata_DATA = FSViewer.tif \ exec-link.tif \ diff --git a/xpm/Makefile.am b/xpm/Makefile.am index 1501abf..926df2e 100644 --- a/xpm/Makefile.am +++ b/xpm/Makefile.am @@ -8,7 +8,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -xpmdatadir = $(fsviewerdir)/xpm +xpmdatadir = $(fsviewer_datadir)/xpm xpmdata_DATA = FSViewer.xpm \ FSViewer2.xpm \ -- 2.11.4.GIT