ueno / libskk

Japanese SKK input method library
GNU General Public License v3.0
78 stars 27 forks source link

configure.ac error message is ambiguous #1

Closed tamo closed 12 years ago

tamo commented 12 years ago

When a library is not found, configure exits with only an ambiguous message: checking for LIBSKK... Required libraries are not found

You should use a more specific error message like: PKG_CHECK_MODULES([necessary libraries], [glib-2.0 >= 2.26.0 gobject-2.0 gio-2.0 gee-1.0 json-glib-1.0], , [AC_MSG_ERROR([glib, gobject, gio, gee or json-glib is not found])])

Otherwise, users cannot know what to do.

ueno commented 12 years ago

Thanks. Fixed in f6fcf56d94519dfcf8f6c650ee9262b7dcf11f59

tamo commented 12 years ago

Thanks!

I read docs about PKG_CHECK_MODULES today and now I think this is better: PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.26.0]) PKG_CHECK_MODULES([GOBJ], [gobject-2.0]) PKG_CHECK_MODULES([GIO], [gio-2.0]) PKG_CHECK_MODULES([GEE], [gee-1.0]) PKG_CHECK_MODULES([JSONGLIB], [json-glib-1.0])

because "Checking for LIBSKK" is wrong. the script doesn't check for libskk, but checks for each library libskk depends on.

tamo commented 12 years ago

oops, $LIBSKK_CFLAGS and $LIBSKK_LDFLAGS are also needed

so i'd suggest

PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.26.0]) PKG_CHECK_MODULES([GOBJ], [gobject-2.0]) PKG_CHECK_MODULES([GIO], [gio-2.0]) PKG_CHECK_MODULES([GEE], [gee-1.0]) PKG_CHECK_MODULES([JSONGLIB], [json-glib-1.0]) LIBSKK_CFLAGS="$GLIB_CFLAGS $GOBJ_CFLAGS $GIO_CFLAGS $GEE_CFLAGS $JSONGLIB_CFLAGS" LIBSKK_LIBS="$GLIB_LIBS $GOBJ_LIBS $GIO_LIBS $GEE_LIBS $JSONGLIB_LIBS" AC_SUBST(LIBSKK_CFLAGS) AC_SUBST(LIBSKK_LIBS)

or

http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html#idp974096

PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.26.0]) PKG_CHECK_MODULES([GOBJ], [gobject-2.0]) PKG_CHECK_MODULES([GIO], [gio-2.0]) PKG_CHECK_MODULES([GEE], [gee-1.0]) PKG_CHECK_MODULES([JSONGLIB], [json-glib-1.0]) PKG_CHECK_MODULES([DEPS], [glib-2.0 >= 2.26.0 gobject-2.0 gio-2.0 gee-1.0 json-glib-1.0]) LIBSKK_CFLAGS="$DEPS_CFLAGS" LIBSKK_LIBS="$DEPS_LIBS" AC_SUBST(LIBSKK_CFLAGS) AC_SUBST(LIBSKK_LIBS)

or modify Makefile.am to use other var-names

ueno commented 12 years ago

Maybe you are right (as in ueno/ibus-skk#41), but I personally think writing PKG_CHECK_MODULES for each module is too much and will make maintenance harder.

Maybe s/LIBSKK/LIBSKK_DEP/ would be a good compromise?

tamo commented 12 years ago

Yes, that's totally okay for me. I saw "Checking for DEPENDENCIES" in several programs. "Checking for LIBSKK_DEP" tells a lot more, and it gives no misleading messages. Thanks, Ueno-san!

ueno commented 12 years ago

Sorry, I changed my mind after I could reduce the number of dependencies. Now it checks each module separately 7f813d52d7e26da2407659e0ffb575f378c287c Thanks for the suggestion.