| 1 |
dnl |
| 2 |
dnl Configuring @@package@@ |
| 3 |
dnl process this file with autoconf to generate 'configure'. |
| 4 |
dnl |
| 5 |
|
| 6 |
AC_PREREQ([2.68]) |
| 7 |
AC_INIT(@@package@@, 1.0, [email protected]) |
| 8 |
dnl If you want to use the system name (OS, architecture, etc) in the |
| 9 |
dnl configure, uncomment the following lines. In such a case, you need |
| 10 |
dnl to copy config.guess and config.sub from automake distribution. |
| 11 |
dnl AC_CANONICAL_BUILD |
| 12 |
dnl AC_CANONICAL_HOST |
| 13 |
dnl AC_CANONICAL_TARGET |
| 14 |
|
| 15 |
dnl Replace @LOCAL_PATHS@ by --with-local option. |
| 16 |
AC_ARG_WITH(local, |
| 17 |
AS_HELP_STRING([--with-local=PATH:PATH...], |
| 18 |
[For each PATH, add PATH/include to the include search |
| 19 |
paths and PATH/lib to the library search paths. Useful if you have some |
| 20 |
libraries installed in non-standard places. ]), |
| 21 |
[ |
| 22 |
AS_CASE([$with_local], |
| 23 |
[yes|no|""], [], dnl no effect |
| 24 |
[LOCAL_PATHS=$with_local]) |
| 25 |
]) |
| 26 |
AC_SUBST(LOCAL_PATHS) |
| 27 |
|
| 28 |
dnl Set up gauche related commands. The commands are set by scanning |
| 29 |
dnl PATH. You can override them by "GOSH=/my/gosh ./configure" etc. |
| 30 |
dnl These variables may contain spaces in the pathnames (especially on |
| 31 |
dnl Windows); Makefile.ins and other files that refer to those variables |
| 32 |
dnl have to quote them properly. |
| 33 |
AC_PATH_PROG([GOSH], gosh) |
| 34 |
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config) |
| 35 |
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package) |
| 36 |
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install) |
| 37 |
AC_PATH_PROG([GAUCHE_CESCONV], gauche-cesconv) |
| 38 |
|
| 39 |
dnl C build settings |
| 40 |
dnl Usually these parameters are set by AC_PROG_CC, but we'd rather use |
| 41 |
dnl the same one as Gauche has been compiled with. |
| 42 |
if test -z "$CC"; then |
| 43 |
CC=`"$GAUCHE_CONFIG" --cc` |
| 44 |
fi |
| 45 |
if test -z "$CFLAGS"; then |
| 46 |
CFLAGS=`"$GAUCHE_CONFIG" --default-cflags` |
| 47 |
fi |
| 48 |
AC_SUBST(CC) |
| 49 |
AC_SUBST(CFLAGS) |
| 50 |
AC_SUBST(CPPFLAGS) |
| 51 |
AC_SUBST(LDFLAGS) |
| 52 |
AC_SUBST(LIBS) |
| 53 |
|
| 54 |
dnl For Windows Unicode support |
| 55 |
if gosh -e'(exit (cond-expand ((and gauche.os.windows gauche.ces.utf8) 0) (else 1)))'; then |
| 56 |
WINDOWS_UNICODE_FLAG="-DUNICODE" |
| 57 |
fi |
| 58 |
AC_SUBST(WINDOWS_UNICODE_FLAG) |
| 59 |
|
| 60 |
SOEXT=`"$GAUCHE_CONFIG" --so-suffix` |
| 61 |
OBJEXT=`"$GAUCHE_CONFIG" --object-suffix` |
| 62 |
EXEEXT=`"$GAUCHE_CONFIG" --executable-suffix` |
| 63 |
AC_SUBST(SOEXT) |
| 64 |
AC_SUBST(OBJEXT) |
| 65 |
AC_SUBST(EXEEXT) |
| 66 |
|
| 67 |
ac_default_prefix=`"$GAUCHE_CONFIG" --prefix` |
| 68 |
|
| 69 |
dnl On MSYS2/MinGW-w64, we must overwrite 'prefix' because |
| 70 |
dnl /mingw64/etc/config.site sets prefix=/mingw64 . |
| 71 |
case "$MSYSTEM" in |
| 72 |
MINGW64|MINGW32) |
| 73 |
case "$prefix" in |
| 74 |
/mingw64|/mingw32) |
| 75 |
prefix=`"$GAUCHE_CONFIG" --prefix`;; |
| 76 |
esac;; |
| 77 |
esac |
| 78 |
|
| 79 |
GAUCHE_PKGINCDIR=`"$GAUCHE_CONFIG" --pkgincdir` |
| 80 |
GAUCHE_PKGLIBDIR=`"$GAUCHE_CONFIG" --pkglibdir` |
| 81 |
GAUCHE_PKGARCHDIR=`"$GAUCHE_CONFIG" --pkgarchdir` |
| 82 |
AC_SUBST(GAUCHE_PKGINCDIR) |
| 83 |
AC_SUBST(GAUCHE_PKGLIBDIR) |
| 84 |
AC_SUBST(GAUCHE_PKGARCHDIR) |
| 85 |
|
| 86 |
dnl Check for headers. |
| 87 |
dnl Add your macro calls to check required headers, if you have any. |
| 88 |
|
| 89 |
dnl Check for other programs. |
| 90 |
dnl Add your macro calls to check existence of programs, if you have any. |
| 91 |
|
| 92 |
dnl Check for libraries |
| 93 |
dnl Add your macro calls to check required libraries, if you have any. |
| 94 |
|
| 95 |
dnl Creating gpd (gauche package description) file |
| 96 |
GAUCHE_PACKAGE_CONFIGURE_ARGS=`echo "$ac_configure_args" | sed 's/@<:@\\"\`\$@:>@/\\\\&/g'` |
| 97 |
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd]) |
| 98 |
"$GAUCHE_PACKAGE" make-gpd "$PACKAGE_NAME" \ |
| 99 |
-version "$PACKAGE_VERSION" \ |
| 100 |
-configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS" |
| 101 |
|
| 102 |
dnl Output |
| 103 |
AC_CONFIG_COMMANDS([VERSION], |
| 104 |
[echo "${PACKAGE_VERSION}" > VERSION], |
| 105 |
[PACKAGE_VERSION="${PACKAGE_VERSION}"]) |
| 106 |
AC_CONFIG_FILES([Makefile]) |
| 107 |
AC_OUTPUT |