2007-09-20 00:32:35 +00:00
|
|
|
#! /bin/bash
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2007-09-20 00:32:35 +00:00
|
|
|
readln()
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
echo -n "$1 [$2] "
|
|
|
|
read ans
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$ans" = X"" ] ; then ans="$2" ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# platform
|
|
|
|
|
2010-07-07 18:12:33 +00:00
|
|
|
readln "What platform (linux/macosx/mingw)?" "linux"
|
2007-09-18 23:57:02 +00:00
|
|
|
platform=$ans
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# debug info
|
|
|
|
|
|
|
|
readln "Do you want debug ASE (y/n)?" "n"
|
|
|
|
debug=$ans
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# profile info
|
|
|
|
|
|
|
|
readln "Do you want profile ASE (y/n)?" "n"
|
|
|
|
profile=$ans
|
|
|
|
|
2008-05-06 15:22:57 +00:00
|
|
|
######################################################################
|
|
|
|
# memory leaks
|
|
|
|
|
|
|
|
readln "Do you want to check memory leaks (y/n)?" "n"
|
|
|
|
memleak=$ans
|
|
|
|
|
2007-09-18 23:57:02 +00:00
|
|
|
######################################################################
|
|
|
|
# prefix
|
|
|
|
|
2010-07-06 01:38:51 +00:00
|
|
|
if [ X"$platform" = X"linux" ] ; then
|
2007-09-18 23:57:02 +00:00
|
|
|
readln "Where do you want install ASE by default?" "/usr/local"
|
|
|
|
prefix=$ans
|
|
|
|
else
|
|
|
|
prefix=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# show information
|
|
|
|
|
|
|
|
case "$platform" in
|
2010-07-06 01:38:51 +00:00
|
|
|
"linux" ) platform_name="Linux" ;;
|
2010-07-07 18:12:33 +00:00
|
|
|
"macosx" ) platform_name="Mac OS X" ;;
|
2010-07-06 01:38:51 +00:00
|
|
|
"mingw" ) platform_name="Windows (Mingw32)" ;;
|
2007-09-18 23:57:02 +00:00
|
|
|
"*" ) exit ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "ASE configured:"
|
|
|
|
|
|
|
|
echo " Platform: $platform_name"
|
|
|
|
|
|
|
|
echo -n " Debug suppport: "
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$debug" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
echo -n " Profile suppport: "
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$profile" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-05-06 15:22:57 +00:00
|
|
|
echo -n " Check memory leaks: "
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$memleak" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
|
2008-05-06 15:22:57 +00:00
|
|
|
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$prefix" != X"" ] ; then
|
2007-09-18 23:57:02 +00:00
|
|
|
echo " Prefix: $prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
readln "Is it right (y/n)?" "y"
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$ans" != X"y" ] ; then exit ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# generate the makefile
|
|
|
|
|
|
|
|
case "$platform" in
|
2010-07-06 01:38:51 +00:00
|
|
|
"linux" ) makefile_name="makefile.linux" ;;
|
2010-07-07 18:12:33 +00:00
|
|
|
"macosx" ) makefile_name="makefile.macosx" ;;
|
2010-07-06 01:38:51 +00:00
|
|
|
"mingw" ) makefile_name="makefile.mingw" ;;
|
2007-09-18 23:57:02 +00:00
|
|
|
"*" ) exit ;;
|
|
|
|
esac
|
|
|
|
|
2007-09-20 00:32:35 +00:00
|
|
|
gen_makefile()
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
|
|
|
makefile=$1
|
|
|
|
|
|
|
|
echo -n "creating $makefile..."
|
|
|
|
|
|
|
|
if [ -f $makefile ] ; then
|
|
|
|
mv $makefile $makefile~
|
|
|
|
echo " (backup in $makefile~)"
|
|
|
|
else
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "# Makefile for $platform_name generated with fix.sh" > $makefile
|
|
|
|
echo "" >> $makefile
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$2" = X"conf" ] ; then
|
2007-09-18 23:57:02 +00:00
|
|
|
echo "CONFIGURED = 1" >> $makefile
|
|
|
|
echo "" >> $makefile
|
|
|
|
fi
|
|
|
|
|
2009-08-05 01:59:56 +00:00
|
|
|
if [ X"$debug" = X"y" ] ; then echo -n "#" >> $makefile ; fi
|
2009-08-05 01:53:02 +00:00
|
|
|
echo "RELEASE = 1" >> $makefile
|
|
|
|
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$debug" != X"y" ] ; then echo -n "#" >> $makefile ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
echo "DEBUGMODE = 1" >> $makefile
|
|
|
|
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"profile" != X"y" ] ; then echo -n "#" >> $makefile ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
echo "PROFILE = 1" >> $makefile
|
|
|
|
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"memleak" != X"y" ] ; then echo -n "#" >> $makefile ; fi
|
2008-05-06 15:22:57 +00:00
|
|
|
echo "MEMLEAK = 1" >> $makefile
|
|
|
|
|
2008-10-11 15:52:47 +00:00
|
|
|
if [ X"$prefix" = X"" ] ; then echo -n "#" >> $makefile ; fi
|
2007-09-18 23:57:02 +00:00
|
|
|
echo "DEFAULT_PREFIX = \"$prefix\"" >> $makefile
|
|
|
|
|
|
|
|
echo "" >> $makefile
|
|
|
|
echo "include $makefile_name" >> $makefile
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_makefile makefile conf
|